feat(workbench): register Quiz as first-class app (Kreativ)

Quiz module code was complete but not wired into the app-registry, so
it never appeared in AppPagePicker. Adds an AppDescriptor with the
Phosphor Exam icon, collection/paramKey/createItem for future DnD &
linking, plus a "Neues Quiz" context-menu action. Categorised under
'creative' next to cards, skilltree and library. Edit/Play stay on
route-based navigation (same pattern as library).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-18 18:51:34 +02:00
parent cce296a527
commit 4efdcfffdb
2 changed files with 38 additions and 0 deletions

View file

@ -76,6 +76,7 @@ import {
Stack,
ArrowClockwise,
Flask,
Exam,
} from '@mana/shared-icons';
// ── Apps with entity capabilities ───────────────────────────
@ -1276,3 +1277,39 @@ registerApp({
},
],
});
registerApp({
id: 'quiz',
name: 'Quiz',
color: '#ec4899',
icon: Exam,
views: {
// Edit (/quiz/[id]/edit) and Play (/quiz/[id]/play) use route-based
// navigation via goto(); the workbench detail-slot isn't wired yet.
list: { load: () => import('$lib/modules/quiz/ListView.svelte') },
},
contextMenuActions: [
{
id: 'new-quiz',
label: 'Neues Quiz',
icon: Plus,
action: () =>
window.dispatchEvent(
new CustomEvent('mana:quick-action', { detail: { app: 'quiz', action: 'new' } })
),
},
],
collection: 'quizzes',
paramKey: 'quizId',
getDisplayData: (item) => ({
title: (item.title as string) || 'Quiz',
subtitle: (item.category as string) || undefined,
}),
createItem: async (data) => {
const { quizzesStore } = await import('$lib/modules/quiz/stores/quizzes.svelte');
const quiz = await quizzesStore.createQuiz({
title: (data.title as string) || 'Neues Quiz',
});
return quiz.id;
},
});

View file

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