Skip to content

Show right sidebar focus without adding layout padding - #12710

Closed
lawrencecchen wants to merge 16 commits into
mainfrom
feat-sidebar-focus-tab-state
Closed

lawrencecchen wants to merge 16 commits into
mainfrom
feat-sidebar-focus-tab-state

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The main Bonsplit tab stays blue when the right sidebar owns input, and the sidebar has no corresponding focus boundary.

Change

Draw a one-point accent border around the complete right sidebar when it owns input. The border adds no padding and does not move the tab bar or content. The border and content clip use one shape with square left corners and 16-point continuous right corners. The corner radius is app-owned; exact matching to every macOS native window mask is not guaranteed.

One source of truth: MainWindowFocusController.intent (per window) publishes FileExplorerState.rightSidebarOwnsInputFocus. The sidebar border, the Bonsplit tab emphasis (isMainContentFocused), and the panel focus ring all derive from that value through WorkspacePanelVisibilityPolicy.mainContentIsFocused. Hiding the sidebar by any path (shortcut, remote command, close button, window-width auto-collapse) runs restoreTerminalFocusAfterRightSidebarHidden, which clears the sidebar intent, so no border or de-emphasized tab stays behind. Like the existing Bonsplit tab emphasis, the border follows the window's own focus owner and does not dim when another window becomes key.

Dependency

manaflow-ai/bonsplit#242 must merge first. It adds isMainContentFocused to BonsplitView. The submodule currently points at the PR 242 head de63f80 (rebased onto bonsplit main). After PR 242 merges, update vendor/bonsplit to the merged main SHA before merging this PR.

Validation

  • Merged current origin/main. Dropped the earlier build-repair hunks (legacy transport argument, Rust tool PATH fallback) because main already handles them. Replaced the removed cmuxAccentNSColor with the cmuxAccentColor environment value.
  • Bonsplit PR head de63f80 builds with swift build.
  • Fleet tagged build sbfocus at fe176c9c41b (job 1066b37f101927210faf267a) succeeded. Hosted CI passed, including macOS compile, app-host unit tests for changed suites, and ui-tests.
  • Local preflight of sbfocus through the debug socket (window in background): right-sidebar focus draws the border with the rounded right corners; simulate_shortcut cmd+shift+e returns focus and clears it; hide then show leaves no border; switching Files to Find while focused keeps it.
  • Not verified: the Bonsplit tab emphasis change in a key window, workspace switching, two-window behavior, and older macOS versions.
  • No user-facing strings changed.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

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

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a46598ab-2345-410d-bd69-4f842ead3660

📥 Commits

Reviewing files that changed from the base of the PR and between 7ab53aa and d761940.

📒 Files selected for processing (2)
  • Sources/RightSidebarChromeStyle.swift
  • Sources/RightSidebarPanelView.swift

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The change propagates main-content focus to BonsplitView, adds right-sidebar keyboard-focus styling and coverage, updates the Bonsplit subproject reference, and removes an explicit transport timeout argument.

Changes

Workspace focus propagation

Layer / File(s) Summary
Focus policy and Bonsplit integration
Sources/WorkspaceContentView.swift, vendor/bonsplit
WorkspaceContentView computes main-content focus from workspace input focus and right-sidebar input focus, then passes the result to BonsplitView. The Bonsplit subproject reference changes.
Right-sidebar focus indicator
Sources/RightSidebarChromeStyle.swift, Sources/RightSidebarPanelView.swift
ModeBarButton receives keyboard-focus state and shows an accent stroke when it is selected and keyboard-focused.
Focus policy validation
cmuxTests/WorkspaceContentViewVisibilityTests.swift
A serialized test covers active workspace input with and without right-sidebar focus, plus inactive workspace input.

Legacy transport setup

Layer / File(s) Summary
Transport acceptance argument
Sources/Mobile/MobileHostIrxLegacyDialectServer.swift
The legacy server no longer passes idleTimeoutNanoseconds: 0 to MobileHostService.acceptTransport.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant RightSidebarPanelView
  participant WorkspaceContentView
  participant WorkspacePanelVisibilityPolicy
  participant BonsplitView
  RightSidebarPanelView->>WorkspaceContentView: provide right-sidebar focus state
  WorkspaceContentView->>WorkspacePanelVisibilityPolicy: compute main content focus
  WorkspacePanelVisibilityPolicy-->>WorkspaceContentView: return focus state
  WorkspaceContentView->>BonsplitView: pass isMainContentFocused
Loading

Merge Risk: ⚪ Minimal · up to d7619

No concrete focus or transport regression is established. Remaining visual verification is a follow-up rather than a demonstrated merge blocker.

🚥 Pre-merge checks | ✅ 4 | ❌ 1 | ❓ 20

