Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions Sources/Bonsplit/Internal/Views/TabBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1549,11 +1549,7 @@ struct TabBarView: View {
private var collapsedSplitButtonMenu: some View {
Menu {
ForEach(visibleSplitButtons) { button in
Button {
performSplitActionButton(button)
} label: {
Text(splitActionButtonTooltip(button, tooltips: appearance.splitButtonTooltips))
}
splitButtonMenuItem(button)
}
} label: {
Image(systemName: "ellipsis")
Expand All @@ -1566,6 +1562,20 @@ struct TabBarView: View {
.accessibilityIdentifier("paneTabBarControl.moreActions")
}

@ViewBuilder
private func splitButtonMenuItem(_ button: BonsplitConfiguration.SplitActionButton) -> some View {
let item = Button {
performSplitActionButton(button)
} label: {
Text(splitActionButtonTooltip(button, tooltips: appearance.splitButtonTooltips))
}
if let shortcut = controller.splitButtonShortcuts[button.action] {
item.keyboardShortcut(shortcut)
} else {
item
}
}

@ViewBuilder
private var splitButtonBackdropChrome: some View {
let snapshot = chromeSnapshot
Expand Down
4 changes: 4 additions & 0 deletions Sources/Bonsplit/Public/BonsplitController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public final class BonsplitController {
didSet { internalController.tabShortcutHintsEnabled = tabShortcutHintsEnabled }
}

/// Keyboard shortcuts shown beside the collapsed split-button menu actions.
/// Hosts provide these so the menu stays in sync with their configurable shortcuts.
public var splitButtonShortcuts: [BonsplitConfiguration.SplitActionButton.Action: KeyboardShortcut] = [:]

/// Handler for file/URL drops from external apps (e.g., Finder).
/// Called when files are dropped onto a pane's content area.
/// Return `true` if the drop was handled.
Expand Down
Loading