Repository navigation
Promote terminal layout restore to a default setting - #1030
Conversation
Remove the experimental label, move the toggle to General, and turn it on for settings files without the field. Files that store a value keep it. Fix two problems that default-on would expose: - A saved worktree that is gone no longer resets the whole layout. - A restore that names no worktree now selects the last focused one instead of leaving the detail view empty.
Existing files store false for anyone who kept the old default. Store the setting under a new key, restoreTerminalLayout, so the old value is ignored once. A later off stays off.
|
Review round 1: one finding, fixed in a4657ef. A launch with only plain folders and no saved layout stayed empty, because the selection fallback did not consider plain folders. It now does, after worktrees. |
A restored terminal could hold first responder while no card was primary, so keyboard input went to a card that was not highlighted. Launching into Canvas now requests focus on the selected tab of the anchor worktree. Canvas now accepts a plain folder as its entry target, as Shelf does.
|
Review round 2: R1 confirmed fixed. Two new P2 findings in the default Canvas path were fixed in a797423. R2: keyboard input could go to a terminal whose card was not highlighted. R3: a setup with only plain folders could not enter Canvas. |
A focus request retries until its view has a window. A request from layout restore could land after the Canvas request and move first responder away from the highlighted card. The newest request now cancels older ones.
|
Review round 3: R1 and R3 confirmed fixed. R2 still reproduced as a race after a Canvas quit and relaunch, because a late retry from restore could take first responder. Fixed in a2b6596: the newest focus request now cancels older ones. |
|
Review round 4 (last): no new code defects. The fix for R2 passed code review and deterministic tests, but real typed input on the final commit is not verified, because neither the reviewer's tool nor my key events could reach the app. The review ends as not clean for that reason. The PR body has a manual check. |
Closes #573
Terminal layout restore has shipped since 2026-04. Live checks confirm that it works, and they found two problems that would hurt new users if it were on by default. This PR fixes both and promotes the feature.
Changes
true, and it turns on once for existing users (see below).allowsMissingWorktreesis removed. A layout that cannot be applied still resets with a warning.Existing users
The setting turns on once for every existing settings file, including for users who turned it off on purpose. Those files store
falsefor anyone who kept the old default, and that cannot be told apart from an explicit choice.The stored key changes from
restoreTerminalLayoutOnLaunchtorestoreTerminalLayout, so no migration state is needed. The old key is ignored and is removed on the next save, and a later off stays off. The release notes should mention this change.If a user enabled the feature in the past and then turned it off, the snapshot file from that time is still on disk. The first launch after the upgrade restores that old layout once. Worktrees that no longer exist are skipped.
Verification
make checkandmake testpass. The regression tests failed before the fix.true; first launch has no warningfalseNot checked: a full cold launch through
prowl openauto-launch. The reviewer exercised the launch argument in an isolated instance, and reducer tests cover the path. Real typed input on the final commit is not verified: automation could not deliver keys. Real typing was confirmed only on the earlier commit a797423, and only for a launch where the first responder was already correct. To check by hand, set the default view to Canvas, keep two projects open, quit from Canvas, relaunch several times, and type without clicking. The text must appear in the highlighted card.Known limit
If a repository fails to load, the next save no longer holds its layout, so its tabs do not return when the folder comes back. This behavior is not new, and it is now documented.