From 3a0ef619ed42fb868f28ce0e165485b94c503b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Catriel=20M=C3=BCller?= Date: Fri, 20 Feb 2026 09:36:22 -0300 Subject: [PATCH] refactor: prune old notifications --- flake.nix | 1 + packages/kilo-vscode/src/KiloProvider.ts | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index f6da887f5..73ed40aea 100644 --- a/flake.nix +++ b/flake.nix @@ -162,6 +162,7 @@ unzip gnutar gzip + ripgrep kilo-dev kilo-install-bin kilo-bin diff --git a/packages/kilo-vscode/src/KiloProvider.ts b/packages/kilo-vscode/src/KiloProvider.ts index 94fe04324..ee06fdd20 100644 --- a/packages/kilo-vscode/src/KiloProvider.ts +++ b/packages/kilo-vscode/src/KiloProvider.ts @@ -905,7 +905,12 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper try { const notifications = await this.httpClient.getNotifications() - const dismissedIds = this.extensionContext?.globalState.get("kilo.dismissedNotificationIds", []) ?? [] + const existing = this.extensionContext?.globalState.get("kilo.dismissedNotificationIds", []) ?? [] + const active = new Set(notifications.map((n) => n.id)) + const dismissedIds = existing.filter((id) => active.has(id)) + 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)