Skip to content

fix(tui): keep last-pane history when a zoom jump is refused - #4701

Closed
devswha wants to merge 2 commits into
mainfrom
fix/tui-zoom-last-pane
Closed

devswha wants to merge 2 commits into
mainfrom
fix/tui-zoom-last-pane

Conversation

@devswha

@devswha devswha commented Nov 25, 2026

Copy link
Copy Markdown
Owner

What broke

A picker jump from a zoomed pane updated the last-pane history even when the core refused the layout write. With the isolated core returning layout_conflict, the pane stayed on t2 but focus.previous became t1 instead of remaining unset.

Fix

Preserve the previous pane during the tentative focus change. Only the confirmed jump records the pane left. This changes the focus history, not the layout or the terminal engine.

Validation

  • The regression failed before the production change and passed after it.
  • bun test ./tui/loop.test.ts ./tui/model/ladder.test.ts -t 'zoom|last_pane|refused picker jump' passed.
  • Re-ran bun run check fast with a shorter TMPDIR and six unit workers. Workflow syntax, generated-file checks, typecheck, and build passed; the unit stage reached the 510-second command deadline (exit 124) without a reported assertion failure before interruption. The prior run failed in an unrelated account test. Main CI's Fast checks also failed in account tests. Publishing with that validation gap per the lead's decision.
  • After the review fix: 14 focused loop and focus-model tests, bun run typecheck, and bun run build passed on the final code.

Review notes

Codex reviewed 478825873f8443aedce80086fd307463c63fbf1f once. Fixed its reproduced medium finding: refreshing a provisional focus on the saved previous pane could erase that entry after a refused jump. A low-severity behavior predating this PR remains: if a peer independently zooms the intended pane during a rejected local write, the loop can treat the shared result as confirmation.

Closes #4519

@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b0f20e7 and 0ed0033.

Files selected for processing: 4

  • changelog.d/tui-last-pane-conflict.md
  • tui/loop.test.ts
  • tui/model/focus.ts
  • tui/model/reduce.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devswha

devswha commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #4725

@devswha devswha closed this Nov 25, 2026
devswha added a commit that referenced this pull request Nov 25, 2026
…xture (#4725)

## Changes

- [#4701 — Preserve last-pane
history](#4701). In an isolated
core, a picker jump from a zoomed pane returned `layout_conflict`: the
screen stayed on `t2`, but the previous-pane history changed to `t1`.
Preserve history through the tentative focus change and intervening
refresh; record the pane left only after confirmation. Codex reviewed
`478825873`; its reproduced refresh finding was fixed in `0ed0033cc`.
[CodeRabbit was
rate-limited](#4701 (comment)).

  Closes #4519

- [#4702 — Use the intended launcher
target](#4702). Isolated PTY probes
reproduced the wrong core with a non-default Herdr plugin session and a
relative socket; launcher fixtures reproduced inherited SSH X11
settings, the wrong desktop session, and one request to an unrelated
listener after the app stopped. Share plugin-config lookup, resolve the
socket relative to the calling shell, drop forwarded X11 settings only
for a newly started core, and verify the desktop server record and
listener before using its port. Codex reviewed `672d07e8a`; its three
reproduced findings (shutdown port reuse, standalone TUI gating, and
legacy launcher validation) were fixed in `1869a756c`. [CodeRabbit was
rate-limited](#4702 (comment)).

  Closes #4577  
  Closes #4576  
  Closes #4561  
  Closes #4463  
  Refs #4460 (partly: the remaining gaps are listed on the issue)

Bundle follow-up `e5f6cad72` restores the desktop `start`/`stop`
guidance that the new listener check masked. These commands do not
contact the server; commands that use its port still require a valid
listener record.

- [#4703 — Synchronize the stop-and-continue
fixture](#4703). An isolated Linux
child-subreaper probe found seven launcher/screen pairs left behind in
80 runs on main. Wait for the screen itself to stop before `fg`, then
let the launcher reap the screen and Bash reap the launcher. Production
code is unchanged by this source PR. Codex reviewed `c42d2c2f7`; its
reproduced teardown finding was fixed in `52553fac1`. [CodeRabbit was
rate-limited](#4703 (comment)).

  Closes #4562

Supersedes #4701 #4702 #4703

## Validation

- Linux: 14 focused zoom and last-pane tests passed; 197 launcher tests
passed (one Windows-only case skipped); all 30 terminal-restoration PTY
tests passed.
- The real `ovis tui` entry rendered an isolated test pane and detached
in both PTY probes: a non-default session discovered through the Herdr
plugin and a relative core socket.
- The stop-and-continue regression passed 40 repeats; the isolated
process-group check passed 60 repeats.
- `bun run typecheck` and `git diff --check origin/main...HEAD` passed.
- The existing desktop lifecycle regression failed on the initial bundle
and passed after `e5f6cad72`. The first fast run also hit an unrelated
SSH Unix-socket path-length failure; all three tests in
`server/ssh-account-add.test.ts` passed with a shorter `TMPDIR`.
- `bun run check fast` passed on `e5f6cad72` with the shorter `TMPDIR`:
27,969 unit tests passed, 0 failed, 247 skipped.
- Native macOS and Windows were not exercised.

---------

Co-authored-by: sisyphus-dev-ai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tui: a refused zoom jump still changes the last-pane history

1 participant