#1777: minimal implementation.#1848
Conversation
|
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)
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 |
|
closed previous PR due to merge conflicts. #1778 |
|
Oh, I've wanted this for so long , I was planning to put up a PR for it. Any help or testing needed? I can test on different OS. |
|
@Marve10s Thanks, that would be helpful! |
ApprovabilityVerdict: Needs human review This PR adds a new user-facing feature (terminal-style input history navigation) and has an unresolved high-severity review comment identifying a potential bug where the wrong message could be sent due to stale promptRef state. Both the new feature nature and the substantive bug concern warrant human review. You can customize Macroscope's approvability policy. Learn more. |
| if (key === 'ArrowUp' && inputHistoryRef.current.length > 0 && !promptRef.current.includes('\n')) { | ||
| if (historyIdxRef.current === -1) historyDraftRef.current = promptRef.current; | ||
| historyIdxRef.current = Math.min(historyIdxRef.current + 1, inputHistoryRef.current.length - 1); | ||
| setPrompt(inputHistoryRef.current[historyIdxRef.current]!); |
There was a problem hiding this comment.
History navigation doesn't synchronously update promptRef
High Severity
The composer's new history navigation updates the prompt state but not promptRef.current synchronously. This leaves promptRef.current stale, causing onSend to potentially send the wrong message and the ArrowUp multiline guard to misbehave.
Reviewed by Cursor Bugbot for commit 375ee94. Configure here.
There was a problem hiding this comment.
this does not happen during testing.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 069183c. Configure here.
| description: toastCopy.description, | ||
| }); | ||
| } | ||
| if (promptForSend.trim()) { inputHistoryRef.current.unshift(promptForSend.trim()); historyIdxRef.current = -1; } |
There was a problem hiding this comment.
History index not reset on early-return send paths
Low Severity
The plan-follow-up path and standalone-slash-command path both clear the prompt and return early from onSend, never reaching the historyIdxRef.current = -1 reset at line 3192. If the user was navigating history before triggering either path, historyIdxRef remains positive, so a subsequent ArrowDown would unexpectedly restore a history entry instead of behaving as normal cursor movement.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 069183c. Configure here.
There was a problem hiding this comment.
cant produce any buggy interactions with slash commands.
|
This is a great feature, would save me some time |


closes #1777
What Changed
Pressing
↑/↓in the composer input navigates through previously sent user messages, shell-style. The live draft is saved when you first press↑and restored when you↓back past the most recent message. History index resets on send.Why
Retyping or slightly tweaking a previous prompt is a common workflow. Every terminal does this — it's muscle memory. The composer already had the full message history available; this just wires
↑/↓intoonComposerCommandKey(where Enter/Tab/menu-navigation already live) using two refs. No new files, no new state, no re-renders.UI Changes
No visual changes — interaction only. Navigation only activates when no autocomplete menu is open, so
@-mention and/-command menus are unaffected.Checklist
2026-04-09.13-28-24.mp4
Note
Low Risk
Small, UI-only keyboard handling change scoped to the chat composer; main risk is unexpected interaction with existing arrow-key behavior in edge cases (cursor position/newlines/menu state).
Overview
Adds shell-style input history navigation to the chat composer in
ChatView.tsx.The composer now builds a per-thread history of previously sent user prompts, saves the current draft when entering history, and lets
ArrowUp/ArrowDowncycle through entries (single-line only). On send, the trimmed prompt is prepended to history and the history index resets.Reviewed by Cursor Bugbot for commit 069183c. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add ArrowUp/ArrowDown input history navigation to the chat composer
Macroscope summarized 069183c.