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 { extractErrorMessage } from "./utils" ;
1218
1319interface UseCreationWorkspaceOptions {
@@ -118,6 +124,10 @@ export function useCreationWorkspace({
118124 // Check if this is a workspace creation result (has metadata field)
119125 if ( "metadata" in result && result . metadata ) {
120126 syncCreationPreferences ( projectPath , result . metadata . id ) ;
127+ if ( projectPath ) {
128+ const pendingInputKey = getInputKey ( getPendingScopeId ( projectPath ) ) ;
129+ updatePersistedState ( pendingInputKey , "" ) ;
130+ }
121131 // Settings are already persisted via useDraftWorkspaceSettings
122132 // Notify parent to switch workspace (clears input via parent unmount)
123133 onWorkspaceCreated ( result . metadata ) ;
You can’t perform that action at this time.
0 commit comments