You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Convert subscribe-in-$effect components to reactive derived reads (blocked on reactive store) #1491
Several components replicate a "subscribe-in-$effect, write-local-$state" pattern to display node data, because the store does not expose a per-node reactive handle. Each maintains a local $state copy of a node and syncs it via an imperative subscription, which races async daemon echoes and is a source of state-cascade bugs.
Once the store exposes a genuinely reactive per-node source (tracked separately), these components should read the store directly with $derived and drop the effect + subscription bookkeeping entirely.
Problem Statement
The local copies are second sources of truth. On a nodeId change the effect tears down and re-subscribes, and an in-flight notification can transiently write the wrong node's data into the local state. This is the component-side half of the recurring optimistic-vs-echo regression class.
Proposed Solution
For each site, replace the $effect subscription + local $state node with:
Delete the manual subscription, the _updateTrigger counters, and the local copy. Per ADR-049, $effect stays only for pushing state into external systems (DOM focus, timers, platform listeners).
Acceptance Criteria
schema-property-form.svelte reads the node via $derived, no local copy/subscription
generic-schema-form.svelte (subscription + the autoOpen prop→state effect) converted
task-schema-form.svelte converted
Per-row subscription guards in base-node-viewer.svelte converted
No $effect remains whose sole purpose is mirroring store state into a component
Code passes bun run quality:fix; tests pass (bun run test:all)
Closing as already resolved. PR #1546 (closing #1490, commit ca7c10e) converted all four named sites while landing the reactive SvelteMap: schema-property-form.svelte, generic-schema-form.svelte, task-schema-form.svelte, and the per-row guards in base-node-viewer.svelte — plus table-row.svelte, reactive-node-service.svelte.ts, and reactive-structure-tree.svelte.ts. Swept packages/desktop-app/src/lib and confirmed no subscribe-in-$effect / local-$state-mirror pattern remains for node data anywhere. The only remaining $effect+subscribe is app-shell.svelte watching daemon connectivity (plain Svelte store, not node data) — a legitimate external-system effect per ADR-049 rule 4. No code changes needed.
Activity
malibio commentedon Jul 6, 2026
Frontend baseline: 147 test files / 3948 tests passed (44s)
malibio commentedon Jul 6, 2026
Closing as already resolved. PR #1546 (closing #1490, commit ca7c10e) converted all four named sites while landing the reactive SvelteMap: schema-property-form.svelte, generic-schema-form.svelte, task-schema-form.svelte, and the per-row guards in base-node-viewer.svelte — plus table-row.svelte, reactive-node-service.svelte.ts, and reactive-structure-tree.svelte.ts. Swept packages/desktop-app/src/lib and confirmed no subscribe-in-$effect / local-$state-mirror pattern remains for node data anywhere. The only remaining $effect+subscribe is app-shell.svelte watching daemon connectivity (plain Svelte store, not node data) — a legitimate external-system effect per ADR-049 rule 4. No code changes needed.