Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

Settings: fold the island away and open the window below it

rouderzd7fc1c729751
diff --git a/NotchBuddy/Sources/App/AppDelegate.swift b/NotchBuddy/Sources/App/AppDelegate.swift
index fae5920e..8ec8af07 100644
--- a/NotchBuddy/Sources/App/AppDelegate.swift
+++ b/NotchBuddy/Sources/App/AppDelegate.swift
@@ -45,18 +45,41 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
private var settingsWindow: NSWindow?
@objc private func openSettings() {
- if let w = settingsWindow, w.isVisible { w.makeKeyAndOrderFront(nil); NSApp.activate(ignoringOtherApps: true); return }
+ // The island floats above every window; fold it away so it can't cover Settings.
+ if AppState.shared.mode == .expanded { islandController?.collapse() }
+
+ if let w = settingsWindow, w.isVisible {
+ placeBelowIsland(w)
+ w.makeKeyAndOrderFront(nil); NSApp.activate(ignoringOtherApps: true); return
+ }
let win = NSWindow(contentRect: NSRect(x: 0, y: 0, width: 480, height: 540),
- styleMask: [.titled, .closable], backing: .buffered, defer: false)
+ styleMask: [.titled, .closable, .miniaturizable, .resizable],
+ backing: .buffered, defer: false)
win.title = "Settings — Coucou"
win.contentView = NSHostingView(rootView: SettingsView())
- win.center()
+ win.contentMinSize = NSSize(width: 420, height: 320)
win.isReleasedWhenClosed = false
+ placeBelowIsland(win)
settingsWindow = win
win.makeKeyAndOrderFront(nil)
NSApp.activate(ignoringOtherApps: true)
}
+ /// Centres the window horizontally and keeps its title bar clear of the island panel
+ /// (320 pt tall at the top of the notch screen), shrinking it to fit if needed.
+ private func placeBelowIsland(_ win: NSWindow) {
+ let screen = IslandWindowController.notchScreen() ?? NSScreen.main ?? win.screen
+ guard let screen else { win.center(); return }
+ let visible = screen.visibleFrame
+ let islandBottom = screen.frame.maxY - 320 - 12 // island panel height + margin
+ let top = min(visible.maxY, islandBottom)
+ var frame = win.frame
+ frame.size.height = min(frame.height, max(top - visible.minY - 12, win.minSize.height))
+ frame.origin.x = visible.midX - frame.width / 2
+ frame.origin.y = max(visible.minY + 12, top - frame.height)
+ win.setFrame(frame, display: true)
+ }
+
// MARK: - Island setup
private func setupIsland() {