Skip to content

Fix Cloud composer pane focus convergence - #17954

Closed
azooz2003-bit wants to merge 6 commits into
mainfrom
fix/cloud-local-focus-ring
Closed

azooz2003-bit wants to merge 6 commits into
mainfrom
fix/cloud-local-focus-ring

Conversation

@azooz2003-bit

Copy link
Copy Markdown
Collaborator

Summary

When a Cloud terminal and a local terminal share a workspace, the Cloud composer can receive keyboard focus while the focus ring stays on the local pane during a SwiftUI host callback rebind. Composer focus now selects its live owning pane directly and preserves the composer as first responder. Background workspace callbacks cannot change selection.

This covers the composer path alongside the terminal input fix in #16271 and the middle-click fix in #16513.

Testing

  • Swift syntax check passed for all three changed files.
  • Test wiring and git diff --check passed.
  • Added regressions for mixed local/Cloud composer focus, draft and responder preservation through a run-loop turn, and background workspace selection. Native tests and live app verification have not run.
  • No new user-facing strings.

Changelog

Fixed: Focusing a Cloud terminal's text box also moves the pane focus ring to Cloud.

Demo Video

No live capture; the regression exercises AppKit composer focus without the SwiftUI host callback.

Checklist

  • Behavior changes have added or updated tests
  • Localization audited; no user-facing strings added

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Fixes Cloud composer focus convergence so the pane focus ring follows the keyboard target when a Cloud terminal shares a workspace with a local one.

  • Composer focus now resolves its live owning pane directly and keeps the composer as first responder, instead of relying on a SwiftUI host callback that can be mid-rebind.
  • Routes selection through the workspace coordinator with a standard trigger so no terminal first-responder follow-up steals focus back from the text box; wires the new onFocusTextBox callback through docked, hosted, and remote tmux panels.
  • Background workspace callbacks can no longer change pane selection.
  • Adds regression tests that exercise the production composer callback for mixed local/Cloud focus, draft and responder preservation through a run-loop turn, and background workspace selection.

Written for commit babb42f. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Focusing a panel’s text box now selects the corresponding pane and keeps the text box ready for input, including in docked and hosted panels.
    • Cloud composer drafts are preserved when focusing the text box.
    • Focusing a Cloud composer in a background workspace no longer changes the selected workspace or source panel.
    • Text-box focus now activates the appropriate pane in remote tmux views as well.

Migrated from #16704 after correcting the PR author identity. The original head commit babb42f is preserved.

@coderabbitai

coderabbitai Bot commented Oct 6, 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 28 minutes.

Check out review usage here.

View limit details

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c19bb161-7db3-4a5c-ab85-fce3def8b176
📥 Commits

Reviewing files that changed from the base of the PR and between ccefb63 and babb42f.

📒 Files selected for processing (11)
  • Sources/Canvas/CanvasHostedPanelContentView.swift
  • Sources/DockSplitPanelContentView.swift
  • Sources/Panels/PanelContentView.swift
  • Sources/Panels/TerminalPanelView.swift
  • Sources/RemoteTmuxWindowMirrorSplitView.swift
  • Sources/Workspace.swift
  • Sources/WorkspaceContentView.swift
  • cmuxTests/BrowserPanelViewIdentityTests.swift
  • cmuxTests/BrowserPanelWindowVisibilityTests.swift
  • cmuxTests/SimulatorPanelThemeTests.swift
  • cmuxTests/SurfacePaneFactoryFocusTests.swift
  • Autopilot · 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.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Note

Pull Request opener @azooz2003-bit is not an author or co-author of any commit in this PR (commit identities: teamleaderleo). The CLA check will still proceed and requires every listed identity plus @azooz2003-bit to have signed.

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Dogfood tours of babb42fc

sidebar-and-chrome-tour at babb42fc: not run

skipped: CI built this head on a runner pool whose products the UI test Macs cannot load, and media never compiles one; gh workflow run pr-media.yml -f pr=<n> -f allow_compile=true does

Tours are picked by the paths globs in dogfood/scenarios/*.json; a Dogfood-tours: a, b line in the description picks them instead (none turns this off). Look at every frame before merging: a green tour only means no step failed.

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.

2 participants