Repository navigation
fix(app): a saved compare tab opens again, and a pane that breaks stays in its pane - #149
Merged
Merged
Conversation
…ys in its pane Quitting with a Compare tab open left every later launch on an empty dark grey window (#137). The saved workspaces were tidied at import time by a function that, for Compare tabs only, called a helper declared further down the module, so the app threw before React drew anything, whichever tab was in front. Restoring now lives in lib/restore.ts, which checks every field of the save and drops what can't be drawn instead of throwing. Every pane, the Compare bar, the tab bar and the pane layer now have their own error boundary. A pane that throws says so in its place with a way out (its terminal, the Terminal lane, or closing the tab), while the sidebar and the other tabs keep working; before, PaneLayer sat outside every boundary but the root one, so any pane in any open tab took the whole window. The last-resort screen offers to reset or close the tab showing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Fixes #137.
Why the window stayed grey
Any saved Compare tab crashed the app before it drew anything, on every launch.
sanitizeinlib/workspaces.tsruns when the module loads, and for Compare tabs it calledmapLeaves, aconstdeclared further down the file and not yet initialised (TypeError: Qf is not a functionin the build). React hadn't mounted, so no error boundary could catch it. This explains the details in the issue: it happens whichever tab is active, it survives restarts, and removing the Compare tab fixes it. The bug has been there since v0.3.7.Separately,
PaneLayerdraws every pane of every open workspace, but it sat outside the view's error boundary. A crash in any pane, such as the 0.3.22 chat hook bug fixed in 8d81e62, replaced the whole window with "Try again".What changed
lib/restore.ts(new, pure, unit-tested) restoresberth.workspacesand never throws.PaneGuard). A side of a Compare tab that breaks offers "Show both terminals" and "Close tab"; other panes offer "Show its terminal" and "Close pane".Proof (mock mode)
A saved Compare tab of two chats opens again:
One side crashes (a test crash via
?mock&crash=), and the bar, the other side, the tabs and the sidebar keep working:After "Show both terminals":
The tab bar's one-line fallback, then the last-resort screen and the app after "Close this tab" (both from temporary throws, reverted):
Tests
app/src/lib/restore.test.ts: 13 tests.pnpm test: 536 pass.app/e2e/restore-tabs.spec.ts: 6 tests that seed the issue's saved state. 60/60 passed at--repeat-each=10. On main's code, 5 of the 6 fail with "Qf is not a function".tsc -p e2epass.e2e/compare.spec.tsflakes with several workers in parallel (the Diff lane count is 0). It does the same on main.🤖 Generated with Claude Code