fix(ui): preserve draft across prompt history

Stop resetting history navigation on input so editing recalled entries doesn't wipe the bottom draft. Allow ArrowDown navigation while in history and persist the session draft only for fresh prompts.
This commit is contained in:
Shantur Rathore
2026-02-11 13:52:02 +00:00
parent 2c24402742
commit 612e50808a
3 changed files with 12 additions and 6 deletions

View File

@@ -17,7 +17,6 @@ type PromptPickerOptions = {
prompt: Accessor<string>
setPrompt: (value: string) => void
resetHistoryNavigation?: () => void
getTextarea: () => HTMLTextAreaElement | null
instanceAgents: Accessor<Agent[]>
@@ -53,7 +52,6 @@ export function usePromptPicker(options: PromptPickerOptions): PromptPickerContr
const target = e.target as HTMLTextAreaElement
const value = target.value
options.setPrompt(value)
options.resetHistoryNavigation?.()
const cursorPos = target.selectionStart