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:
Jakob Wennberg
2026-03-20 09:31:29 +01:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 38b658205d
commit cf77adaa0a
30 changed files with 115 additions and 833 deletions
-16
View File
@@ -17,7 +17,6 @@ import type {
CompanySettings,
InvoiceInboxItem,
} from '@/types'
import type { ExtensionToggle } from '@/lib/extensions/types'
// ============================================================
// Chainable Supabase mock
@@ -487,21 +486,6 @@ export function makeInvoiceInboxItem(
}
}
export function makeExtensionToggle(
overrides: Partial<ExtensionToggle> = {}
): ExtensionToggle {
return {
id: nextId(),
user_id: 'user-1',
sector_slug: 'general',
extension_slug: 'receipt-ocr',
enabled: true,
created_at: '2024-01-01T00:00:00Z',
updated_at: '2024-01-01T00:00:00Z',
...overrides,
}
}
// ============================================================
// API Route Test Helpers
// ============================================================