Repository navigation
Save-divergence detector: skip empty workspaces, see dropped tab-bar entries and kept pane trees (dark, layout-owner build only) - #30125
Conversation
…entries and kept pane trees (dark, layout-owner build only) - A workspace key that names nothing (or only places a stored closed-tab record) is no longer reported as "workspace added/removed" or "terminal row owner changed". - A save that drops a terminal tab's tab-bar entry while keeping its row is reported, read from the stored session before the Loader rebuilds the entry. - A pane tree main keeps over the window's (windowSaveForMain) is reported, so a window-side pane repair shows up.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
7fd0f326-3904-4d43-978b-8920889cb675
📒 Files selected for processing: 5
src/main/ipc/renderer-shutdown-checkpoint.tssrc/main/ipc/session.tssrc/main/persistence/window-save-divergence.test.tssrc/main/persistence/window-save-divergence.tssrc/main/persistence/window-save-raw-session-divergence.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
… tree and one-sided closed tabs (dark, layout-owner build only)
…ported too (dark, layout-owner build only)
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Report closed-tab changes during a workspace content… · window-save-divergence.ts:164-169
src/main/persistence/window-save-divergence.ts:164-169
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winReport closed-tab changes during a workspace content transition.
If a workspace loses its last tab and gains a closed-tab record in the same save, this early return reports only
workspace removed.closedTabsOfOneSidedWorkspacesdoes not recover the closed-tab finding because both models still contain the workspace key. IncludediffClosedTabs(before, after)when both layouts exist, even if only one has content.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f5ad042c-f027-4cfb-9702-b79caa7012db
📒 Files selected for processing: 3
src/main/persistence/window-save-divergence.test.tssrc/main/persistence/window-save-divergence.tssrc/main/persistence/window-save-raw-session-divergence.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
…s reported (dark, layout-owner build only)
ELI5
Orca is moving ownership of the tab and pane layout from the window to the main process. Behind a build switch that is off in shipped builds, a checker watches every window save and reports any layout change main learned only from that save. This PR makes the checker quieter where it was wrong and lets it see two kinds of change it was blind to. It only reports; it never changes, delays, or fails a save.
What Changed
Nothing changes for users: the checker is compiled in only when the layout-owner build switch is on, and shipped builds have it off.
With the switch on, three changes to the checker:
root: null) for such a tab counts too, since main keeps its tree then as well.The pane-tree, tab-bar and one-sided closed-tab checks live in a new file,
window-save-raw-session-divergence.ts, because they read the stored session rather than main's layout model.Why
The checker gates the next step of the layout move: it must be quiet across the full end-to-end suite before saves stop carrying layout. The last full sweep had reports that were only empty keys (noise that hides real ones) and two blind spots (a removed tab-bar entry, a pane repair). Alternatives considered:
Linked Issue
N/A (internal layout-owner work).
Visual Proof
N/A: no UI change; the code runs only in layout-owner builds and only writes log lines.
Testing
Failing first. New unit tests in
window-save-divergence.test.ts. Against main's checker, 4 fail (empty workspace, closed-tab-only workspace, dropped tab-bar entry, kept pane tree). Against the earlier revisions of this PR, 5 more fail (empty row flip, closed-tab record added under a new key, pane tree of a tab no workspace places, save with no pane tree, closed-tab record moved to another worktree). All pass now.Gates.
pnpm tcpass;pnpm run check:code-quality:changedpass; layout-writer ratchets OK (main 211, renderer 651); focus-read ratchet OK (1095);pnpm run audit:anti-sloppass; vitestsrc/main/persistence/,src/main/ipc/session*,src/main/ipc/renderer-shutdown*: 1808 passed.Switch-off bundle (unminified, base vs this branch). Renderer and preload identical apart from the build commit stamp and chunk hash names. Main differs in three lines only: the switch-off
saveFromWindowtakes one more parameter it does not use, and its two callers pass the save to it. No checker code is in the switch-off bundle.Checker before/after (switch-on e2e build, same specs, base = this branch's base):
Totals for the final run: 17 reports before, 20 after (an earlier run of this branch: 22). By kind: "workspace added" 13 -> 5, "terminal row owner changed" 11 -> 13, new "pane tree kept" 2, "defaultTabsAppliedByWorkspace changed" 0 -> 3 (timing, see above). No "tab-bar entry removed" report appeared. The row-owner reports on empty workspaces are kept on purpose (see What Changed and Why).
AI Disclosure
Review
Agent skill upstream boundary
Notes
Security: none. Cross-platform: no platform code. SSH and paired servers: a paired server's partition is still skipped; SSH partitions are checked as before. Performance: switch-off has no checker code; switch-on adds one pass over the stored tab-bar entries and the saved pane trees per save.
After the last fix (closed-tab worktree check), wsl-host-fake-transport, paired-client-project-removal-stops-host-terminals and workspace-layout-oracle were re-run: 4 row-owner reports, the same as the run in the table.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)