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
Mail pill: the number alone, filters on one line, a taller notch to read
Claudef9a2c9eb6e17
diff --git a/NotchBuddy/Resources/Localizable.xcstrings b/NotchBuddy/Resources/Localizable.xcstringsindex 66f7b1aa..34713e64 100644--- a/NotchBuddy/Resources/Localizable.xcstrings+++ b/NotchBuddy/Resources/Localizable.xcstrings@@ -2728,6 +2728,107 @@}}},+ "hub.mail.checked %lld" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "تم فحص %lld رسالة جديدة اليوم. لم تطابق أيٌّ منها شخصًا مهمًا أو كلمة محظورة أو قاعدة، لذا تركها Coucou كما هي."+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "আজ %lld টি নতুন বার্তা দেখা হয়েছে। কোনোটি VIP, নিষিদ্ধ শব্দ বা নিয়মের সাথে মেলেনি, তাই Coucou সেগুলো যেমন ছিল তেমনই রেখেছে।"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Heute %lld neue Nachrichten geprüft. Keine passte zu einem VIP, einem gesperrten Wort oder einer Regel, also hat Coucou sie gelassen, wie sie sind."+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%lld new messages checked today. None matched a VIP, a banned word or a rule, so Coucou left them as they are."+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%lld mensajes nuevos revisados hoy. Ninguno coincidía con un VIP, una palabra prohibida o una regla, así que Coucou los dejó como estaban."+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%lld nouveaux messages vérifiés aujourd’hui. Aucun ne correspondait à un VIP, un mot banni ou une règle : Coucou les a laissés tels quels."+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "आज %lld नए संदेश जाँचे गए। कोई भी VIP, प्रतिबंधित शब्द या नियम से मेल नहीं खाया, इसलिए Coucou ने उन्हें वैसे ही छोड़ दिया।"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%lld pesan baru diperiksa hari ini. Tidak ada yang cocok dengan VIP, kata terlarang, atau aturan, jadi Coucou membiarkannya apa adanya."+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "今日は新着メッセージを %lld 件確認しました。VIP、禁止ワード、ルールのどれにも当てはまらなかったので、Coucou はそのままにしました。"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "오늘 새 메시지 %lld개를 확인했어요. VIP, 금지어, 규칙 중 어느 것에도 해당하지 않아 Coucou는 그대로 두었어요."+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%lld mensagens novas verificadas hoje. Nenhuma correspondia a um VIP, uma palavra banida ou uma regra, então o Coucou as deixou como estavam."+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Сегодня проверено новых писем: %lld. Ни одно не совпало с VIP, запрещённым словом или правилом, поэтому Coucou оставил их как есть."+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "วันนี้ตรวจข้อความใหม่แล้ว %lld ฉบับ ไม่มีฉบับใดตรงกับ VIP คำต้องห้าม หรือกฎ Coucou จึงปล่อยไว้ตามเดิม"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Bugün %lld yeni ileti kontrol edildi. Hiçbiri bir VIP, yasaklı kelime veya kuralla eşleşmedi, bu yüzden Coucou onları olduğu gibi bıraktı."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "今天检查了 %lld 封新邮件。没有一封匹配 VIP、屏蔽词或规则,所以 Coucou 保持原样。"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "今天檢查了 %lld 封新郵件。沒有一封符合 VIP、封鎖字詞或規則,所以 Coucou 保持原樣。"+ }+ }+ }+ },"hub.mail.mail-closed" : {"extractionState" : "manual","localizations" : {@@ -6566,6 +6667,309 @@}}},+ "mail.open" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "فتح"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "খুলুন"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Öffnen"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Open"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Abrir"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Ouvrir"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "खोलें"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Buka"+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "開く"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "열기"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Abrir"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Открыть"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "เปิด"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Aç"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "打开"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "打開"+ }+ }+ }+ },+ "mail.preview-empty" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "لا يحتوي هذا البريد على نص."+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "এই বার্তায় কোনো লেখা নেই।"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Diese Nachricht hat keinen Text."+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "This message has no text."+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Este mensaje no tiene texto."+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Ce message n’a pas de texte."+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "इस संदेश में कोई टेक्स्ट नहीं है।"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Pesan ini tidak berisi teks."+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "このメッセージには本文がありません。"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "이 메시지에는 본문이 없어요."+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Esta mensagem não tem texto."+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "В этом письме нет текста."+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ข้อความนี้ไม่มีเนื้อหา"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Bu iletide metin yok."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "这封邮件没有正文。"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "這封郵件沒有內文。"+ }+ }+ }+ },+ "mail.preview-failed" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "لم يقدّم تطبيق Mail نص هذه الرسالة. افتحها في Mail لقراءتها."+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mail এই বার্তার লেখা দেয়নি। পড়তে Mail-এ খুলুন।"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mail hat den Text dieser Nachricht nicht geliefert. Öffne sie in Mail, um sie zu lesen."+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mail didn’t give the text of this message. Open it in Mail to read it."+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mail no ha dado el texto de este mensaje. Ábrelo en Mail para leerlo."+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mail n’a pas donné le texte de ce message. Ouvre-le dans Mail pour le lire."+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mail ने इस संदेश का टेक्स्ट नहीं दिया। पढ़ने के लिए इसे Mail में खोलें।"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mail tidak memberikan teks pesan ini. Buka di Mail untuk membacanya."+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mail からこのメッセージの本文を取得できませんでした。Mail で開いて読んでください。"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mail에서 이 메시지의 본문을 가져오지 못했어요. Mail에서 열어 읽어 보세요."+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "O Mail não entregou o texto desta mensagem. Abra no Mail para ler."+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mail не передал текст этого письма. Откройте его в Mail, чтобы прочитать."+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mail ไม่ได้ส่งเนื้อหาของข้อความนี้มา เปิดใน Mail เพื่ออ่าน"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mail bu iletinin metnini vermedi. Okumak için Mail’de aç."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "“邮件”没有提供这封邮件的正文。请在“邮件”中打开阅读。"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "「郵件」沒有提供這封郵件的內文。請在「郵件」中打開閱讀。"+ }+ }+ }+ },"mail.plan.bad-address" : {"extractionState" : "manual","localizations" : {@@ -48456,6 +48860,107 @@}}},+ "Back" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "رجوع"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ফিরে যান"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Zurück"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Back"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Atrás"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Retour"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "वापस"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Kembali"+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "戻る"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "뒤로"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Voltar"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Назад"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ย้อนกลับ"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Geri"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "返回"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "返回"+ }+ }+ }+ },"Bahasa Indonesia" : {"localizations" : {"ja" : {diff --git a/NotchBuddy/Sources/App/IslandRootView.swift b/NotchBuddy/Sources/App/IslandRootView.swiftindex 252bc45d..3b5a1451 100644--- a/NotchBuddy/Sources/App/IslandRootView.swift+++ b/NotchBuddy/Sources/App/IslandRootView.swift@@ -179,6 +179,16 @@ struct IslandContainer: View {cornerRadius = state.mode == .expanded ? IslandConst.expandedCorner : IslandConst.roundedCornerislandTopRadius = 0}+ .onReceive(NotificationCenter.default.publisher(for: .islandResize)) { _ in+ guard state.mode == .expanded, state.view != .prompt else { return }+ let (w, h) = islandSize(mode: .expanded, view: state.view,+ progress: state.uploadProgress,+ nw: state.notchWidth, nh: state.notchHeight)+ withAnimation(openSpring) {+ islandWidth = w+ islandHeight = h+ }+ }.onReceive(NotificationCenter.default.publisher(for: .botGreet)) { _ ingreetNotif.toggle()}diff --git a/NotchBuddy/Sources/App/IslandWindowController.swift b/NotchBuddy/Sources/App/IslandWindowController.swiftindex 89376441..4b2d3ddc 100644--- a/NotchBuddy/Sources/App/IslandWindowController.swift+++ b/NotchBuddy/Sources/App/IslandWindowController.swift@@ -2047,6 +2047,14 @@ extension Notification.Name {static let openWardrobeFromDesktop = Notification.Name("notchBuddy.openWardrobeFromDesktop")// Island moved to another screen (resting size may differ: notch vs bar)static let islandScreenChanged = Notification.Name("notchBuddy.islandScreenChanged")+ // A card asked for another height (MailLayout): resize the open island+ static let islandResize = Notification.Name("notchBuddy.islandResize")+}++/// The home view grows while a mail is open in the Mail card, so it can be read.+enum MailLayout {+ nonisolated(unsafe) static var detailHeight: CGFloat?+ static let readingHeight: CGFloat = 250}// MARK: - islandSize (takes real notch dimensions)@@ -2063,6 +2071,9 @@ func islandSize(mode: IslandMode, view: IslandView,if view == .question, let h = QuestionLayout.height {return (IslandConst.expandedWidth, h)}+ if view == .overview, let h = MailLayout.detailHeight {+ return (IslandConst.expandedWidth, h)+ }return (IslandConst.expandedWidth, layout.height)}}diff --git a/NotchBuddy/Sources/App/MailController.swift b/NotchBuddy/Sources/App/MailController.swiftindex 1eb45077..b4548b0f 100644--- a/NotchBuddy/Sources/App/MailController.swift+++ b/NotchBuddy/Sources/App/MailController.swift@@ -74,6 +74,8 @@ final class MailController: ObservableObject {@Published private(set) var automationDenied = false/// Text of the messages opened in the card, by message id.@Published private(set) var previews: [String: String] = [:]+ /// Messages Mail didn't give the text of (in time): the card says so instead of "Loading…".+ @Published private(set) var previewFailed: Set<String> = []/// How many messages are kept for the card (the newest across all inboxes).nonisolated static let keep = 12@@ -268,6 +270,7 @@ final class MailController: ObservableObject {let fresh = list.filter { $0.date >= since && !store.isSeen($0.id) }.sorted { $0.date < $1.date }guard !fresh.isEmpty else { return }store.markSeen(fresh.map(\.id))+ store.countChecked(fresh.count)let needsText = MailTriage.needsText(settings)for message in fresh {var facts = MailFacts(sender: message.sender, subject: message.subject, account: message.account)@@ -340,16 +343,19 @@ final class MailController: ObservableObject {// MARK: - Actions (each one follows a click)- /// The message's text (first 1,200 characters), read once and cached.+ /// The message's text (first 4,000 characters), read once and cached. Mail may have to+ /// download it: 20 seconds at most, then the card says it couldn't.func loadPreview(_ message: MailMessage) {guard previews[message.id] == nil, Self.mailRunning() else { return }+ previewFailed.remove(message.id)Task {let script = Self.messageScript(message, body: """set c to ""- try+ with timeout of 20 secondsset c to content of m- end try- if (length of c) > 1200 then set c to text 1 thru 1200 of c+ end timeout+ if c is missing value then set c to ""+ if (length of c) > 4000 then set c to text 1 thru 4000 of creturn c""")let result = await runAppleScript(script)@@ -361,7 +367,7 @@ final class MailController: ObservableObject {.trimmingCharacters(in: .whitespacesAndNewlines)previews[message.id] = text} else {- previews[message.id] = ""+ previewFailed.insert(message.id)}}}diff --git a/NotchBuddy/Sources/App/MailHubPages.swift b/NotchBuddy/Sources/App/MailHubPages.swiftindex 227ec568..b5c416c3 100644--- a/NotchBuddy/Sources/App/MailHubPages.swift+++ b/NotchBuddy/Sources/App/MailHubPages.swift@@ -69,7 +69,11 @@ struct HubMailOverviewPage: View {}HubCard {if store.journal.isEmpty {- HubEmptyState(text: String(localized: "hub.mail.journal-empty"), state: .idle, color: mailBlue)+ // Sorting on and messages looked at: say so, it works, nothing matched yet.+ HubEmptyState(text: store.settings.autoSort && store.checkedToday > 0+ ? String(format: String(localized: "hub.mail.checked %lld"), Int64(store.checkedToday))+ : String(localized: "hub.mail.journal-empty"),+ state: .idle, color: mailBlue)} else {ForEach(Array(store.journal.prefix(100).enumerated()), id: \.element.id) { i, entry inif i > 0 { HubDivider() }diff --git a/NotchBuddy/Sources/App/MailTriage.swift b/NotchBuddy/Sources/App/MailTriage.swiftindex 33f0512a..a6de7f83 100644--- a/NotchBuddy/Sources/App/MailTriage.swift+++ b/NotchBuddy/Sources/App/MailTriage.swift@@ -239,7 +239,9 @@ enum MailScript {/// Messages of every account's inbox matching `whose`, in the list format of/// MailController.parseList (unread count first, then one record per message).- static func searchScript(whose: String, today: Bool) -> String {+ /// At most `limit` messages per inbox, the newest: an inbox with a thousand unread+ /// messages answers in a second, and the other scripts (a message opened) don't wait.+ static func searchScript(whose: String, today: Bool, limit: Int = 60) -> String {"""set RS to character id 30set US to character id 31@@ -271,7 +273,22 @@ enum MailScript {set dts to date received of (every message of mb whose \(whose))set rds to read status of (every message of mb whose \(whose))set fls to flagged status of (every message of mb whose \(whose))- repeat with i from 1 to count of ids+ set c to count of ids+ set a to 1+ set b to c+ if c > \(limit) then+ -- The newest: the start of the list when message 1 is the most recent.+ try+ if (item 1 of dts) < (item c of dts) then+ set a to c - \(limit) + 1+ else+ set b to \(limit)+ end if+ on error+ set b to \(limit)+ end try+ end if+ repeat with i from a to btryset s to item i of subsif s is missing value then set s to ""diff --git a/NotchBuddy/Sources/App/MailTriageStore.swift b/NotchBuddy/Sources/App/MailTriageStore.swiftindex 71a06f0a..d6aab230 100644--- a/NotchBuddy/Sources/App/MailTriageStore.swift+++ b/NotchBuddy/Sources/App/MailTriageStore.swift@@ -124,6 +124,27 @@ final class MailTriageStore: ObservableObject {save(journal, to: "journal.json")}+ /// New messages the automatic sorting looked at today, matched or not (the Overview shows+ /// it while nothing was sorted: it is working, nothing matched).+ @Published private(set) var checkedToday: Int = {+ let d = UserDefaults.standard+ return d.string(forKey: "mailCheckedDay") == MailTriageStore.dayKey() ? d.integer(forKey: "mailCheckedCount") : 0+ }()++ func countChecked(_ n: Int) {+ let d = UserDefaults.standard+ let day = Self.dayKey()+ let base = d.string(forKey: "mailCheckedDay") == day ? d.integer(forKey: "mailCheckedCount") : 0+ d.set(day, forKey: "mailCheckedDay")+ d.set(base + n, forKey: "mailCheckedCount")+ checkedToday = base + n+ }++ nonisolated private static func dayKey() -> String {+ let c = Calendar.current.dateComponents([.year, .month, .day], from: Date())+ return "\(c.year ?? 0)-\(c.month ?? 0)-\(c.day ?? 0)"+ }+/// What was sorted today, for the Overview.var today: (sorted: Int, junk: Int, important: Int) {let start = Calendar.current.startOfDay(for: Date())diff --git a/NotchBuddy/Sources/App/MailViews.swift b/NotchBuddy/Sources/App/MailViews.swiftindex 01dd4a9a..7ce6a4ea 100644--- a/NotchBuddy/Sources/App/MailViews.swift+++ b/NotchBuddy/Sources/App/MailViews.swift@@ -34,6 +34,16 @@ struct MailCardView: View {}}.onAppear { mail.refreshIfStale() }+ // A mail open: the notch grows so it can be read; back to the list, it shrinks.+ .onChange(of: openId) { _, id in setReading(id != nil) }+ .onDisappear { setReading(false) }+ }++ private func setReading(_ on: Bool) {+ let h: CGFloat? = on ? MailLayout.readingHeight : nil+ guard MailLayout.detailHeight != h else { return }+ MailLayout.detailHeight = h+ NotificationCenter.default.post(name: .islandResize, object: nil)}private var list: some View {@@ -57,6 +67,7 @@ struct MailCardView: View {.foregroundColor(Color(hex: "#E8E9EC")).focused($searchFocused).onSubmit { mail.runSearch() }+ if mail.searching { MailSpinner() }Button {withAnimation(.easeOut(duration: 0.15)) { searchOpen = false }mail.clearSearch()@@ -69,15 +80,20 @@ struct MailCardView: View {.help(String(localized: "Close"))} else {if let unread = mail.unreadCount, unread > 0 {- Text(String(format: String(localized: "%lld unread"), Int64(unread)))+ // Just the number, on one line: "1308" (the whole sentence in the tooltip).+ Text(verbatim: unread > 9999 ? "9999+" : String(unread)).font(.system(size: 10, weight: .semibold)).foregroundColor(Color(hex: mailAccent)).monospacedDigit()+ .lineLimit(1)+ .fixedSize().padding(.horizontal, 6).padding(.vertical, 1).background(Color(hex: mailAccent).opacity(0.14)).clipShape(Capsule())+ .help(String(format: String(localized: "%lld unread"), Int64(unread)))}Spacer(minLength: 2)+ if mail.searching { MailSpinner() }Button {withAnimation(.easeOut(duration: 0.15)) { searchOpen = true }searchFocused = true@@ -97,17 +113,13 @@ struct MailCardView: View {.padding(.trailing, 36)// Quick filters: All, Unread, Important, Today.- HStack(spacing: 4) {- ForEach(MailFilter.allCases, id: \.self) { f in- MailFilterChip(title: f.title, on: mail.filter == f) { mail.setFilter(f) }- }- if mail.searching {- Text("mail.searching")- .font(.system(size: 9.5))- .foregroundColor(Color(hex: "#6B7079"))- .padding(.leading, 4)+ // One line whatever the language: a longer set scrolls sideways, never wraps.+ ScrollView(.horizontal, showsIndicators: false) {+ HStack(spacing: 3) {+ ForEach(MailFilter.allCases, id: \.self) { f in+ MailFilterChip(title: f.title, on: mail.filter == f) { mail.setFilter(f) }+ }}- Spacer(minLength: 0)}.padding(.top, 4).padding(.leading, 108)@@ -216,8 +228,10 @@ private struct MailFilterChip: View {Button(action: action) {Text(title).font(.system(size: 9.5, weight: on ? .semibold : .regular))+ .lineLimit(1)+ .fixedSize().foregroundColor(Color(hex: on ? "#E8E9EC" : (hovered ? "#B0B5BE" : "#6B7079")))- .padding(.horizontal, 7).padding(.vertical, 2)+ .padding(.horizontal, 6).padding(.vertical, 2).background(Capsule().fill(on ? Color(hex: mailAccent).opacity(0.22) : Color.white.opacity(hovered ? 0.06 : 0))).contentShape(Capsule())}@@ -239,7 +253,18 @@ extension MailFilter {// MARK: - Mail detail-/// One message opened in the card: sender, subject, the start of its text, and actions.+/// The small turning circle of a search in progress (in the header: the filters keep their line).+private struct MailSpinner: View {+ var body: some View {+ ProgressView()+ .controlSize(.mini)+ .scaleEffect(0.7)+ .frame(width: 12, height: 12)+ }+}++/// One message opened in the card: sender, subject, its text (the notch grows to read it,+/// MailLayout) and the actions in one row of icons, each with its name on hover.struct MailDetailView: View {let message: MailMessagelet onClose: () -> Void@@ -247,7 +272,7 @@ struct MailDetailView: View {var body: some View {let accent = Color(hex: mailAccent)- VStack(alignment: .leading, spacing: 4) {+ VStack(alignment: .leading, spacing: 5) {// Header: back, sender, ageHStack(spacing: 6) {Button(action: onClose) {@@ -258,6 +283,7 @@ struct MailDetailView: View {.contentShape(Rectangle())}.buttonStyle(.plain)+ .help(String(localized: "Back"))Circle().fill(message.isRead ? Color(hex: "#4D5159") : accent)@@ -268,6 +294,11 @@ struct MailDetailView: View {.lineLimit(1).truncationMode(.tail).layoutPriority(1).help(message.senderAddress)+ if message.isFlagged {+ Image(systemName: "flag.fill")+ .font(.system(size: 8))+ .foregroundColor(Color(hex: "#F5A524"))+ }Spacer(minLength: 2)Text(message.timeAgo).font(.system(size: 10))@@ -281,43 +312,61 @@ struct MailDetailView: View {Text(message.subject.isEmpty ? " " : message.subject).font(.system(size: 11, weight: .medium)).foregroundColor(Color(hex: "#C5C8CD"))- .lineLimit(1).truncationMode(.tail)+ .lineLimit(2).truncationMode(.tail)+ .fixedSize(horizontal: false, vertical: true)- // The start of the message, scrollable.+ // The text, scrollable, in all the room left.ScrollView(.vertical, showsIndicators: false) {Group {if let text = mail.previews[message.id] {- Text(text.isEmpty ? " " : text)+ Text(text.isEmpty ? String(localized: "mail.preview-empty") : text)+ } else if mail.previewFailed.contains(message.id) {+ Text("mail.preview-failed")} else {- Text("Loading…")+ HStack(spacing: 6) {+ MailSpinner()+ Text("Loading…")+ }}}.font(.system(size: 10.5)).foregroundColor(Color(hex: "#9398A1"))+ .lineSpacing(2).frame(maxWidth: .infinity, alignment: .leading).textSelection(.enabled)}- .frame(height: 28)+ .frame(maxHeight: .infinity)// Actions: each one is the user's own click. Nothing is ever sent from here.- HStack(spacing: 12) {- Button("Open in Mail") { mail.openInMail(message) }- .foregroundColor(accent.opacity(0.9))- Button("Reply") { mail.reply(message) }- .foregroundColor(Color(hex: "#C5C8CD"))+ HStack(spacing: 4) {+ Button { mail.openInMail(message) } label: {+ Text("mail.open")+ .font(.system(size: 10.5, weight: .semibold))+ .foregroundColor(accent)+ .lineLimit(1)+ .fixedSize()+ .padding(.horizontal, 8).padding(.vertical, 3)+ .background(Capsule().fill(accent.opacity(0.16)))+ }+ .help(String(localized: "Open in Mail"))+ Spacer(minLength: 4)+ MailIconButton(symbol: "arrowshape.turn.up.left", help: String(localized: "Reply")) {+ mail.reply(message)+ }if !message.isRead {- Button("Mark as read") { mail.markAsRead(message) }- .foregroundColor(Color(hex: "#8E939C"))+ MailIconButton(symbol: "envelope.open", help: String(localized: "Mark as read")) {+ mail.markAsRead(message)+ }}- Button(message.isFlagged ? String(localized: "mail.not-important") : String(localized: "mail.important")) {+ MailIconButton(symbol: message.isFlagged ? "flag.slash" : "flag",+ help: message.isFlagged ? String(localized: "mail.not-important") : String(localized: "mail.important"),+ tint: "#F5A524") {mail.toggleFlag(message)}- .foregroundColor(Color(hex: "#F5A524").opacity(0.9))- Button(String(localized: "mail.junk")) {+ MailIconButton(symbol: "xmark.bin", help: String(localized: "mail.junk")) {mail.moveToJunk(message)onClose()}- .foregroundColor(Color(hex: "#8E939C"))Menu {Button(String(localized: "mail.make-vip")) { mail.makeVIP(message) }Button(String(localized: "mail.ignore-sender")) {@@ -328,13 +377,14 @@ struct MailDetailView: View {Image(systemName: "ellipsis").font(.system(size: 11, weight: .semibold)).foregroundColor(Color(hex: "#8E939C"))+ .frame(width: 22, height: 20)}.menuStyle(.borderlessButton).menuIndicator(.hidden).fixedSize()}- .font(.system(size: 11, weight: .medium)).buttonStyle(.plain)+ .padding(.bottom, 8)}.padding(.top, 4).padding(.leading, 108)@@ -344,4 +394,27 @@ struct MailDetailView: View {.onAppear { mail.loadPreview(message) }}}++/// An action of the open mail: an icon, its name on hover.+private struct MailIconButton: View {+ let symbol: String+ let help: String+ var tint: String = "#B0B5BE"+ let action: () -> Void+ @State private var hovered = false++ var body: some View {+ Button(action: action) {+ Image(systemName: symbol)+ .font(.system(size: 11, weight: .medium))+ .foregroundColor(Color(hex: tint).opacity(hovered ? 1 : 0.8))+ .frame(width: 24, height: 20)+ .background(RoundedRectangle(cornerRadius: 5).fill(Color.white.opacity(hovered ? 0.08 : 0)))+ .contentShape(Rectangle())+ }+ .buttonStyle(.plain)+ .help(help)+ .onHover { hovered = $0 }+ }+}#endifdiff --git a/tests/MailTriageTests.swift b/tests/MailTriageTests.swiftindex 0ae6914b..6d099511 100644--- a/tests/MailTriageTests.swift+++ b/tests/MailTriageTests.swift@@ -103,6 +103,8 @@ enum MailTriageTests {precondition(sc.contains("id of (every message of mb whose read status is false)"))precondition(sc.contains("flagged status of (every message of mb whose read status is false)"))precondition(!sc.contains("set d0"))+ precondition(sc.contains("if c > 60 then") && sc.contains("repeat with i from a to b"), "the newest 60 at most")+ precondition(MailScript.searchScript(whose: "read status is false", today: false, limit: 5).contains("set a to c - 5 + 1"))precondition(MailScript.searchScript(whose: "date received > d0", today: true).contains(MailScript.todayPrelude))}}diff --git a/windows/src/i18n/extra.json b/windows/src/i18n/extra.jsonindex 4b34c64e..40dbc77d 100644--- a/windows/src/i18n/extra.json+++ b/windows/src/i18n/extra.json@@ -226,21 +226,6 @@"ko": "자동 닫기","ja": "自動で閉じる"},- "Back": {- "zh-Hans": "返回",- "hi": "वापस",- "es": "Atrás",- "ar": "رجوع",- "fr": "Retour",- "bn": "ফিরে যান",- "pt-BR": "Voltar",- "ru": "Назад",- "id": "Kembali",- "de": "Zurück",- "tr": "Geri",- "ko": "뒤로",- "ja": "戻る"- },"Back up and remove": {"zh-Hans": "备份并移除","hi": "बैकअप लें और हटाएँ",diff --git a/windows/src/i18n/strings.json b/windows/src/i18n/strings.jsonindex 32324a0d..1a560e6b 100644--- a/windows/src/i18n/strings.json+++ b/windows/src/i18n/strings.json@@ -1082,6 +1082,21 @@"ko": "자동화가 허용되지 않았어요","ja": "オートメーションが許可されていません"},+ "Back": {+ "zh-Hans": "返回",+ "hi": "वापस",+ "es": "Atrás",+ "ar": "رجوع",+ "fr": "Retour",+ "bn": "ফিরে যান",+ "pt-BR": "Voltar",+ "ru": "Назад",+ "id": "Kembali",+ "de": "Zurück",+ "tr": "Geri",+ "ko": "뒤로",+ "ja": "戻る"+ },"Banned words": {"zh-Hans": "屏蔽词","hi": "प्रतिबंधित शब्द",@@ -4787,6 +4802,21 @@"ko": "메일","ja": "メール"},+ "Mail didn’t give the text of this message. Open it in Mail to read it.": {+ "zh-Hans": "“邮件”没有提供这封邮件的正文。请在“邮件”中打开阅读。",+ "hi": "Mail ने इस संदेश का टेक्स्ट नहीं दिया। पढ़ने के लिए इसे Mail में खोलें।",+ "es": "Mail no ha dado el texto de este mensaje. Ábrelo en Mail para leerlo.",+ "ar": "لم يقدّم تطبيق Mail نص هذه الرسالة. افتحها في Mail لقراءتها.",+ "fr": "Mail n’a pas donné le texte de ce message. Ouvre-le dans Mail pour le lire.",+ "bn": "Mail এই বার্তার লেখা দেয়নি। পড়তে Mail-এ খুলুন।",+ "pt-BR": "O Mail não entregou o texto desta mensagem. Abra no Mail para ler.",+ "ru": "Mail не передал текст этого письма. Откройте его в Mail, чтобы прочитать.",+ "id": "Mail tidak memberikan teks pesan ini. Buka di Mail untuk membacanya.",+ "de": "Mail hat den Text dieser Nachricht nicht geliefert. Öffne sie in Mail, um sie zu lesen.",+ "tr": "Mail bu iletinin metnini vermedi. Okumak için Mail’de aç.",+ "ko": "Mail에서 이 메시지의 본문을 가져오지 못했어요. Mail에서 열어 읽어 보세요.",+ "ja": "Mail からこのメッセージの本文を取得できませんでした。Mail で開いて読んでください。"+ },"Mail is closed": {"zh-Hans": "“邮件”未打开","hi": "Mail बंद है",@@ -9707,6 +9737,21 @@"ko": "그러면","ja": "実行"},+ "This message has no text.": {+ "zh-Hans": "这封邮件没有正文。",+ "hi": "इस संदेश में कोई टेक्स्ट नहीं है।",+ "es": "Este mensaje no tiene texto.",+ "ar": "لا يحتوي هذا البريد على نص.",+ "fr": "Ce message n’a pas de texte.",+ "bn": "এই বার্তায় কোনো লেখা নেই।",+ "pt-BR": "Esta mensagem não tem texto.",+ "ru": "В этом письме нет текста.",+ "id": "Pesan ini tidak berisi teks.",+ "de": "Diese Nachricht hat keinen Text.",+ "tr": "Bu iletide metin yok.",+ "ko": "이 메시지에는 본문이 없어요.",+ "ja": "このメッセージには本文がありません。"+ },"This model is not available.": {"zh-Hans": "此模型不可用。","hi": "यह मॉडल उपलब्ध नहीं है।",@@ -11867,6 +11912,21 @@"ko": "{0}분","ja": "{0} 分"},+ "{0} new messages checked today. None matched a VIP, a banned word or a rule, so Coucou left them as they are.": {+ "zh-Hans": "今天检查了 {0} 封新邮件。没有一封匹配 VIP、屏蔽词或规则,所以 Coucou 保持原样。",+ "hi": "आज {0} नए संदेश जाँचे गए। कोई भी VIP, प्रतिबंधित शब्द या नियम से मेल नहीं खाया, इसलिए Coucou ने उन्हें वैसे ही छोड़ दिया।",+ "es": "{0} mensajes nuevos revisados hoy. Ninguno coincidía con un VIP, una palabra prohibida o una regla, así que Coucou los dejó como estaban.",+ "ar": "تم فحص {0} رسالة جديدة اليوم. لم تطابق أيٌّ منها شخصًا مهمًا أو كلمة محظورة أو قاعدة، لذا تركها Coucou كما هي.",+ "fr": "{0} nouveaux messages vérifiés aujourd’hui. Aucun ne correspondait à un VIP, un mot banni ou une règle : Coucou les a laissés tels quels.",+ "bn": "আজ {0} টি নতুন বার্তা দেখা হয়েছে। কোনোটি VIP, নিষিদ্ধ শব্দ বা নিয়মের সাথে মেলেনি, তাই Coucou সেগুলো যেমন ছিল তেমনই রেখেছে।",+ "pt-BR": "{0} mensagens novas verificadas hoje. Nenhuma correspondia a um VIP, uma palavra banida ou uma regra, então o Coucou as deixou como estavam.",+ "ru": "Сегодня проверено новых писем: {0}. Ни одно не совпало с VIP, запрещённым словом или правилом, поэтому Coucou оставил их как есть.",+ "id": "{0} pesan baru diperiksa hari ini. Tidak ada yang cocok dengan VIP, kata terlarang, atau aturan, jadi Coucou membiarkannya apa adanya.",+ "de": "Heute {0} neue Nachrichten geprüft. Keine passte zu einem VIP, einem gesperrten Wort oder einer Regel, also hat Coucou sie gelassen, wie sie sind.",+ "tr": "Bugün {0} yeni ileti kontrol edildi. Hiçbiri bir VIP, yasaklı kelime veya kuralla eşleşmedi, bu yüzden Coucou onları olduğu gibi bıraktı.",+ "ko": "오늘 새 메시지 {0}개를 확인했어요. VIP, 금지어, 규칙 중 어느 것에도 해당하지 않아 Coucou는 그대로 두었어요.",+ "ja": "今日は新着メッセージを {0} 件確認しました。VIP、禁止ワード、ルールのどれにも当てはまらなかったので、Coucou はそのままにしました。"+ },"{0} removed": {"zh-Hans": "已移除 {0}","hi": "{0} हटाया गया",diff --git a/windows/src/style.css b/windows/src/style.cssindex 4eb1f63e..1ed218c9 100644--- a/windows/src/style.css+++ b/windows/src/style.css@@ -3057,6 +3057,8 @@ html[data-dir="rtl"] #views :is(.bubble, .reply .md-p, .reply .md-h, .reply .md-padding: 1px 6px;border-radius: 999px;background: rgba(47, 140, 255, 0.14);+ white-space: nowrap;+ flex: 0 0 auto;}.mail-spacer {@@ -3092,15 +3094,24 @@ html[data-dir="rtl"] #views :is(.bubble, .reply .md-p, .reply .md-h, .reply .md-.mail-filters {display: flex;align-items: center;- gap: 4px;+ gap: 3px;padding-top: 4px;+ /* One line whatever the language: a longer set scrolls sideways, never wraps. */+ overflow-x: auto;+ scrollbar-width: none;+}++.mail-filters::-webkit-scrollbar {+ display: none;}.mail-chip {border: 0;border-radius: 999px;- padding: 2px 7px;+ padding: 2px 6px;background: transparent;+ white-space: nowrap;+ flex: 0 0 auto;font: 400 9.5px var(--font);color: #6b7079;cursor: default;@@ -3117,10 +3128,21 @@ html[data-dir="rtl"] #views :is(.bubble, .reply .md-p, .reply .md-h, .reply .md-background: rgba(47, 140, 255, 0.22);}-.mail-searching {- font: 400 9.5px var(--font);- color: #6b7079;- padding-left: 4px;+/* A search in progress, in the header: the filters keep their line. */+.mail-spinner {+ flex: 0 0 auto;+ width: 9px;+ height: 9px;+ border-radius: 50%;+ border: 1.5px solid rgba(142, 147, 156, 0.35);+ border-top-color: #8e939c;+ animation: mail-spin 0.8s linear infinite;+}++@keyframes mail-spin {+ to {+ transform: rotate(360deg);+ }}.mail-rows {diff --git a/windows/src/views/mail.ts b/windows/src/views/mail.tsindex 8332116b..4a20c4f9 100644--- a/windows/src/views/mail.ts+++ b/windows/src/views/mail.ts@@ -184,12 +184,18 @@ export function buildMailCard(host: MailCardHost): MailCard {clear(head);head.append(dot(MAIL_BLUE, 7), h("b", { text: "Outlook" }));if (searchOpen) {- head.append(field, closeSearch);+ head.append(field);+ if (searching) head.append(h("span", { class: "mail-spinner" }));+ head.append(closeSearch);} else {head.append(h("span", { text: t("Inbox") }));- unreadTag.textContent = d.unread > 0 ? t("{0} unread", { 0: d.unread }) : "";+ // Just the number, on one line (the sentence on hover).+ unreadTag.textContent = d.unread > 9999 ? "9999+" : String(d.unread);+ unreadTag.title = t("{0} unread", { 0: d.unread });unreadTag.style.display = d.unread > 0 ? "" : "none";- head.append(unreadTag, h("span", { class: "mail-spacer" }), searchBtn);+ head.append(unreadTag, h("span", { class: "mail-spacer" }));+ if (searching) head.append(h("span", { class: "mail-spinner" }));+ head.append(searchBtn);}clear(filters);@@ -203,7 +209,6 @@ export function buildMailCard(host: MailCardHost): MailCard {},}));}- if (searching) filters.append(h("span", { class: "mail-searching", text: t("Searching…") }));filters.style.display = d.running ? "" : "none";clear(listBody);