From 1815139dc168196b209147d68b28f0b4cc335ecc Mon Sep 17 00:00:00 2001 From: Till JS Date: Tue, 28 Apr 2026 20:57:14 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20drop=20context=20module=20=E2=80=94=20?= =?UTF-8?q?registry=20refs,=20schema,=20AI=20route,=20AppId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The context module's UI + Dexie tables + i18n bundle were already removed in d3e2e73ca. This follow-up cleans up everything else that still referenced it: - API: rename POST /api/v1/context/import-url → /api/v1/kontext/import-url (the kontext singleton was the only consumer); drop the unused /ai/generate + /ai/estimate endpoints; rename the credit-op label AI_CONTEXT_IMPORT_URL → KONTEXT_IMPORT_URL; drop AI_CONTEXT_GENERATION from packages/credits. - Web: drop registerApp + File icon import from app-registry/apps.ts; drop contextModuleConfig from data/module-registry.ts (+ snapshot test); drop useRecentDocuments + useSpaces from cross-app-queries.ts; drop ContextDocsWidget from widget-registry + dashboard.svelte.ts + types/dashboard{,.test}.ts; drop dashboard.widgets.context from all 5 dashboard locales; drop context entries from hooks.server allowlist, splitscreen registry, observatory mockData, spiral collect, crypto registry + plaintext-allowlist. - Dexie: remove documents/contextSpaces/documentTags from v1, v31, v53 stores blocks; add v57 dropping the three tables on local dev DBs that already ran an earlier schema. - Shared-branding: drop 'context' from AppId union, APP_BRANDING, MANA_APPS, APP_ICONS (+ contextSvg), ContextLogo.svelte (+ logos barrel re-export). - Spiral-DB: drop context: 10 from MANA_APP_INDEX (slot now free). - i18n hardcoded-string baseline: drop 5 context routes/files. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/api/src/index.ts | 1 + apps/mana/apps/web/src/hooks.server.ts | 1 - .../src/lib/data/crypto/plaintext-allowlist.ts | 1 - .../apps/web/src/lib/data/crypto/registry.ts | 7 ------- apps/mana/apps/web/src/lib/data/database.ts | 12 ++++++++++-- .../web/src/lib/i18n/locales/dashboard/de.json | 8 -------- .../web/src/lib/i18n/locales/dashboard/en.json | 8 -------- .../web/src/lib/i18n/locales/dashboard/es.json | 8 -------- .../web/src/lib/i18n/locales/dashboard/fr.json | 8 -------- .../web/src/lib/i18n/locales/dashboard/it.json | 8 -------- .../apps/web/src/lib/splitscreen/registry.ts | 1 - .../apps/web/src/lib/types/dashboard.test.ts | 1 - apps/mana/apps/web/src/lib/types/dashboard.ts | 1 - packages/shared-branding/src/app-icons.ts | 4 ---- packages/shared-branding/src/config.ts | 13 ------------- packages/shared-branding/src/index.ts | 1 - packages/shared-branding/src/logos/index.ts | 1 - packages/shared-branding/src/mana-apps.ts | 17 ----------------- packages/spiral-db/src/schema.ts | 1 - scripts/i18n-hardcoded-baseline.json | 5 ----- 20 files changed, 11 insertions(+), 96 deletions(-) diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index 35aaa2cfe..28d268591 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -96,6 +96,7 @@ const RESOURCE_MODULES = [ 'chat', 'food', 'guides', + 'kontext', 'news-research', 'notes', 'picture', diff --git a/apps/mana/apps/web/src/hooks.server.ts b/apps/mana/apps/web/src/hooks.server.ts index 5902db919..5c3ee4325 100644 --- a/apps/mana/apps/web/src/hooks.server.ts +++ b/apps/mana/apps/web/src/hooks.server.ts @@ -160,7 +160,6 @@ const APP_SUBDOMAINS = new Set([ 'times', 'uload', 'memoro', - 'context', 'questions', 'moodlit', ]); diff --git a/apps/mana/apps/web/src/lib/data/crypto/plaintext-allowlist.ts b/apps/mana/apps/web/src/lib/data/crypto/plaintext-allowlist.ts index 338056bf2..2c5704f93 100644 --- a/apps/mana/apps/web/src/lib/data/crypto/plaintext-allowlist.ts +++ b/apps/mana/apps/web/src/lib/data/crypto/plaintext-allowlist.ts @@ -42,7 +42,6 @@ export const PLAINTEXT_ALLOWLIST: readonly string[] = [ 'customQuotes', // TODO: audit 'dashboardConfigs', // TODO: audit 'deckTags', // TODO: audit - 'documentTags', // TODO: audit 'dreamTags', // TODO: audit 'entryTags', // TODO: audit 'eventInvitations', // TODO: audit diff --git a/apps/mana/apps/web/src/lib/data/crypto/registry.ts b/apps/mana/apps/web/src/lib/data/crypto/registry.ts index 5d03592fa..87729de1f 100644 --- a/apps/mana/apps/web/src/lib/data/crypto/registry.ts +++ b/apps/mana/apps/web/src/lib/data/crypto/registry.ts @@ -237,13 +237,6 @@ export const ENCRYPTION_REGISTRY: Record = { presiDecks: { enabled: true, fields: ['title', 'description'] }, slides: { enabled: true, fields: ['content'] }, - // ─── Context ───────────────────────────────────────────── - // LocalDocument has `title` + `content` (no `body` column on the - // schema). DocumentType (text/context/prompt) and the spaceId - // foreign key stay plaintext so the workspace tree still groups - // documents per space without a key. - documents: { enabled: true, fields: ['title', 'content'] }, - // ─── Storage ───────────────────────────────────────────── // `name` IS indexed but no .where('name') call site exists in the // app — encryption is safe, the index just becomes a no-op for diff --git a/apps/mana/apps/web/src/lib/data/database.ts b/apps/mana/apps/web/src/lib/data/database.ts index 73bb07060..89fce5dea 100644 --- a/apps/mana/apps/web/src/lib/data/database.ts +++ b/apps/mana/apps/web/src/lib/data/database.ts @@ -1269,7 +1269,6 @@ db.version(53) songs: 'id, artist, album, genre, favorite, title, _updatedAtIndex', mukkePlaylists: 'id, name, _updatedAtIndex', presiDecks: 'id, isPublic, _updatedAtIndex', - documents: 'id, contextSpaceId, type, pinned, title, [contextSpaceId+type], _updatedAtIndex', playgroundConversations: 'id, model, isPinned, _updatedAtIndex', journalEntries: 'id, entryDate, mood, isPinned, isArchived, isFavorite, _updatedAtIndex', dreams: 'id, dreamDate, mood, isLucid, isPinned, isArchived, _updatedAtIndex', @@ -1297,7 +1296,6 @@ db.version(53) 'songs', 'mukkePlaylists', 'presiDecks', - 'documents', 'playgroundConversations', 'journalEntries', 'dreams', @@ -1457,6 +1455,16 @@ db.version(58).stores({ kontextDoc: null, }); +// v59 — Drop the legacy context module's Dexie tables (no users, no +// data). Cleans up any orphan tables left in local dev IndexedDB +// instances that ran an earlier schema. The module's UI + registry +// refs were removed in this same commit; v59 is the schema-side drop. +db.version(59).stores({ + contextSpaces: null, + documents: null, + documentTags: null, +}); + // ─── Sync Routing ────────────────────────────────────────── // SYNC_APP_MAP, TABLE_TO_SYNC_NAME, TABLE_TO_APP, SYNC_NAME_TO_TABLE, // toSyncName() and fromSyncName() are now derived from per-module diff --git a/apps/mana/apps/web/src/lib/i18n/locales/dashboard/de.json b/apps/mana/apps/web/src/lib/i18n/locales/dashboard/de.json index d5395af40..66db4f411 100644 --- a/apps/mana/apps/web/src/lib/i18n/locales/dashboard/de.json +++ b/apps/mana/apps/web/src/lib/i18n/locales/dashboard/de.json @@ -111,14 +111,6 @@ "create": "Deck erstellen", "open": "Presi öffnen" }, - "context": { - "title": "Context", - "description": "Deine Dokumente & Spaces", - "spaces": "Spaces", - "documents": "Dokumente", - "empty": "Keine Dokumente", - "open": "Context öffnen" - }, "contacts_recent": { "title": "Letzte Kontakte", "description": "Kürzlich aktualisierte Kontakte" diff --git a/apps/mana/apps/web/src/lib/i18n/locales/dashboard/en.json b/apps/mana/apps/web/src/lib/i18n/locales/dashboard/en.json index e87b3eb0d..83c7be3c6 100644 --- a/apps/mana/apps/web/src/lib/i18n/locales/dashboard/en.json +++ b/apps/mana/apps/web/src/lib/i18n/locales/dashboard/en.json @@ -111,14 +111,6 @@ "create": "Create deck", "open": "Open Presi" }, - "context": { - "title": "Context", - "description": "Your documents & spaces", - "spaces": "Spaces", - "documents": "Documents", - "empty": "No documents", - "open": "Open Context" - }, "contacts_recent": { "title": "Recent Contacts", "description": "Recently updated contacts" diff --git a/apps/mana/apps/web/src/lib/i18n/locales/dashboard/es.json b/apps/mana/apps/web/src/lib/i18n/locales/dashboard/es.json index 7b6b65cb6..9425fe838 100644 --- a/apps/mana/apps/web/src/lib/i18n/locales/dashboard/es.json +++ b/apps/mana/apps/web/src/lib/i18n/locales/dashboard/es.json @@ -111,14 +111,6 @@ "create": "Crear deck", "open": "Abrir Presi" }, - "context": { - "title": "Context", - "description": "Tus documentos y espacios", - "spaces": "Espacios", - "documents": "Documentos", - "empty": "Sin documentos", - "open": "Abrir Context" - }, "contacts_recent": { "title": "Contactos recientes", "description": "Contactos actualizados recientemente" diff --git a/apps/mana/apps/web/src/lib/i18n/locales/dashboard/fr.json b/apps/mana/apps/web/src/lib/i18n/locales/dashboard/fr.json index c69068ec6..0ba144bd5 100644 --- a/apps/mana/apps/web/src/lib/i18n/locales/dashboard/fr.json +++ b/apps/mana/apps/web/src/lib/i18n/locales/dashboard/fr.json @@ -111,14 +111,6 @@ "create": "Créer un deck", "open": "Ouvrir Presi" }, - "context": { - "title": "Context", - "description": "Tes documents et espaces", - "spaces": "Espaces", - "documents": "Documents", - "empty": "Aucun document", - "open": "Ouvrir Context" - }, "contacts_recent": { "title": "Contacts récents", "description": "Contacts mis à jour récemment" diff --git a/apps/mana/apps/web/src/lib/i18n/locales/dashboard/it.json b/apps/mana/apps/web/src/lib/i18n/locales/dashboard/it.json index e47f2bbf6..9e5fcae96 100644 --- a/apps/mana/apps/web/src/lib/i18n/locales/dashboard/it.json +++ b/apps/mana/apps/web/src/lib/i18n/locales/dashboard/it.json @@ -111,14 +111,6 @@ "create": "Crea deck", "open": "Apri Presi" }, - "context": { - "title": "Context", - "description": "I tuoi documenti e spazi", - "spaces": "Spazi", - "documents": "Documenti", - "empty": "Nessun documento", - "open": "Apri Context" - }, "contacts_recent": { "title": "Contatti recenti", "description": "Contatti aggiornati di recente" diff --git a/apps/mana/apps/web/src/lib/splitscreen/registry.ts b/apps/mana/apps/web/src/lib/splitscreen/registry.ts index 2c0b3f52e..07db3e537 100644 --- a/apps/mana/apps/web/src/lib/splitscreen/registry.ts +++ b/apps/mana/apps/web/src/lib/splitscreen/registry.ts @@ -22,7 +22,6 @@ const SPLIT_APP_ID_LIST = [ 'skilltree', 'citycorners', 'times', - 'context', 'questions', 'food', 'plants', diff --git a/apps/mana/apps/web/src/lib/types/dashboard.test.ts b/apps/mana/apps/web/src/lib/types/dashboard.test.ts index eeebe9ea5..8c3328aa8 100644 --- a/apps/mana/apps/web/src/lib/types/dashboard.test.ts +++ b/apps/mana/apps/web/src/lib/types/dashboard.test.ts @@ -51,7 +51,6 @@ describe('WIDGET_REGISTRY', () => { 'storage', 'music', 'presi', - 'context', 'mana-auth', 'food', 'plants', diff --git a/apps/mana/apps/web/src/lib/types/dashboard.ts b/apps/mana/apps/web/src/lib/types/dashboard.ts index 3cf49be2d..91c27e4ec 100644 --- a/apps/mana/apps/web/src/lib/types/dashboard.ts +++ b/apps/mana/apps/web/src/lib/types/dashboard.ts @@ -130,7 +130,6 @@ export interface WidgetMeta { | 'storage' | 'music' | 'presi' - | 'context' | 'times' | 'food' | 'plants' diff --git a/packages/shared-branding/src/app-icons.ts b/packages/shared-branding/src/app-icons.ts index 385b374d2..5a5bf93b2 100644 --- a/packages/shared-branding/src/app-icons.ts +++ b/packages/shared-branding/src/app-icons.ts @@ -72,9 +72,6 @@ const timesSvg = ``; -// Context icon (document/knowledge with sky blue gradient) -const contextSvg = ``; - // Comic icon — speech bubble with a lightning-bolt panel marker on // orange→red gradient. Sits warm between Picture (green) and Wardrobe // (rose) so the Mana launcher reads as a coherent creative family. @@ -124,7 +121,6 @@ export const APP_ICONS = { comic: svgToDataUrl(comicSvg), augur: svgToDataUrl(augurSvg), questions: svgToDataUrl(questionsSvg), - context: svgToDataUrl(contextSvg), citycorners: svgToDataUrl(citycornersSvg), times: svgToDataUrl(timesSvg), calc: svgToDataUrl(calcSvg), diff --git a/packages/shared-branding/src/config.ts b/packages/shared-branding/src/config.ts index bb5a69276..03028a8af 100644 --- a/packages/shared-branding/src/config.ts +++ b/packages/shared-branding/src/config.ts @@ -302,19 +302,6 @@ export const APP_BRANDING = { logoStroke: true, logoStrokeWidth: 1.5, }, - context: { - id: 'context', - name: 'Context', - tagline: 'Knowledge Management', - primaryColor: '#0ea5e9', - secondaryColor: '#38bdf8', - // Document/brain icon for knowledge management - logoPath: - 'M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z', - logoViewBox: '0 0 24 24', - logoStroke: true, - logoStrokeWidth: 1.5, - }, } satisfies Record; /** Derived from `APP_BRANDING` keys — single source of truth. */ diff --git a/packages/shared-branding/src/index.ts b/packages/shared-branding/src/index.ts index 4f12a27b1..1b9c5919c 100644 --- a/packages/shared-branding/src/index.ts +++ b/packages/shared-branding/src/index.ts @@ -36,7 +36,6 @@ export { PlantsLogo, LightWriteLogo, MusicLogo, - ContextLogo, CitycornersLogo, } from './logos'; diff --git a/packages/shared-branding/src/logos/index.ts b/packages/shared-branding/src/logos/index.ts index 640c0d7e1..82bb2945b 100644 --- a/packages/shared-branding/src/logos/index.ts +++ b/packages/shared-branding/src/logos/index.ts @@ -23,5 +23,4 @@ export { default as SkillTreeLogo } from './SkillTreeLogo.svelte'; export { default as PlantsLogo } from './PlantsLogo.svelte'; export { default as LightWriteLogo } from './LightWriteLogo.svelte'; export { default as MusicLogo } from './MusicLogo.svelte'; -export { default as ContextLogo } from './ContextLogo.svelte'; export { default as CitycornersLogo } from './CitycornersLogo.svelte'; diff --git a/packages/shared-branding/src/mana-apps.ts b/packages/shared-branding/src/mana-apps.ts index 862314ba1..9df1f1331 100644 --- a/packages/shared-branding/src/mana-apps.ts +++ b/packages/shared-branding/src/mana-apps.ts @@ -444,23 +444,6 @@ export const MANA_APPS: ManaApp[] = [ status: 'beta', requiredTier: 'guest', }, - { - id: 'context', - name: 'Context', - description: { - de: 'Wissensmanagement', - en: 'Knowledge Management', - }, - longDescription: { - de: 'AI-gestütztes Dokumenten- und Wissensmanagement mit Spaces, Kontextreferenzen und KI-Generierung.', - en: 'AI-powered document and knowledge management with spaces, context references, and AI generation.', - }, - icon: APP_ICONS.context, - color: '#0ea5e9', - comingSoon: false, - status: 'beta', - requiredTier: 'guest', - }, { id: 'times', name: 'Times', diff --git a/packages/spiral-db/src/schema.ts b/packages/spiral-db/src/schema.ts index 20b774e8b..2f3ea41f0 100644 --- a/packages/spiral-db/src/schema.ts +++ b/packages/spiral-db/src/schema.ts @@ -185,7 +185,6 @@ export const MANA_APP_INDEX: Record = { storage: 7, music: 8, presi: 9, - context: 10, cards: 11, photos: 12, skilltree: 13, diff --git a/scripts/i18n-hardcoded-baseline.json b/scripts/i18n-hardcoded-baseline.json index f61a4fa45..639328ca1 100644 --- a/scripts/i18n-hardcoded-baseline.json +++ b/scripts/i18n-hardcoded-baseline.json @@ -92,7 +92,6 @@ "apps/mana/apps/web/src/lib/modules/contacts/components/pages/ContactPage.svelte": 2, "apps/mana/apps/web/src/lib/modules/contacts/ListView.svelte": 1, "apps/mana/apps/web/src/lib/modules/contacts/views/DetailView.svelte": 4, - "apps/mana/apps/web/src/lib/modules/context/ListView.svelte": 2, "apps/mana/apps/web/src/lib/modules/core/widgets/ActiveTimerWidget.svelte": 2, "apps/mana/apps/web/src/lib/modules/core/widgets/NutritionProgressWidget.svelte": 5, "apps/mana/apps/web/src/lib/modules/core/widgets/PlantWateringWidget.svelte": 3, @@ -200,10 +199,6 @@ "apps/mana/apps/web/src/routes/(app)/comic/new/+page.svelte": 1, "apps/mana/apps/web/src/routes/(app)/companion/+page.svelte": 2, "apps/mana/apps/web/src/routes/(app)/contacts/[id]/+page.svelte": 1, - "apps/mana/apps/web/src/routes/(app)/context/documents/[id]/+page.svelte": 3, - "apps/mana/apps/web/src/routes/(app)/context/documents/+page.svelte": 5, - "apps/mana/apps/web/src/routes/(app)/context/spaces/[id]/+page.svelte": 3, - "apps/mana/apps/web/src/routes/(app)/context/spaces/+page.svelte": 5, "apps/mana/apps/web/src/routes/(app)/food/add/+page.svelte": 2, "apps/mana/apps/web/src/routes/(app)/food/goals/+page.svelte": 1, "apps/mana/apps/web/src/routes/(app)/gifts/redeem/+page.svelte": 1,