feat: add preset configurations with built-in and custom presets

Add preset store with three built-in presets (Strict mode, Research only,
Full access) and localStorage persistence for custom presets. Integrate
preset selector into ConfigSidebar with load, save, and delete actions.
Built-in presets cannot be deleted.

Closes #14

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
shahondin1624
2026-03-12 12:07:50 +01:00
parent a14a92a87d
commit 4bd1cef1cf
4 changed files with 253 additions and 0 deletions

View File

@@ -15,3 +15,4 @@
| #11 | Session creation and ID management | COMPLETED | [issue-011.md](issue-011.md) |
| #12 | Session history sidebar | COMPLETED | [issue-012.md](issue-012.md) |
| #13 | Session config sidebar component | COMPLETED | [issue-013.md](issue-013.md) |
| #14 | Preset configurations | COMPLETED | [issue-014.md](issue-014.md) |

View File

@@ -0,0 +1,35 @@
---
---
# Issue #14: Preset configurations
**Status:** COMPLETED
**Issue:** https://git.shahondin1624.de/llm-multiverse/llm-multiverse-ui/issues/14
**Branch:** `feature/issue-14-preset-configs`
## Acceptance Criteria
- [x] Save current config as a named preset
- [x] Load preset from a list
- [x] Delete custom presets
- [x] 2-3 built-in default presets shipped:
- "Strict mode" — no overrides, restricted tools (FS Write, Run Shell, Run Code, Package Install disabled)
- "Research only" — limited tool set for read-only operations (Memory Write, FS Write, Run Code, Run Shell, Package Install disabled)
- "Full access" — all overrides relaxed (OverrideLevel.ALL), no tools disabled
- [x] Presets persisted in localStorage
- [x] Built-in presets cannot be deleted
## Implementation
### New Files
- `src/lib/stores/presets.svelte.ts` — preset store with built-in presets and localStorage persistence for custom presets
### Modified Files
- `src/lib/components/ConfigSidebar.svelte` — added preset selector section at the top with load, save, and delete functionality
### Key Decisions
- Built-in presets are hardcoded constants, not stored in localStorage
- Custom presets stored under `llm-multiverse-presets` localStorage key
- Overwriting a custom preset with the same name is allowed; overwriting built-in presets is not
- Preset config uses a plain interface (`PresetConfig`) rather than protobuf types for clean serialization
- Preset section placed at the top of the sidebar before Override Level, matching the issue instructions