feat(library): register as workbench app (Kreativ category)

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) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-17 13:53:01 +02:00
parent 24704e28b6
commit 85bba162db
2 changed files with 26 additions and 0 deletions

View file

@ -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' } })
),
},
],
});

View file

@ -107,6 +107,7 @@ export const APP_CATEGORY_MAP: Record<string, AppCategory> = {
guides: 'creative',
quotes: 'creative',
uload: 'creative',
library: 'creative',
playground: 'creative',
// System — settings, admin, meta