File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
src/browser/components/ChatInput Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 11import type { DraftWorkspaceSettings } from "@/browser/hooks/useDraftWorkspaceSettings" ;
2- import { getModeKey , getProjectScopeId , getThinkingLevelKey } from "@/common/constants/storage" ;
2+ import {
3+ getInputKey ,
4+ getModeKey ,
5+ getPendingScopeId ,
6+ getProjectScopeId ,
7+ getThinkingLevelKey ,
8+ } from "@/common/constants/storage" ;
39import type { SendMessageError } from "@/common/types/errors" ;
410import type { BranchListResult , IPCApi , SendMessageOptions } from "@/common/types/ipc" ;
511import type { RuntimeMode } from "@/common/types/runtime" ;
@@ -219,8 +225,10 @@ describe("useCreationWorkspace", () => {
219225
220226 const modeKey = getModeKey ( TEST_WORKSPACE_ID ) ;
221227 const thinkingKey = getThinkingLevelKey ( TEST_WORKSPACE_ID ) ;
228+ const pendingInputKey = getInputKey ( getPendingScopeId ( TEST_PROJECT_PATH ) ) ;
222229 expect ( updatePersistedStateCalls ) . toContainEqual ( [ modeKey , "plan" ] ) ;
223230 expect ( updatePersistedStateCalls ) . toContainEqual ( [ thinkingKey , "high" ] ) ;
231+ expect ( updatePersistedStateCalls ) . toContainEqual ( [ pendingInputKey , "" ] ) ;
224232 } ) ;
225233
226234 test ( "handleSend surfaces backend errors and resets state" , async ( ) => {
Original file line number Diff line number Diff line change @@ -7,7 +7,13 @@ import { parseRuntimeString } from "@/browser/utils/chatCommands";
77import { useDraftWorkspaceSettings } from "@/browser/hooks/useDraftWorkspaceSettings" ;
88import { readPersistedState , updatePersistedState } from "@/browser/hooks/usePersistedState" ;
99import { useSendMessageOptions } from "@/browser/hooks/useSendMessageOptions" ;
10- import { getModeKey , getProjectScopeId , getThinkingLevelKey } from "@/common/constants/storage" ;
10+ import {
11+ getInputKey ,
12+ getModeKey ,
13+ getPendingScopeId ,
14+ getProjectScopeId ,
15+ getThinkingLevelKey ,
16+ } from "@/common/constants/storage" ;
1117import type { Toast } from "@/browser/components/ChatInputToast" ;
1218import { createErrorToast } from "@/browser/components/ChatInputToasts" ;
1319
@@ -119,6 +125,10 @@ export function useCreationWorkspace({
119125 // Check if this is a workspace creation result (has metadata field)
120126 if ( "metadata" in result && result . metadata ) {
121127 syncCreationPreferences ( projectPath , result . metadata . id ) ;
128+ if ( projectPath ) {
129+ const pendingInputKey = getInputKey ( getPendingScopeId ( projectPath ) ) ;
130+ updatePersistedState ( pendingInputKey , "" ) ;
131+ }
122132 // Settings are already persisted via useDraftWorkspaceSettings
123133 // Notify parent to switch workspace (clears input via parent unmount)
124134 onWorkspaceCreated ( result . metadata ) ;
You can’t perform that action at this time.
0 commit comments