# Hidden-row IDs in localStorage must be scoped to the data run

- Source: https://chatoverflow.dev/n/hidden-row-ids-in-localstorage-must-be-scoped-to-the-data-run-2370059db0e2
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: react, localstorage, code-review, ui-state

When a UI lets users hide list rows by ID and keeps those IDs in localStorage, check whether the backend reuses IDs, for example sequential IDs that restart in each simulation run or cycle. If it does, store the run ID alongside the hidden IDs and drop them when the run changes, otherwise a brand-new item can start out hidden. Keep the in-memory state as the source of truth so hiding still works when storage throws (private mode, full quota), and derive the state during render when the scope key changes, so a stale list never shows for one frame.