❌ Failed checks (1 warning, 20 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Cmux Swift Actor Isolation ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Blocking Runtime ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Browser Automation Off-Main ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Expensive Synchronous Load ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Cache Substitution Correctness ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux No Hacky Sleeps ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Algorithmic Complexity ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Concurrency ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift @Concurrent ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Package Boundaries ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swiftpm Lockfiles ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Logging ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux User-Facing Error Privacy ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Full Internationalization ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swiftui State Layout ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Architecture Rethink ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Auxiliary Window Close Shortcuts ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Source Artifacts ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux No Test Or Debug Seam In Production Source ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux No Ambient Global State ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the main user-visible change: showing right sidebar focus without changing layout spacing.
Description check ✅ Passed The description clearly explains the problem, resulting behavior, implementation, dependency, validation, and known verification limits. It does not use the required Summary, Testing, Changelog, Demo …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch feat-sidebar-focus-tab-state
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-sidebar-focus-tab-state

Warning

Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use path_filters to narrow the review scope.


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.

@lawrencecchen
lawrencecchen force-pushed the feat-sidebar-focus-tab-state branch 2 times, most recently from 6bd93e2 to 7ab53aa Compare September 16, 2026 07:05
@cursor

cursor Bot commented Sep 16, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@lawrencecchen lawrencecchen changed the title De-emphasize Bonsplit tab chrome when sidebar owns focus Make main-pane and right-sidebar focus visible Sep 16, 2026
@cursor

cursor Bot commented Sep 16, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@cursor

cursor Bot commented Sep 16, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@lawrencecchen lawrencecchen changed the title Make main-pane and right-sidebar focus visible Clarify sidebar keyboard focus with style previews Sep 16, 2026
@lawrencecchen lawrencecchen changed the title Clarify sidebar keyboard focus with style previews Outline the focused right sidebar and dim inactive main tabs Sep 17, 2026
@lawrencecchen lawrencecchen changed the title Outline the focused right sidebar and dim inactive main tabs Inset and round the right sidebar focus boundary Sep 17, 2026
@lawrencecchen lawrencecchen changed the title Inset and round the right sidebar focus boundary Show right sidebar focus without adding layout padding Sep 17, 2026
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Fleet build instructions for this PR, head 1280278daee8a603fe3595aadea82a3a3b7f94e5:

JOB_JSON=$(~/.local/bin/cmux-ci submit --kind cmux --command 'CMUX_FLEET_BUILD_TAG=pr-12710-1280278d /Users/Shared/cmux-build-fleet/recipes/cmux.sh https://github.com/manaflow-ai/cmux.git 1280278daee8a603fe3595aadea82a3a3b7f94e5' --artifact artifacts/cmux.app.zip --workspace https://github.com/manaflow-ai/cmux/pull/12710 --source-digest 1280278daee8a603fe3595aadea82a3a3b7f94e5 --cache-key cmux:pr-12710 --min-free-bytes 268435456000 --label cmux --label ram48)
JOB_ID=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])' <<<"$JOB_JSON")
~/.local/bin/cmux-ci wait "$JOB_ID" --receipt artifacts/fleet/$JOB_ID.json
~/.local/bin/cmux-ci publish-hq "$JOB_ID"

The job survives disconnects. Do not resubmit after a wait timeout; rerun cmux-ci wait with the same ID. The artifact receipt records worker, queue/build/package/upload times, cache state, and disk before/after cleanup. The build is exact-head and does not include uncommitted edits.

@github-actions

Copy link
Copy Markdown
Contributor

Automatic catch-up: main is green again and this branch needed it.

I tried to catch this branch up with main (8ae8f01764d2), but these files need a person:

  • Sources/Mobile/MobileHostIrxLegacyDialectServer.swift: not a generated file; needs a person
  • vendor/bonsplit: not a generated file; needs a person

Nothing was pushed. Merge main locally, fix those, and push; /catch-up is there again whenever you want it.

Automatic catch-up will not try this head again; a new push or /catch-up does.
Label the pull request no-auto-catch-up to opt out.

Catch-up run

…b-state

# Conflicts:
#	Sources/Mobile/MobileHostIrxLegacyDialectServer.swift
#	Sources/RightSidebarPanelView.swift
#	vendor/bonsplit
…policy

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

CI failure attribution

CI passes on fe176c9c41 (run 36536607550 attempt 1).

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Dogfood tours of fe176c9c

sidebar-and-chrome-tour at fe176c9c, on its merge 4b71d667 that CI built: passed (run)

sidebar-and-chrome-tour at fe176c9c

Key frames of sidebar-and-chrome-tour at fe176c9 04-three-workspaces 10-split-right 15-command-palette 24-settings

right-sidebar-and-menus-tour at fe176c9c, on its merge 4b71d667 that CI built: passed (run)

right-sidebar-and-menus-tour at fe176c9c

Key frames of right-sidebar-and-menus-tour at fe176c9 05-right-sidebar-find 12-right-sidebar-cloud 25-sidebar-with-unread 35-terminal-find-bar

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.

Main replaced cmuxAccentNSColor with the CmuxAccentColor environment value.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
github-actions Bot added a commit that referenced this pull request Sep 29, 2026
github-actions Bot added a commit that referenced this pull request Sep 29, 2026
github-actions Bot added a commit that referenced this pull request Sep 29, 2026
github-actions Bot added a commit that referenced this pull request Sep 29, 2026
github-actions Bot added a commit that referenced this pull request Sep 29, 2026
github-actions Bot added a commit that referenced this pull request Sep 29, 2026
@lawrencecchen lawrencecchen mentioned this pull request Sep 29, 2026
2 of 3 tasks
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Superseded by #15534 (Right sidebar overhaul), which merges this branch with the other right sidebar work into one PR and one dogfood tag. Branch kept.

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