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
1 change: 1 addition & 0 deletions Sources/Bonsplit/Internal/Views/TabBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ struct TabBarView: View {
dlog("tab.close pane=\(pane.id.id.uuidString.prefix(5)) tab=\(tab.id.uuidString.prefix(5)) title=\"\(tab.title)\"")
#endif
withTransaction(Transaction(animation: nil)) {
controller.onTabCloseRequest?(TabID(id: tab.id), pane.id)
_ = controller.closeTab(TabID(id: tab.id), inPane: pane.id)
}
},
Expand Down
3 changes: 3 additions & 0 deletions Sources/Bonsplit/Internal/Views/TabItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ struct TabItemView: View {
guard !tab.isPinned else { return }
onClose()
}))
.onTapGesture(count: 2) {
onZoomToggle()
}
.onTapGesture {
onSelect()
}
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 @@ -51,6 +51,10 @@ public final class BonsplitController {
/// Return `true` when the drop has been handled by the host application.
@ObservationIgnored public var onExternalTabDrop: ((ExternalTabDropRequest) -> Bool)?

/// Called when the user explicitly requests to close a tab from the tab strip UI.
/// Internal host-driven closes should not use this hook.
@ObservationIgnored public var onTabCloseRequest: ((_ tabId: TabID, _ paneId: PaneID) -> Void)?

// MARK: - Internal State

internal var internalController: SplitViewController
Expand Down