diff --git a/CHANGELOG.md b/CHANGELOG.md index e55d2c72..6451a773 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- [memorandum] Ordner-Erstellung über FAB + Modal statt direkter Erstellung; FAB immer sichtbar; Zero-State öffnet ebenfalls das Modal. +- [jokes] Inline-Witz-Formular durch FAB + Modal ersetzt; Seite zeigt nur noch den Zufallswitz-Bereich. - [hitstar] Remove Spotify embed (full iframe) from the reveal phase; only round tracker, abort button, flipped track card and next-round button are shown after guessing. - [hitstar] Spotify track search now uses a single random year (1955–2025) per request instead of a fixed range to improve year distribution across decades. - [hitstar] Add `genre:pop` filter to Spotify search query to increase the share of well-known tracks. diff --git a/docs/features/jokes.md b/docs/features/jokes.md index edb0596c..8c0bd07d 100644 --- a/docs/features/jokes.md +++ b/docs/features/jokes.md @@ -99,6 +99,19 @@ Keys under `jokes.*` in translation files. --- +## Frontend Components + +| Component | Description | +|-----------|-------------| +| `frontend/src/lib/components/jokes/Jokes.svelte` | Main page component — shows random joke area only | +| `frontend/src/lib/components/jokes/CreateJokeOverlay.svelte` | Carbon Modal for creating a new joke (FAB-triggered) | + +### Create Joke Pattern + +Joke creation uses a FAB (fixed primary button, bottom-right) that opens a Carbon Modal (`CreateJokeOverlay.svelte`). The modal contains a `TextArea` for the joke text and a `Select` for language (`de`/`en`). On success: `celebrate()` + `InlineNotification` + auto-close after ~1.5 s. The inline form that was previously embedded directly on the page has been removed. + +--- + ## Key Implementation Notes - `persistDailyJoke()` sets `verified: true` on all auto-fetched jokes. diff --git a/docs/features/memorandum.md b/docs/features/memorandum.md index 4185d2e5..8e9e5da0 100644 --- a/docs/features/memorandum.md +++ b/docs/features/memorandum.md @@ -91,6 +91,26 @@ Keys under `memorandum.*` in translation files. --- +## Frontend Components + +| Component | Description | +|-----------|-------------| +| `frontend/src/lib/components/memorandum/FolderArea.svelte` | Main folder grid; FAB always visible | +| `frontend/src/lib/components/memorandum/FolderOverlay.svelte` | Dual-mode Carbon Modal: **create** (FAB) and **edit** (context menu) | +| `frontend/src/lib/components/memorandum/LinkOverlay.svelte` | Modal for creating/editing links | +| `frontend/src/lib/components/memorandum/Startup.svelte` | Zero-state screen with "create folder" CTA | + +### Folder Create/Edit Pattern + +`FolderOverlay.svelte` handles both modes via `type = $derived(currentFolderId ? 'edit' : 'new')`: + +- **Create** (FAB in `FolderArea.svelte`): `bind:open={createFolderModalOpen}`, no `currentFolderId` → pre-fills default name, resets color sliders, pushes new `FolderClass` to `$localPresetStore`, calls `celebrate()`. +- **Edit** (context menu in `Folder.svelte`): `bind:open={$folderOverlayOptionsStore.showOverlay}` in `+page.svelte`, `currentFolderId` is set → loads persisted name and background color. + +The FAB is **always visible** (not gated on `Folders.length > 0`). The zero-state screen also opens the create modal via its CTA button. + +--- + ## Key Implementation Notes - Memorandum has **no dedicated MongoDB schema** — all data lives in the shared Keystore collection. diff --git a/frontend/src/lib/components/jokes/CreateJokeOverlay.svelte b/frontend/src/lib/components/jokes/CreateJokeOverlay.svelte new file mode 100644 index 00000000..30f3d4ee --- /dev/null +++ b/frontend/src/lib/components/jokes/CreateJokeOverlay.svelte @@ -0,0 +1,108 @@ + + + + {#if $initialized} +