Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
Add task sidebar auto-open setting (#2314)
legs00b5c3e1b3b0
diff --git a/apps/desktop/src/clientPersistence.test.ts b/apps/desktop/src/clientPersistence.test.tsindex 19f9b09f9..192d7ac10 100644--- a/apps/desktop/src/clientPersistence.test.ts+++ b/apps/desktop/src/clientPersistence.test.ts@@ -49,6 +49,7 @@ function makeSecretStorage(available: boolean): DesktopSecretStorage {}const clientSettings: ClientSettings = {+ autoOpenPlanSidebar: false,confirmThreadArchive: true,confirmThreadDelete: false,diffWordWrap: true,diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsxindex 3a7192270..c27afda97 100644--- a/apps/web/src/components/ChatView.tsx+++ b/apps/web/src/components/ChatView.tsx@@ -616,6 +616,7 @@ export default function ChatView(props: ChatViewProps) {(store) => store.setStickyModelSelection,);const timestampFormat = settings.timestampFormat;+ const autoOpenPlanSidebar = settings.autoOpenPlanSidebar;const navigate = useNavigate();const rawSearch = useSearch({strict: false,@@ -2010,6 +2011,7 @@ export default function ChatView(props: ChatViewProps) {planSidebarOpenOnNextThreadRef.current = false;setPlanSidebarOpen(true);} else {+ planSidebarOpenOnNextThreadRef.current = false;setPlanSidebarOpen(false);}planSidebarDismissedForTurnRef.current = null;@@ -2018,6 +2020,7 @@ export default function ChatView(props: ChatViewProps) {// Auto-open the plan sidebar when plan/todo steps arrive for the current turn.// Don't auto-open for plans carried over from a previous turn (the user can open manually).useEffect(() => {+ if (!autoOpenPlanSidebar) return;if (!activePlan) return;if (planSidebarOpen) return;const latestTurnId = activeLatestTurn?.turnId ?? null;@@ -2025,7 +2028,13 @@ export default function ChatView(props: ChatViewProps) {const turnKey = activePlan.turnId ?? sidebarProposedPlan?.turnId ?? "__dismissed__";if (planSidebarDismissedForTurnRef.current === turnKey) return;setPlanSidebarOpen(true);- }, [activePlan, activeLatestTurn?.turnId, planSidebarOpen, sidebarProposedPlan?.turnId]);+ }, [+ activePlan,+ activeLatestTurn?.turnId,+ autoOpenPlanSidebar,+ planSidebarOpen,+ sidebarProposedPlan?.turnId,+ ]);useEffect(() => {setIsRevertingCheckpoint(false);@@ -2950,7 +2959,7 @@ export default function ChatView(props: ChatViewProps) {// Optimistically open the plan sidebar when implementing (not refining).// "default" mode here means the agent is executing the plan, which produces// step-tracking activities that the sidebar will display.- if (nextInteractionMode === "default") {+ if (nextInteractionMode === "default" && autoOpenPlanSidebar) {planSidebarDismissedForTurnRef.current = null;setPlanSidebarOpen(true);}@@ -2979,6 +2988,7 @@ export default function ChatView(props: ChatViewProps) {runtimeMode,setComposerDraftInteractionMode,setThreadError,+ autoOpenPlanSidebar,environmentId,],);@@ -3071,8 +3081,8 @@ export default function ChatView(props: ChatViewProps) {return waitForStartedServerThread(scopeThreadRef(activeThread.environmentId, nextThreadId));}).then(() => {- // Signal that the plan sidebar should open on the new thread.- planSidebarOpenOnNextThreadRef.current = true;+ // Signal that the plan sidebar should open on the new thread when enabled.+ planSidebarOpenOnNextThreadRef.current = autoOpenPlanSidebar;return navigate({to: "/$environmentId/$threadId",params: {@@ -3113,6 +3123,7 @@ export default function ChatView(props: ChatViewProps) {navigate,resetLocalDispatch,runtimeMode,+ autoOpenPlanSidebar,environmentId,]);diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsxindex 1e8cffd0c..29d09a5cd 100644--- a/apps/web/src/components/settings/SettingsPanels.tsx+++ b/apps/web/src/components/settings/SettingsPanels.tsx@@ -472,6 +472,9 @@ export function useSettingsRestore(onRestored?: () => void) {...(settings.diffWordWrap !== DEFAULT_UNIFIED_SETTINGS.diffWordWrap? ["Diff line wrapping"]: []),+ ...(settings.autoOpenPlanSidebar !== DEFAULT_UNIFIED_SETTINGS.autoOpenPlanSidebar+ ? ["Task sidebar"]+ : []),...(settings.enableAssistantStreaming !== DEFAULT_UNIFIED_SETTINGS.enableAssistantStreaming? ["Assistant output"]: []),@@ -493,6 +496,7 @@ export function useSettingsRestore(onRestored?: () => void) {[areProviderSettingsDirty,isGitWritingModelDirty,+ settings.autoOpenPlanSidebar,settings.confirmThreadArchive,settings.confirmThreadDelete,settings.addProjectBaseDirectory,@@ -945,6 +949,32 @@ export function GeneralSettingsPanel() {}/>+ <SettingsRow+ title="Task sidebar"+ description="Open the plan and task sidebar automatically when steps appear."+ resetAction={+ settings.autoOpenPlanSidebar !== DEFAULT_UNIFIED_SETTINGS.autoOpenPlanSidebar ? (+ <SettingResetButton+ label="task sidebar"+ onClick={() =>+ updateSettings({+ autoOpenPlanSidebar: DEFAULT_UNIFIED_SETTINGS.autoOpenPlanSidebar,+ })+ }+ />+ ) : null+ }+ control={+ <Switch+ checked={settings.autoOpenPlanSidebar}+ onCheckedChange={(checked) =>+ updateSettings({ autoOpenPlanSidebar: Boolean(checked) })+ }+ aria-label="Open the task sidebar automatically"+ />+ }+ />+<SettingsRowtitle="New threads"description="Pick the default workspace mode for newly created draft threads."diff --git a/apps/web/src/localApi.test.ts b/apps/web/src/localApi.test.tsindex f53122175..c361cbd78 100644--- a/apps/web/src/localApi.test.ts+++ b/apps/web/src/localApi.test.ts@@ -529,6 +529,7 @@ describe("wsApi", () => {it("reads and writes persistence through the desktop bridge when available", async () => {const clientSettings = {+ autoOpenPlanSidebar: false,confirmThreadArchive: true,confirmThreadDelete: false,diffWordWrap: true,@@ -587,6 +588,7 @@ describe("wsApi", () => {const { createLocalApi } = await import("./localApi");const api = createLocalApi(rpcClientMock as never);const clientSettings = {+ autoOpenPlanSidebar: false,confirmThreadArchive: true,confirmThreadDelete: false,diffWordWrap: true,diff --git a/packages/contracts/src/settings.ts b/packages/contracts/src/settings.tsindex 6301364f3..2b50957a7 100644--- a/packages/contracts/src/settings.ts+++ b/packages/contracts/src/settings.ts@@ -31,6 +31,7 @@ export type SidebarProjectGroupingMode = typeof SidebarProjectGroupingMode.Type;export const DEFAULT_SIDEBAR_PROJECT_GROUPING_MODE: SidebarProjectGroupingMode = "repository";export const ClientSettingsSchema = Schema.Struct({+ autoOpenPlanSidebar: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),confirmThreadArchive: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),confirmThreadDelete: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),diffWordWrap: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),@@ -243,6 +244,7 @@ export const ServerSettingsPatch = Schema.Struct({export type ServerSettingsPatch = typeof ServerSettingsPatch.Type;export const ClientSettingsPatch = Schema.Struct({+ autoOpenPlanSidebar: Schema.optionalKey(Schema.Boolean),confirmThreadArchive: Schema.optionalKey(Schema.Boolean),confirmThreadDelete: Schema.optionalKey(Schema.Boolean),diffWordWrap: Schema.optionalKey(Schema.Boolean),