fix: stability fixes round 2 — cross-tab sync, atomic persistence, state cleanup#254
Merged
mattleaverton merged 6 commits intodanshapiro:mainfrom Mar 30, 2026
Merged
Conversation
… Redux actions Remove server broadcast `terminal.runtime.updated` (no client handler existed), unused sessionsSlice actions (collapseAll, expandAll), and unused tabRegistrySlice action (clearClosedTabSnapshot). Clears noise before structural stability fixes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace full-replacement hydrateTabs with set-union merge. Tabs created in different browser tabs now survive cross-tab sync instead of being silently overwritten. Per-tab updatedAt resolves property conflicts (newer wins). Tombstone set prevents deleted tabs from resurrecting via remote sync. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge separate freshell.tabs.v2 and freshell.panes.v2 localStorage keys into a single freshell.layout.v3 key. Eliminates partial-write vulnerability where tabs could persist but panes fail, causing orphaned tabs with picker content. Cross-tab sync now handles one storage event instead of two, removing the readAndHydratePairedKey workaround. Includes migration from v2 keys on first load. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When waitForSession finds a session in the queue, check the disk cache before falling through to queue.waitFor(). Sessions discovered at startup are enqueued before cache is consulted, so this avoids blocking terminal creation on queue processing when the cache already has a valid result. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the legacy terminalId field from Tab type. All terminal identity now lives exclusively in pane.content.terminalId. Add pane-tree-walking selectors (selectTerminalIdsForTab, selectPrimaryTerminalIdForTab, selectTabIdByTerminalId) and replace 27 read sites across 16 source files. Migration strips legacy terminalId from persisted data on load. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts: # src/components/Sidebar.tsx
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
Five fixes for structural state management issues, worked serially on a single branch. Closes #253.
Dead code cleanup — Remove unused
terminal.runtime.updatedserver broadcast (no client handler) and 3 never-dispatched Redux actions (collapseAll,expandAll,clearClosedTabSnapshot). -226 lines.Tombstone merge for cross-tab sync — Replace full-replacement
hydrateTabswith set-union merge. Tabs created in different browser tabs now survive sync instead of being silently overwritten. Per-tabupdatedAtresolves property conflicts (newer wins). Tombstone set prevents deleted tabs from resurrecting.Atomic tabs+panes persistence — Merge separate
freshell.tabs.v2andfreshell.panes.v2localStorage keys into a singlefreshell.layout.v3key. Eliminates partial-write vulnerability. Cross-tab sync handles one storage event instead of two, removing thereadAndHydratePairedKeyworkaround. Includes v2→v3 migration on first load.Session repair hot-path — Add cache check in
waitForSessionbefore falling through to serial queue wait. Sessions discovered at startup are enqueued before cache is consulted; this avoids blocking terminal creation when the cache already has a valid result.Remove
tab.terminalIddual source of truth — Remove the legacyterminalIdfield from theTabtype. All terminal identity now lives exclusively inpane.content.terminalId. Add pane-tree-walking selectors and replace 27 read sites across 16 source files.Test plan
refresh-context-menu-flow)tab.terminalIdremoval🤖 Generated with Claude Code