Skip to content

feat: AI input history navigation with up/down arrow keys#842

Draft
scriptease wants to merge 1 commit intoRunMaestro:rcfrom
scriptease:feat/up-arrow
Draft

feat: AI input history navigation with up/down arrow keys#842
scriptease wants to merge 1 commit intoRunMaestro:rcfrom
scriptease:feat/up-arrow

Conversation

@scriptease
Copy link
Copy Markdown

Summary

  • Pressing at the beginning of the AI chat input cycles through previously sent messages (oldest → newest)
  • Pressing walks forward through history, restoring your unsaved draft when you reach the end
  • Works in both the main AI input and Group Chat input

Behavior

  • History is per-session and in-memory (cleared on app restart)
  • Capped at 100 entries; consecutive duplicate messages are skipped
  • The current unsaved draft is preserved when navigation starts and restored on the way back down
  • Terminal mode is unaffected — it retains its existing command history modal

Implementation

New useAIMessageHistory hook manages per-session history state via Map refs (no React state, no re-renders). Hooked into useInputProcessing to record messages at send time (AI mode only — wizard, queue, and direct send paths). Navigation is handled in useInputKeyDown for the main input and inline refs in GroupChatInput for group chat.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 31ed8eb6-ae4a-43e9-b85d-6de7ce0e3565

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Press ArrowUp at position 0 in the AI chat input to cycle through previously
sent messages; ArrowDown walks forward, restoring the saved draft at the end.
Per-session, in-memory only (max 100 entries, no consecutive duplicates).
Same behavior wired into GroupChatInput.

Co-Authored-By: Claude Sonnet 4.6 <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.

2 participants