Skip to content
Merged
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/Bugbook/App/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ enum CommandPaletteMode {
case search
case commands
case newTab
case splitLauncher
}

enum ViewMode {
Expand Down
14 changes: 14 additions & 0 deletions Sources/Bugbook/App/BugbookApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,19 @@ class AppDelegate: NSObject, NSApplicationDelegate {
NotificationCenter.default.post(name: .switchWorkspace, object: index)
return nil
}

// Cmd+Option+1-9 for pane focus switching (by visual order)
NSEvent.addLocalMonitorForEvents(matching: .keyDown) { event in
let flags = event.modifierFlags.intersection(.deviceIndependentFlagsMask)
guard flags == [.command, .option] else { return event }

let digitKeyCodes: [UInt16: Int] = [
18: 0, 19: 1, 20: 2, 21: 3, 23: 4, 22: 5, 26: 6, 28: 7, 25: 8
]
guard let index = digitKeyCodes[event.keyCode] else { return event }
NotificationCenter.default.post(name: .focusPaneByIndex, object: index)
return nil
}
}

@objc private func windowDidBecomeKey(_ notification: Notification) {
Expand Down Expand Up @@ -423,4 +436,5 @@ extension Notification.Name {
static let movePaneFocusUp = Notification.Name("movePaneFocusUp")
static let movePaneFocusDown = Notification.Name("movePaneFocusDown")
static let switchWorkspace = Notification.Name("switchWorkspace")
static let focusPaneByIndex = Notification.Name("focusPaneByIndex")
}
1 change: 1 addition & 0 deletions Sources/Bugbook/Extensions/FloatingPopover.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import SwiftUI
extension EnvironmentValues {
@Entry var popoverDismiss: (() -> Void)? = nil
@Entry var workspacePath: String? = nil
@Entry var paneReplaceWarningId: UUID? = nil
}

// MARK: - Floating Popover
Expand Down
9 changes: 9 additions & 0 deletions Sources/Bugbook/Models/BlockDocument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class BlockDocument {
var meetingVolatileText: String = ""
@ObservationIgnored var onStartMeeting: ((UUID) -> Void)?
@ObservationIgnored var onStopMeeting: ((UUID) -> Void)?
@ObservationIgnored var onSplitPane: (() -> Void)?
@ObservationIgnored var transcriptionService: TranscriptionService?
@ObservationIgnored var availablePages: [FileEntry] = []
@ObservationIgnored var filePath: String?
Expand Down Expand Up @@ -927,6 +928,7 @@ class BlockDocument {
case askAI
case meetingNotes
case meeting
case splitPane
}

struct SlashCommand {
Expand Down Expand Up @@ -966,6 +968,8 @@ class BlockDocument {
SlashCommand(name: "Toggle Heading 3", icon: "chevron.right", action: .blockType(.headingToggle, headingLevel: 3), section: "Basic blocks", keywords: ["toggle h3", "collapsible heading"]),
SlashCommand(name: "Table of Contents", icon: "list.bullet.indent", action: .blockType(.outline, headingLevel: 0), section: "Basic blocks", keywords: ["toc", "outline", "contents", "navigation", "headings"]),
SlashCommand(name: "Callout", icon: "exclamationmark.circle", action: .blockType(.callout, headingLevel: 0), section: "Basic blocks", keywords: ["note", "alert", "warning", "info", "tip", "callout"]),
// Layout
SlashCommand(name: "Split Pane", icon: "rectangle.split.2x1", action: .splitPane, section: "Layout", keywords: ["split", "pane", "tile", "open", "side"]),
// Inline
SlashCommand(name: "Page", icon: "doc.text", action: .createPage, section: "Inline", keywords: ["subpage", "new page", "child"]),
SlashCommand(name: "Link to Page", icon: "link", action: .linkToPage, section: "Inline", keywords: ["wiki", "reference", "mention"]),
Expand Down Expand Up @@ -1037,6 +1041,11 @@ class BlockDocument {
dismissSlashMenu()
return

case .splitPane:
dismissSlashMenu()
onSplitPane?()
Comment on lines +1044 to +1046
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Wire /split slash action to a real launcher handler

The new .splitPane slash command only executes onSplitPane?(), but this callback is not wired anywhere in the document setup flow (e.g., wireUpDocumentCallbacks still only sets the other handlers), so /split currently just closes the slash menu and performs no action. That makes the newly added slash command path non-functional for normal editor usage.

Useful? React with 👍 / 👎.

return

case .meeting:
saveUndo()
updateBlockProperty(id: blockId) { block in
Expand Down
Loading
Loading