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.
feat(web): remove Build/Plan toggle from the composer (#5551)
Theo Browne48aa875c0e6f
diff --git a/apps/desktop/src/settings/DesktopClientSettings.test.ts b/apps/desktop/src/settings/DesktopClientSettings.test.tsindex 26c3127de..c1cb8588b 100644--- a/apps/desktop/src/settings/DesktopClientSettings.test.ts+++ b/apps/desktop/src/settings/DesktopClientSettings.test.ts@@ -29,6 +29,7 @@ const clientSettings: ClientSettings = {fontSizeTerminal: 12,fontSmoothing: true,glassOpacity: 80,+ planModeEnabled: false,providerModelPreferences: {},sidebarAutoSettleAfterDays: 3,sidebarProjectGroupingMode: "repository_path",diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsxindex a4c9bcc7c..f0e25e644 100644--- a/apps/web/src/components/ChatView.tsx+++ b/apps/web/src/components/ChatView.tsx@@ -1481,8 +1481,13 @@ function ChatViewContent(props: ChatViewProps) {? (localServerError ?? activeServerThread?.session?.lastError ?? null): localDraftError;const runtimeMode = composerRuntimeMode ?? activeThread?.runtimeMode ?? DEFAULT_RUNTIME_MODE;- const interactionMode =- composerInteractionMode ?? activeThread?.interactionMode ?? DEFAULT_INTERACTION_MODE;+ // Plan mode is legacy (Settings → Beta). With the flag off the effective+ // mode is forced to "default" — even for threads with a stored plan mode —+ // so nobody is trapped in plan mode while its toggle is hidden. The next+ // send persists "default" back to the thread.+ const interactionMode = settings.planModeEnabled+ ? (composerInteractionMode ?? activeThread?.interactionMode ?? DEFAULT_INTERACTION_MODE)+ : DEFAULT_INTERACTION_MODE;const isLocalDraftThread = !isServerThread && localDraftThread !== undefined;const canCheckoutPullRequestIntoThread = isLocalDraftThread;const activeThreadId = activeThread?.id ?? null;@@ -4811,7 +4816,10 @@ function ChatViewContent(props: ChatViewProps) {});return;}+ // Legacy plan mode: /plan and /default only act when the beta flag is on;+ // otherwise they send as plain text like any other message.const standaloneSlashCommand =+ settings.planModeEnabled &&composerImages.length === 0 &&sendableComposerTerminalContexts.length === 0 &&composerElementContexts.length === 0 &&diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsxindex 6f3a6ec22..795cb9102 100644--- a/apps/web/src/components/chat/ChatComposer.tsx+++ b/apps/web/src/components/chat/ChatComposer.tsx@@ -875,14 +875,16 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)const selectedPromptEffort = composerProviderState.promptEffort;const selectedModelOptionsForDispatch = composerProviderState.modelOptionsForDispatch;+ // Plan mode is a legacy feature behind Settings → Beta. With the flag off,+ // ChatView forces the effective mode to "default", so hiding the toggle+ // can't trap anyone in plan mode.+ const planModeUiEnabled = settings.planModeEnabled;const composerProviderControls = useMemo(() => ({- showInteractionModeToggle: getProviderInteractionModeToggle(- providerStatuses,- selectedProvider,- ),+ showInteractionModeToggle:+ planModeUiEnabled && getProviderInteractionModeToggle(providerStatuses, selectedProvider),}),- [providerStatuses, selectedProvider],+ [planModeUiEnabled, providerStatuses, selectedProvider],);const selectedModelSelection = useMemo<ModelSelection>(() => createModelSelection(selectedInstanceId, selectedModel, selectedModelOptionsForDispatch),@@ -1043,20 +1045,24 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)label: "/model",description: "Switch response model for this thread",},- {- id: "slash:plan",- type: "slash-command",- command: "plan",- label: "/plan",- description: "Switch this thread into plan mode",- },- {- id: "slash:default",- type: "slash-command",- command: "default",- label: "/default",- description: "Switch this thread back to normal build mode",- },+ ...(planModeUiEnabled+ ? ([+ {+ id: "slash:plan",+ type: "slash-command",+ command: "plan",+ label: "/plan",+ description: "Switch this thread into plan mode",+ },+ {+ id: "slash:default",+ type: "slash-command",+ command: "default",+ label: "/default",+ description: "Switch this thread back to normal build mode",+ },+ ] as const)+ : []),] satisfies ReadonlyArray<Extract<ComposerCommandItem, { type: "slash-command" }>>;const providerSlashCommandItems = (selectedProviderStatus?.slashCommands ?? []).map((command) => ({@@ -1091,7 +1097,13 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps));}return [];- }, [composerTrigger, selectedProvider, selectedProviderStatus, workspaceEntries.entries]);+ }, [+ composerTrigger,+ planModeUiEnabled,+ selectedProvider,+ selectedProviderStatus,+ workspaceEntries.entries,+ ]);const composerMenuOpen = Boolean(composerTrigger);const composerMenuSearchKey = composerTrigger@@ -1857,6 +1869,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)event: KeyboardEvent,) => {if (key === "Tab" && event.shiftKey) {+ if (!planModeUiEnabled) return false;toggleInteractionMode();return true;}diff --git a/apps/web/src/components/settings/BetaSettingsPanel.tsx b/apps/web/src/components/settings/BetaSettingsPanel.tsxindex 740d3048f..4b96fb153 100644--- a/apps/web/src/components/settings/BetaSettingsPanel.tsx+++ b/apps/web/src/components/settings/BetaSettingsPanel.tsx@@ -60,6 +60,7 @@ export function BetaSettingsPanel() {const sidebarAutoSettleAfterDays = useClientSettings((settings) => settings.sidebarAutoSettleAfterDays,);+ const planModeEnabled = useClientSettings((settings) => settings.planModeEnabled);const updateSettings = useUpdateClientSettings();return (@@ -114,6 +115,17 @@ export function BetaSettingsPanel() {) : null}</>) : null}+ <SettingsRow+ {...searchableSetting("restore-plan-mode")}+ description="Legacy feature. Brings back the Build/Plan toggle in the composer along with the /plan and /default commands and the Shift+Tab shortcut. While off, every thread runs in build mode."+ control={+ <Switch+ checked={planModeEnabled}+ onCheckedChange={(checked) => updateSettings({ planModeEnabled: Boolean(checked) })}+ aria-label="Restore plan mode (legacy)"+ />+ }+ /></SettingsSection></SettingsPageContainer>);diff --git a/apps/web/src/components/settings/settingsSearch.ts b/apps/web/src/components/settings/settingsSearch.tsindex 69d16147a..3b3a8c220 100644--- a/apps/web/src/components/settings/settingsSearch.ts+++ b/apps/web/src/components/settings/settingsSearch.ts@@ -177,6 +177,11 @@ export const SETTINGS_SEARCH_ITEMS = [to: "/settings/beta",targetId: "sidebar-v2",},+ {+ id: "restore-plan-mode",+ title: "Restore plan mode (legacy)",+ to: "/settings/beta",+ },{id: "archive",title: "Archived threads",diff --git a/packages/contracts/src/settings.ts b/packages/contracts/src/settings.tsindex 7679ab6e4..4b477227f 100644--- a/packages/contracts/src/settings.ts+++ b/packages/contracts/src/settings.ts@@ -167,6 +167,10 @@ export const ClientSettingsSchema = Schema.Struct({modelOrder: Schema.Array(Schema.String).pipe(Schema.withDecodingDefault(Effect.succeed([]))),}),).pipe(Schema.withDecodingDefault(Effect.succeed({}))),+ // Legacy plan mode. The composer's Build/Plan toggle was removed from the+ // default UI; this beta flag restores it (plus the /plan and /default slash+ // commands) for users who still rely on the old workflow.+ planModeEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),sidebarAutoSettleAfterDays: Schema.NullOr(SidebarAutoSettleAfterDays).pipe(Schema.withDecodingDefault(Effect.succeed(DEFAULT_SIDEBAR_AUTO_SETTLE_AFTER_DAYS)),),@@ -781,6 +785,7 @@ export const ClientSettingsPatch = Schema.Struct({}),),),+ planModeEnabled: Schema.optionalKey(Schema.Boolean),sidebarAutoSettleAfterDays: Schema.optionalKey(Schema.NullOr(SidebarAutoSettleAfterDays)),sidebarProjectGroupingMode: Schema.optionalKey(SidebarProjectGroupingMode),sidebarProjectGroupingOverrides: Schema.optionalKey(