From 0f8fbb381be49ff27d0d626c8138150130a9c4fc Mon Sep 17 00:00:00 2001 From: Till JS Date: Wed, 22 Apr 2026 18:10:28 +0200 Subject: [PATCH] =?UTF-8?q?feat(settings):=20Phase=202d.6=20=E2=80=94=20Ta?= =?UTF-8?q?g-Presets=20management=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes the userTagPresets loop: users can now create, set-default, and delete presets from Settings → Tag-Presets, making the dropdown in SpaceCreateDialog actually useful (before this, it only showed "empty" / "copy-current" because no presets existed). New settings category "Tag-Presets": - searchIndex.ts: adds the category entry + anchor; sidebar picks it up automatically since it iterates `categories`. - TagPresetsSection.svelte: list + create + delete + set-default. - settings/ListView.svelte: conditional render wiring. The create flow is deliberately one-click: name the preset, hit "Aus erstellen", and we snapshot every non-deleted tag + tagGroup in the active Space into the new preset (with groupName denormalized so the preset is space-independent). The first preset automatically becomes the user's default — subsequent ones can be promoted via the star button. No full per-entry editor in this commit. If the user wants to tweak a preset's contents, they create a sibling Space with the preset, modify tags there, and promote THAT Space's tags to a new preset. Scope-creep avoidance for a feature whose main value is snapshotting, not authoring. Type-check clean. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../lib/components/settings/searchIndex.ts | 11 +- .../sections/TagPresetsSection.svelte | 369 ++++++++++++++++++ .../src/lib/modules/settings/ListView.svelte | 3 + 3 files changed, 381 insertions(+), 2 deletions(-) create mode 100644 apps/mana/apps/web/src/lib/components/settings/sections/TagPresetsSection.svelte diff --git a/apps/mana/apps/web/src/lib/components/settings/searchIndex.ts b/apps/mana/apps/web/src/lib/components/settings/searchIndex.ts index f88f85244..83f803b7b 100644 --- a/apps/mana/apps/web/src/lib/components/settings/searchIndex.ts +++ b/apps/mana/apps/web/src/lib/components/settings/searchIndex.ts @@ -4,9 +4,9 @@ * updates both the navigation and the search results. */ import type { Component } from 'svelte'; -import { Gear, Robot, ShieldCheck, Cloud } from '@mana/shared-icons'; +import { Gear, Robot, ShieldCheck, Cloud, Tag } from '@mana/shared-icons'; -export type CategoryId = 'general' | 'ai' | 'security' | 'data'; +export type CategoryId = 'general' | 'ai' | 'security' | 'data' | 'tag-presets'; export interface Category { id: CategoryId; @@ -55,6 +55,13 @@ export const categories: Category[] = [ 'danger-zone', ], }, + { + id: 'tag-presets', + label: 'Tag-Presets', + description: 'Tag-Sets für neue Spaces', + icon: Tag, + anchors: ['tag-presets'], + }, ]; export interface SearchEntry { diff --git a/apps/mana/apps/web/src/lib/components/settings/sections/TagPresetsSection.svelte b/apps/mana/apps/web/src/lib/components/settings/sections/TagPresetsSection.svelte new file mode 100644 index 000000000..d26a537d5 --- /dev/null +++ b/apps/mana/apps/web/src/lib/components/settings/sections/TagPresetsSection.svelte @@ -0,0 +1,369 @@ + + + +
+
+

Tag-Presets

+

+ Gespeicherte Tag-Sets, die du beim Anlegen eines neuen Space als Start-Vorlage wählen kannst. + Änderungen am Preset berühren bereits erstellte Spaces nicht — es ist eine Einweg-Kopie. +

+
+ +
+ + +
+ {#if error}

{error}

{/if} + + {#if presets.value.length === 0} +

+ Noch keine Presets. Lege das erste an, indem du dem aktuellen Tag-Set einen Namen gibst — es + wird dann automatisch als Default für neue Spaces verwendet. +

+ {:else} +
    + {#each presets.value as preset (preset.id)} +
  • +
    +
    + {preset.name} + {#if preset.isDefault} + + + Default + + {/if} +
    +
    + {preset.tags.length} Tag{preset.tags.length === 1 ? '' : 's'} + {#if preset.tags.some((t) => t.groupName)} + · mit Gruppen + {/if} +
    +
    +
    + {#if !preset.isDefault} + + {/if} + +
    +
  • + {/each} +
+ {/if} +
+ + diff --git a/apps/mana/apps/web/src/lib/modules/settings/ListView.svelte b/apps/mana/apps/web/src/lib/modules/settings/ListView.svelte index 6dbd9b0e3..a14f2c6f3 100644 --- a/apps/mana/apps/web/src/lib/modules/settings/ListView.svelte +++ b/apps/mana/apps/web/src/lib/modules/settings/ListView.svelte @@ -16,6 +16,7 @@ import AiSection from '$lib/components/settings/sections/AiSection.svelte'; import SecuritySection from '$lib/components/settings/sections/SecuritySection.svelte'; import DataSection from '$lib/components/settings/sections/DataSection.svelte'; + import TagPresetsSection from '$lib/components/settings/sections/TagPresetsSection.svelte'; let activeCategory = $state('general'); @@ -77,6 +78,8 @@ {:else if activeCategory === 'data'} + {:else if activeCategory === 'tag-presets'} + {/if}