Add composer prompt history navigation with ArrowUp and ArrowDown#1157
Add composer prompt history navigation with ArrowUp and ArrowDown#1157jamesx0416 wants to merge 2 commits intopingdotgg:mainfrom
Conversation
- Recall prior user prompts in the composer when caret is on first/last visual line - Preserve draft text while navigating history and reset state on send/thread changes - Extract prompt history resolution/navigation utilities with coverage in new unit tests
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can disable sequence diagrams in the walkthrough.Disable the |
Add terminal-style prompt recall per thread using ArrowUp/ArrowDown. First ArrowUp captures the current draft; walking past the newest entry with ArrowDown restores it. History prefers the current thread and falls back to same-project threads when empty. Includes two interaction bugfixes from code review: - Non-collapsed selection and Shift+Arrow no longer trigger history (readComposerVisualLineState returns false for non-collapsed, and ChatView guards on !event.shiftKey) - ArrowUp at the oldest entry now clamps (handled: true) instead of leaking control back to the Lexical editor Port of upstream PR pingdotgg#1157 adapted to local architecture. Co-Authored-By: Claude Opus 4.6 <[email protected]>
What Changed
ArrowUpandArrowDownArrowDownback out of history restores the saved in-progress draft instead of dropping itWhy
Prompt iteration in the composer should behave like terminal history. The goal was to make recalling, editing, and resending earlier prompts fast and predictable without losing the current draft. The follow-up commit fixes the edge cases so history only triggers at the real visual top/bottom of the composer and does not wrap at the oldest entry.
UI Changes
No UI changes
Video
Screen.Recording.2026-03-17.at.7.02.44.pm.mp4
Checklist