From 421ef5545719328db86065827830e626fb426bcc Mon Sep 17 00:00:00 2001 From: Till JS Date: Mon, 23 Mar 2026 22:34:56 +0100 Subject: [PATCH] feat(manacore): implement mukke, presi, and context dashboard widgets Add the 3 missing widget components that were registered but not implemented: - MukkeLibraryWidget: shows library stats (songs, playlists, favorites), recent songs with artist/duration - PresiDecksWidget: shows recent presentations with public/private indicator, descriptions, and update dates - ContextDocsWidget: shows recent documents grouped by type (text, context, prompt) with space names, falls back to space list All widgets follow the established pattern: APP_URLS for links, WidgetSkeleton/WidgetError for loading/error, auto-retry on failure. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../dashboard/WidgetContainer.svelte | 6 + .../widgets/ContextDocsWidget.svelte | 163 ++++++++++++++++++ .../widgets/MukkeLibraryWidget.svelte | 132 ++++++++++++++ .../dashboard/widgets/PresiDecksWidget.svelte | 124 +++++++++++++ 4 files changed, 425 insertions(+) create mode 100644 apps/manacore/apps/web/src/lib/components/dashboard/widgets/ContextDocsWidget.svelte create mode 100644 apps/manacore/apps/web/src/lib/components/dashboard/widgets/MukkeLibraryWidget.svelte create mode 100644 apps/manacore/apps/web/src/lib/components/dashboard/widgets/PresiDecksWidget.svelte diff --git a/apps/manacore/apps/web/src/lib/components/dashboard/WidgetContainer.svelte b/apps/manacore/apps/web/src/lib/components/dashboard/WidgetContainer.svelte index ed08aa2c1..097c3fb23 100644 --- a/apps/manacore/apps/web/src/lib/components/dashboard/WidgetContainer.svelte +++ b/apps/manacore/apps/web/src/lib/components/dashboard/WidgetContainer.svelte @@ -26,6 +26,9 @@ import ManadeckProgressWidget from './widgets/ManadeckProgressWidget.svelte'; import ClockTimersWidget from './widgets/ClockTimersWidget.svelte'; import StorageUsageWidget from './widgets/StorageUsageWidget.svelte'; + import MukkeLibraryWidget from './widgets/MukkeLibraryWidget.svelte'; + import PresiDecksWidget from './widgets/PresiDecksWidget.svelte'; + import ContextDocsWidget from './widgets/ContextDocsWidget.svelte'; interface Props { widget: WidgetConfig; @@ -67,6 +70,9 @@ 'manadeck-progress': ManadeckProgressWidget, 'clock-timers': ClockTimersWidget, 'storage-usage': StorageUsageWidget, + 'mukke-library': MukkeLibraryWidget, + 'presi-decks': PresiDecksWidget, + 'context-docs': ContextDocsWidget, } as const; const WidgetComponent = $derived(widgetComponents[widget.type]); diff --git a/apps/manacore/apps/web/src/lib/components/dashboard/widgets/ContextDocsWidget.svelte b/apps/manacore/apps/web/src/lib/components/dashboard/widgets/ContextDocsWidget.svelte new file mode 100644 index 000000000..2b3bd96c3 --- /dev/null +++ b/apps/manacore/apps/web/src/lib/components/dashboard/widgets/ContextDocsWidget.svelte @@ -0,0 +1,163 @@ + + +
+
+

+ 🧠 + {$_('dashboard.widgets.context.title')} +

+ {#if spaces.length > 0} + + {spaces.length} Spaces + + {/if} +
+ + {#if state === 'loading'} + + {:else if state === 'error'} + + {:else if documents.length === 0 && spaces.length === 0} +
+
📚
+

+ {$_('dashboard.widgets.context.empty')} +

+ + Space erstellen + +
+ {:else} + + {#if documents.length > 0} + + {:else} + + + {/if} + + + {/if} +
diff --git a/apps/manacore/apps/web/src/lib/components/dashboard/widgets/MukkeLibraryWidget.svelte b/apps/manacore/apps/web/src/lib/components/dashboard/widgets/MukkeLibraryWidget.svelte new file mode 100644 index 000000000..bfc327b4f --- /dev/null +++ b/apps/manacore/apps/web/src/lib/components/dashboard/widgets/MukkeLibraryWidget.svelte @@ -0,0 +1,132 @@ + + +
+
+

+ 🎵 + {$_('dashboard.widgets.mukke.title')} +

+
+ + {#if state === 'loading'} + + {:else if state === 'error'} + + {:else if !stats || stats.totalSongs === 0} +
+
🎶
+

+ {$_('dashboard.widgets.mukke.empty')} +

+ + Musik entdecken + +
+ {:else} + +
+
+
{stats.totalSongs}
+
Songs
+
+
+
{stats.totalPlaylists}
+
Playlists
+
+
+
{stats.favoriteCount}
+
Favoriten
+
+
+ + + {#if recentSongs.length > 0} +
+ {#each recentSongs as song} +
+ {song.favorite ? '❤️' : '🎵'} +
+

{song.title}

+ {#if song.artist} +

{song.artist}

+ {/if} +
+ {#if song.duration} + + {mukkeService.formatDuration(song.duration)} + + {/if} +
+ {/each} +
+ {/if} + + + {/if} +
diff --git a/apps/manacore/apps/web/src/lib/components/dashboard/widgets/PresiDecksWidget.svelte b/apps/manacore/apps/web/src/lib/components/dashboard/widgets/PresiDecksWidget.svelte new file mode 100644 index 000000000..7ca3842b0 --- /dev/null +++ b/apps/manacore/apps/web/src/lib/components/dashboard/widgets/PresiDecksWidget.svelte @@ -0,0 +1,124 @@ + + +
+
+

+ 📊 + {$_('dashboard.widgets.presi.title')} +

+ {#if decks.length > 0} + + {decks.length} + + {/if} +
+ + {#if state === 'loading'} + + {:else if state === 'error'} + + {:else if decks.length === 0} +
+
🎨
+

+ {$_('dashboard.widgets.presi.empty')} +

+ + Präsentation erstellen + +
+ {:else} + + + + {/if} +