diff --git a/src/extension.ts b/src/extension.ts index 2147703aa5..fc5f216201 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -102,16 +102,19 @@ export async function activate(context: vscode.ExtensionContext) { try { if (!previousVersion || currentVersion !== previousVersion) { Logger.log(`Cline version changed: ${previousVersion} -> ${currentVersion}. First run or update detected.`) - const lastShownPopupNotificationVersion = context.globalState.get("clineLastPopupNotificationVersion") - if (currentVersion !== lastShownPopupNotificationVersion && previousVersion) { - // Show VS Code popup notification as this version hasn't been notified yet without doing it for fresh installs - const message = `Cline has been updated to v${currentVersion}` + // Use the same condition as announcements: focus when there's a new announcement to show + const lastShownAnnouncementId = context.globalState.get("lastShownAnnouncementId") + const latestAnnouncementId = context.extension?.packageJSON?.version?.split(".").slice(0, 2).join(".") ?? "" + + if (lastShownAnnouncementId !== latestAnnouncementId) { + // Focus Cline when there's a new announcement to show (major/minor updates or fresh installs) + const message = previousVersion + ? `Cline has been updated to v${currentVersion}` + : `Welcome to Cline v${currentVersion}` await vscode.commands.executeCommand("claude-dev.SidebarProvider.focus") await new Promise((resolve) => setTimeout(resolve, 200)) HostProvider.window.showMessage({ type: ShowMessageType.INFORMATION, message }) - // Record that we've shown the popup for this version. - await context.globalState.update("clineLastPopupNotificationVersion", currentVersion) } // Always update the main version tracker for the next launch. await context.globalState.update("clineVersion", currentVersion)