fix(frontend): persist rail expanded/collapsed state across navigation - #148
Merged
mhersson merged 1 commit intoMay 25, 2026
Merged
Conversation
- Add safeReadRail/safeWriteRail helpers with try/catch for private browsing - Initialize railExpanded with lazy useState: safeReadRail() ?? isHITLRunning - Wrap setRailExpanded to persist every change to localStorage - On card-identity change: restore from localStorage instead of resetting to isHITLRunning - On HITL flip-on: persist forced-expand to localStorage via safeWriteRail(true) - Update web/CLAUDE.md localStorage allowlist with contextmatrix-rail-expanded key
mhersson
deleted the
ctxmax-639/the-status-of-the-rail-should-be-remembered
branch
May 25, 2026 15:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug where the CardPanel right rail's expanded/collapsed state was reset whenever the user navigated away from the board (e.g. to /chat or /all) and came back.
safeReadRail()/safeWriteRail()helpers with try/catch to handle private-mode gracefullyrailExpandedfrom localStorage (contextmatrix-rail-expanded) withisHITLRunningas fallbacksetRailExpandedto persist every user toggle to localStorageweb/CLAUDE.mdlocalStorage allowlist to include the new keyFollow-up polish items (useCallback stability, redundant read, stale CLAUDE.md prose, explicit test isolation) tracked in CTXMAX-641.
Test plan
go test ./internal/...)