refactor(vscode): extract notification reset handler

This commit is contained in:
Mark IJbema
2026-06-26 11:02:01 +02:00
parent acfcbcace8
commit 3f4688c825
2 changed files with 12 additions and 7 deletions
+2 -7
View File
@@ -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<void> {
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.
*/
@@ -0,0 +1,10 @@
import * as vscode from "vscode"
export async function resetReadNotifications(
context: vscode.ExtensionContext | undefined,
refresh: () => Promise<void>,
): Promise<void> {
await context?.globalState.update("kilo.dismissedNotificationIds", undefined)
await refresh()
vscode.window.showInformationMessage("Read notifications have been reset.")
}