Repository navigation
Unify the frontend store layer on Svelte 5 runes - #1579
Conversation
Rewrite collections, schemas, layout, settings, navigation, status-bar as $state class instances with getters; keep free-fn delegators. Convert all $store reads and get(store) sites in production consumers to direct state reads. Tests updated in a follow-up commit.
Convert get(store) reads to .state; drop svelte/store get imports; rewrite layout.test.ts persistence tests against the fresh rune-store instance and remove writable-only subscription-mechanics tests (ADR-049). Update the collection-refresh mock to expose a .state field instead of subscribe/set.
The e2e tier runs a plain node environment with no Svelte compiler, so a dynamic import of a rune-store (*.svelte.ts) threw "$state is not defined". Register the existing setup-svelte-mocks.ts as a setupFile so the rune globals exist inside each fork worker.
Pragmatic Code Review — PR #1579Review Type: Initial Review SummaryThis is a clean, disciplined, net-positive refactor. Six legacy Recommendation: APPROVE. No blocking issues. A few optional nits only. Requirements Check
Verified Invariants (review focus areas)
Findings🟢 Suggestions / Nits (all optional)1.
2. This is not a hack: it reuses the exact same setup file the main 3. Now that Test Quality AssessmentThe removed ADR-049 Compliance✅ No state-to-state Project Standards✅ No |
malibio
left a comment
There was a problem hiding this comment.
Review recommendation: APPROVE (posted as a comment because GitHub blocks self-approval on your own PR). Clean, net-positive ADR-049 rune migration — no blocking issues, three optional nits. Full report in the review comment above.
Build new CollectionItem objects instead of mutating item.children in place, removing the hidden side-effect the reviewer flagged (collections.svelte.ts). The collectionsTree getter runs this on every reactive read, so a pure function is the safer contract. Behavior unchanged; 40 collections tests pass. Skipped the other two 🟢 nits: the e2e setupFiles reuse (reviewer confirmed sound, not a hack) and the schemasData wrapper (kept for symmetry with collectionsData / daemon-reconnect wiring — reviewer said not for this PR).
Review feedback addressedThe review returned APPROVE with 3 optional 🟢 suggestions and no Critical/Important findings. ✅ Addressed (1):
⏭️ Skipped (2), with reasoning:
Quality: eslint + svelte-check clean (0 errors / 1729 files). Pre-push gate (test:all + cargo build + e2e + Rust) passed. |
Closes #1513