Skip to content

[CTX-1337] fix(ui): hand focus to pinned view and fence cross-workspace survivors (#2222) - #2233

Merged
Xuepoo merged 2 commits into
mainfrom
ctx-1337/fix-pinned-ghost-leaf
Oct 18, 2026
Merged

Xuepoo merged 2 commits into
mainfrom
ctx-1337/fix-pinned-ghost-leaf

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Priority: P1 | Area: area:ui | Labels: fix,P1,area:ui | Milestone: 0.0.24 | RFC: none | Task: CTX-1337

Closes #2222

What

Pinned sibling of #2221. Pins live in the window-global PinnedStore, invisible to floated_views()/floated_count(), so the float fix skipped the pinned case and left a session-less focused leaf.

Changes

  • retire_sole_tiled_leaf_for_pinned: removes the dead sole leaf through the explicit-close funnel and binds focus plus primary_view to the topmost pin.
  • close_view: pinned arm; prune suppressed while a pin survives.
  • Both reap branches (terminal_app.rs) use the same retirement path.
  • load_slot: a focus that is not live in the loaded slot re-homes to a layout leaf, then float, then pin; cleared (with primary) when nothing is live — no input can fall through to a hidden foreign shell.
  • discard_pinned: survivor fallback to the topmost pin, then float.

Verification

  • fmt, clippy -D warnings (terminal/runtime all targets), Windows workspace all-targets: pass
  • terminal 1210/1210; runtime 2520 passed, 1 skipped
  • Mutation: reverting each fix fails its tests (focus=Some(foreign) vs None; focus=None vs surviving pin)
  • Headed on Workspace 5: close with pinned survivor → views: [], live input CTX1337_PIN_ALIVE, desktop restored
  • Follow-up fix(session): pin-only empty tiled base fails session capture validation and is not saved #2230 tracks session capture on a pin-only empty base

@Xuepoo Xuepoo added this to the 0.0.24 milestone Oct 18, 2026
@Xuepoo Xuepoo added fix Bug fix P1 Priority: high area:ui Area: UI / layout labels Oct 18, 2026
@coderabbitai

coderabbitai Bot commented Oct 18, 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 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 759828ae-c7c4-4866-95c7-78edf145ee56
📥 Commits

Reviewing files that changed from the base of the PR and between 8da9df0 and 58c03be.

📒 Files selected for processing: 4
  • crates/bitty-runtime/src/runtime/workspaces.rs
  • crates/bitty-terminal/src/chrome_keys.rs
  • crates/bitty-terminal/src/terminal_app.rs
  • crates/bitty-terminal/src/tests.rs
  • 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

Comment @coderabbitai help to get the list of available commands.

@Xuepoo
Xuepoo merged commit f424321 into main Oct 18, 2026
17 checks passed
@Xuepoo
Xuepoo deleted the ctx-1337/fix-pinned-ghost-leaf branch October 18, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui Area: UI / layout fix Bug fix P1 Priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ui): pinned panel leaves a session-less focused leaf after the last tiled panel closes

1 participant