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.
Swift ai-agentsanthropicantigravityclaudeclaude-codecodexcursordynamic-islandgemini-cliiosiphonlinuxmacosmacos-appmenubar-appnotchopen-sourceswiftswiftuiwindows
Coucou in a corner of the screen
Claude53eb18de1c27
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 95d48041..2528c244 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -30,6 +30,9 @@ jobs:- name: Test display choicerun: bash scripts/test-display-choice.sh+ - name: Test island placement (notch and the four corners)+ run: bash scripts/test-island-placement.sh+- name: Test parallel Claude Code sessionsrun: bash scripts/test-session-registry.shdiff --git a/NotchBuddy/Resources/Localizable.xcstrings b/NotchBuddy/Resources/Localizable.xcstringsindex 8e0ab48b..3bb60d80 100644--- a/NotchBuddy/Resources/Localizable.xcstrings+++ b/NotchBuddy/Resources/Localizable.xcstrings@@ -56015,6 +56015,713 @@}}},+ "island.position" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "الموضع"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "অবস্থান"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Position"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Position"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Posición"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Position"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "स्थान"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Posisi"+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "位置"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "위치"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Posição"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Расположение"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ตำแหน่ง"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Konum"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "位置"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "位置"+ }+ }+ }+ },+ "island.position.notch" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "النتوء (أعلى الوسط)"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "নচ (উপরে মাঝখানে)"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Notch (oben mittig)"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Notch (top centre)"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Notch (arriba en el centro)"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Notch (en haut au centre)"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "नॉच (ऊपर बीच में)"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Notch (atas tengah)"+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ノッチ(上部中央)"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "노치 (상단 가운데)"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Notch (no alto, ao centro)"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Вырез (вверху по центру)"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "รอยบาก (ด้านบนตรงกลาง)"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Çentik (üst orta)"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "刘海(顶部居中)"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "瀏海(頂部置中)"+ }+ }+ }+ },+ "island.position.top-left" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "أعلى اليسار"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "উপরে বাঁয়ে"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Oben links"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Top left"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Arriba a la izquierda"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "En haut à gauche"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ऊपर बाएँ"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Kiri atas"+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "左上"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "왼쪽 위"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Superior esquerdo"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Вверху слева"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "มุมซ้ายบน"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Sol üst"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "左上角"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "左上角"+ }+ }+ }+ },+ "island.position.top-right" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "أعلى اليمين"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "উপরে ডানে"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Oben rechts"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Top right"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Arriba a la derecha"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "En haut à droite"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ऊपर दाएँ"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Kanan atas"+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "右上"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "오른쪽 위"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Superior direito"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Вверху справа"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "มุมขวาบน"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Sağ üst"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "右上角"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "右上角"+ }+ }+ }+ },+ "island.position.bottom-left" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "أسفل اليسار"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "নিচে বাঁয়ে"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Unten links"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Bottom left"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Abajo a la izquierda"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "En bas à gauche"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "नीचे बाएँ"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Kiri bawah"+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "左下"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "왼쪽 아래"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Inferior esquerdo"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Внизу слева"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "มุมซ้ายล่าง"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Sol alt"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "左下角"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "左下角"+ }+ }+ }+ },+ "island.position.bottom-right" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "أسفل اليمين"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "নিচে ডানে"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Unten rechts"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Bottom right"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Abajo a la derecha"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "En bas à droite"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "नीचे दाएँ"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Kanan bawah"+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "右下"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "오른쪽 아래"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Inferior direito"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Внизу справа"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "มุมขวาล่าง"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Sağ alt"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "右下角"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "右下角"+ }+ }+ }+ },+ "island.position.hint" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "في الزاوية، يطفو Coucou فوق سطح المكتب ويُفتح من هناك. يمكنك أيضًا سحب Mochi قرب زاوية من الشاشة، أو إعادته إلى أعلى الوسط."+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "কোণে থাকলে Coucou আপনার ডেস্কটপের উপর ভাসে এবং সেখান থেকেই খোলে। Mochi-কে স্ক্রিনের কোনো কোণের কাছে টেনে আনতে পারেন, অথবা আবার উপরের মাঝখানে নিতে পারেন।"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "In einer Ecke schwebt Coucou über deinem Schreibtisch und öffnet sich von dort. Du kannst Mochi auch in die Nähe einer Bildschirmecke ziehen oder zurück nach oben in die Mitte."+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "In a corner, Coucou floats over your desktop and opens from there. You can also drag Mochi near a corner of the screen, or back to the top centre."+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "En una esquina, Coucou flota sobre tu escritorio y se abre desde ahí. También puedes arrastrar a Mochi cerca de una esquina de la pantalla, o devolverlo arriba en el centro."+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Dans un coin, Coucou flotte sur ton bureau et s’ouvre depuis ce coin. Tu peux aussi glisser Mochi près d’un coin de l’écran, ou le ramener en haut au centre."+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "कोने में Coucou आपके डेस्कटॉप पर तैरता है और वहीं से खुलता है। आप Mochi को स्क्रीन के किसी कोने के पास खींच सकते हैं, या वापस ऊपर बीच में ला सकते हैं।"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Di sudut, Coucou melayang di atas desktop dan terbuka dari sana. Kamu juga bisa menyeret Mochi ke dekat sudut layar, atau kembali ke atas tengah."+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "隅に置くと、Coucou はデスクトップの上に浮かび、そこから開きます。Mochi を画面の隅の近くへドラッグしたり、上部中央へ戻したりすることもできます。"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "모서리에 두면 Coucou가 데스크톱 위에 떠 있고 그 자리에서 열려요. Mochi를 화면 모서리 근처로 끌어다 놓거나 상단 가운데로 다시 옮길 수도 있어요."+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Num canto, o Coucou flutua sobre a sua área de trabalho e abre a partir dali. Você também pode arrastar o Mochi para perto de um canto da tela, ou de volta ao centro, no alto."+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "В углу Coucou парит над рабочим столом и открывается оттуда. Можно также перетащить Mochi к углу экрана или обратно наверх по центру."+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "เมื่ออยู่ที่มุม Coucou จะลอยอยู่เหนือเดสก์ท็อปและเปิดจากตรงนั้น คุณยังลาก Mochi ไปใกล้มุมจอ หรือกลับไปด้านบนตรงกลางได้ด้วย"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Bir köşedeyken Coucou masaüstünün üzerinde süzülür ve oradan açılır. Mochi’yi ekranın bir köşesine yakın sürükleyebilir ya da üst ortaya geri getirebilirsin."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "放在角落时,Coucou 会浮在桌面上并从那里展开。你也可以把 Mochi 拖到屏幕角落附近,或拖回顶部中间。"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "放在角落時,Coucou 會浮在桌面上並從那裡展開。你也可以把 Mochi 拖到螢幕角落附近,或拖回頂部中間。"+ }+ }+ }+ },"Français" : {"localizations" : {"ja" : {diff --git a/NotchBuddy/Sources/App/AppState.swift b/NotchBuddy/Sources/App/AppState.swiftindex e6684587..91a59a10 100644--- a/NotchBuddy/Sources/App/AppState.swift+++ b/NotchBuddy/Sources/App/AppState.swift@@ -357,6 +357,11 @@ final class AppState: ObservableObject {didSet { UserDefaults.standard.set(Int(hotkeyCode), forKey: "hotkeyCode") }}+ /// Where the island lives on its screen: the notch, or a corner (IslandPlacement) — persisted.+ @Published var islandPlacement: IslandPlacement = .notch {+ didSet { UserDefaults.standard.set(islandPlacement.rawValue, forKey: "islandPlacement") }+ }+// Screen hosting the island (notch screen by default) — persisted@Published var islandDisplay: IslandDisplayChoice = .notch {didSet { UserDefaults.standard.set(islandDisplay.storageValue, forKey: "islandDisplay") }@@ -583,6 +588,7 @@ final class AppState: ObservableObject {if let v = ud.object(forKey: "hotkeyFlags") as? Int { hotkeyFlags = UInt(v) }if let v = ud.object(forKey: "hotkeyCode") as? Int { hotkeyCode = UInt16(v) }if let v = ud.string(forKey: "islandDisplay") { islandDisplay = IslandDisplayChoice(storageValue: v) }+ if let v = ud.string(forKey: "islandPlacement"), let p = IslandPlacement(rawValue: v) { islandPlacement = p }if let d = ud.data(forKey: "vercelProjectFilter"),let a = try? JSONDecoder().decode([String].self, from: d) { vercelProjectFilter = Set(a) }if let d = ud.data(forKey: "n8nWorkflowFilter"),diff --git a/NotchBuddy/Sources/App/BotCanvasView.swift b/NotchBuddy/Sources/App/BotCanvasView.swiftindex 9ee632d7..e7c6a496 100644--- a/NotchBuddy/Sources/App/BotCanvasView.swift+++ b/NotchBuddy/Sources/App/BotCanvasView.swift@@ -210,7 +210,6 @@ struct BotCanvasView: View {let (islandW, islandH) = islandSize(mode: state.mode, view: state.view,progress: state.uploadProgress,nw: state.notchWidth, nh: state.notchHeight)- let screen = IslandWindowController.islandScreen().framelet desktopTop = IslandWindowController.desktopTop// The pointer read now, not from the island poll (which slows down far from it).let mouse = DesktopSpace.topDown(NSEvent.mouseLocation, desktopTop: desktopTop)@@ -218,8 +217,10 @@ struct BotCanvasView: View {let (botCx, botCy, _, _) = botPosition(mode: state.mode, view: state.view,islandW: islandW, islandH: islandH,uploadProgress: state.uploadProgress)- return DesktopSpace.topDown(CGPoint(x: screen.midX - islandW / 2 + botCx,- y: screen.maxY - botCy),+ // Where the island really is: the notch, or its corner.+ let island = IslandWindowController.islandScreenRect(size: CGSize(width: islandW, height: islandH))+ return DesktopSpace.topDown(CGPoint(x: island.minX + botCx,+ y: island.maxY - botCy),desktopTop: desktopTop)}let botX = botPoint(islandH: islandH)diff --git a/NotchBuddy/Sources/App/DesktopMochi.swift b/NotchBuddy/Sources/App/DesktopMochi.swiftindex d7d30485..17e661fb 100644--- a/NotchBuddy/Sources/App/DesktopMochi.swift+++ b/NotchBuddy/Sources/App/DesktopMochi.swift@@ -260,8 +260,7 @@ final class DesktopMochiController {phase = .flyingOutlet s = DesktopMochiController.panelSize- let screen = IslandWindowController.islandScreen()- let startOrigin = NSPoint(x: screen.frame.midX - s/2, y: screen.frame.maxY - s)+ let startOrigin = IslandWindowController.homeOrigin(size: s)let target = loadSavedPosition()let p = makeBlankPanel()@@ -332,8 +331,7 @@ final class DesktopMochiController {cancellables.removeAll()isSleeping = falselet s = DesktopMochiController.panelSize- let screen = IslandWindowController.islandScreen()- let targetOrigin = NSPoint(x: screen.frame.midX - s/2, y: screen.frame.maxY - s)+ let targetOrigin = IslandWindowController.homeOrigin(size: s)NSAnimationContext.runAnimationGroup({ ctx inctx.duration = 0.45ctx.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)@@ -360,8 +358,7 @@ final class DesktopMochiController {isSleeping = falselet s = DesktopMochiController.panelSize- let screen = IslandWindowController.islandScreen()- let targetOrigin = NSPoint(x: screen.frame.midX - s/2, y: screen.frame.maxY - s)+ let targetOrigin = IslandWindowController.homeOrigin(size: s)NSAnimationContext.runAnimationGroup({ ctx inctx.duration = 0.45ctx.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)diff --git a/NotchBuddy/Sources/App/IslandPlacement.swift b/NotchBuddy/Sources/App/IslandPlacement.swiftnew file mode 100644index 00000000..3e9977a8--- /dev/null+++ b/NotchBuddy/Sources/App/IslandPlacement.swift@@ -0,0 +1,61 @@+import Foundation++/// Where the island lives: at the notch (top centre), or in one of the screen's four corners.+/// In a corner it is a small floating pill that opens from its corner, downwards from the top+/// corners (just under the menu bar), upwards from the bottom ones (just above the Dock).+///+/// Pure geometry (tested by scripts/test-island-placement.sh). AppKit coordinates: y goes up.+enum IslandPlacement: String, CaseIterable, Sendable {+ case notch, topLeft, topRight, bottomLeft, bottomRight++ var isCorner: Bool { self != .notch }+ var isBottom: Bool { self == .bottomLeft || self == .bottomRight }+ var isLeft: Bool { self == .topLeft || self == .bottomLeft }+ var isRight: Bool { self == .topRight || self == .bottomRight }++ /// Room the corner island keeps from the screen's edges (inside the visible frame).+ static let margin: CGFloat = 10+ /// The island panel is wider than the open island; this much empty room on each side+ /// (Mochi's hearts, the shadow). Same value as (panel width − open width) / 2.+ static let side: CGFloat = 40+ /// A drop of Mochi this close to a corner of the screen moves the island there.+ static let snapDistance: CGFloat = 180++ /// The panel's origin on the screen. `screen` is the screen's frame, `visible` its visible+ /// frame (without the menu bar and the Dock).+ func panelOrigin(screen: CGRect, visible: CGRect, panelSize: CGSize) -> CGPoint {+ let m = Self.margin, s = Self.side+ switch self {+ case .notch: return CGPoint(x: screen.midX - panelSize.width / 2, y: screen.maxY - panelSize.height)+ case .topLeft: return CGPoint(x: visible.minX + m - s, y: visible.maxY - m - panelSize.height)+ case .topRight: return CGPoint(x: visible.maxX - m + s - panelSize.width, y: visible.maxY - m - panelSize.height)+ case .bottomLeft: return CGPoint(x: visible.minX + m - s, y: visible.minY + m)+ case .bottomRight: return CGPoint(x: visible.maxX - m + s - panelSize.width, y: visible.minY + m)+ }+ }++ /// The island's rect inside the panel (panel coordinates, y up) for an island of `size`:+ /// centred at the top for the notch, held by its corner otherwise.+ func islandRect(panelSize: CGSize, size: CGSize) -> CGRect {+ let x: CGFloat+ if isLeft { x = Self.side }+ else if isRight { x = panelSize.width - Self.side - size.width }+ else { x = (panelSize.width - size.width) / 2 }+ let y = isBottom ? 0 : panelSize.height - size.height+ return CGRect(x: x, y: y, width: size.width, height: size.height)+ }++ /// Where Mochi dropped at `point` sends the island: a corner when the drop is near one,+ /// the notch when it is near the top centre, else nil (the drop does what it did before).+ static func snap(_ point: CGPoint, screen: CGRect) -> IslandPlacement? {+ let d = snapDistance+ let nearLeft = point.x - screen.minX < d, nearRight = screen.maxX - point.x < d+ let nearTop = screen.maxY - point.y < d, nearBottom = point.y - screen.minY < d+ if nearTop && nearLeft { return .topLeft }+ if nearTop && nearRight { return .topRight }+ if nearBottom && nearLeft { return .bottomLeft }+ if nearBottom && nearRight { return .bottomRight }+ if screen.maxY - point.y < 90 && abs(point.x - screen.midX) < 220 { return .notch }+ return nil+ }+}diff --git a/NotchBuddy/Sources/App/IslandRootView.swift b/NotchBuddy/Sources/App/IslandRootView.swiftindex e8e1af7d..032c42eb 100644--- a/NotchBuddy/Sources/App/IslandRootView.swift+++ b/NotchBuddy/Sources/App/IslandRootView.swift@@ -8,16 +8,37 @@ struct IslandRootView: View {@EnvironmentObject var state: AppStatevar body: some View {- ZStack(alignment: .top) {+ let placement = state.islandPlacement+ ZStack(alignment: placement.alignment) {Color.clear.frame(maxWidth: .infinity, maxHeight: .infinity)- IslandContainer(state: state)- .frame(maxWidth: .infinity, alignment: .center)+ if placement.isCorner {+ // Held by its corner: it grows away from it (IslandPlacement.islandRect).+ IslandContainer(state: state)+ .padding(.horizontal, IslandPlacement.side)+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: placement.alignment)+ } else {+ IslandContainer(state: state)+ .frame(maxWidth: .infinity, alignment: .center)+ }}.ignoresSafeArea()}}+extension IslandPlacement {+ /// The panel corner the island is held by (top centre at the notch).+ var alignment: Alignment {+ switch self {+ case .notch: return .top+ case .topLeft: return .topLeading+ case .topRight: return .topTrailing+ case .bottomLeft: return .bottomLeading+ case .bottomRight: return .bottomTrailing+ }+ }+}+// MARK: - Island containerstruct IslandContainer: View {@@ -60,6 +81,13 @@ struct IslandContainer: View {// Hidden over a real notch: draw nothing. A black copy of the notch would slide// away with the Space on a desktop swipe, while the real notch stays..fill(Color.black.opacity(state.mode == .hidden && state.hasNotch ? 0 : 1))+ // Floating in a corner: a thin edge and a shadow lift it off the desktop.+ .overlay(+ IslandShape(width: islandWidth, height: islandHeight,+ cornerRadius: cornerRadius, topRadius: islandTopRadius)+ .stroke(Color.white.opacity(state.islandPlacement.isCorner ? 0.09 : 0), lineWidth: 1)+ )+ .shadow(color: .black.opacity(state.islandPlacement.isCorner ? 0.45 : 0), radius: 14, y: 6)// Contentif state.mode == .expanded {@@ -143,7 +171,8 @@ struct IslandContainer: View {progress: state.uploadProgress,nw: state.notchWidth, nh: state.notchHeight)let cr = newMode == .expanded ? IslandConst.expandedCorner : IslandConst.roundedCorner- let tr: CGFloat = 0+ // In a corner the island floats: its top corners are rounded too.+ let tr: CGFloat = state.islandPlacement.isCorner ? cr : 0withAnimation(anim) {islandWidth = wislandHeight = (newMode == .expanded && state.view == .prompt) ? chatPromptHeight : h@@ -177,7 +206,7 @@ struct IslandContainer: View {islandWidth = wislandHeight = state.view == .prompt ? chatPromptHeight : hcornerRadius = state.mode == .expanded ? IslandConst.expandedCorner : IslandConst.roundedCorner- islandTopRadius = 0+ islandTopRadius = state.islandPlacement.isCorner ? cornerRadius : 0}.onReceive(NotificationCenter.default.publisher(for: .islandResize)) { _ inguard state.mode == .expanded, state.view != .prompt else { return }@@ -199,6 +228,8 @@ struct IslandContainer: View {nw: state.notchWidth, nh: state.notchHeight)islandWidth = wislandHeight = (state.mode == .expanded && state.view == .prompt) ? chatPromptHeight : h+ // The notch ↔ a corner: flat or rounded top.+ islandTopRadius = state.islandPlacement.isCorner ? cornerRadius : 0}}diff --git a/NotchBuddy/Sources/App/IslandWindowController.swift b/NotchBuddy/Sources/App/IslandWindowController.swiftindex b8b0b57f..779895d7 100644--- a/NotchBuddy/Sources/App/IslandWindowController.swift+++ b/NotchBuddy/Sources/App/IslandWindowController.swift@@ -16,6 +16,7 @@ final class IslandWindowController: NSWindowController {private var keyMonitor: Any?private var viewSubscription: AnyCancellable?private var displaySubscription: AnyCancellable?+ private var placementSubscription: AnyCancellable?private var autoCloseSubscription: AnyCancellable?private var absenceSubscription: AnyCancellable?private var openOnHoverSubscription: AnyCancellable?@@ -70,15 +71,17 @@ final class IslandWindowController: NSWindowController {convenience init() {let screen = Self.targetScreen(for: AppState.shared.islandDisplay)Self.currentScreen = screen- let geometry = Self.screenGeometry(for: screen)+ let geometry = Self.restingGeometry(for: screen)let nW = geometry.widthlet nH = geometry.heightlet panelW: CGFloat = 720let panelH: CGFloat = 560- let sf = screen.frame+ let origin = AppState.shared.islandPlacement.panelOrigin(+ screen: screen.frame, visible: screen.visibleFrame, panelSize: CGSize(width: panelW, height: panelH))+ Self.panelFrame = NSRect(origin: origin, size: CGSize(width: panelW, height: panelH))let panel = IslandPanel(- contentRect: NSRect(x: sf.midX - panelW/2, y: sf.maxY - panelH,+ contentRect: NSRect(x: origin.x, y: origin.y,width: panelW, height: panelH),styleMask: [.borderless, .nonactivatingPanel],backing: .buffered, defer: false@@ -207,6 +210,15 @@ final class IslandWindowController: NSWindowController {self?.moveToTargetScreen(choice: choice)}+ // The notch or a corner (Settings, or Mochi dropped near a corner).+ placementSubscription = state.$islandPlacement+ .dropFirst()+ .removeDuplicates()+ .receive(on: DispatchQueue.main)+ .sink { [weak self] _ in+ self?.relocate(to: Self.islandScreen())+ }+// Screen plugged/unplugged, lid closed, arrangement or resolution changed.NotificationCenter.default.addObserver(forName: NSApplication.didChangeScreenParametersNotification, object: nil, queue: .main@@ -222,11 +234,12 @@ final class IslandWindowController: NSWindowController {relocate(to: Self.targetScreen(for: choice))}- /// Recomputes the resting geometry for `screen` and moves the panel to its top centre.+ /// Recomputes the resting geometry for `screen` and moves the panel to its top centre, or to+ /// the corner the island lives in./// Always re-applied, even on the same screen: its menu bar or resolution may have changed.private func relocate(to screen: NSScreen) {guard let panel = window as? IslandPanel else { return }- let geometry = Self.screenGeometry(for: screen)+ let geometry = Self.restingGeometry(for: screen)notchW = geometry.widthnotchH = geometry.heighthasNotch = geometry.hasNotch@@ -237,10 +250,11 @@ final class IslandWindowController: NSWindowController {AppState.shared.hasNotch = hasNotchSelf.currentScreen = screen- let sf = screen.framelet size = panel.frame.size- panel.setFrame(NSRect(x: sf.midX - size.width/2, y: sf.maxY - size.height,- width: size.width, height: size.height), display: true)+ let origin = state.islandPlacement.panelOrigin(screen: screen.frame, visible: screen.visibleFrame,+ panelSize: size)+ Self.panelFrame = NSRect(origin: origin, size: size)+ panel.setFrame(Self.panelFrame, display: true)// notchWidth/hasNotch are not @Published: tell the views to resize the island.NotificationCenter.default.post(name: .islandScreenChanged, object: nil)state.objectWillChange.send()@@ -981,6 +995,19 @@ final class IslandWindowController: NSWindowController {self.state.stateOverride = nil#if !APPSTORE+ // Dropped near a corner of its screen (or back at the top centre): the island+ // moves there.+ if let here = NSScreen.screens.first(where: { $0.frame.contains(mouse) }),+ here == Self.islandScreen(),+ let target = IslandPlacement.snap(mouse, screen: here.frame),+ target != self.state.islandPlacement {+ self.hideDragGhost()+ self.state.islandPlacement = target+ SoundEngine.shared.play("pop")+ NotificationCenter.default.post(name: .triggerEmote, object: BotEmote.happy)+ return+ }+let windowCtx = self.windowContextAtPoint(mouse)let inNotchZone = self.window?.frame.contains(mouse) == true@@ -1260,13 +1287,13 @@ final class IslandWindowController: NSWindowController {// MARK: - Coordinate conversion: window (AppKit, y-up) → island coords (y-down, 0,0 = island top-left)func windowToIsland(_ loc: CGPoint) -> CGPoint {- let panelH = window?.frame.height ?? 320+ let island = islandPanel.currentIslandFrame(nw: notchW, nh: notchH)let panelW = window?.frame.width ?? 720- let islandLeft = (panelW - IslandConst.expandedWidth) / 2- // Island is glued to panel top; its bottom in AppKit = panelH - 176+ let islandLeft = AppState.shared.islandPlacement.isCorner+ ? island.minX : (panelW - IslandConst.expandedWidth) / 2return CGPoint(x: loc.x - islandLeft,- y: panelH - loc.y // AppKit y is from bottom; island y from top+ y: island.maxY - loc.y // AppKit y is from bottom; island y from top)}@@ -1347,15 +1374,16 @@ final class IslandWindowController: NSWindowController {} else {islandH = fixedH}- let islandMinX = (panelW - islandW) / 2+ let rect = s.islandPlacement.islandRect(panelSize: CGSize(width: panelW, height: panelH),+ size: CGSize(width: islandW, height: islandH))let (cx, cy, diameter, _) = botPosition(mode: s.mode, view: s.view,islandW: islandW, islandH: islandH,uploadProgress: s.uploadProgress, hasNotch: s.hasNotch)let radius = (diameter / 0.6) / 2// botPosition cy is from island TOP; panel AppKit coords have y=0 at bottom- // island top in AppKit coords = panelH (island glued to top of panel/screen)- let botX = islandMinX + cx- let botY = panelH - cy+ // (the island's top is the panel's top at the notch, lower in a bottom corner).+ let botX = rect.minX + cx+ let botY = rect.maxY - cylet dx = windowPoint.x - botXlet dy = windowPoint.y - botYreturn dx*dx + dy*dy <= radius * radius@@ -1381,6 +1409,35 @@ final class IslandWindowController: NSWindowController {/// Screen the island currently sits on (Settings window, desktop Mochi flights).private(set) static var currentScreen: NSScreen?+ /// The island panel's frame on the screen (set where it is placed).+ private(set) static var panelFrame: NSRect = .zero++ /// The island's rect on the screen for an island of `size` (AppKit, y up).+ static func islandScreenRect(size: CGSize) -> CGRect {+ AppState.shared.islandPlacement.islandRect(panelSize: panelFrame.size, size: size)+ .offsetBy(dx: panelFrame.minX, dy: panelFrame.minY)+ }++ /// Where Mochi leaves from and flies back to (a square of side `s`): the top centre at the+ /// notch, the resting island in a corner.+ static func homeOrigin(size s: CGFloat) -> NSPoint {+ let app = AppState.shared+ guard app.islandPlacement.isCorner else {+ let f = islandScreen().frame+ return NSPoint(x: f.midX - s / 2, y: f.maxY - s)+ }+ let r = islandScreenRect(size: CGSize(width: app.notchWidth, height: app.notchHeight))+ return NSPoint(x: r.minX + 40 - s / 2, y: r.midY - s / 2)+ }++ /// The resting island for `screen`: the notch's size at the notch, or the small bar of a+ /// screen without a notch when the island lives in a corner (it floats, Mochi in sight).+ static func restingGeometry(for screen: NSScreen) -> IslandScreenGeometry {+ guard AppState.shared.islandPlacement.isCorner else { return screenGeometry(for: screen) }+ return IslandScreenGeometry(screenWidth: screen.frame.width, safeAreaTop: 0,+ auxiliaryLeftWidth: nil, auxiliaryRightWidth: nil,+ menuBarHeight: NSStatusBar.system.thickness)+ }static func islandScreen() -> NSScreen {if let s = currentScreen, NSScreen.screens.contains(s) { return s }@@ -1453,7 +1510,7 @@ final class IslandPanel: NSPanel {} else {h = fixedH}- return CGRect(x: (frame.width - w) / 2, y: frame.height - h, width: w, height: h)+ return s.islandPlacement.islandRect(panelSize: frame.size, size: CGSize(width: w, height: h))}}diff --git a/NotchBuddy/Sources/App/SettingsSearch.swift b/NotchBuddy/Sources/App/SettingsSearch.swiftindex 08f57e48..84672b38 100644--- a/NotchBuddy/Sources/App/SettingsSearch.swift+++ b/NotchBuddy/Sources/App/SettingsSearch.swift@@ -100,7 +100,9 @@ final class SettingsSearch: ObservableObject {e("general.demo", .general, "demo.groupbox.title"),e("general.sound", .general, "Sound", ["Enable sounds", "Volume", "Open sounds folder", "Reload sounds"]),e("general.behavior", .general, "Behavior", ["Open on hover", "Close after", "Hide after", "alerts.all-pills"]),- e("general.display", .general, "Display", ["Show Mochi on", "Screen with the notch", "Main screen (menu bar)", "Follow the mouse"]),+ e("general.display", .general, "Display", ["Show Mochi on", "Screen with the notch", "Main screen (menu bar)", "Follow the mouse",+ "island.position", "island.position.top-left", "island.position.top-right",+ "island.position.bottom-left", "island.position.bottom-right"]),e("general.vitals", .general, "vitals.title", ["vitals.toggle"]),e("general.hotkey", .general, "Hotkey", ["Show island with shortcut", "Shortcut"]),e("general.startup", .general, "Startup", ["Launch at Mac startup"]),diff --git a/NotchBuddy/Sources/App/SettingsView.swift b/NotchBuddy/Sources/App/SettingsView.swiftindex bf10fbd8..69d3a72e 100644--- a/NotchBuddy/Sources/App/SettingsView.swift+++ b/NotchBuddy/Sources/App/SettingsView.swift@@ -390,6 +390,22 @@ struct SettingsView: View {.font(.system(size: 11)).foregroundColor(.secondary).fixedSize(horizontal: false, vertical: true)+ #if !APPSTORE+ // The notch or a corner of the screen (IslandPlacement).+ Picker(String(localized: "island.position"), selection: $state.islandPlacement) {+ Text("island.position.notch").tag(IslandPlacement.notch)+ Divider()+ Text("island.position.top-left").tag(IslandPlacement.topLeft)+ Text("island.position.top-right").tag(IslandPlacement.topRight)+ Text("island.position.bottom-left").tag(IslandPlacement.bottomLeft)+ Text("island.position.bottom-right").tag(IslandPlacement.bottomRight)+ }+ .frame(maxWidth: 360)+ Text("island.position.hint")+ .font(.system(size: 11))+ .foregroundColor(.secondary)+ .fixedSize(horizontal: false, vertical: true)+ #endif}.padding(6).onAppear { refreshConnectedScreens() }diff --git a/NotchBuddy/Sources/App/Voice/VoiceCaptionManager.swift b/NotchBuddy/Sources/App/Voice/VoiceCaptionManager.swiftindex 83aed9c0..0b688c49 100644--- a/NotchBuddy/Sources/App/Voice/VoiceCaptionManager.swift+++ b/NotchBuddy/Sources/App/Voice/VoiceCaptionManager.swift@@ -66,7 +66,12 @@ final class VoiceCaptionManager {/// Height of the black capsule, reported by the view (it follows the answer's length).var capsuleHeight: CGFloat = 0 {- didSet { if capsuleHeight != oldValue { updateMouseAcceptance() } }+ didSet {+ guard capsuleHeight != oldValue else { return }+ // Above a bottom-corner island, the panel follows the capsule's height.+ if AppState.shared.islandPlacement.isBottom { reposition(animated: false) }+ updateMouseAcceptance()+ }}private init() {@@ -220,8 +225,8 @@ final class VoiceCaptionManager {private func reposition(animated: Bool, closing: Bool = false) {guard let p = panel, let screen else { return }let app = AppState.shared- let (_, fixedH) = islandSize(mode: app.mode, view: app.view, progress: app.uploadProgress,- nw: app.notchWidth, nh: app.notchHeight)+ let (islandW, fixedH) = islandSize(mode: app.mode, view: app.view, progress: app.uploadProgress,+ nw: app.notchWidth, nh: app.notchHeight)var islandH = fixedHif app.mode == .expanded && app.view == .prompt {islandH = min(300, 240 + CGFloat(app.chatHistory.count) * 40)@@ -229,10 +234,19 @@ final class VoiceCaptionManager {let visibleH = max(islandH, app.notchHeight)let sf = screen.framelet w = Self.panelWidth, h = Self.panelHeight- let frame = NSRect(x: sf.midX - w / 2, y: sf.maxY - h, width: w, height: h)+ let offset = min(visibleH + notchGap, Self.islandRoom)+ var frame = NSRect(x: sf.midX - w / 2, y: sf.maxY - h, width: w, height: h)+ if app.islandPlacement.isCorner {+ // Under the island in a top corner; above it in a bottom one (the capsule then ends+ // just over the island's top).+ let island = IslandWindowController.islandScreenRect(size: CGSize(width: islandW, height: islandH))+ let top = app.islandPlacement.isBottom+ ? island.maxY + notchGap + capsuleHeight + offset+ : island.maxY+ frame = NSRect(x: island.midX - w / 2, y: top - h, width: w, height: h)+ }if p.frame != frame { p.setFrame(frame, display: true) }- let offset = min(visibleH + notchGap, Self.islandRoom)if offset != state.topOffset {if animated && p.isVisible && state.isVisible {withAnimation(closing ? closeEase : openSpring) { state.topOffset = offset }diff --git a/docs/SPEC.md b/docs/SPEC.mdindex ca99d44b..101d9636 100644--- a/docs/SPEC.md+++ b/docs/SPEC.md@@ -301,6 +301,15 @@ Chaque jalon se termine par build + capture + comparaison aux références + com- Hidden = 0 % CPU ; compact < 3 % ; mémoire < 100 Mo.- La démo (⌃⌥⌘D) se filme d'une traite sans intervention.+## 12 bis. Coucou dans un coin de l'écran++Version GitHub : l'île peut vivre au notch (par défaut) ou dans un des quatre coins de son écran (`AppState.islandPlacement`, clé `islandPlacement` : `notch`, `topLeft`, `topRight`, `bottomLeft`, `bottomRight`).++- **Où** : coins du haut juste sous la barre des menus, coins du bas juste au-dessus du Dock (`screen.visibleFrame`), à 10 pt des bords. La géométrie est dans `IslandPlacement` (pure, testée par `scripts/test-island-placement.sh`) : origine du panneau, rectangle de l'île dans le panneau, coin visé par un lâcher.+- **Forme** : au repos, la petite barre d'un écran sans notch (80 × 24 pt, Mochi visible), coins du haut arrondis aussi, fin liseré et ombre. Ouverte, elle grandit depuis son coin : vers le bas en haut, vers le haut en bas, vers la droite à gauche, vers la gauche à droite. Toutes les vues sont les mêmes.+- **Choisir** : Réglages → Général → Affichage → Position, ou glisser Mochi et le lâcher à moins de 180 pt d'un coin de l'écran (ou en haut au centre pour revenir au notch). Son `pop`, émote `happy`.+- **Suivent l'île** : le suivi des yeux, Mochi sur le bureau (départ et retour), les sous-titres de la voix (sous l'île en haut, au-dessus en bas), la zone de survol et les clics.+## 13. Mochi sur le bureauMochi peut quitter l'island et vivre comme une icône flottante sur le bureau. Il conserve tout son comportement (tenue, émotes, suivi des yeux, danse) et réagit aux alertes.diff --git a/scripts/test-island-placement.sh b/scripts/test-island-placement.shnew file mode 100755index 00000000..8f9fe1aa--- /dev/null+++ b/scripts/test-island-placement.sh@@ -0,0 +1,9 @@+#!/usr/bin/env bash+set -euo pipefail+cd "$(dirname "$0")/.."+TEST_DIR="$(mktemp -d "${TMPDIR:-/tmp}/coucou-island-placement.XXXXXX")"+trap 'rm -rf "$TEST_DIR"' EXIT+swiftc -swift-version 6 -strict-concurrency=complete \+ NotchBuddy/Sources/App/IslandPlacement.swift \+ tests/IslandPlacementTests.swift -o "$TEST_DIR/island-placement-tests"+"$TEST_DIR/island-placement-tests"diff --git a/tests/IslandPlacementTests.swift b/tests/IslandPlacementTests.swiftnew file mode 100644index 00000000..fadb4887--- /dev/null+++ b/tests/IslandPlacementTests.swift@@ -0,0 +1,39 @@+import Foundation++@main+enum IslandPlacementTests {+ static func main() {+ let screen = CGRect(x: 0, y: 0, width: 1512, height: 982)+ let visible = CGRect(x: 0, y: 70, width: 1512, height: 879) // menu bar 33, Dock 70+ let panel = CGSize(width: 720, height: 560)+ let open = CGSize(width: 640, height: 160)++ // Notch: top centre, as before.+ let n = IslandPlacement.notch.panelOrigin(screen: screen, visible: visible, panelSize: panel)+ precondition(n == CGPoint(x: 396, y: 422))+ precondition(IslandPlacement.notch.islandRect(panelSize: panel, size: open) == CGRect(x: 40, y: 400, width: 640, height: 160))++ // Corners: the island 10 pt from the visible edges, whatever its size.+ for p in IslandPlacement.allCases where p.isCorner {+ let o = p.panelOrigin(screen: screen, visible: visible, panelSize: panel)+ for size in [CGSize(width: 80, height: 24), CGSize(width: 240, height: 24), open] {+ let r = p.islandRect(panelSize: panel, size: size).offsetBy(dx: o.x, dy: o.y)+ if p.isLeft { precondition(r.minX == 10, "\(p) \(r)") }+ if p.isRight { precondition(r.maxX == 1502, "\(p) \(r)") }+ if p.isBottom { precondition(r.minY == 80, "\(p) \(r): above the Dock") }+ else { precondition(r.maxY == 939, "\(p) \(r): under the menu bar") }+ }+ }++ // Drops: a corner, the notch, or nothing.+ precondition(IslandPlacement.snap(CGPoint(x: 40, y: 950), screen: screen) == .topLeft)+ precondition(IslandPlacement.snap(CGPoint(x: 1490, y: 960), screen: screen) == .topRight)+ precondition(IslandPlacement.snap(CGPoint(x: 60, y: 30), screen: screen) == .bottomLeft)+ precondition(IslandPlacement.snap(CGPoint(x: 1450, y: 100), screen: screen) == .bottomRight)+ precondition(IslandPlacement.snap(CGPoint(x: 760, y: 960), screen: screen) == .notch)+ precondition(IslandPlacement.snap(CGPoint(x: 760, y: 500), screen: screen) == nil)+ precondition(IslandPlacement.snap(CGPoint(x: 400, y: 960), screen: screen) == nil, "top, but not near the notch nor a corner")+ precondition(IslandPlacement(rawValue: "bottomRight") == .bottomRight)+ print("IslandPlacement tests: all passed")+ }+}diff --git a/windows/src/i18n/strings.json b/windows/src/i18n/strings.jsonindex 735f86b8..f54160a3 100644--- a/windows/src/i18n/strings.json+++ b/windows/src/i18n/strings.json@@ -1202,6 +1202,36 @@"ko": "아래","ja": "下"},+ "Bottom left": {+ "zh-Hans": "左下角",+ "hi": "नीचे बाएँ",+ "es": "Abajo a la izquierda",+ "ar": "أسفل اليسار",+ "fr": "En bas à gauche",+ "bn": "নিচে বাঁয়ে",+ "pt-BR": "Inferior esquerdo",+ "ru": "Внизу слева",+ "id": "Kiri bawah",+ "de": "Unten links",+ "tr": "Sol alt",+ "ko": "왼쪽 아래",+ "ja": "左下"+ },+ "Bottom right": {+ "zh-Hans": "右下角",+ "hi": "नीचे दाएँ",+ "es": "Abajo a la derecha",+ "ar": "أسفل اليمين",+ "fr": "En bas à droite",+ "bn": "নিচে ডানে",+ "pt-BR": "Inferior direito",+ "ru": "Внизу справа",+ "id": "Kanan bawah",+ "de": "Unten rechts",+ "tr": "Sağ alt",+ "ko": "오른쪽 아래",+ "ja": "右下"+ },"Bow": {"zh-Hans": "蝴蝶结","hi": "बो",@@ -4067,6 +4097,21 @@"ko": "중요","ja": "重要"},+ "In a corner, Coucou floats over your desktop and opens from there. You can also drag Mochi near a corner of the screen, or back to the top centre.": {+ "zh-Hans": "放在角落时,Coucou 会浮在桌面上并从那里展开。你也可以把 Mochi 拖到屏幕角落附近,或拖回顶部中间。",+ "hi": "कोने में Coucou आपके डेस्कटॉप पर तैरता है और वहीं से खुलता है। आप Mochi को स्क्रीन के किसी कोने के पास खींच सकते हैं, या वापस ऊपर बीच में ला सकते हैं।",+ "es": "En una esquina, Coucou flota sobre tu escritorio y se abre desde ahí. También puedes arrastrar a Mochi cerca de una esquina de la pantalla, o devolverlo arriba en el centro.",+ "ar": "في الزاوية، يطفو Coucou فوق سطح المكتب ويُفتح من هناك. يمكنك أيضًا سحب Mochi قرب زاوية من الشاشة، أو إعادته إلى أعلى الوسط.",+ "fr": "Dans un coin, Coucou flotte sur ton bureau et s’ouvre depuis ce coin. Tu peux aussi glisser Mochi près d’un coin de l’écran, ou le ramener en haut au centre.",+ "bn": "কোণে থাকলে Coucou আপনার ডেস্কটপের উপর ভাসে এবং সেখান থেকেই খোলে। Mochi-কে স্ক্রিনের কোনো কোণের কাছে টেনে আনতে পারেন, অথবা আবার উপরের মাঝখানে নিতে পারেন।",+ "pt-BR": "Num canto, o Coucou flutua sobre a sua área de trabalho e abre a partir dali. Você também pode arrastar o Mochi para perto de um canto da tela, ou de volta ao centro, no alto.",+ "ru": "В углу Coucou парит над рабочим столом и открывается оттуда. Можно также перетащить Mochi к углу экрана или обратно наверх по центру.",+ "id": "Di sudut, Coucou melayang di atas desktop dan terbuka dari sana. Kamu juga bisa menyeret Mochi ke dekat sudut layar, atau kembali ke atas tengah.",+ "de": "In einer Ecke schwebt Coucou über deinem Schreibtisch und öffnet sich von dort. Du kannst Mochi auch in die Nähe einer Bildschirmecke ziehen oder zurück nach oben in die Mitte.",+ "tr": "Bir köşedeyken Coucou masaüstünün üzerinde süzülür ve oradan açılır. Mochi’yi ekranın bir köşesine yakın sürükleyebilir ya da üst ortaya geri getirebilirsin.",+ "ko": "모서리에 두면 Coucou가 데스크톱 위에 떠 있고 그 자리에서 열려요. Mochi를 화면 모서리 근처로 끌어다 놓거나 상단 가운데로 다시 옮길 수도 있어요.",+ "ja": "隅に置くと、Coucou はデスクトップの上に浮かび、そこから開きます。Mochi を画面の隅の近くへドラッグしたり、上部中央へ戻したりすることもできます。"+ },"Inbox": {"zh-Hans": "收件箱","hi": "इनबॉक्स",@@ -6182,6 +6227,21 @@"ko": "노치","ja": "ノッチ"},+ "Notch (top centre)": {+ "zh-Hans": "刘海(顶部居中)",+ "hi": "नॉच (ऊपर बीच में)",+ "es": "Notch (arriba en el centro)",+ "ar": "النتوء (أعلى الوسط)",+ "fr": "Notch (en haut au centre)",+ "bn": "নচ (উপরে মাঝখানে)",+ "pt-BR": "Notch (no alto, ao centro)",+ "ru": "Вырез (вверху по центру)",+ "id": "Notch (atas tengah)",+ "de": "Notch (oben mittig)",+ "tr": "Çentik (üst orta)",+ "ko": "노치 (상단 가운데)",+ "ja": "ノッチ(上部中央)"+ },"Notch shortcuts — active when the notch is in front": {"zh-Hans": "岛快捷键 — 岛获得焦点时有效","hi": "आइलैंड शॉर्टकट — आइलैंड फोकस में होने पर सक्रिय",@@ -7367,6 +7427,21 @@"ko": "다듬어서","ja": "丁寧"},+ "Position": {+ "zh-Hans": "位置",+ "hi": "स्थान",+ "es": "Posición",+ "ar": "الموضع",+ "fr": "Position",+ "bn": "অবস্থান",+ "pt-BR": "Posição",+ "ru": "Расположение",+ "id": "Posisi",+ "de": "Position",+ "tr": "Konum",+ "ko": "위치",+ "ja": "位置"+ },"Preparing…": {"zh-Hans": "正在准备…","hi": "तैयारी हो रही है…",@@ -9947,6 +10022,21 @@"ko": "최애 에이전트","ja": "トップのエージェント"},+ "Top left": {+ "zh-Hans": "左上角",+ "hi": "ऊपर बाएँ",+ "es": "Arriba a la izquierda",+ "ar": "أعلى اليسار",+ "fr": "En haut à gauche",+ "bn": "উপরে বাঁয়ে",+ "pt-BR": "Superior esquerdo",+ "ru": "Вверху слева",+ "id": "Kiri atas",+ "de": "Oben links",+ "tr": "Sol üst",+ "ko": "왼쪽 위",+ "ja": "左上"+ },"Top project": {"zh-Hans": "最活跃项目","hi": "शीर्ष प्रोजेक्ट",@@ -9962,6 +10052,21 @@"ko": "최애 프로젝트","ja": "トップのプロジェクト"},+ "Top right": {+ "zh-Hans": "右上角",+ "hi": "ऊपर दाएँ",+ "es": "Arriba a la derecha",+ "ar": "أعلى اليمين",+ "fr": "En haut à droite",+ "bn": "উপরে ডানে",+ "pt-BR": "Superior direito",+ "ru": "Вверху справа",+ "id": "Kanan atas",+ "de": "Oben rechts",+ "tr": "Sağ üst",+ "ko": "오른쪽 위",+ "ja": "右上"+ },"Transcript": {"zh-Hans": "转写","hi": "ट्रांसक्रिप्ट",