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
Mac: blue Mochi while a new Coucou waits, then What's new after the update
Claudeb1d8a8d3404b
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 1eb4bca1..9f92ebac 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -48,6 +48,9 @@ jobs:- name: Test Mac update (releases, versions, where it may replace itself)run: bash scripts/test-mac-update.sh+ - name: Test What's new+ run: bash scripts/test-whats-new-mac.sh+- name: Test Claude Desktop chat (stop button labels)run: bash scripts/test-claude-desktop-chat.shdiff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.ymlindex 01e0a30d..682237c1 100644--- a/.github/workflows/windows-ci.yml+++ b/.github/workflows/windows-ci.yml@@ -8,6 +8,7 @@ on:pull_request:paths:- 'windows/**'+ - 'scripts/test-whats-new.py'- '.github/workflows/windows-ci.yml'push:branches: [main]@@ -57,6 +58,10 @@ jobs:- name: Island testsrun: npm test+ # Every release brings its "What's new" in the 12 languages (src/whats-new/whats-new.json).+ - name: What's new for this version+ run: python ../scripts/test-whats-new.py windows+# The app bundles target/release/coucou-hook.exe as a resource, and its# build script refuses to run until that file exists. One command per# step: PowerShell carries on after a failed command in the same step.diff --git a/CLAUDE.md b/CLAUDE.mdindex 654283ba..f3952e1d 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -31,3 +31,4 @@ Windows and Linux: `cd windows && npm install && npm run tauri dev`- Pill IDs are stable contract values (Keychain, UserDefaults, hook routing): never rename an existing pill ID.- New views follow the existing app style. `design/prototype/notch-buddy.html` and `design/captures/` are references for new work, not a reason to change existing views.- Every release adds its CHANGELOG.md section, a row in the README Versions table, and commits the regenerated Info.plist with the new version.+- Every release also adds its What's new, shown once in the notch or the island after Coucou updates itself: an entry for the new version in `NotchBuddy/Resources/whats-new.json` (Mac, the 14 languages) or `windows/src/whats-new/whats-new.json` (Windows and Linux, the 12 languages). 1 to 4 items picked from the CHANGELOG section, each with an icon from `scripts/test-whats-new.py`, a short title and one line, translated in every language. `python3 scripts/test-whats-new.py` checks it; CI and `release.sh` fail without it.diff --git a/NotchBuddy/Resources/Localizable.xcstrings b/NotchBuddy/Resources/Localizable.xcstringsindex 176eed50..c3388a00 100644--- a/NotchBuddy/Resources/Localizable.xcstrings+++ b/NotchBuddy/Resources/Localizable.xcstrings@@ -1,6 +1,1163 @@{"sourceLanguage" : "en","strings" : {+ "whatsnew.all-changes" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "كل التغييرات"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "সব পরিবর্তন"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Alle Änderungen"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "All changes"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Todos los cambios"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Tous les changements"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "सभी बदलाव"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Semua perubahan"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Todas as mudanças"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Все изменения"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "การเปลี่ยนแปลงทั้งหมด"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Tüm değişiklikler"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "全部更新内容"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "全部更新內容"+ }+ }+ }+ },+ "whatsnew.coffee" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ادعُ Mochi إلى قهوة"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mochi-কে কফি খাওয়ান"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mochi einen Kaffee spendieren"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Buy Mochi a coffee"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Invitar a Mochi a un café"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Offrir un café à Mochi"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mochi को कॉफ़ी पिलाएँ"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Traktir Mochi kopi"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Pagar um café para o Mochi"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Угостить Mochi кофе"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "เลี้ยงกาแฟ Mochi"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mochi’ye kahve ısmarla"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "请 Mochi 喝咖啡"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "請 Mochi 喝咖啡"+ }+ }+ }+ },+ "whatsnew.next" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "التالي"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "পরবর্তী"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Weiter"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Next"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Siguiente"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Suivant"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "आगे"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Lanjut"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Próximo"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Далее"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ถัดไป"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "İleri"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "下一步"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "下一步"+ }+ }+ }+ },+ "whatsnew.so-far" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou الخاص بك حتى الآن"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "এ পর্যন্ত আপনার Coucou"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Dein Coucou bisher"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Your Coucou so far"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Tu Coucou hasta ahora"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Ton Coucou jusqu’ici"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "अब तक आपका Coucou"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou-mu sejauh ini"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Seu Coucou até agora"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Ваш Coucou на сегодня"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou ของคุณจนถึงตอนนี้"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Şimdiye kadar Coucou’n"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "你的 Coucou 至今"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "你的 Coucou 至今"+ }+ }+ }+ },+ "whatsnew.stat.agent-time" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "مع وكلائك"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "এজেন্টদের সঙ্গে"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mit deinen Agents"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "With your agents"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Con tus agentes"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Avec tes agents"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "एजेंटों के साथ"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Bersama agenmu"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Com seus agentes"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "С агентами"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "กับเอเจนต์ของคุณ"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Ajanlarınla"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "与智能体一起"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "與代理一起"+ }+ }+ }+ },+ "whatsnew.stat.approvals" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "موافقات من النوتش"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "নচ থেকে অনুমোদিত"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "In der Notch freigegeben"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Approved from the notch"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Aprobados desde el notch"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Validés depuis le notch"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "नॉच से मंज़ूर"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Disetujui dari notch"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Aprovados pelo notch"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Одобрено из выреза"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "อนุมัติจากรอยบาก"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Çentikten onaylanan"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "在刘海中批准"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "在瀏海中核准"+ }+ }+ }+ },+ "whatsnew.stat.lines" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "أسطر مكتوبة"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "লেখা লাইন"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Geschriebene Zeilen"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Lines written"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Líneas escritas"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Lignes écrites"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "लिखी गई पंक्तियाँ"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Baris ditulis"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Linhas escritas"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Строк написано"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "บรรทัดที่เขียน"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Yazılan satırlar"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "写下的代码行"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "寫下的程式碼行"+ }+ }+ }+ },+ "whatsnew.stat.notes" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "مكالمات مُفرّغة"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ট্রান্সক্রাইব করা কল"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Transkribierte Anrufe"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Calls transcribed"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Llamadas transcritas"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Appels transcrits"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ट्रांसक्राइब की गई कॉल"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Panggilan ditranskripsi"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Chamadas transcritas"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Звонков расшифровано"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "การโทรที่ถอดความ"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Yazıya dökülen aramalar"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "已转写的通话"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "已轉寫的通話"+ }+ }+ }+ },+ "whatsnew.stat.saved" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "وفّرته مع Flow"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Flow দিয়ে বাঁচানো"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mit Flow gespart"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Saved with Flow"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Ahorrado con Flow"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Gagnés avec Flow"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Flow से बचा समय"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Dihemat dengan Flow"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Economizado com o Flow"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Сэкономлено с Flow"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ประหยัดด้วย Flow"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Flow ile kazanılan"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Flow 帮你节省"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Flow 幫你節省"+ }+ }+ }+ },+ "whatsnew.stat.sessions" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "جلسات الوكلاء"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "এজেন্ট সেশন"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Agent-Sitzungen"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Agent sessions"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Sesiones de agentes"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Sessions d’agents"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "एजेंट सत्र"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Sesi agen"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Sessões de agentes"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Сессии агентов"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "เซสชันเอเจนต์"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Ajan oturumları"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "智能体会话"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "代理工作階段"+ }+ }+ }+ },+ "whatsnew.stat.words" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "كلمات مُملاة"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "বলা শব্দ"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Diktierte Wörter"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Words dictated"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Palabras dictadas"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Mots dictés"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "बोले गए शब्द"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Kata didiktekan"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Palavras ditadas"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Слов надиктовано"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "คำที่พูด"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Dikte edilen kelimeler"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "口述字数"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "口述字數"+ }+ }+ }+ },+ "whatsnew.thanks" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou مجاني ومفتوح المصدر. إن وفّر عليك الوقت، يمكنك دعوة Mochi إلى قهوة."+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou বিনামূল্যে ও ওপেন সোর্স। এটি আপনার সময় বাঁচালে Mochi-কে এক কাপ কফি খাওয়াতে পারেন।"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou ist kostenlos und Open Source. Wenn es dir Zeit spart, kannst du Mochi einen Kaffee spendieren."+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou is free and open source. If it saves you time, you can buy Mochi a coffee."+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou es gratis y de código abierto. Si te ahorra tiempo, puedes invitar a Mochi a un café."+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou est gratuit et open source. S’il te fait gagner du temps, tu peux offrir un café à Mochi."+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou मुफ़्त और ओपन सोर्स है। अगर यह आपका समय बचाता है, तो Mochi को एक कॉफ़ी पिला सकते हैं।"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou gratis dan open source. Kalau ini menghemat waktumu, kamu bisa traktir Mochi kopi."+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "O Coucou é gratuito e de código aberto. Se ele economiza seu tempo, você pode pagar um café para o Mochi."+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou бесплатный и с открытым кодом. Если он экономит вам время, можно угостить Mochi кофе."+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou ใช้ฟรีและเป็นโอเพนซอร์ส ถ้าช่วยประหยัดเวลาคุณ เลี้ยงกาแฟ Mochi สักแก้วได้นะ"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou ücretsiz ve açık kaynak. Sana zaman kazandırıyorsa Mochi’ye bir kahve ısmarlayabilirsin."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou 免费且开源。如果它帮你节省了时间,可以请 Mochi 喝杯咖啡。"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Coucou 免費且開源。如果它幫你節省了時間,可以請 Mochi 喝杯咖啡。"+ }+ }+ }+ },+ "whatsnew.title %@" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "أنت الآن على Coucou %@"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "আপনি এখন Coucou %@-এ"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Du hast jetzt Coucou %@"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "You’re on Coucou %@"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Ya tienes Coucou %@"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Tu es sur Coucou %@"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "आप Coucou %@ पर हैं"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Kamu sekarang di Coucou %@"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Você está no Coucou %@"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "У вас Coucou %@"+ }+ },+ "th" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "ตอนนี้คุณใช้ Coucou %@"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Artık Coucou %@ kullanıyorsun"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "你已更新到 Coucou %@"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "你已更新到 Coucou %@"+ }+ }+ }+ },"Auto mode" : {"extractionState" : "manual","localizations" : {diff --git a/NotchBuddy/Sources/App/AppDelegate.swift b/NotchBuddy/Sources/App/AppDelegate.swiftindex c3d56957..6a106837 100644--- a/NotchBuddy/Sources/App/AppDelegate.swift+++ b/NotchBuddy/Sources/App/AppDelegate.swift@@ -24,6 +24,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate {func applicationDidFinishLaunching(_ notification: Notification) {// Ignore SIGPIPE — prevents crash when nb-hook closes socket before we write responsesignal(SIGPIPE, SIG_IGN)+ #if !APPSTORE+ // Before anything writes its settings: did Coucou just update itself? (What's new, once.)+ WhatsNewCenter.shared.noteLaunch()+ #endif// Warm up Keychain cache on main thread BEFORE any poller or view touches it_ = KeychainStore.shared#if APPSTOREdiff --git a/NotchBuddy/Sources/App/BotCanvasView.swift b/NotchBuddy/Sources/App/BotCanvasView.swiftindex 782484db..9ee632d7 100644--- a/NotchBuddy/Sources/App/BotCanvasView.swift+++ b/NotchBuddy/Sources/App/BotCanvasView.swift@@ -51,6 +51,13 @@ struct BotCanvasView: View {? cgColorFromHex(state.focusTask!.color): nil}+ // A new Coucou waits and Mochi has nothing else to say: he turns blue, with an arrow.+ let updateHint = MacUpdater.shared.hintActive+ && (state.effectiveState == .idle || state.effectiveState == .sleeping)+ && state.pendingApproval == nil && state.pendingQuestion == nil+ && !state.showingPlanDetail+ if updateHint { engine.bodyColor = BotEngine.updateBlue }+ engine.setUpdateHint(updateHint)#elseengine.bodyColor = (state.focusTask?.isIntegration == true)? cgColorFromHex(state.focusTask!.color)diff --git a/NotchBuddy/Sources/App/IslandRootView.swift b/NotchBuddy/Sources/App/IslandRootView.swiftindex bce6fc25..4f632627 100644--- a/NotchBuddy/Sources/App/IslandRootView.swift+++ b/NotchBuddy/Sources/App/IslandRootView.swift@@ -495,7 +495,7 @@ struct IslandContentView: View {// Views that fill available height instead of the fixed 98pt content frame:// chat (prompt) is always flexible; mail is flexible only when active so// it doesn't push the ZStack taller when inactive.- let isTall = v == .prompt || (v == .mail && active)+ let isTall = v == .prompt || ((v == .mail || v == .whatsNew) && active)let anim: Animation = active? .spring(response: 0.4, dampingFraction: 0.8).delay(0.16): .easeIn(duration: 0.16)diff --git a/NotchBuddy/Sources/App/IslandViewContent.swift b/NotchBuddy/Sources/App/IslandViewContent.swiftindex 2a45844c..a4f30419 100644--- a/NotchBuddy/Sources/App/IslandViewContent.swift+++ b/NotchBuddy/Sources/App/IslandViewContent.swift@@ -51,6 +51,12 @@ struct IslandViewContent: View {#elseEmptyView()#endif+ case .whatsNew:+ #if !APPSTORE+ WhatsNewCardView()+ #else+ EmptyView()+ #endif}}}diff --git a/NotchBuddy/Sources/App/IslandWindowController.swift b/NotchBuddy/Sources/App/IslandWindowController.swiftindex de86dd1c..e3b1a797 100644--- a/NotchBuddy/Sources/App/IslandWindowController.swift+++ b/NotchBuddy/Sources/App/IslandWindowController.swift@@ -1270,6 +1270,13 @@ final class IslandWindowController: NSWindowController {func defaultView() -> IslandView {if state.pendingApproval != nil { return .approval }+ #if !APPSTORE+ // Mochi is blue: a new Coucou waits, and that is the first thing the island shows.+ if state.pendingQuestion == nil, MacUpdater.shared.hintActive {+ MacUpdater.shared.prepareCard()+ return .update+ }+ #endifreturn state.tasks.isEmpty ? .empty : .overview}diff --git a/NotchBuddy/Sources/App/MacUpdate.swift b/NotchBuddy/Sources/App/MacUpdate.swiftindex 27d63b26..abf610c0 100644--- a/NotchBuddy/Sources/App/MacUpdate.swift+++ b/NotchBuddy/Sources/App/MacUpdate.swift@@ -110,6 +110,15 @@ enum MacUpdate {return true}+ /// Mochi turns blue while a newer Coucou waits (and a click opens the update first): once the+ /// user said yes to looking, until it is installed, except for a day after "Later" on that version.+ static func showsHint(_ release: Release?, current: String, consent: Bool?,+ laterVersion: String?, laterAt: Date?, now: Date) -> Bool {+ guard consent == true, let release, isNewer(release.version, than: current) else { return false }+ if laterVersion == release.version, let at = laterAt, now >= at, now.timeIntervalSince(at) < snooze { return false }+ return true+ }+/// The app in the zip is the one announced: right bundle id, the release's version.static func matches(infoPlist: [String: Any], version: String) -> Bool {infoPlist["CFBundleIdentifier"] as? String == bundleIddiff --git a/NotchBuddy/Sources/App/MacUpdater.swift b/NotchBuddy/Sources/App/MacUpdater.swiftindex 7bec9218..8b703973 100644--- a/NotchBuddy/Sources/App/MacUpdater.swift+++ b/NotchBuddy/Sources/App/MacUpdater.swift@@ -30,11 +30,18 @@ final class MacUpdater: ObservableObject {enum CheckResult: Equatable { case none, checking, upToDate, unreachable }- @Published private(set) var phase: Phase = .idle+ @Published private(set) var phase: Phase = .idle {+ didSet { if busy != (oldValue.isBusy) { refreshHint() } }+ }/// For "Check now" in Settings.@Published private(set) var lastCheck: CheckResult = .none/// The newest release found, kept even after "Later" (the menu bar and Settings offer it).- @Published private(set) var latest: MacUpdate.Release? = nil+ @Published private(set) var latest: MacUpdate.Release? = nil {+ didSet { refreshHint() }+ }+ /// A newer Coucou waits: Mochi is blue and a click opens the update first (BotCanvasView,+ /// IslandWindowController.defaultView). Off for a day after Later.+ @Published private(set) var hintActive = false// Not secrets: UserDefaults./// nil: not asked yet. true: Coucou may look at GitHub. false: never.@@ -54,6 +61,15 @@ final class MacUpdater: ObservableObject {get { UserDefaults.standard.object(forKey: "updateSnoozedAt") as? Date }set { UserDefaults.standard.set(newValue, forKey: "updateSnoozedAt") }}+ /// "Later" on the card: no blue Mochi for that version for a day (the announcement has its own snooze).+ private var laterVersion: String? {+ get { UserDefaults.standard.string(forKey: "updateLaterVersion") }+ set { UserDefaults.standard.set(newValue, forKey: "updateLaterVersion") }+ }+ private var laterAt: Date? {+ get { UserDefaults.standard.object(forKey: "updateLaterAt") as? Date }+ set { UserDefaults.standard.set(newValue, forKey: "updateLaterAt") }+ }private var askedAt: Date? {get { UserDefaults.standard.object(forKey: "updateConsentAskedAt") as? Date }set { UserDefaults.standard.set(newValue, forKey: "updateConsentAskedAt") }@@ -63,11 +79,19 @@ final class MacUpdater: ObservableObject {Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "0"}- var busy: Bool {- switch phase {- case .downloading, .verifying, .installing, .relaunching: return true- default: return false- }+ var busy: Bool { phase.isBusy }++ private func refreshHint() {+ let on = !busy && MacUpdate.showsHint(latest, current: Self.currentVersion, consent: Self.consent,+ laterVersion: laterVersion, laterAt: laterAt, now: Date())+ if hintActive != on { hintActive = on }+ }++ /// The island opens on the update while Mochi is blue (a click, a hover, the keyboard).+ func prepareCard() {+ guard let release = latest, !busy else { return }+ if case .available = phase { return }+ phase = .available(release)}private var timer: Timer?@@ -98,6 +122,7 @@ final class MacUpdater: ObservableObject {}private func tick(launch: Bool = false) {+ refreshHint() // a day after Later, Mochi turns blue againswitch Self.consent {case nil:askIfFree()@@ -133,6 +158,7 @@ final class MacUpdater: ObservableObject {/// Settings: the toggle.func setEnabled(_ on: Bool) {Self.consent = on+ refreshHint()if on { Task { await check(manual: false) } }else if case .asking = phase { phase = .idle }}@@ -191,6 +217,9 @@ final class MacUpdater: ObservableObject {if case .available(let r) = phase {snoozedVersion = r.versionsnoozedAt = Date()+ laterVersion = r.version+ laterAt = Date()+ refreshHint()}if !busy { phase = .idle }NotificationCenter.default.post(name: .islandCollapse, object: nil)@@ -348,6 +377,15 @@ final class MacUpdater: ObservableObject {}}+extension MacUpdater.Phase {+ var isBusy: Bool {+ switch self {+ case .downloading, .verifying, .installing, .relaunching: return true+ default: return false+ }+ }+}+private struct UpdateFailure: Error, Sendable {let message: Stringinit(_ m: String) { message = m }diff --git a/NotchBuddy/Sources/App/RecapStore.swift b/NotchBuddy/Sources/App/RecapStore.swiftindex 6884f43d..1a997a72 100644--- a/NotchBuddy/Sources/App/RecapStore.swift+++ b/NotchBuddy/Sources/App/RecapStore.swift@@ -218,6 +218,17 @@ final class RecapStore {)}+ /// Everything the recap still keeps (its last 12 weeks), for "What's new" after an update.+ func keptTotals() -> (sessions: Int, minutes: Int, linesAdded: Int, approvals: Int, since: Date?) {+ let turns = data.turns+ let approvals = data.decisions.filter { $0.decision == "allow" || $0.decision == "always" }.count+ return (sessions: turns.count,+ minutes: Int(mergedTotalSeconds(turns) / 60),+ linesAdded: turns.reduce(0) { $0 + $1.linesAdded },+ approvals: approvals,+ since: (turns.map(\.start) + data.decisions.map(\.date)).min())+ }+// MARK: - Persistencevar isEnabled: Bool {diff --git a/NotchBuddy/Sources/App/WhatsNew.swift b/NotchBuddy/Sources/App/WhatsNew.swiftnew file mode 100644index 00000000..cfb0251a--- /dev/null+++ b/NotchBuddy/Sources/App/WhatsNew.swift@@ -0,0 +1,124 @@+import Foundation++// "What's new" after Coucou updated itself (GitHub build): once, in the notch, what the version+// brings (Resources/whats-new.json, one entry per release, in every language), then what you did+// with Coucou so far, from what is already on this Mac (nothing is sent anywhere). Pure Foundation+// so tests/WhatsNewTests.swift checks the rules: which entry, which language, fresh install or+// update, which numbers are worth showing.++enum WhatsNew {+ struct Item: Decodable, Equatable, Sendable {+ let icon: String+ let title: [String: String]+ let detail: [String: String]+ }++ struct Release: Decodable, Equatable, Sendable {+ let version: String+ let items: [Item]+ }++ private struct File: Decodable {+ let releases: [Release]+ }++ /// The releases in whats-new.json; nothing when it doesn't read.+ static func releases(_ data: Data) -> [Release] {+ (try? JSONDecoder().decode(File.self, from: data))?.releases ?? []+ }++ /// The entry of this version ("0.6" and "0.6.0" are the same).+ static func release(for version: String, in releases: [Release]) -> Release? {+ releases.first { !MacUpdate.isNewer($0.version, than: version) && !MacUpdate.isNewer(version, than: $0.version) }+ }++ // MARK: - When++ /// Show it when the running version is newer than the last one this Mac saw. Coucou 0.5.2 and+ /// earlier kept no version: then an install that was used before counts as an update, a new+ /// one (nothing used yet) doesn't.+ static func shouldShow(lastSeen: String?, current: String, usedBefore: Bool) -> Bool {+ if let lastSeen { return MacUpdate.isNewer(current, than: lastSeen) }+ return usedBefore+ }++ // MARK: - Language++ /// The app's language first ("pt-BR", "zh-Hant"), then shorter forms of it, then English.+ static func text(_ values: [String: String], languages: [String]) -> String {+ for lang in languages {+ var parts = lang.replacingOccurrences(of: "_", with: "-").split(separator: "-").map(String.init)+ while !parts.isEmpty {+ if let v = values[parts.joined(separator: "-")], !v.isEmpty { return v }+ parts.removeLast()+ }+ }+ return values["en"] ?? values.values.sorted().first ?? ""+ }++ // MARK: - Icons++ /// The icons whats-new.json may name (scripts/test-whats-new.py has the same list), as SF Symbols.+ static let symbols: [String: String] = [+ "update": "arrow.down.circle.fill",+ "languages": "globe",+ "terminal": "terminal.fill",+ "checklist": "checklist",+ "bell": "bell.badge.fill",+ "chat": "bubble.left.and.bubble.right.fill",+ "mic": "mic.fill",+ "phone": "iphone",+ "shield": "lock.shield.fill",+ "sparkles": "sparkles",+ "bolt": "bolt.fill",+ "puzzle": "puzzlepiece.extension.fill",+ "paint": "paintpalette.fill",+ "eye": "eye.fill",+ "keyboard": "keyboard.fill",+ "heart": "heart.fill",+ "clock": "clock.fill",+ "download": "shippingbox.fill",+ "bug": "ladybug.fill",+ ]++ static func symbol(_ icon: String) -> String { symbols[icon] ?? "sparkles" }++ // MARK: - Your Coucou so far++ struct Stats: Equatable, Sendable {+ var sessions = 0+ var agentMinutes = 0+ var linesAdded = 0+ var approvals = 0+ var words = 0+ var minutesSaved = 0+ var notes = 0+ }++ enum Chip: Equatable, Sendable {+ case sessions(Int), agentTime(minutes: Int), lines(Int), approvals(Int)+ case words(Int), saved(minutes: Int), notes(Int)+ }++ /// The numbers worth showing, at most six: nothing that is zero, agents first, then Flow.+ static func chips(_ s: Stats, max: Int = 6) -> [Chip] {+ var out: [Chip] = []+ if s.sessions > 0 { out.append(.sessions(s.sessions)) }+ if s.agentMinutes >= 1 { out.append(.agentTime(minutes: s.agentMinutes)) }+ if s.linesAdded > 0 { out.append(.lines(s.linesAdded)) }+ if s.approvals > 0 { out.append(.approvals(s.approvals)) }+ if s.words > 0 { out.append(.words(s.words)) }+ if s.minutesSaved >= 1 { out.append(.saved(minutes: s.minutesSaved)) }+ if s.notes > 0 { out.append(.notes(s.notes)) }+ return Array(out.prefix(max))+ }++ // MARK: - Links++ /// "Buy Mochi a coffee": the same Stripe page as coucou's site and README.+ static let coffeeURL = URL(string: "https://buy.stripe.com/dRm6oGbfa7Kqcqs0hxes003")!++ static func releasePage(_ version: String) -> URL {+ URL(string: "https://github.com/\(MacUpdate.owner)/\(MacUpdate.repo)/releases/tag/v\(version)")!+ }+}diff --git a/NotchBuddy/Sources/App/WhatsNewViews.swift b/NotchBuddy/Sources/App/WhatsNewViews.swiftnew file mode 100644index 00000000..7c7b446d--- /dev/null+++ b/NotchBuddy/Sources/App/WhatsNewViews.swift@@ -0,0 +1,268 @@+#if !APPSTORE+import AppKit+import SwiftUI++// MARK: - When: once, after Coucou updated itself++@MainActor+final class WhatsNewCenter: ObservableObject {+ static let shared = WhatsNewCenter()++ /// The version's entry, from Resources/whats-new.json; nil once seen (or none for this version).+ @Published private(set) var release: WhatsNew.Release?+ /// 0: what the version brings. 1: your Coucou so far.+ @Published var page = 0+ @Published private(set) var stats = WhatsNew.Stats()++ // Not a secret: UserDefaults.+ private static let lastSeenKey = "whatsNewLastVersion"++ /// First thing at launch, before anything else writes its settings: was this Mac on an older+ /// Coucou? The version is recorded at once, so the card comes once per version.+ func noteLaunch() {+ let d = UserDefaults.standard+ let current = MacUpdater.currentVersion+ let last = d.string(forKey: Self.lastSeenKey)+ let show = WhatsNew.shouldShow(lastSeen: last, current: current, usedBefore: last == nil && Self.usedBefore())+ d.set(current, forKey: Self.lastSeenKey)+ guard show, let entry = WhatsNew.release(for: current, in: Self.bundled()) else { return }+ release = entry+ appendAppLog("nb.log", "[WhatsNew] updated from \(last ?? "an earlier version") to \(current)")+ // After the greeting, when nothing waits in the notch.+ tryShow(after: 4, attempts: 12)+ }++ /// Coucou 0.5.2 and earlier kept no version: settings only written once you used Coucou.+ private static func usedBefore() -> Bool {+ let d = UserDefaults.standard+ let keys = ["coucouHooksInstalled", "updateCheckConsent", "activeIntegrations", "recapLastShownWeek",+ "settingsSection", "soundEnabled", "openOnHover", "hotkeyEnabled"]+ if keys.contains(where: { d.object(forKey: $0) != nil }) { return true }+ let fm = FileManager.default+ let support = HookServer.supportDir+ return fm.fileExists(atPath: support.appendingPathComponent("recap.json").path)+ || fm.fileExists(atPath: FlowStore.folder.appendingPathComponent("stats.json").path)+ }++ private static func bundled() -> [WhatsNew.Release] {+ guard let url = Bundle.main.url(forResource: "whats-new", withExtension: "json"),+ let data = try? Data(contentsOf: url) else { return [] }+ return WhatsNew.releases(data)+ }++ private func tryShow(after delay: TimeInterval, attempts: Int) {+ DispatchQueue.main.asyncAfter(deadline: .now() + delay) { [weak self] in+ guard let self, self.release != nil else { return }+ let s = AppState.shared+ let busy = s.pendingApproval != nil || s.pendingQuestion != nil+ || s.view == .greeting || (s.mode == .expanded && s.view != .whatsNew)+ if busy {+ if attempts > 0 { self.tryShow(after: 15, attempts: attempts - 1) }+ return+ }+ self.show()+ }+ }++ func show() {+ guard release != nil else { return }+ stats = Self.collectStats()+ page = 0+ NotificationCenter.default.post(name: .hookExpand, object: IslandView.whatsNew)+ NotificationCenter.default.post(name: .triggerEmote, object: BotEmote.proud)+ SoundEngine.shared.play("proud")+ }++ func next() {+ withAnimation(.spring(response: 0.35, dampingFraction: 0.85)) { page = 1 }+ }++ func close() {+ release = nil+ NotificationCenter.default.post(name: .islandCollapse, object: nil)+ }++ func openCoffee() {+ NSWorkspace.shared.open(WhatsNew.coffeeURL)+ }++ func openReleasePage() {+ NSWorkspace.shared.open(WhatsNew.releasePage(release?.version ?? MacUpdater.currentVersion))+ }++ /// Only what is already on this Mac: the recap's weeks, Flow's counts, the Notetaker's notes.+ private static func collectStats() -> WhatsNew.Stats {+ let recap = RecapStore.shared.keptTotals()+ let flow = FlowStore.shared+ let words = flow.totalWords+ return WhatsNew.Stats(+ sessions: recap.sessions,+ agentMinutes: recap.minutes,+ linesAdded: recap.linesAdded,+ approvals: recap.approvals,+ words: words,+ minutesSaved: Int(FlowText.minutesSaved(words: words, seconds: flow.totalSeconds)),+ notes: NoteTaker.shared.notes.count+ )+ }+}++// MARK: - Notch card++struct WhatsNewCardView: View {+ @ObservedObject private var center = WhatsNewCenter.shared++ private static let blue = Color(hex: "#3B82F6")++ var body: some View {+ ZStack {+ CardBackground(wash: .indigo)+ VStack(alignment: .leading, spacing: 8) {+ if center.page == 0 {+ features+ .transition(.asymmetric(insertion: .move(edge: .leading).combined(with: .opacity),+ removal: .move(edge: .leading).combined(with: .opacity)))+ } else {+ soFar+ .transition(.asymmetric(insertion: .move(edge: .trailing).combined(with: .opacity),+ removal: .opacity))+ }+ }+ .padding(.leading, 116)+ .padding(.trailing, 16)+ .padding(.vertical, 12)+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)+ }+ }++ // Step 1: what the version brings++ @ViewBuilder private var features: some View {+ let version = center.release?.version ?? MacUpdater.currentVersion+ header(String(format: String(localized: "whatsnew.title %@"), version), step: 0)+ LazyVGrid(columns: [GridItem(.flexible(), spacing: 12, alignment: .topLeading),+ GridItem(.flexible(), spacing: 12, alignment: .topLeading)],+ alignment: .leading, spacing: 9) {+ ForEach(Array((center.release?.items ?? []).enumerated()), id: \.offset) { _, item in+ FeatureRow(item: item)+ }+ }+ Spacer(minLength: 0)+ HStack(spacing: 8) {+ PrimaryButton(verbatim: String(localized: "whatsnew.next")) { center.next() }+ SecondaryButton(verbatim: String(localized: "whatsnew.all-changes")) { center.openReleasePage() }+ }+ }++ // Step 2: your Coucou so far, and the coffee++ @ViewBuilder private var soFar: some View {+ let chips = WhatsNew.chips(center.stats)+ header(String(localized: "whatsnew.so-far"), step: 1)+ if !chips.isEmpty {+ LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 10, alignment: .topLeading), count: 3),+ alignment: .leading, spacing: 8) {+ ForEach(Array(chips.enumerated()), id: \.offset) { _, chip in+ StatChip(chip: chip)+ }+ }+ }+ Text(String(localized: "whatsnew.thanks"))+ .font(.system(size: 11))+ .foregroundColor(Color(hex: "#8E939C"))+ .lineLimit(2)+ .fixedSize(horizontal: false, vertical: true)+ Spacer(minLength: 0)+ HStack(spacing: 8) {+ PrimaryButton(verbatim: "☕ " + String(localized: "whatsnew.coffee")) { center.openCoffee() }+ SecondaryButton("OK") { center.close() }+ }+ }++ private func header(_ title: String, step: Int) -> some View {+ HStack(spacing: 8) {+ Text(title)+ .font(.system(size: 14, weight: .semibold))+ .foregroundColor(Color(hex: "#F1F2F4"))+ .lineLimit(1)+ Spacer(minLength: 6)+ HStack(spacing: 4) {+ ForEach(0..<2, id: \.self) { i in+ Capsule()+ .fill(i == step ? Self.blue : Color.white.opacity(0.18))+ .frame(width: i == step ? 14 : 5, height: 5)+ }+ }+ }+ }+}++private struct FeatureRow: View {+ let item: WhatsNew.Item++ var body: some View {+ let langs = Bundle.main.preferredLocalizations+ HStack(alignment: .top, spacing: 8) {+ Image(systemName: WhatsNew.symbol(item.icon))+ .font(.system(size: 11, weight: .semibold))+ .foregroundColor(Color(hex: "#93C5FD"))+ .frame(width: 24, height: 24)+ .background(RoundedRectangle(cornerRadius: 7).fill(Color(hex: "#3B82F6").opacity(0.18)))+ VStack(alignment: .leading, spacing: 2) {+ Text(WhatsNew.text(item.title, languages: langs))+ .font(.system(size: 12, weight: .semibold))+ .foregroundColor(Color(hex: "#F1F2F4"))+ .lineLimit(1)+ Text(WhatsNew.text(item.detail, languages: langs))+ .font(.system(size: 10.5))+ .foregroundColor(Color(hex: "#8E939C"))+ .lineLimit(2)+ .fixedSize(horizontal: false, vertical: true)+ }+ }+ }+}++private struct StatChip: View {+ let chip: WhatsNew.Chip++ var body: some View {+ let p = parts+ VStack(alignment: .leading, spacing: 1) {+ HStack(spacing: 5) {+ Image(systemName: p.icon)+ .font(.system(size: 10, weight: .semibold))+ .foregroundColor(Color(hex: "#93C5FD"))+ Text(verbatim: p.value)+ .font(.system(size: 16, weight: .bold))+ .foregroundColor(Color(hex: "#F1F2F4"))+ .lineLimit(1)+ .minimumScaleFactor(0.8)+ }+ Text(p.label)+ .font(.system(size: 9.5))+ .foregroundColor(Color(hex: "#8E939C"))+ .lineLimit(1)+ }+ }++ private var parts: (icon: String, value: String, label: String) {+ switch chip {+ case .sessions(let n):+ return ("terminal.fill", FlowText.shortCount(n), String(localized: "whatsnew.stat.sessions"))+ case .agentTime(let m):+ return ("clock.fill", HubInsightsPage.duration(minutes: Double(m)), String(localized: "whatsnew.stat.agent-time"))+ case .lines(let n):+ return ("chevron.left.forwardslash.chevron.right", FlowText.shortCount(n), String(localized: "whatsnew.stat.lines"))+ case .approvals(let n):+ return ("checkmark.circle.fill", FlowText.shortCount(n), String(localized: "whatsnew.stat.approvals"))+ case .words(let n):+ return ("mic.fill", FlowText.shortCount(n), String(localized: "whatsnew.stat.words"))+ case .saved(let m):+ return ("bolt.fill", HubInsightsPage.duration(minutes: Double(m)), String(localized: "whatsnew.stat.saved"))+ case .notes(let n):+ return ("phone.fill", FlowText.shortCount(n), String(localized: "whatsnew.stat.notes"))+ }+ }+}+#endifdiff --git a/NotchBuddy/Sources/CoucouKit/BotEngine.swift b/NotchBuddy/Sources/CoucouKit/BotEngine.swiftindex 59b6020d..fd710cc5 100644--- a/NotchBuddy/Sources/CoucouKit/BotEngine.swift+++ b/NotchBuddy/Sources/CoucouKit/BotEngine.swift@@ -70,6 +70,8 @@ enum BadgeType {case bang(CGColor)case question(CGColor)case dot(CGColor)+ /// A new Coucou is waiting (Mac GitHub build): a white up arrow.+ case arrow(CGColor)}// MARK: - Mochi track constants (from PISTES.mochi)@@ -172,6 +174,11 @@ let BotStates: [BotState: BotStateCfg] = [final class BotEngine: ObservableObject {var isMini: Bool = falsevar bodyColor: CGColor? = nil // override for mini bots+ /// A new version waits (BotCanvasView sets it while Mochi has nothing else to say):+ /// the blue up-arrow badge instead of the state's own.+ private(set) var updateHint = false+ /// #3B82F6: Mochi's colour while an update waits.+ static let updateBlue = CGColor(red: 0.231, green: 0.510, blue: 0.965, alpha: 1)// Animation state (mirrors prototype 's' object)var yaw: CGFloat = 0@@ -309,7 +316,7 @@ final class BotEngine: ObservableObject {colT = cgColorToTuple(cfg.color)setTarget(key: "tint", value: cfg.tint)setTarget(key: "tilt", value: cfg.tilt)- setBadge(cfg.badge)+ setBadge(updateHint && (newState == .idle || newState == .sleeping) ? .arrow(Self.updateBlue) : cfg.badge)switch newState {case .finished:@@ -340,6 +347,14 @@ final class BotEngine: ObservableObject {}}+ /// The caller decides when (an update waits, Mochi idle or asleep); the badge follows.+ func setUpdateHint(_ on: Bool) {+ guard on != updateHint else { return }+ updateHint = on+ setBadge(on ? .arrow(Self.updateBlue) : cfg.badge)+ if on { blink() }+ }+func setBadge(_ b: BadgeType?) {let key = badgeString(b)guard key != badgeKey else { return }@@ -1706,6 +1721,27 @@ final class BotEngine: ObservableObject {var inner = Path()inner.addEllipse(in: CGRect(x: -R*0.135, y: -R*0.135, width: R*0.27, height: R*0.27))ctx.fill(inner, with: .color(Color(cgColor: col)))++ case .arrow(let col):+ // Same ring as "!" and "?", with an up arrow that rises a little now and then.+ var ring = Path()+ ring.addEllipse(in: CGRect(x: -R*0.3, y: -R*0.3, width: R*0.6, height: R*0.6))+ ctx.fill(ring, with: .color(.black))+ var inner = Path()+ inner.addEllipse(in: CGRect(x: -R*0.23, y: -R*0.23, width: R*0.46, height: R*0.46))+ ctx.fill(inner, with: .color(Color(cgColor: col)))+ if !isMini {+ let phase = (now * 0.8).truncatingRemainder(dividingBy: 1)+ let lift = phase < 0.25 ? -sin(phase / 0.25 * .pi) * R * 0.035 : 0+ var arrow = Path()+ arrow.move(to: CGPoint(x: 0, y: R*0.12 + lift))+ arrow.addLine(to: CGPoint(x: 0, y: -R*0.11 + lift))+ arrow.move(to: CGPoint(x: -R*0.09, y: -R*0.02 + lift))+ arrow.addLine(to: CGPoint(x: 0, y: -R*0.11 + lift))+ arrow.addLine(to: CGPoint(x: R*0.09, y: -R*0.02 + lift))+ ctx.stroke(arrow, with: .color(.white),+ style: StrokeStyle(lineWidth: R*0.055, lineCap: .round, lineJoin: .round))+ }}}@@ -1844,6 +1880,7 @@ private func badgeString(_ b: BadgeType?) -> String {case .bang(let c): return "bang-\(hex(c))"case .question(let c): return "q-\(hex(c))"case .dot(let c): return "dot-\(hex(c))"+ case .arrow(let c): return "arrow-\(hex(c))"}}@@ -1895,6 +1932,7 @@ extension BadgeType: Equatable {case (.bang, .bang): return truecase (.question, .question): return truecase (.dot, .dot): return true+ case (.arrow, .arrow): return truedefault: return false}}diff --git a/NotchBuddy/Sources/CoucouKit/IslandTypes.swift b/NotchBuddy/Sources/CoucouKit/IslandTypes.swiftindex 20187cce..ec9bcdc1 100644--- a/NotchBuddy/Sources/CoucouKit/IslandTypes.swift+++ b/NotchBuddy/Sources/CoucouKit/IslandTypes.swift@@ -16,6 +16,7 @@ enum IslandView: String, CaseIterable {case voiceResult // voice command executed — "✓ Musique lancée" for ~2 scase capture // a screen capture just taken (⌃⌥X): paste, copy, annotate, ask Claudecase update // a new Coucou is out on GitHub: one click to install it (GitHub build)+ case whatsNew // Coucou just updated itself: what the version brings, then your Coucou so far (GitHub build)}// MARK: - Bot State@@ -243,6 +244,8 @@ enum IslandConst {.capture: ViewLayout(height: 160, botX: 58, botY: nil, botDiameter: 52, agentMode: .none),// New version: Mochi on the left, the version and Update now.update: ViewLayout(height: 160, botX: 62, botY: nil, botDiameter: 58, agentMode: .none),+ // After an update: taller, four items then the stats (like mail, it fills the height)+ .whatsNew: ViewLayout(height: 232, botX: 62, botY: nil, botDiameter: 58, agentMode: .none),]// Project colors — keyed by lowercase display name or slugdiff --git a/NotchBuddy/project.yml b/NotchBuddy/project.ymlindex 896846d3..8f7f3772 100644--- a/NotchBuddy/project.yml+++ b/NotchBuddy/project.yml@@ -131,6 +131,9 @@ targets:type: folder- path: Resources/Localizable.xcstringsbuildPhase: resources+ # What's new after an update, once in the notch (WhatsNewViews.swift; GitHub build)+ - path: Resources/whats-new.json+ buildPhase: resourcesinfo:path: Resources/Info.plistproperties:diff --git a/scripts/release.sh b/scripts/release.shindex f386a1c1..fe2769aa 100755--- a/scripts/release.sh+++ b/scripts/release.sh@@ -43,6 +43,9 @@ CHANGES=$(awk -v head="## $VERSION" '[ -n "$CHANGES" ] || die "CHANGELOG.md has no '## $VERSION' section"grep -q "| \[$VERSION\]" README.md || die "README.md has no row for $VERSION in the Versions table"+# Mochi shows it once in the notch after the update: an entry in every language.+python3 scripts/test-whats-new.py mac >/dev/null \+ || { python3 scripts/test-whats-new.py mac; die "NotchBuddy/Resources/whats-new.json needs a complete entry for $VERSION (CLAUDE.md, Releases)"; }if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; thendie "tag $TAG already exists here"diff --git a/scripts/test-whats-new-mac.sh b/scripts/test-whats-new-mac.shnew file mode 100755index 00000000..450b6e92--- /dev/null+++ b/scripts/test-whats-new-mac.sh@@ -0,0 +1,8 @@+#!/usr/bin/env bash+set -euo pipefail+cd "$(dirname "$0")/.."+TEST_DIR="$(mktemp -d "${TMPDIR:-/tmp}/coucou-whats-new.XXXXXX")"+trap 'rm -rf "$TEST_DIR"' EXIT+swiftc NotchBuddy/Sources/App/MacUpdate.swift NotchBuddy/Sources/App/WhatsNew.swift tests/WhatsNewTests.swift -o "$TEST_DIR/whats-new-tests"+"$TEST_DIR/whats-new-tests"+python3 scripts/test-whats-new.pydiff --git a/tests/MacUpdateTests.swift b/tests/MacUpdateTests.swiftindex 858d5865..fc62592f 100644--- a/tests/MacUpdateTests.swift+++ b/tests/MacUpdateTests.swift@@ -91,6 +91,16 @@ enum MacUpdateTests {check("Later yesterday: again", MacUpdate.shouldAnnounce(r, current: "0.5.1", snoozedVersion: "0.6.0", snoozedAt: now - 25 * 3600, now: now))check("Later on an older version: this one shows", MacUpdate.shouldAnnounce(r, current: "0.5.1", snoozedVersion: "0.5.2", snoozedAt: now - 60, now: now))+ print("\nBlue Mochi while it waits")+ check("waiting: blue", MacUpdate.showsHint(r, current: "0.5.1", consent: true, laterVersion: nil, laterAt: nil, now: now))+ check("not asked yet: no", !MacUpdate.showsHint(r, current: "0.5.1", consent: nil, laterVersion: nil, laterAt: nil, now: now))+ check("said no: no", !MacUpdate.showsHint(r, current: "0.5.1", consent: false, laterVersion: nil, laterAt: nil, now: now))+ check("nothing found: no", !MacUpdate.showsHint(nil, current: "0.5.1", consent: true, laterVersion: nil, laterAt: nil, now: now))+ check("installed: no", !MacUpdate.showsHint(r, current: "0.6.0", consent: true, laterVersion: nil, laterAt: nil, now: now))+ check("Later an hour ago: no", !MacUpdate.showsHint(r, current: "0.5.1", consent: true, laterVersion: "0.6.0", laterAt: now - 3600, now: now))+ check("Later yesterday: blue again", MacUpdate.showsHint(r, current: "0.5.1", consent: true, laterVersion: "0.6.0", laterAt: now - 25 * 3600, now: now))+ check("Later on an older version: blue", MacUpdate.showsHint(r, current: "0.5.1", consent: true, laterVersion: "0.5.9", laterAt: now - 60, now: now))+print("\nThe app in the zip")check("right id and version", MacUpdate.matches(infoPlist: ["CFBundleIdentifier": "fr.louisraille.NotchBuddy", "CFBundleShortVersionString": "0.6.0"], version: "0.6.0"))check("another app", !MacUpdate.matches(infoPlist: ["CFBundleIdentifier": "com.evil.app", "CFBundleShortVersionString": "0.6.0"], version: "0.6.0"))diff --git a/tests/WhatsNewTests.swift b/tests/WhatsNewTests.swiftnew file mode 100644index 00000000..c13c455c--- /dev/null+++ b/tests/WhatsNewTests.swift@@ -0,0 +1,80 @@+import Foundation++@main+enum WhatsNewTests {+ static var failures = 0++ static func check(_ label: String, _ got: Bool) {+ if got { print(" ✓ \(label)") }+ else { print(" ✗ \(label)"); failures += 1 }+ }++ static func main() {+ print("\nWhen it shows")+ check("0.5.2 → 0.6.0", WhatsNew.shouldShow(lastSeen: "0.5.2", current: "0.6.0", usedBefore: false))+ check("same version: no", !WhatsNew.shouldShow(lastSeen: "0.6.0", current: "0.6.0", usedBefore: true))+ check("0.6 is 0.6.0: no", !WhatsNew.shouldShow(lastSeen: "0.6", current: "0.6.0", usedBefore: true))+ check("an older dev build: no", !WhatsNew.shouldShow(lastSeen: "0.7.0", current: "0.6.0", usedBefore: true))+ check("0.9.3 → 0.10.0", WhatsNew.shouldShow(lastSeen: "0.9.3", current: "0.10.0", usedBefore: false))+ check("from 0.5.2 (no version kept), used before: yes", WhatsNew.shouldShow(lastSeen: nil, current: "0.6.0", usedBefore: true))+ check("a new install: no", !WhatsNew.shouldShow(lastSeen: nil, current: "0.6.0", usedBefore: false))++ print("\nWhich entry")+ let json = """+ {"about": "x", "releases": [+ {"version": "0.6.0", "items": [{"icon": "update", "title": {"en": "One", "fr": "Un", "pt-BR": "Um", "zh-Hant": "一"}, "detail": {"en": "Line"}}]},+ {"version": "0.5.2", "items": [{"icon": "bell", "title": {"en": "Old"}, "detail": {"en": "Old line"}}]}+ ]}+ """+ let releases = WhatsNew.releases(Data(json.utf8))+ check("reads two releases", releases.count == 2)+ check("0.6.0", WhatsNew.release(for: "0.6.0", in: releases)?.items.first?.icon == "update")+ check("0.6 finds 0.6.0", WhatsNew.release(for: "0.6", in: releases)?.version == "0.6.0")+ check("no entry for 0.6.1", WhatsNew.release(for: "0.6.1", in: releases) == nil)+ check("garbage reads as nothing", WhatsNew.releases(Data("{".utf8)).isEmpty)++ print("\nLanguage")+ let title = releases[0].items[0].title+ check("fr", WhatsNew.text(title, languages: ["fr"]) == "Un")+ check("fr-CA falls back to fr", WhatsNew.text(title, languages: ["fr-CA"]) == "Un")+ check("pt-BR", WhatsNew.text(title, languages: ["pt-BR"]) == "Um")+ check("zh-Hant-TW falls back to zh-Hant", WhatsNew.text(title, languages: ["zh-Hant-TW"]) == "一")+ check("de missing: English", WhatsNew.text(title, languages: ["de"]) == "One")+ check("empty value: next language", WhatsNew.text(["fr": "", "en": "One"], languages: ["fr"]) == "One")++ print("\nIcons")+ check("every icon has a symbol", WhatsNew.symbols.count == 19)+ check("unknown icon: sparkles", WhatsNew.symbol("rocket") == "sparkles")++ print("\nYour Coucou so far")+ check("nothing used: no chips", WhatsNew.chips(WhatsNew.Stats()).isEmpty)+ let s = WhatsNew.Stats(sessions: 42, agentMinutes: 600, linesAdded: 9000, approvals: 120, words: 15000, minutesSaved: 90, notes: 3)+ let chips = WhatsNew.chips(s)+ check("six at most", chips.count == 6)+ check("agents first", chips.first == .sessions(42))+ check("notes cut when full", !chips.contains(.notes(3)))+ check("zeros left out", WhatsNew.chips(WhatsNew.Stats(words: 300)) == [.words(300)])+ check("less than a minute saved: left out", WhatsNew.chips(WhatsNew.Stats(words: 5, minutesSaved: 0)) == [.words(5)])++ print("\nThe app's own file")+ let path = URL(fileURLWithPath: #filePath).deletingLastPathComponent().deletingLastPathComponent()+ .appendingPathComponent("NotchBuddy/Resources/whats-new.json")+ if let data = try? Data(contentsOf: path) {+ let own = WhatsNew.releases(data)+ check("whats-new.json reads", !own.isEmpty)+ check("its icons all have a symbol", own.allSatisfy { $0.items.allSatisfy { WhatsNew.symbols[$0.icon] != nil } })+ } else {+ check("whats-new.json is there", false)+ }++ print("\nLinks")+ check("coffee goes to Stripe", WhatsNew.coffeeURL.host == "buy.stripe.com")+ check("release page", WhatsNew.releasePage("0.6.0").absoluteString == "https://github.com/Louis-CFM/coucou/releases/tag/v0.6.0")++ if failures > 0 {+ print("\n\(failures) failure(s)")+ exit(1)+ }+ print("\nAll What's new tests passed")+ }+}