From 85bba162dbe862838da8ece515e73e1785144d1a Mon Sep 17 00:00:00 2001 From: Till JS Date: Fri, 17 Apr 2026 13:53:01 +0200 Subject: [PATCH] feat(library): register as workbench app (Kreativ category) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Library was listed in MANA_APPS (for the tier/branding registry) and had a /library route, but it wasn't yet registered in the workbench app registry — so users couldn't add it as a tile to their Workbench scene. Adds: - registerApp({ id: 'library', icon: Stack, … }) in app-registry/apps.ts with a "+ Neuer Eintrag" context-menu action (emits the standard mana:quick-action CustomEvent, ready to be listened to in ListView once we want an in-workbench create flow). - library → 'creative' entry in app-registry/categories.ts so it appears in the Kreativ section of the app picker. Only the list view is registered; the detail view still uses the route-based pattern (/library/entry/[id]) and the route-level +page.svelte wrapper. Migrating DetailView to the workbench ViewProps shape (params + navigate + goBack) is deferred — the route works fine for now. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../apps/web/src/lib/app-registry/apps.ts | 25 +++++++++++++++++++ .../web/src/lib/app-registry/categories.ts | 1 + 2 files changed, 26 insertions(+) diff --git a/apps/mana/apps/web/src/lib/app-registry/apps.ts b/apps/mana/apps/web/src/lib/app-registry/apps.ts index 60762806f..3bf59c0ab 100644 --- a/apps/mana/apps/web/src/lib/app-registry/apps.ts +++ b/apps/mana/apps/web/src/lib/app-registry/apps.ts @@ -73,6 +73,7 @@ import { Crown, ShootingStar, CloudSun, + Stack, } from '@mana/shared-icons'; // ── Apps with entity capabilities ─────────────────────────── @@ -1239,3 +1240,27 @@ registerApp({ list: { load: () => import('$lib/modules/feedback/ListView.svelte') }, }, }); + +registerApp({ + id: 'library', + name: 'Bibliothek', + color: '#a855f7', + icon: Stack, + views: { + // Detail view uses the route-based pattern (/library/entry/[id]); the + // workbench detail-slot (ViewProps params/navigate) pattern is not + // wired up yet. Clicks on a card in the list view navigate via goto(). + list: { load: () => import('$lib/modules/library/ListView.svelte') }, + }, + contextMenuActions: [ + { + id: 'new-entry', + label: 'Neuer Eintrag', + icon: Plus, + action: () => + window.dispatchEvent( + new CustomEvent('mana:quick-action', { detail: { app: 'library', action: 'new' } }) + ), + }, + ], +}); diff --git a/apps/mana/apps/web/src/lib/app-registry/categories.ts b/apps/mana/apps/web/src/lib/app-registry/categories.ts index 1ea0ee07f..d3a9a3eb6 100644 --- a/apps/mana/apps/web/src/lib/app-registry/categories.ts +++ b/apps/mana/apps/web/src/lib/app-registry/categories.ts @@ -107,6 +107,7 @@ export const APP_CATEGORY_MAP: Record = { guides: 'creative', quotes: 'creative', uload: 'creative', + library: 'creative', playground: 'creative', // System — settings, admin, meta