refactor: remove extension toggle system — compiled-in extensions are always active (#59)
The runtime toggle system (extension_toggles table, API routes, hooks, UI components) added unnecessary complexity. Extensions controlled via extensions.config.json at build time are now always active for all users. This removes ~835 lines of toggle-related code including API routes, DB queries, the ExtensionToggleButton component, useEnabledExtensions and useExtensionToggle hooks, and the toggle-check module. AI consent gating remains unchanged. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
38b658205d
commit
cf77adaa0a
@@ -48,21 +48,12 @@ export function getExtensionsBySector(slug: SectorSlug): ExtensionDefinition[] {
|
||||
return getSector(slug)?.extensions ?? []
|
||||
}
|
||||
|
||||
/** Extensions with a workspace and a quickAction href — for sidebar nav.
|
||||
* Filters against the user's enabled extensions when provided. */
|
||||
export function getExtensionNavItems(
|
||||
enabledExtensions?: { sector_slug: string; extension_slug: string }[]
|
||||
): { href: string; label: string; icon: string }[] {
|
||||
/** Extensions with a workspace and a quickAction href — for sidebar nav. */
|
||||
export function getExtensionNavItems(): { href: string; label: string; icon: string }[] {
|
||||
return getAllExtensions()
|
||||
.filter(e => {
|
||||
const key = `${e.sector}/${e.slug}`
|
||||
if (!(key in WORKSPACES) || !e.quickAction?.href) return false
|
||||
if (enabledExtensions) {
|
||||
return enabledExtensions.some(
|
||||
t => t.sector_slug === e.sector && t.extension_slug === e.slug
|
||||
)
|
||||
}
|
||||
return true
|
||||
return key in WORKSPACES && !!e.quickAction?.href
|
||||
})
|
||||
.sort((a, b) => (a.quickAction!.order ?? 0) - (b.quickAction!.order ?? 0))
|
||||
.map(e => ({
|
||||
|
||||
Reference in New Issue
Block a user