Skip to content

feat(prompt-input): recall earlier prompts with ArrowUp - #153

Merged
aayushbtw merged 6 commits into
ui-sdkfrom
feat/prompt-history
Nov 21, 2026
Merged

aayushbtw merged 6 commits into
ui-sdkfrom
feat/prompt-history

Conversation

@aayushbtw

Copy link
Copy Markdown
Owner

Why

UX audit item. ArrowUp in the composer brings back earlier prompts, like a terminal.

What changed

  • PromptInput keeps one createInputHistory per mount, and it's on by default. ArrowUp works on the first line or in an empty field. ArrowDown steps forward and ends at the draft. It stands aside while the Trigger Menu is open.
  • A prompt is recorded only when it was really sent, meaning the field cleared after submit. A refused submit isn't recorded.
  • Breaking: PromptInputTextarea and PromptInputCommandTextarea no longer take controller. A recalled prompt still reaches onValueChange.

Tradeoffs

On by default, because nothing recalls until you send something. Call event.preventDefault() in onKeyDown to opt out.

Verification

vpr check, vpr build and vpr test pass, with 7 new tests. In Chromium, I sent 2 prompts, then pressed ArrowUp twice and ArrowDown twice, and the field ended back at the draft.

@aayushbtw aayushbtw added the ui-sdk Base UI to ui-sdk migration label Nov 21, 2026
PromptInput now skips a submit while its PromptInputSubmit is disabled or not ready, and records the prompt at submit time when it goes through. Drops the clear-after-submit proxy, which a user's own Backspace could trip.
# Conflicts:
#	apps/site/content/components/prompt-input.md
#	packages/ui/registry.json
#	packages/ui/src/components/ai/prompt-input.tsx
@aayushbtw
aayushbtw merged commit 9e7aa49 into ui-sdk Nov 21, 2026
1 check passed
@aayushbtw
aayushbtw deleted the feat/prompt-history branch November 21, 2026 10:30
aayushbtw added a commit that referenced this pull request Nov 21, 2026
The tracker used status words outside its own legend. This switches them to merged, marks #153 merged, and fixes the intro paths.
aayushbtw added a commit that referenced this pull request Nov 21, 2026
* docs(ui-sdk): record the UX audit fixes

* docs(ui-sdk): use the legend's merged status

The tracker used status words outside its own legend. This switches them to merged, marks #153 merged, and fixes the intro paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui-sdk Base UI to ui-sdk migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant