P8-02: State model refactor (Zustand/Redux-lite) with deterministic action pipeline #38

Closed
opened 2026-02-19 19:04:53 -05:00 by Rbanh · 3 comments
Owner

Goal:
Stop ad-hoc mutable state drift and make edits deterministic.

Scope:

  • Central state store for model, selection, viewport, UI mode, diagnostics.
  • Action/reducer pipeline for all mutations (drag, edit pin, net operations, symbol edits).
  • Add undo/redo as transaction log with typed actions.
  • Persist view/ui preferences safely.

Acceptance:

  • No direct object mutation from UI components.
  • Undo/redo stability under stress (drag-edit-net sequence).
  • Deterministic replay of action log reproduces same model + viewport.
Goal: Stop ad-hoc mutable state drift and make edits deterministic. Scope: - Central state store for model, selection, viewport, UI mode, diagnostics. - Action/reducer pipeline for all mutations (drag, edit pin, net operations, symbol edits). - Add undo/redo as transaction log with typed actions. - Persist view/ui preferences safely. Acceptance: - No direct object mutation from UI components. - Undo/redo stability under stress (drag-edit-net sequence). - Deterministic replay of action log reproduces same model + viewport.
Rbanh added this to the Phase 8 - React/ELK Core Refactor milestone 2026-02-19 19:05:13 -05:00
Author
Owner

Sprint 1 progress landed in d029e48.

Implemented:

  • Deterministic centralized store foundation at frontend-react/src/state/store.js.
  • Core actions scaffold: setModel, setCompileResult, setSelection, moveComponent, applyJsonText.
  • Undo/redo transaction scaffolding.
  • Determinism and history tests in tests/state-store.test.js.

Validation:

  • npm test passes (includes new store tests).

Status:

  • Partial completion; React UI integration and full action coverage still pending.
Sprint 1 progress landed in `d029e48`. Implemented: - Deterministic centralized store foundation at `frontend-react/src/state/store.js`. - Core actions scaffold: `setModel`, `setCompileResult`, `setSelection`, `moveComponent`, `applyJsonText`. - Undo/redo transaction scaffolding. - Determinism and history tests in `tests/state-store.test.js`. Validation: - `npm test` passes (includes new store tests). Status: - Partial completion; React UI integration and full action coverage still pending.
Author
Owner

Sprint 2 progress in 5a4e116.

Delivered:

  • Added lifecycle slice (isCompiling, lastError, lastAction) and actions (beginCompile, completeCompile, failCompile).
  • Added React subscription hooks (useSchemetaSelector, useSchemetaActions) using useSyncExternalStore.
  • Extended determinism tests for lifecycle behavior and history non-interference.

Validation:

  • npm test passed (includes updated tests/state-store.test.js).

Status:

  • In progress: additional action coverage and broader parity transactions still pending.
Sprint 2 progress in `5a4e116`. Delivered: - Added lifecycle slice (`isCompiling`, `lastError`, `lastAction`) and actions (`beginCompile`, `completeCompile`, `failCompile`). - Added React subscription hooks (`useSchemetaSelector`, `useSchemetaActions`) using `useSyncExternalStore`. - Extended determinism tests for lifecycle behavior and history non-interference. Validation: - `npm test` passed (includes updated `tests/state-store.test.js`). Status: - In progress: additional action coverage and broader parity transactions still pending.
Author
Owner

Completed by deterministic store/action pipeline integration in Sprint 2/3 (5a4e116, dc9c277). Undo/redo and mutation paths now run through centralized React store actions.

Completed by deterministic store/action pipeline integration in Sprint 2/3 (`5a4e116`, `dc9c277`). Undo/redo and mutation paths now run through centralized React store actions.
Rbanh closed this issue 2026-02-19 23:29:14 -05:00
Sign in to join this conversation.
No Label
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Rbanh/schemeta#38
No description provided.