Skip to content

Mark tabs and split action buttons for host hint modes - #281

Closed
teamleaderleo wants to merge 2 commits into
mainfrom
leo/hint-targets
Closed

teamleaderleo wants to merge 2 commits into
mainfrom
leo/hint-targets

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 11, 2026 •

Copy link
Copy Markdown

cmux's hint mode (Cmd-J) labels every clickable control in the window so typing a label clicks it. It walks the window in process, and there SwiftUI shows the tab bar only as unknown accessibility elements, so the pane tab bar's tabs and split action buttons got no labels.

  • New public BonsplitHintTargetView: a transparent, click-through, non-accessibility view at a control's frame, with a title.
  • Each tab carries one named by its title. Each split action button carries one, applied once in splitButtonRow so it covers all three button styles, named by its tooltip.

Nothing changes for clicks or VoiceOver: the view returns nil from hitTest and is not an accessibility element.

Tests: Tests/BonsplitTests/BonsplitHintTargetTests.swift hosts a two-tab BonsplitView and expects targets named after both tabs and the default New Terminal and Split Right tooltips.

Used by manaflow-ai/cmux cx-zjtn.7 (hint mode labels for the pane tab bar). The cmux pin bump that adopts this also brings #272, #273 and #275; #272's fields are opt-in, so cmux's buttons keep their current behavior.

🤖 Generated with Claude Code


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

Marks pane tab bar tabs and split action buttons with a new BonsplitHintTargetView so a host's keyboard hint mode (like cmux's Cmd-J) can label them. SwiftUI shows the tab bar only as unknown accessibility elements in process, so hosts couldn't name these controls before.

The target view is transparent and click-through—it returns nil from hitTest and isn't an accessibility element—so clicks and VoiceOver behavior are unchanged. Each tab carries a target named by its title; each split action button carries one named by its tooltip. Tests cover a two-tab BonsplitView and expect targets for both tabs and the default New Terminal and Split Right tooltips.

Written for commit 9a48db6. Summary will update on new commits.

View guided diff Turn on auto-fix

Summary by CodeRabbit

  • New Features
    • Keyboard hint mode can now identify tabs by their titles and split actions by their existing tooltip text.
    • Hint targets do not intercept mouse interactions or appear as separate accessibility elements.

teamleaderleo and others added 2 commits October 11, 2026 14:09
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A host's keyboard hint mode walks its window in process, where SwiftUI shows
the tab bar only as unknown accessibility elements. Each tab and split action
button now carries a click-through BonsplitHintTargetView at its frame, named
by the tab title or the button tooltip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5c54ca4d-7bfd-464a-949c-18e785ed4529

📥 Commits

Reviewing files that changed from the base of the PR and between 5e441ac and 9a48db6.


📒 Files selected for processing (4)
  • Sources/Bonsplit/Internal/Views/TabBarView.swift
  • Sources/Bonsplit/Internal/Views/TabItemView.swift
  • Sources/Bonsplit/Public/BonsplitHintTarget.swift
  • Tests/BonsplitTests/BonsplitHintTargetTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

The change adds BonsplitHintTargetView and a SwiftUI modifier, then applies hint targets to tab titles and split-action tooltip text. Tests verify the target titles and hit-test behavior.

Changes

Keyboard hint targets

Layer / File(s) Summary
Hint target view and modifier
Sources/Bonsplit/Public/BonsplitHintTarget.swift
Adds an NSView subclass that stores a title, does not handle hit tests, and is not an accessibility element. A SwiftUI representable updates the title, and a view modifier attaches it as a background.
Register tab and split-action titles
Sources/Bonsplit/Internal/Views/TabItemView.swift, Sources/Bonsplit/Internal/Views/TabBarView.swift, Tests/BonsplitTests/BonsplitHintTargetTests.swift
Tab views use their title as a hint target. Split-action buttons use their tooltip text. Tests check expected target titles and confirm that targets return nil from hit testing.

Priority: ➖ Normal

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

Change: Feature

Suggested reviewers: lawrencecchen


Merge Risk: ⚪ Minimal · up to 9a48d

This change adds a transparent, click-through view that marks tabs and split-action buttons for hint modes. Existing click and VoiceOver behavior is not expected to change, and no merge-blocking risk was found.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: marking tabs and split action buttons for host hint modes.
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.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • 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.

@teamleaderleo

Copy link
Copy Markdown
Author

Parking this: Leo decided hint mode in cmux stays opt-in (manaflow-ai/cmux#19538 closed), so the tab-bar labels are on hold. Tests passed here (Hint targets suite). The branch leo/hint-targets stays for when the work resumes; the cmux side is on leo/cx-zjtn-7-tabbar-hints (red test 0/7 recorded).

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.

1 participant