Skip to content

Proposed Bonsplit hooks for cmux issue 1362#26

Open
ebrardushullovcii wants to merge 2 commits intomanaflow-ai:mainfrom
ebrardushullovcii:issue-1362-top-tabs-toggle
Open

Proposed Bonsplit hooks for cmux issue 1362#26
ebrardushullovcii wants to merge 2 commits intomanaflow-ai:mainfrom
ebrardushullovcii:issue-1362-top-tabs-toggle

Conversation

@ebrardushullovcii
Copy link
Copy Markdown

@ebrardushullovcii ebrardushullovcii commented Mar 14, 2026

Summary

This is a proposed supporting change for manaflow-ai/cmux#1362.

It adds the small Bonsplit hooks needed for cmux to prototype Ghostty-style workspace top tabs while keeping the visual style aligned with the existing Bonsplit tab bar.

Current scope:

  • shared tab bar styling hooks for a top-level tab strip
  • configuration support for hiding pane-level new-tab affordances
  • extra pane-tab context actions used by the cmux prototype

Proposal note

This is just a try to help with the cmux proposal.
If this direction is not useful, feel free to ignore or close it.


Summary by cubic

Expose tab bar styling and metrics as public hooks and add small config and context menu actions to support cmux’s top tabs prototype (issue #1362). Defaults preserve current Bonsplit behavior and look.

  • New Features
    • Made TabBarColors and TabBarMetrics public, with Color/NSColor helpers for reuse in top‑level tab strips.
    • Added appearance.showPaneNewTabButtons (default true) to optionally hide pane‑level new‑tab buttons.
    • Added tab context actions: splitRight, splitDown, splitBrowserRight, splitBrowserDown.
    • Localized context menu titles using the package bundle and updated the clear‑name label.

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

Summary by CodeRabbit

  • New Features

    • Added split actions (right/down) for terminal and browser tabs.
    • New configuration option to show or hide the pane "new tab" buttons.
  • Localization

    • Tab context menu and split action labels use localized strings for internationalization.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b055878a-8e64-464a-97b9-96eed4c9b409

📥 Commits

Reviewing files that changed from the base of the PR and between 76e42eb and bda0482.

📒 Files selected for processing (1)
  • Sources/Bonsplit/Internal/Views/TabItemView.swift
🚧 Files skipped from review as they are similar to previous changes (1)
  • Sources/Bonsplit/Internal/Views/TabItemView.swift

📝 Walkthrough

Walkthrough

This PR promotes TabBarColors and TabBarMetrics to public, adds a public configuration flag showPaneNewTabButtons, localizes tab context menu titles, and adds four new TabContextAction cases for split actions; TabBarView now conditionally renders new-tab buttons based on the config flag.

Changes

Cohort / File(s) Summary
Styling API visibility
Sources/Bonsplit/Internal/Styling/TabBarColors.swift, Sources/Bonsplit/Internal/Styling/TabBarMetrics.swift
Enums and their static members changed from internal to public; no logic or value changes.
Configuration & public types
Sources/Bonsplit/Public/BonsplitConfiguration.swift, Sources/Bonsplit/Public/Types/TabContextAction.swift
Added showPaneNewTabButtons: Bool to BonsplitConfiguration and Appearance (default true). Added enum cases: splitRight, splitDown, splitBrowserRight, splitBrowserDown.
Views & localization
Sources/Bonsplit/Internal/Views/TabBarView.swift, Sources/Bonsplit/Internal/Views/TabItemView.swift
TabBarView conditionally renders the two new-tab buttons based on showPaneNewTabButtons. TabItemView replaces hard-coded context menu titles with localized strings; action bindings unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • #1083: The new showPaneNewTabButtons flag and split action cases relate to pane action visibility and behavior.

Possibly related PRs

  • #17: Overlaps on tab context menu changes and split-related action additions.

Poem

🐰 I hopped from hidden shades to sunlit views,
Public colors, metrics — now I choose,
Buttons peek or quietly hide,
Menu words speak in every tide,
Splits and hops — a joyous muse! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Proposed Bonsplit hooks for cmux issue 1362' clearly references the main objective of exposing public hooks (TabBarColors, TabBarMetrics, and new configuration options) to support the cmux issue #1362 proposal.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

@ebrardushullovcii ebrardushullovcii marked this pull request as ready for review March 14, 2026 15:11
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@ebrardushullovcii
Copy link
Copy Markdown
Author

Companion cmux proposal is here: manaflow-ai/cmux#1437\n\nThat PR now rebases cleanly on current main and is mergeable again. If this Bonsplit direction looks reasonable, the cmux PR shows the full proposed integration.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
Sources/Bonsplit/Internal/Styling/TabBarMetrics.swift (1)

4-52: LGTM!

Making these constants public enables external consumers (like the cmux prototype) to reuse Bonsplit's tab-bar metrics consistently.

Minor nit: The file resides under Internal/Styling/ but is now a public API. Consider moving it to Public/Styling/ for consistency, or alternatively renaming the folder if more types become public.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Sources/Bonsplit/Internal/Styling/TabBarMetrics.swift` around lines 4 - 52,
TabBarMetrics is declared public but lives under Internal/Styling which
mismatches its visibility; move the TabBarMetrics type (and any other public
styling types) out of the Internal/Styling folder into a Public/Styling area (or
rename the folder from Internal to Public) so the filesystem layout reflects the
API surface, update any module export or target include if needed, and ensure
the symbol TabBarMetrics and its constants keep their public access after the
move.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Sources/Bonsplit/Internal/Views/TabItemView.swift`:
- Around line 369-387: The four contextButton calls that create localized labels
for the split actions (contextButton(..., action: .splitRight),
contextButton(..., action: .splitDown), contextButton(..., action:
.splitBrowserRight), contextButton(..., action: .splitBrowserDown) in
TabItemView.swift) are using bundle: .main; change each localized initializer to
use bundle: .module instead so the strings are resolved from the package module
bundle rather than the main app bundle.
- Around line 326-335: The two contextButton calls use bundle: .main which will
miss package-localized strings; change them to use the package bundle (use
bundle: .module) or replace the calls with the existing localizedContextButton
helper used later; update the contextButton invocations around
contextMenuState.hasCustomTitle (and the preceding Rename Tab call) to use
Bundle.module or call localizedContextButton so localization resolves from the
package instead of .main.

---

Nitpick comments:
In `@Sources/Bonsplit/Internal/Styling/TabBarMetrics.swift`:
- Around line 4-52: TabBarMetrics is declared public but lives under
Internal/Styling which mismatches its visibility; move the TabBarMetrics type
(and any other public styling types) out of the Internal/Styling folder into a
Public/Styling area (or rename the folder from Internal to Public) so the
filesystem layout reflects the API surface, update any module export or target
include if needed, and ensure the symbol TabBarMetrics and its constants keep
their public access after the move.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a5a85e71-feca-4c7a-b0b5-2927ae4ee861

📥 Commits

Reviewing files that changed from the base of the PR and between 505181f and 76e42eb.

📒 Files selected for processing (6)
  • Sources/Bonsplit/Internal/Styling/TabBarColors.swift
  • Sources/Bonsplit/Internal/Styling/TabBarMetrics.swift
  • Sources/Bonsplit/Internal/Views/TabBarView.swift
  • Sources/Bonsplit/Internal/Views/TabItemView.swift
  • Sources/Bonsplit/Public/BonsplitConfiguration.swift
  • Sources/Bonsplit/Public/Types/TabContextAction.swift

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Sources/Bonsplit/Internal/Views/TabItemView.swift">

<violation number="1" location="Sources/Bonsplit/Internal/Views/TabItemView.swift:327">
P2: These new localized menu labels are resolved from `.main` instead of `Bundle.module`, so Bonsplit package localizations are skipped and labels can stay untranslated unless the host app duplicates the keys.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@ebrardushullovcii
Copy link
Copy Markdown
Author

Pushed to address the actionable AI review item on the Bonsplit side.\n\nThe new localized tab context-menu labels now resolve from instead of , so the package-localized strings come from Bonsplit itself rather than depending on the host app to duplicate those keys.

@ebrardushullovcii
Copy link
Copy Markdown
Author

Pushed bda0482 to address the actionable AI review item on the Bonsplit side.

The new localized tab context-menu labels now resolve from Bundle.module instead of .main, so the package-localized strings come from Bonsplit itself rather than depending on the host app to duplicate those keys.

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