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
2 changes: 1 addition & 1 deletion packages/notch-mod/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "switchboard-notch",
"version": "0.1.2",
"version": "0.1.3",
"description": "Claude's questions drop from your Mac's notch as a native card. Pick with 1-4, type your own answer, or press esc to answer in Claude Code as usual.",
"author": {
"name": "sameeeeeeep",
Expand Down
Binary file modified packages/notch-mod/helper/sb-card
Binary file not shown.
14 changes: 7 additions & 7 deletions packages/notch-mod/helper/sb-card.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct CardOption: Decodable { let label: String; let detail: String?; let recom
struct CardSpec: Decodable {
let title: String?; let question: String; let options: [CardOption]
let at: String?; let source: String?; let timeout: Double?
let appearance: String? // "light" | "dark"; omitted = follow the system
}

// Claude's design language: warm ivory / warm charcoal surfaces, terracotta accent, serif voice.
Expand Down Expand Up @@ -59,9 +60,9 @@ final class Model: ObservableObject {

struct CardView: View {
@ObservedObject var m: Model
@Environment(\.colorScheme) var scheme
let dark: Bool
@FocusState var fieldFocused: Bool
var p: Palette { scheme == .dark ? .dark : .light }
var p: Palette { dark ? .dark : .light }
var shape: UnevenRoundedRectangle {
UnevenRoundedRectangle(topLeadingRadius: 12, bottomLeadingRadius: 20,
bottomTrailingRadius: 20, topTrailingRadius: 12)
Expand Down Expand Up @@ -166,13 +167,12 @@ guard CommandLine.arguments.count > 1,

let app = NSApplication.shared
app.setActivationPolicy(.accessory)
// Test hook: force an appearance (SB_CARD_APPEARANCE=light|dark); otherwise follow the system.
if let a = ProcessInfo.processInfo.environment["SB_CARD_APPEARANCE"] {
app.appearance = NSAppearance(named: a == "dark" ? .darkAqua : .aqua)
}
// Light or dark: the spec can force one (for screenshots); otherwise follow the system.
let isDark = spec.appearance.map { $0 == "dark" }
?? (app.effectiveAppearance.bestMatch(from: [.darkAqua, .aqua]) == .darkAqua)

let model = Model(spec)
let host = NSHostingView(rootView: CardView(m: model))
let host = NSHostingView(rootView: CardView(m: model, dark: isDark))
host.layoutSubtreeIfNeeded()
let size = host.fittingSize

Expand Down
Loading