style(journals): stabilize and standardize all configuration interfaces

- Implemented 'untrack' safeguards in all modal effect blocks to prevent reactivity loops.
- Standardized Module, Journal, and Entry configuration with unified tabbed UI and Aether Orange theme.
- Fixed critical 'journal is undefined' and ReferenceErrors in configuration modals.
- Restored missing button toggles and visibility options in journal-level settings.
- Documented Dexie liveQuery '$' prefix mandate in GEMINI.md and project documentation.
- Eliminated legacy JournalEntry_SettingsMenu in favor of ModalJournalEntryConfig.
This commit is contained in:
Scott Idem
2026-01-14 17:50:48 -05:00
parent 8ae23cdcd9
commit cdf318e744
8 changed files with 238 additions and 316 deletions

View File

@@ -11,10 +11,11 @@ This project is the frontend UI/UX for the Aether (AE) system, built with Svelte
## 🏗️ Architecture & Standards
### Svelte v5 (Runes)
- **State Management:** Use `$state` and `$derived`. Props are passed via `$props()` and can be `$bindable`.
- **Event Handling:** Use lowercase `onevent` attributes (e.g., `onclick`). Handle `preventDefault` inside functions.
- **Dexie Integration:** `liveQuery` results are observables and require the `$` prefix (e.g., `$lq__obj`) in templates. Subscribe in `onMount` to avoid SSR issues.
### Reactivity & Stores
- **Svelte 5 Runes:** Use `$state`, `$derived`, and `$effect` for component-level reactivity.
- **Dexie LiveQuery:** Results from `liveQuery` are observables. You **MUST** use the `$` prefix (e.g., `$lq__obj`) in templates and logic to subscribe to the live data. Failure to do so will result in accessing the observable object instead of its data.
- **Persistence:** Use `svelte-persisted-store` for data that must survive page refreshes (e.g., `ae_loc`, `journals_loc`).
- **Initialization:** Always initialize reactive state (`$state`) outside of `$props()` destructuring. Use `untrack` inside `$effect` when synchronizing props to local state to prevent infinite loops.
### ID Convention (Triple-ID Pattern)
- **Standard:** Use `id`, `[obj_type]_id`, and `[obj_type]_id_random` consistently.