From 6f300bce87bcc81c68882186a398beffd1b4b0f0 Mon Sep 17 00:00:00 2001 From: bobleer Date: Thu, 30 Jul 2026 00:43:25 +0800 Subject: [PATCH] fix(web): exclude worktree workspaces from recent workspaces list Linked worktree directories (non-main) were appearing in the recent workspaces list shown on the Welcome page and in the nav workspace switcher menu. These are temporary working directories and should not pollute the recent history. Filter them out at the data source level using the existing isLinkedWorktreeWorkspace helper, in both the startup state snapshot and the getRecentWorkspaces API call. --- src/web-ui/src/shared/types/global-state.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/web-ui/src/shared/types/global-state.ts b/src/web-ui/src/shared/types/global-state.ts index 9cc0b5a702..2774c94a70 100644 --- a/src/web-ui/src/shared/types/global-state.ts +++ b/src/web-ui/src/shared/types/global-state.ts @@ -393,7 +393,9 @@ function mapApplicationState(state: APIApplicationState): ApplicationState { function mapWorkspaceStartupStateSnapshot( snapshot: APIWorkspaceStartupStateSnapshot ): WorkspaceStartupState { - const recentWorkspaces = snapshot.recentWorkspaces.map(mapWorkspaceInfo); + const recentWorkspaces = snapshot.recentWorkspaces + .map(mapWorkspaceInfo) + .filter(ws => !isLinkedWorktreeWorkspace(ws)); return { cleanupRemovedCount: snapshot.cleanupRemovedCount, currentWorkspace: snapshot.currentWorkspace ? mapWorkspaceInfo(snapshot.currentWorkspace) : null, @@ -565,7 +567,9 @@ export function createGlobalStateAPI(): GlobalStateAPI { }, async getRecentWorkspaces(): Promise { - const workspaces = (await globalAPI.getRecentWorkspaces()).map(mapWorkspaceInfo); + const workspaces = (await globalAPI.getRecentWorkspaces()) + .map(mapWorkspaceInfo) + .filter(ws => !isLinkedWorktreeWorkspace(ws)); logger.debug('getRecentWorkspaces returned', summarizeWorkspacesForLog(workspaces)); return workspaces; },