From acfcbcace8072dab781d036c51fcda47f5849c30 Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Fri, 26 Jun 2026 10:43:32 +0200 Subject: [PATCH 1/3] fix(vscode): reset read notifications from settings --- .changeset/reset-read-notifications.md | 5 ++++ packages/kilo-vscode/src/KiloProvider.ts | 9 +++++++ .../components/settings/AboutKiloCodeTab.tsx | 27 +++++++++---------- .../kilo-vscode/webview-ui/src/i18n/ar.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/br.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/bs.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/da.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/de.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/en.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/es.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/fr.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/it.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/ja.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/ko.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/nl.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/no.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/pl.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/ru.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/th.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/tr.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/uk.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/zh.ts | 1 + .../kilo-vscode/webview-ui/src/i18n/zht.ts | 1 + .../src/types/messages/webview-messages.ts | 5 ++++ 24 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 .changeset/reset-read-notifications.md diff --git a/.changeset/reset-read-notifications.md b/.changeset/reset-read-notifications.md new file mode 100644 index 00000000000..bbf0cf929be --- /dev/null +++ b/.changeset/reset-read-notifications.md @@ -0,0 +1,5 @@ +--- +"kilo-code": patch +--- + +Support resetting read notifications from the VS Code extension settings. diff --git a/packages/kilo-vscode/src/KiloProvider.ts b/packages/kilo-vscode/src/KiloProvider.ts index 118ae7243ec..25cc4072d3c 100644 --- a/packages/kilo-vscode/src/KiloProvider.ts +++ b/packages/kilo-vscode/src/KiloProvider.ts @@ -1232,6 +1232,9 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper case "resetAllSettings": await this.handleResetAllSettings() break + case "resetReadNotifications": + await this.handleResetReadNotifications() + break case "telemetry": TelemetryProxy.capture(message.event, message.properties) break @@ -3241,6 +3244,12 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper vscode.window.showInformationMessage("Kilo Code settings have been reset to defaults.") } + private async handleResetReadNotifications(): Promise { + await this.extensionContext?.globalState.update("kilo.dismissedNotificationIds", undefined) + await this.fetchAndSendNotifications() + vscode.window.showInformationMessage("Read notifications have been reset.") + } + /** * Read the current browser automation settings and push them to the webview. */ diff --git a/packages/kilo-vscode/webview-ui/src/components/settings/AboutKiloCodeTab.tsx b/packages/kilo-vscode/webview-ui/src/components/settings/AboutKiloCodeTab.tsx index ea15459c9bc..7e74c6aefd7 100644 --- a/packages/kilo-vscode/webview-ui/src/components/settings/AboutKiloCodeTab.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/settings/AboutKiloCodeTab.tsx @@ -357,21 +357,18 @@ const AboutKiloCodeTab: Component = (props) => { > {language.t("settings.aboutKiloCode.resetSettings.description")}

- +
+ + +
) diff --git a/packages/kilo-vscode/webview-ui/src/i18n/ar.ts b/packages/kilo-vscode/webview-ui/src/i18n/ar.ts index ebea1d7c8ef..fd2c265e918 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/ar.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/ar.ts @@ -1227,6 +1227,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "يؤدي هذا إلى إعادة تعيين الإعدادات الخاصة بامتداد VS Code فقط إلى قيمها الافتراضية. الإعدادات المشتركة مع CLI، مثل الأوضاع وقواعد الموافقة التلقائية، مخزّنة في تكوين CLI ولن تتأثر.", "settings.aboutKiloCode.resetSettings.button": "إعادة تعيين جميع الإعدادات", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "نقل الإعدادات", "settings.aboutKiloCode.settingsTransfer.description": "تصدير أو استيراد إعداداتك لنقلها بين نُسخ VS Code.", "settings.aboutKiloCode.exportSettings": "تصدير", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/br.ts b/packages/kilo-vscode/webview-ui/src/i18n/br.ts index 8b36f169d31..d0378e8c7b4 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/br.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/br.ts @@ -1251,6 +1251,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "Isso redefine apenas as configurações específicas da extensão VS Code para seus valores padrão. As configurações compartilhadas com o CLI, como modos e regras de aprovação automática, são armazenadas na configuração do CLI e não serão redefinidas.", "settings.aboutKiloCode.resetSettings.button": "Redefinir Todas as Configurações", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Transferência de configurações", "settings.aboutKiloCode.settingsTransfer.description": "Exporte ou importe suas configurações para transferi-las entre instâncias do VS Code.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/bs.ts b/packages/kilo-vscode/webview-ui/src/i18n/bs.ts index c8283620a7d..de1e41dbf83 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/bs.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/bs.ts @@ -1253,6 +1253,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "Ovo resetuje samo postavke specifične za VS Code ekstenziju na njihove zadane vrijednosti. Postavke koje se dijele s CLI-jem, kao što su načini rada i pravila automatskog odobravanja, pohranjene su u CLI konfiguraciji i neće biti resetovane.", "settings.aboutKiloCode.resetSettings.button": "Resetuj sve postavke", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Prijenos postavki", "settings.aboutKiloCode.settingsTransfer.description": "Izvezite ili uvezite postavke za prijenos između VS Code instanci.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/da.ts b/packages/kilo-vscode/webview-ui/src/i18n/da.ts index f360d7680a1..dee2237b79b 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/da.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/da.ts @@ -1247,6 +1247,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "Dette nulstiller kun VS Code-udvidelsesspecifikke indstillinger til deres standardværdier. Indstillinger der deles med CLI, såsom tilstande og regler for automatisk godkendelse, er gemt i CLI-konfigurationen og vil ikke blive nulstillet.", "settings.aboutKiloCode.resetSettings.button": "Nulstil alle indstillinger", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Overførsel af indstillinger", "settings.aboutKiloCode.settingsTransfer.description": "Eksportér eller importér dine indstillinger for at overføre dem mellem VS Code-instanser.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/de.ts b/packages/kilo-vscode/webview-ui/src/i18n/de.ts index 3489d9193a7..fb6b30e8461 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/de.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/de.ts @@ -1266,6 +1266,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "Dies setzt nur VS Code-erweiterungsspezifische Einstellungen auf ihre Standardwerte zurück. Einstellungen, die mit der CLI geteilt werden, wie Modi und Regeln für die automatische Genehmigung, werden in der CLI-Konfiguration gespeichert und nicht zurückgesetzt.", "settings.aboutKiloCode.resetSettings.button": "Alle Einstellungen zurücksetzen", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Einstellungen übertragen", "settings.aboutKiloCode.settingsTransfer.description": "Exportieren oder importieren Sie Ihre Einstellungen, um sie zwischen VS Code-Instanzen zu übertragen.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/en.ts b/packages/kilo-vscode/webview-ui/src/i18n/en.ts index 95a2c88cea5..7cc617f8ea8 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/en.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/en.ts @@ -1227,6 +1227,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "This resets only VS Code extension-specific settings to their default values. Settings shared with the CLI, such as modes and auto-approve rules, are stored in the CLI configuration and will not be reset.", "settings.aboutKiloCode.resetSettings.button": "Reset All Settings", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Settings Transfer", "settings.aboutKiloCode.settingsTransfer.description": "Export or import your settings to transfer them between VS Code instances.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/es.ts b/packages/kilo-vscode/webview-ui/src/i18n/es.ts index f09a59a4cce..2a383c61f9e 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/es.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/es.ts @@ -1259,6 +1259,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "Esto restablece únicamente las configuraciones específicas de la extensión VS Code a sus valores predeterminados. Las configuraciones compartidas con el CLI, como los modos y las reglas de aprobación automática, se almacenan en la configuración del CLI y no serán restablecidas.", "settings.aboutKiloCode.resetSettings.button": "Restablecer toda la configuración", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Transferencia de ajustes", "settings.aboutKiloCode.settingsTransfer.description": "Exporta o importa tus ajustes para transferirlos entre instancias de VS Code.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/fr.ts b/packages/kilo-vscode/webview-ui/src/i18n/fr.ts index 79052b1d5f4..78d031b278c 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/fr.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/fr.ts @@ -1272,6 +1272,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "Ceci réinitialise uniquement les paramètres spécifiques à l'extension VS Code à leurs valeurs par défaut. Les paramètres partagés avec le CLI, tels que les modes et les règles d'approbation automatique, sont stockés dans la configuration du CLI et ne seront pas réinitialisés.", "settings.aboutKiloCode.resetSettings.button": "Réinitialiser tous les paramètres", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Transfert des paramètres", "settings.aboutKiloCode.settingsTransfer.description": "Exportez ou importez vos paramètres pour les transférer entre instances VS Code.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/it.ts b/packages/kilo-vscode/webview-ui/src/i18n/it.ts index 005494f6bde..190ee910118 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/it.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/it.ts @@ -1076,6 +1076,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "Ripristina solo le impostazioni specifiche dell'estensione VS Code ai valori predefiniti. Le impostazioni condivise con la CLI, come modalità e regole di approvazione automatica, sono salvate nella configurazione CLI e non verranno ripristinate.", "settings.aboutKiloCode.resetSettings.button": "Ripristina tutte le impostazioni", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Trasferimento impostazioni", "settings.aboutKiloCode.settingsTransfer.description": "Esporta o importa le impostazioni per trasferirle tra istanze VS Code.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/ja.ts b/packages/kilo-vscode/webview-ui/src/i18n/ja.ts index 283c0ec787a..c813407f602 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/ja.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/ja.ts @@ -1242,6 +1242,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "これはVS Code拡張機能固有の設定のみをデフォルト値にリセットします。モードや自動承認ルールなど、CLIと共有される設定はCLI設定ファイルに保存されており、リセットされません。", "settings.aboutKiloCode.resetSettings.button": "すべての設定をリセット", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "設定の移行", "settings.aboutKiloCode.settingsTransfer.description": "VS Code インスタンス間で設定を転送するには、エクスポートまたはインポートしてください。", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/ko.ts b/packages/kilo-vscode/webview-ui/src/i18n/ko.ts index 7109078ac16..454b473130a 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/ko.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/ko.ts @@ -1237,6 +1237,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "이 기능은 VS Code 확장 프로그램 전용 설정만 기본값으로 초기화합니다. 모드 및 자동 승인 규칙과 같이 CLI와 공유되는 설정은 CLI 구성에 저장되며 초기화되지 않습니다.", "settings.aboutKiloCode.resetSettings.button": "모든 설정 초기화", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "설정 이전", "settings.aboutKiloCode.settingsTransfer.description": "VS Code 인스턴스 간에 설정을 전송하려면 내보내기 또는 가져오기하세요.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/nl.ts b/packages/kilo-vscode/webview-ui/src/i18n/nl.ts index 20b6adf5282..827c863f5a9 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/nl.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/nl.ts @@ -1241,6 +1241,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "Dit reset alleen VS Code-extensiespecifieke instellingen naar hun standaardwaarden. Instellingen die gedeeld worden met de CLI, zoals modi en regels voor automatisch goedkeuren, worden opgeslagen in de CLI-configuratie en worden niet gereset.", "settings.aboutKiloCode.resetSettings.button": "Alle instellingen resetten", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Instellingen overdragen", "settings.aboutKiloCode.settingsTransfer.description": "Exporteer of importeer uw instellingen om ze tussen VS Code-instanties over te dragen.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/no.ts b/packages/kilo-vscode/webview-ui/src/i18n/no.ts index fdf4011a5bc..e988e09c013 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/no.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/no.ts @@ -1210,6 +1210,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "Dette tilbakestiller kun VS Code-utvidelsesspecifikke innstillinger til standardverdiene. Innstillinger som deles med CLI, som modi og regler for automatisk godkjenning, lagres i CLI-konfigurasjonen og vil ikke tilbakestilles.", "settings.aboutKiloCode.resetSettings.button": "Tilbakestill alle innstillinger", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Overføring av innstillinger", "settings.aboutKiloCode.settingsTransfer.description": "Eksporter eller importer innstillingene dine for å overføre dem mellom VS Code-instanser.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/pl.ts b/packages/kilo-vscode/webview-ui/src/i18n/pl.ts index 024c85fa02c..1e55d7debe6 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/pl.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/pl.ts @@ -1210,6 +1210,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "To resetuje tylko ustawienia specyficzne dla rozszerzenia VS Code do ich domyślnych wartości. Ustawienia współdzielone z CLI, takie jak tryby i reguły automatycznego zatwierdzania, są przechowywane w konfiguracji CLI i nie zostaną zresetowane.", "settings.aboutKiloCode.resetSettings.button": "Resetuj wszystkie ustawienia", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Przenoszenie ustawień", "settings.aboutKiloCode.settingsTransfer.description": "Eksportuj lub importuj ustawienia, aby przenosić je między instancjami VS Code.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/ru.ts b/packages/kilo-vscode/webview-ui/src/i18n/ru.ts index c1dbc2fc269..156d818f3d2 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/ru.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/ru.ts @@ -1252,6 +1252,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "Это сбрасывает только настройки, специфичные для расширения VS Code, до значений по умолчанию. Настройки, общие с CLI, такие как режимы и правила автоматического утверждения, хранятся в конфигурации CLI и не будут сброшены.", "settings.aboutKiloCode.resetSettings.button": "Сбросить все настройки", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Перенос настроек", "settings.aboutKiloCode.settingsTransfer.description": "Экспортируйте или импортируйте настройки для переноса между экземплярами VS Code.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/th.ts b/packages/kilo-vscode/webview-ui/src/i18n/th.ts index 9e3dfbb2122..a1e60796808 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/th.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/th.ts @@ -1234,6 +1234,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "การดำเนินการนี้จะรีเซ็ตเฉพาะการตั้งค่าเฉพาะของส่วนขยาย VS Code กลับเป็นค่าเริ่มต้นเท่านั้น การตั้งค่าที่ใช้ร่วมกับ CLI เช่น โหมดและกฎการอนุมัติอัตโนมัติ จะถูกเก็บไว้ในการกำหนดค่า CLI และจะไม่ถูกรีเซ็ต", "settings.aboutKiloCode.resetSettings.button": "รีเซ็ตการตั้งค่าทั้งหมด", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "ถ่ายโอนการตั้งค่า", "settings.aboutKiloCode.settingsTransfer.description": "ส่งออกหรือนำเข้าการตั้งค่าเพื่อถ่ายโอนระหว่างอินสแตนซ์ VS Code", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/tr.ts b/packages/kilo-vscode/webview-ui/src/i18n/tr.ts index 0f61e74c65c..b2c3b689589 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/tr.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/tr.ts @@ -1238,6 +1238,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "Bu, yalnızca VS Code uzantısına özgü ayarları varsayılan değerlerine sıfırlar. Modlar ve otomatik onay kuralları gibi CLI ile paylaşılan ayarlar, CLI yapılandırmasında depolanır ve sıfırlanmaz.", "settings.aboutKiloCode.resetSettings.button": "Tüm Ayarları Sıfırla", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Ayar Aktarımı", "settings.aboutKiloCode.settingsTransfer.description": "Ayarlarınızı VS Code örnekleri arasında aktarmak için dışa veya içe aktarın.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/uk.ts b/packages/kilo-vscode/webview-ui/src/i18n/uk.ts index ac62609fd15..28c61a41b1d 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/uk.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/uk.ts @@ -1234,6 +1234,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "Це скине лише налаштування, специфічні для розширення VS Code, до стандартних значень. Налаштування, що зберігаються в конфігурації CLI (такі як режими та правила автоматичного схвалення), не будуть скинуті.", "settings.aboutKiloCode.resetSettings.button": "Скинути всі налаштування", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "Перенесення налаштувань", "settings.aboutKiloCode.settingsTransfer.description": "Експортуйте або імпортуйте налаштування для перенесення між екземплярами VS Code.", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/zh.ts b/packages/kilo-vscode/webview-ui/src/i18n/zh.ts index 1d6c8147cf9..7767c601c7d 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/zh.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/zh.ts @@ -1216,6 +1216,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "此操作仅将 VS Code 扩展专属设置重置为默认值。与 CLI 共享的设置(如模式和自动审批规则)存储在 CLI 配置中,不会被重置。", "settings.aboutKiloCode.resetSettings.button": "重置所有设置", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "设置迁移", "settings.aboutKiloCode.settingsTransfer.description": "导出或导入设置,以便在 VS Code 实例之间传输。", "settings.aboutKiloCode.exportSettings": "导出", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/zht.ts b/packages/kilo-vscode/webview-ui/src/i18n/zht.ts index 4603eb794e7..fba8e44d91e 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/zht.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/zht.ts @@ -1180,6 +1180,7 @@ export const dict = { "settings.aboutKiloCode.resetSettings.description": "此操作僅將 VS Code 擴充功能專屬設定重置為預設值。與 CLI 共享的設定(例如模式和自動核准規則)儲存在 CLI 設定中,不會被重置。", "settings.aboutKiloCode.resetSettings.button": "重置所有設定", + "settings.aboutKiloCode.resetSettings.notificationsButton": "Reset Read Notifications", "settings.aboutKiloCode.settingsTransfer.title": "設定轉移", "settings.aboutKiloCode.settingsTransfer.description": "匯出或匯入設定,以便在 VS Code 實例之間轉移。", "settings.aboutKiloCode.exportSettings": "匯出", diff --git a/packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts b/packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts index 781df064c8e..773257d646d 100644 --- a/packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts +++ b/packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts @@ -466,6 +466,10 @@ export interface ResetAllSettingsRequest { type: "resetAllSettings" } +export interface ResetReadNotificationsRequest { + type: "resetReadNotifications" +} + export interface SettingsTabChangedMessage { type: "settingsTabChanged" tab: string @@ -1189,6 +1193,7 @@ export type WebviewMessage = | RequestNotificationSettingsMessage | TestNotificationMessage | ResetAllSettingsRequest + | ResetReadNotificationsRequest | SettingsTabChangedMessage | SyncSessionRequest | CreateWorktreeSessionRequest From 3f4688c8257f559ef1b1d7bebbc908098a480697 Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Fri, 26 Jun 2026 11:02:01 +0200 Subject: [PATCH 2/3] refactor(vscode): extract notification reset handler --- packages/kilo-vscode/src/KiloProvider.ts | 9 ++------- .../kilo-vscode/src/kilo-provider/notifications.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 packages/kilo-vscode/src/kilo-provider/notifications.ts diff --git a/packages/kilo-vscode/src/KiloProvider.ts b/packages/kilo-vscode/src/KiloProvider.ts index 25cc4072d3c..bfb80e1e02f 100644 --- a/packages/kilo-vscode/src/KiloProvider.ts +++ b/packages/kilo-vscode/src/KiloProvider.ts @@ -70,6 +70,7 @@ import { interceptMessage } from "./kilo-provider/git-changes-request" import { matchFollowup, recordFollowup, type Followup } from "./kilo-provider/followup-session" import { clearCommandsCache, loadCommands } from "./kilo-provider/commands" import { fetchMessagePage, MESSAGE_PAGE_LIMIT } from "./kilo-provider/message-page" +import { resetReadNotifications } from "./kilo-provider/notifications" import { childID } from "./kilo-provider/task-session" import { VisibleTaskStreams } from "./kilo-provider/visible-task-streams" import { handleNetworkEvent, clearNetworkWaits } from "./kilo-provider/network" @@ -1233,7 +1234,7 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper await this.handleResetAllSettings() break case "resetReadNotifications": - await this.handleResetReadNotifications() + await resetReadNotifications(this.extensionContext, () => this.fetchAndSendNotifications()) break case "telemetry": TelemetryProxy.capture(message.event, message.properties) @@ -3244,12 +3245,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper vscode.window.showInformationMessage("Kilo Code settings have been reset to defaults.") } - private async handleResetReadNotifications(): Promise { - await this.extensionContext?.globalState.update("kilo.dismissedNotificationIds", undefined) - await this.fetchAndSendNotifications() - vscode.window.showInformationMessage("Read notifications have been reset.") - } - /** * Read the current browser automation settings and push them to the webview. */ diff --git a/packages/kilo-vscode/src/kilo-provider/notifications.ts b/packages/kilo-vscode/src/kilo-provider/notifications.ts new file mode 100644 index 00000000000..b84bb4c15cf --- /dev/null +++ b/packages/kilo-vscode/src/kilo-provider/notifications.ts @@ -0,0 +1,10 @@ +import * as vscode from "vscode" + +export async function resetReadNotifications( + context: vscode.ExtensionContext | undefined, + refresh: () => Promise, +): Promise { + await context?.globalState.update("kilo.dismissedNotificationIds", undefined) + await refresh() + vscode.window.showInformationMessage("Read notifications have been reset.") +} From 2acb32595df81c77293e6f2cb987271c6d072146 Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Fri, 26 Jun 2026 11:08:03 +0200 Subject: [PATCH 3/3] refactor(vscode): move notification state handling --- packages/kilo-vscode/src/KiloProvider.ts | 92 +++++-------------- .../src/kilo-provider/notifications.ts | 88 ++++++++++++++++-- 2 files changed, 105 insertions(+), 75 deletions(-) diff --git a/packages/kilo-vscode/src/KiloProvider.ts b/packages/kilo-vscode/src/KiloProvider.ts index bfb80e1e02f..f61e50ee43c 100644 --- a/packages/kilo-vscode/src/KiloProvider.ts +++ b/packages/kilo-vscode/src/KiloProvider.ts @@ -70,7 +70,13 @@ import { interceptMessage } from "./kilo-provider/git-changes-request" import { matchFollowup, recordFollowup, type Followup } from "./kilo-provider/followup-session" import { clearCommandsCache, loadCommands } from "./kilo-provider/commands" import { fetchMessagePage, MESSAGE_PAGE_LIMIT } from "./kilo-provider/message-page" -import { resetReadNotifications } from "./kilo-provider/notifications" +import { + dismissNotification, + fetchAndSendNotifications as fetchNotifications, + resetReadNotifications, + type NotificationsContext, + type NotificationsMessage, +} from "./kilo-provider/notifications" import { childID } from "./kilo-provider/task-session" import { VisibleTaskStreams } from "./kilo-provider/visible-task-streams" import { handleNetworkEvent, clearNetworkWaits } from "./kilo-provider/network" @@ -331,7 +337,7 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper private pending = 0 private configWarningsShown = false /** Cached notificationsLoaded payload */ - private cachedNotificationsMessage: unknown = null + private cachedNotificationsMessage: NotificationsMessage | null = null private pendingKiloModel: { modelID?: string; agent?: string } | null = null private pendingReviewComments: { comments: unknown[]; autoSend: boolean }[] = [] private readyResolvers: (() => void)[] = [] @@ -1234,7 +1240,7 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper await this.handleResetAllSettings() break case "resetReadNotifications": - await resetReadNotifications(this.extensionContext, () => this.fetchAndSendNotifications()) + await resetReadNotifications(this.notificationsContext()) break case "telemetry": TelemetryProxy.capture(message.event, message.properties) @@ -2375,79 +2381,27 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper } } - /** - * Fetch Kilo news/notifications and send to webview. - * Uses the cached message pattern so the webview gets data immediately on refresh. - */ - private async fetchAndSendNotifications(): Promise { - if (!this.client) { - if (this.cachedNotificationsMessage) { - // Merge the latest dismissed IDs from globalState into the cached - // message so that dismissals persisted while offline are honoured. - const persisted = this.extensionContext?.globalState.get("kilo.dismissedNotificationIds", []) ?? [] - if (persisted.length > 0) { - const cached = this.cachedNotificationsMessage as { - type: string - notifications: unknown[] - dismissedIds: string[] - } - const merged = Array.from(new Set([...cached.dismissedIds, ...persisted])) - this.cachedNotificationsMessage = { ...cached, dismissedIds: merged } - } - this.postMessage(this.cachedNotificationsMessage) - } - return + private notificationsContext(): NotificationsContext { + return { + context: this.extensionContext, + client: this.client, + cached: () => this.cachedNotificationsMessage, + set: (message) => { + this.cachedNotificationsMessage = message + }, + post: (message) => this.postMessage(message), + notify: (id) => this.connectionService.notifyNotificationDismissed(id), } + } - try { - const { data: all } = await retry(() => this.client!.kilo.notifications(undefined, { throwOnError: true })) - const notifications = all.filter((n) => !n.showIn || n.showIn.includes("extension")) - const existing = this.extensionContext?.globalState.get("kilo.dismissedNotificationIds", []) ?? [] - const active = new Set(notifications.map((n) => n.id)) - // Only prune stale dismissed IDs when we have a non-empty notification - // list. An empty list may mean the API returned nothing due to being - // unauthenticated (e.g. right after logout), not that all notifications - // are gone — pruning in that case would wipe the persisted dismissals. - const dismissedIds = notifications.length > 0 ? existing.filter((id) => active.has(id)) : existing - if (dismissedIds.length !== existing.length) { - await this.extensionContext?.globalState.update("kilo.dismissedNotificationIds", dismissedIds) - } - const message = { type: "notificationsLoaded", notifications, dismissedIds } - this.cachedNotificationsMessage = message - this.postMessage(message) - } catch (error) { - console.error("[Kilo New] KiloProvider: Failed to fetch notifications:", error) - } + private async fetchAndSendNotifications(): Promise { + await fetchNotifications(this.notificationsContext()) } // Cloud session methods extracted to kilo-provider/handlers/cloud-session.ts - /** - * Persist a dismissed notification ID in globalState and push updated lists to webview. - */ private async handleDismissNotification(notificationId: string): Promise { - if (!this.extensionContext) return - const existing = this.extensionContext.globalState.get("kilo.dismissedNotificationIds", []) - if (!existing.includes(notificationId)) { - await this.extensionContext.globalState.update("kilo.dismissedNotificationIds", [...existing, notificationId]) - } - // Update the cached message so the dismiss persists even if - // fetchAndSendNotifications() fails (e.g. no client / API error). - if (this.cachedNotificationsMessage) { - const cached = this.cachedNotificationsMessage as { - type: string - notifications: unknown[] - dismissedIds: string[] - } - if (!cached.dismissedIds.includes(notificationId)) { - this.cachedNotificationsMessage = { - ...cached, - dismissedIds: [...cached.dismissedIds, notificationId], - } - } - } - await this.fetchAndSendNotifications() - this.connectionService.notifyNotificationDismissed(notificationId) + await dismissNotification(this.notificationsContext(), notificationId) } /** Read attention settings from VS Code config and push to webview. */ diff --git a/packages/kilo-vscode/src/kilo-provider/notifications.ts b/packages/kilo-vscode/src/kilo-provider/notifications.ts index b84bb4c15cf..0e29770fff1 100644 --- a/packages/kilo-vscode/src/kilo-provider/notifications.ts +++ b/packages/kilo-vscode/src/kilo-provider/notifications.ts @@ -1,10 +1,86 @@ import * as vscode from "vscode" +import type { KiloClient } from "@kilocode/sdk/v2/client" +import { retry } from "../services/cli-backend/retry" -export async function resetReadNotifications( - context: vscode.ExtensionContext | undefined, - refresh: () => Promise, -): Promise { - await context?.globalState.update("kilo.dismissedNotificationIds", undefined) - await refresh() +const KEY = "kilo.dismissedNotificationIds" + +interface NotificationAction { + actionText: string + actionURL: string +} + +interface NotificationItem { + id: string + title: string + message: string + action?: NotificationAction + showIn?: string[] + suggestModelId?: string +} + +export interface NotificationsMessage { + type: "notificationsLoaded" + notifications: NotificationItem[] + dismissedIds: string[] +} + +export interface NotificationsContext { + context: vscode.ExtensionContext | undefined + client: KiloClient | null + cached: () => NotificationsMessage | null + set: (message: NotificationsMessage) => void + post: (message: NotificationsMessage) => void + notify: (id: string) => void +} + +export async function fetchAndSendNotifications(ctx: NotificationsContext): Promise { + if (!ctx.client) { + const cached = ctx.cached() + if (cached) { + const persisted = ctx.context?.globalState.get(KEY, []) ?? [] + const dismissedIds = + persisted.length > 0 ? Array.from(new Set([...cached.dismissedIds, ...persisted])) : cached.dismissedIds + const message = { ...cached, dismissedIds } + if (message !== cached) ctx.set(message) + ctx.post(message) + } + return + } + + try { + const { data: all } = await retry(() => ctx.client!.kilo.notifications(undefined, { throwOnError: true })) + const notifications = all.filter((n) => !n.showIn || n.showIn.includes("extension")) + const existing = ctx.context?.globalState.get(KEY, []) ?? [] + const active = new Set(notifications.map((n) => n.id)) + const dismissedIds = notifications.length > 0 ? existing.filter((id) => active.has(id)) : existing + if (dismissedIds.length !== existing.length) await ctx.context?.globalState.update(KEY, dismissedIds) + const message = { type: "notificationsLoaded" as const, notifications, dismissedIds } + ctx.set(message) + ctx.post(message) + } catch (error) { + console.error("[Kilo New] KiloProvider: Failed to fetch notifications:", error) + } +} + +export async function dismissNotification(ctx: NotificationsContext, id: string): Promise { + if (!ctx.context) return + const existing = ctx.context.globalState.get(KEY, []) + if (!existing.includes(id)) await ctx.context.globalState.update(KEY, [...existing, id]) + + const cached = ctx.cached() + if (cached && !cached.dismissedIds.includes(id)) { + ctx.set({ + ...cached, + dismissedIds: [...cached.dismissedIds, id], + }) + } + + await fetchAndSendNotifications(ctx) + ctx.notify(id) +} + +export async function resetReadNotifications(ctx: NotificationsContext): Promise { + await ctx.context?.globalState.update(KEY, undefined) + await fetchAndSendNotifications(ctx) vscode.window.showInformationMessage("Read notifications have been reset.") }