Stop auto focus of Cline window on Every update (#5117)

This commit is contained in:
Ara
2025-07-23 04:03:28 -07:00
committed by GitHub
parent e8aaa61494
commit 23fea0e16b
+9 -6
View File
@@ -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<string>("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<string>("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)