diff --git a/packages/types/src/global-settings.ts b/packages/types/src/global-settings.ts index 79a09ff017..8dcca960f7 100644 --- a/packages/types/src/global-settings.ts +++ b/packages/types/src/global-settings.ts @@ -27,6 +27,7 @@ export const globalSettingsSchema = z.object({ lastShownAnnouncementId: z.string().optional(), customInstructions: z.string().optional(), taskHistory: z.array(historyItemSchema).optional(), + showAllWorkspacesTasks: z.boolean().optional(), condensingApiConfigId: z.string().optional(), customCondensingPrompt: z.string().optional(), diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 4a934e9fa0..8f2bbb46ba 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -1409,6 +1409,7 @@ export class ClineProvider profileThresholds, alwaysAllowFollowupQuestions, followupAutoApproveTimeoutMs, + showAllWorkspacesTasks, } = await this.getState() const telemetryKey = process.env.POSTHOG_API_KEY @@ -1522,6 +1523,7 @@ export class ClineProvider hasOpenedModeSelector: this.getGlobalState("hasOpenedModeSelector") ?? false, alwaysAllowFollowupQuestions: alwaysAllowFollowupQuestions ?? false, followupAutoApproveTimeoutMs: followupAutoApproveTimeoutMs ?? 60000, + showAllWorkspacesTasks: showAllWorkspacesTasks ?? false, } } @@ -1675,6 +1677,7 @@ export class ClineProvider codebaseIndexEmbedderModelId: "", }, profileThresholds: stateValues.profileThresholds ?? {}, + showAllWorkspacesTasks: stateValues.showAllWorkspacesTasks ?? false, } } diff --git a/src/core/webview/__tests__/ClineProvider.spec.ts b/src/core/webview/__tests__/ClineProvider.spec.ts index 19c9a7c9fc..83c1ccf41c 100644 --- a/src/core/webview/__tests__/ClineProvider.spec.ts +++ b/src/core/webview/__tests__/ClineProvider.spec.ts @@ -492,6 +492,7 @@ describe("ClineProvider", () => { version: "1.0.0", clineMessages: [], taskHistory: [], + showAllWorkspacesTasks: false, shouldShowAnnouncement: false, apiConfiguration: { apiProvider: "openrouter", diff --git a/src/core/webview/webviewMessageHandler.ts b/src/core/webview/webviewMessageHandler.ts index a6577fb2fb..7cd92897ef 100644 --- a/src/core/webview/webviewMessageHandler.ts +++ b/src/core/webview/webviewMessageHandler.ts @@ -2206,5 +2206,10 @@ export const webviewMessageHandler = async ( } break } + + case "showAllWorkspacesTasks": + await updateGlobalState("showAllWorkspacesTasks", message.bool ?? false) + await provider.postStateToWebview() + break } } diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 953c0c1070..25f31d7d1a 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -105,6 +105,7 @@ export interface ExtensionMessage { | "shareTaskSuccess" | "codeIndexSettingsSaved" | "codeIndexSecretStatus" + | "showAllWorkspacesTasks" text?: string payload?: any // Add a generic payload for now, can refine later action?: @@ -231,6 +232,7 @@ export type ExtensionState = Pick< version: string clineMessages: ClineMessage[] currentTaskItem?: HistoryItem + showAllWorkspacesTasks: boolean apiConfiguration?: ProviderSettings uriScheme?: string shouldShowAnnouncement: boolean diff --git a/src/shared/WebviewMessage.ts b/src/shared/WebviewMessage.ts index fa9fb67310..b3e2b2ac19 100644 --- a/src/shared/WebviewMessage.ts +++ b/src/shared/WebviewMessage.ts @@ -193,6 +193,7 @@ export interface WebviewMessage { | "checkRulesDirectoryResult" | "saveCodeIndexSettingsAtomic" | "requestCodeIndexSecretStatus" + | "showAllWorkspacesTasks" text?: string editedMessageContent?: string tab?: "settings" | "history" | "mcp" | "modes" | "chat" | "marketplace" | "account" diff --git a/webview-ui/src/components/history/HistoryView.tsx b/webview-ui/src/components/history/HistoryView.tsx index 2f156d0418..001fcddb25 100644 --- a/webview-ui/src/components/history/HistoryView.tsx +++ b/webview-ui/src/components/history/HistoryView.tsx @@ -1,4 +1,6 @@ import React, { memo, useState } from "react" + +import { vscode } from "@/utils/vscode" import { DeleteTaskDialog } from "./DeleteTaskDialog" import { BatchDeleteTaskDialog } from "./BatchDeleteTaskDialog" import { Virtuoso } from "react-virtuoso" @@ -35,8 +37,8 @@ const HistoryView = ({ onDone }: HistoryViewProps) => { sortOption, setSortOption, setLastNonRelevantSort, - showAllWorkspaces, - setShowAllWorkspaces, + showAllWorkspacesTasks, + setShowAllWorkspacesTasks, } = useTaskSearch() const { t } = useAppTranslation() @@ -129,12 +131,19 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {