@devries-cameron20 / t3code Mirror · read-only / commits / 00b5c3e1b3
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 25, 05:00 UTC

Add task sidebar auto-open setting (#2314)

legs committed Apr 23, 2026 at 18:59 UTC 00b5c3e1b3b06888282e5d5e0678a2e3a88eb607
5 files changed +50 -4
apps/desktop/src/clientPersistence.test.ts
+1
@@ -49,6 +49,7 @@ function makeSecretStorage(available: boolean): DesktopSecretStorage {
49 }
50
51 const clientSettings: ClientSettings = {
52 + autoOpenPlanSidebar: false,
53 confirmThreadArchive: true,
54 confirmThreadDelete: false,
55 diffWordWrap: true,
apps/web/src/components/ChatView.tsx
+15 -4
@@ -616,6 +616,7 @@ export default function ChatView(props: ChatViewProps) {
616 (store) => store.setStickyModelSelection,
617 );
618 const timestampFormat = settings.timestampFormat;
619 + const autoOpenPlanSidebar = settings.autoOpenPlanSidebar;
620 const navigate = useNavigate();
621 const rawSearch = useSearch({
622 strict: false,
@@ -2010,6 +2011,7 @@ export default function ChatView(props: ChatViewProps) {
2011 planSidebarOpenOnNextThreadRef.current = false;
2012 setPlanSidebarOpen(true);
2013 } else {
2014 + planSidebarOpenOnNextThreadRef.current = false;
2015 setPlanSidebarOpen(false);
2016 }
2017 planSidebarDismissedForTurnRef.current = null;
@@ -2018,6 +2020,7 @@ export default function ChatView(props: ChatViewProps) {
2020 // Auto-open the plan sidebar when plan/todo steps arrive for the current turn.
2021 // Don't auto-open for plans carried over from a previous turn (the user can open manually).
2022 useEffect(() => {
2023 + if (!autoOpenPlanSidebar) return;
2024 if (!activePlan) return;
2025 if (planSidebarOpen) return;
2026 const latestTurnId = activeLatestTurn?.turnId ?? null;
@@ -2025,7 +2028,13 @@ export default function ChatView(props: ChatViewProps) {
2028 const turnKey = activePlan.turnId ?? sidebarProposedPlan?.turnId ?? "__dismissed__";
2029 if (planSidebarDismissedForTurnRef.current === turnKey) return;
2030 setPlanSidebarOpen(true);
2028 - }, [activePlan, activeLatestTurn?.turnId, planSidebarOpen, sidebarProposedPlan?.turnId]);
2031 + }, [
2032 + activePlan,
2033 + activeLatestTurn?.turnId,
2034 + autoOpenPlanSidebar,
2035 + planSidebarOpen,
2036 + sidebarProposedPlan?.turnId,
2037 + ]);
2038
2039 useEffect(() => {
2040 setIsRevertingCheckpoint(false);
@@ -2950,7 +2959,7 @@ export default function ChatView(props: ChatViewProps) {
2959 // Optimistically open the plan sidebar when implementing (not refining).
2960 // "default" mode here means the agent is executing the plan, which produces
2961 // step-tracking activities that the sidebar will display.
2953 - if (nextInteractionMode === "default") {
2962 + if (nextInteractionMode === "default" && autoOpenPlanSidebar) {
2963 planSidebarDismissedForTurnRef.current = null;
2964 setPlanSidebarOpen(true);
2965 }
@@ -2979,6 +2988,7 @@ export default function ChatView(props: ChatViewProps) {
2988 runtimeMode,
2989 setComposerDraftInteractionMode,
2990 setThreadError,
2991 + autoOpenPlanSidebar,
2992 environmentId,
2993 ],
2994 );
@@ -3071,8 +3081,8 @@ export default function ChatView(props: ChatViewProps) {
3081 return waitForStartedServerThread(scopeThreadRef(activeThread.environmentId, nextThreadId));
3082 })
3083 .then(() => {
3074 - // Signal that the plan sidebar should open on the new thread.
3075 - planSidebarOpenOnNextThreadRef.current = true;
3084 + // Signal that the plan sidebar should open on the new thread when enabled.
3085 + planSidebarOpenOnNextThreadRef.current = autoOpenPlanSidebar;
3086 return navigate({
3087 to: "/$environmentId/$threadId",
3088 params: {
@@ -3113,6 +3123,7 @@ export default function ChatView(props: ChatViewProps) {
3123 navigate,
3124 resetLocalDispatch,
3125 runtimeMode,
3126 + autoOpenPlanSidebar,
3127 environmentId,
3128 ]);
3129
apps/web/src/components/settings/SettingsPanels.tsx
+30
@@ -472,6 +472,9 @@ export function useSettingsRestore(onRestored?: () => void) {
472 ...(settings.diffWordWrap !== DEFAULT_UNIFIED_SETTINGS.diffWordWrap
473 ? ["Diff line wrapping"]
474 : []),
475 + ...(settings.autoOpenPlanSidebar !== DEFAULT_UNIFIED_SETTINGS.autoOpenPlanSidebar
476 + ? ["Task sidebar"]
477 + : []),
478 ...(settings.enableAssistantStreaming !== DEFAULT_UNIFIED_SETTINGS.enableAssistantStreaming
479 ? ["Assistant output"]
480 : []),
@@ -493,6 +496,7 @@ export function useSettingsRestore(onRestored?: () => void) {
496 [
497 areProviderSettingsDirty,
498 isGitWritingModelDirty,
499 + settings.autoOpenPlanSidebar,
500 settings.confirmThreadArchive,
501 settings.confirmThreadDelete,
502 settings.addProjectBaseDirectory,
@@ -945,6 +949,32 @@ export function GeneralSettingsPanel() {
949 }
950 />
951
952 + <SettingsRow
953 + title="Task sidebar"
954 + description="Open the plan and task sidebar automatically when steps appear."
955 + resetAction={
956 + settings.autoOpenPlanSidebar !== DEFAULT_UNIFIED_SETTINGS.autoOpenPlanSidebar ? (
957 + <SettingResetButton
958 + label="task sidebar"
959 + onClick={() =>
960 + updateSettings({
961 + autoOpenPlanSidebar: DEFAULT_UNIFIED_SETTINGS.autoOpenPlanSidebar,
962 + })
963 + }
964 + />
965 + ) : null
966 + }
967 + control={
968 + <Switch
969 + checked={settings.autoOpenPlanSidebar}
970 + onCheckedChange={(checked) =>
971 + updateSettings({ autoOpenPlanSidebar: Boolean(checked) })
972 + }
973 + aria-label="Open the task sidebar automatically"
974 + />
975 + }
976 + />
977 +
978 <SettingsRow
979 title="New threads"
980 description="Pick the default workspace mode for newly created draft threads."
apps/web/src/localApi.test.ts
+2
@@ -529,6 +529,7 @@ describe("wsApi", () => {
529
530 it("reads and writes persistence through the desktop bridge when available", async () => {
531 const clientSettings = {
532 + autoOpenPlanSidebar: false,
533 confirmThreadArchive: true,
534 confirmThreadDelete: false,
535 diffWordWrap: true,
@@ -587,6 +588,7 @@ describe("wsApi", () => {
588 const { createLocalApi } = await import("./localApi");
589 const api = createLocalApi(rpcClientMock as never);
590 const clientSettings = {
591 + autoOpenPlanSidebar: false,
592 confirmThreadArchive: true,
593 confirmThreadDelete: false,
594 diffWordWrap: true,
packages/contracts/src/settings.ts
+2
@@ -31,6 +31,7 @@ export type SidebarProjectGroupingMode = typeof SidebarProjectGroupingMode.Type;
31 export const DEFAULT_SIDEBAR_PROJECT_GROUPING_MODE: SidebarProjectGroupingMode = "repository";
32
33 export const ClientSettingsSchema = Schema.Struct({
34 + autoOpenPlanSidebar: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
35 confirmThreadArchive: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
36 confirmThreadDelete: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
37 diffWordWrap: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
@@ -243,6 +244,7 @@ export const ServerSettingsPatch = Schema.Struct({
244 export type ServerSettingsPatch = typeof ServerSettingsPatch.Type;
245
246 export const ClientSettingsPatch = Schema.Struct({
247 + autoOpenPlanSidebar: Schema.optionalKey(Schema.Boolean),
248 confirmThreadArchive: Schema.optionalKey(Schema.Boolean),
249 confirmThreadDelete: Schema.optionalKey(Schema.Boolean),
250 diffWordWrap: Schema.optionalKey(Schema.Boolean),