Skip to content

Chat: recall previous prompts with ArrowUp/ArrowDown - #227

Open
arsenmuk wants to merge 1 commit into
mainfrom
arsenmuk/prompt-history-arrow
Open

Chat: recall previous prompts with ArrowUp/ArrowDown#227
arsenmuk wants to merge 1 commit into
mainfrom
arsenmuk/prompt-history-arrow

Conversation

@arsenmuk

Copy link
Copy Markdown
Member

Shell-style prompt history in the chat composer.

  • ArrowUp recalls prompts already sent in the current chat (newest first, adjacent dupes dropped); ArrowDown walks back toward newest, then restores your in-progress draft.
  • Arrows are only hijacked when they wouldn't otherwise move the caret in multi-line text — Up on the first line, Down on the last — and never while text is selected, a modifier is held, or mid-IME composition (also closes a pre-existing Enter-during-composition gap).

Scope: frontend only — one file (web/src/components/Chat/ChatInput.tsx), +74/−1. Source is the in-memory conversation; no backend, API, or storage change. History is session-scoped by design; global cross-chat recall can follow as a small localStorage add-on.

Testing: npm run build (tsc + vite) passes; verified manually in the panel. Repo has no frontend test runner.

Shell-style history in the composer: ArrowUp walks back through prompts already sent in this chat; ArrowDown walks forward and restores the in-progress draft past the newest. Arrows are only hijacked when they wouldn't otherwise move the caret within multi-line text (Up on the first line, Down on the last), with no selection or modifier held, and never mid-IME-composition.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant