Reset per-tab editor state when the active home changes #41

Open
opened 2026-07-17 03:08:41 +00:00 by claude-bot · 0 comments
Contributor

QuotesTab initializes its editor form once (QuotesTab.jsx:13-15) and never re-syncs when state.quotes is replaced by a home switch or reload (App.jsx:202-205, :359-369 — the tab stays mounted across home changes). Saving afterwards writes the stale form over freshly loaded data, silently. BackupTab's scenario selector (BackupTab.jsx:29) has the same init-once pattern with milder consequences.

Fix: render the active tab with key={activeHomeId} in App.jsx so all per-tab editor state remounts on home switch; optionally add a targeted quote-set-identity effect in QuotesTab if remounting mid-edit ever needs to be softened.

Acceptance criteria

  • Switching homes while on Quotes cannot save prior home's form data
  • Reload of active home resets the editor to persisted values

(Audit finding F-21, 2026-07-16 — Severity: Medium, Confidence: Medium)

`QuotesTab` initializes its editor form once (`QuotesTab.jsx:13-15`) and never re-syncs when `state.quotes` is replaced by a home switch or reload (`App.jsx:202-205`, `:359-369` — the tab stays mounted across home changes). Saving afterwards writes the stale form over freshly loaded data, silently. `BackupTab`'s scenario selector (`BackupTab.jsx:29`) has the same init-once pattern with milder consequences. Fix: render the active tab with `key={activeHomeId}` in `App.jsx` so all per-tab editor state remounts on home switch; optionally add a targeted quote-set-identity effect in QuotesTab if remounting mid-edit ever needs to be softened. **Acceptance criteria** - [ ] Switching homes while on Quotes cannot save prior home's form data - [ ] Reload of active home resets the editor to persisted values *(Audit finding F-21, 2026-07-16 — Severity: Medium, Confidence: Medium)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
rbrooks/BatteryStorageCalculator#41
No description provided.