diff --git a/apps/macos/Sources/Clawdis/MenuContextCardInjector.swift b/apps/macos/Sources/Clawdis/MenuContextCardInjector.swift index 588a6021e..a12d37f5a 100644 --- a/apps/macos/Sources/Clawdis/MenuContextCardInjector.swift +++ b/apps/macos/Sources/Clawdis/MenuContextCardInjector.swift @@ -160,12 +160,22 @@ final class MenuContextCardInjector: NSObject, NSMenuDelegate { } private func findInsertIndex(in menu: NSMenu) -> Int? { - // Prefer inserting before the "Send Heartbeats" toggle item. + // Prefer inserting before the first separator (so the card sits right below the Active toggle). if let idx = menu.items.firstIndex(where: { $0.title == "Send Heartbeats" }) { + // SwiftUI menus typically include a separator right after the first toggle; insert before it so the + // separator appears below the context card. + if let sepIdx = menu.items[..= 2 { return 2 } + + if let sepIdx = menu.items.firstIndex(where: { $0.isSeparatorItem }) { + return sepIdx + } + + // Fallback: insert after the first item. + if menu.items.count >= 1 { return 1 } return menu.items.count }