Repository navigation
fix(native-chat): recall every sent prompt with Up/Down in the composer - #26044
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughNative chat composers now derive prompt recall from displayed conversation messages and command markers instead of local history state. Up and Down navigate prompts when the caret is at the corresponding visual edge and recall conditions are met. The change adds recall-position tracking, prompt extraction and stepping, and editor support for detecting visual edges. It removes history updates from send, command, and typed-insertion paths. Unit and end-to-end tests cover prompt ordering, navigation, draft changes, and caret behavior. Priority: ⬇️ Low Merge Risk: 🔵 Low · up to Up can recall a failed submission as though it were sent. Exclude unsent rows before merging, or explicitly accept this limited behavior. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
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 |
Recall read a list kept in the composer, so it forgot everything on reload or remount. It now reads the prompts the chat shows.
b044b32 to
ad241e9
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
cc31479c-4eb4-4903-886c-7ea380be14ac
📥 Commits
Reviewing files that changed from the base of the PR and between b044b3266fcf23cf4a2ec9951b63438f146dc504 and ad241e9.
📒 Files selected for processing (11)
src/renderer/src/components/native-chat/NativeChatComposer.tsxsrc/renderer/src/components/native-chat/NativeChatContextUsageRing.test.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.tsxsrc/renderer/src/components/native-chat/native-chat-composer-state.test.tssrc/renderer/src/components/native-chat/native-chat-composer-state.tssrc/renderer/src/components/native-chat/native-chat-composer-types.tssrc/renderer/src/components/native-chat/use-native-chat-composer-catalog.test.tsxsrc/renderer/src/components/native-chat/use-native-chat-composer-keydown.steer.test.tsxsrc/renderer/src/components/native-chat/use-native-chat-composer-keydown.test.tsxsrc/renderer/src/components/native-chat/use-native-chat-composer-keydown.tssrc/renderer/src/components/native-chat/use-native-chat-structured-composer-send.ts
💤 Files with no reviewable changes (3)
- src/renderer/src/components/native-chat/use-native-chat-structured-composer-send.ts
- src/renderer/src/components/native-chat/native-chat-composer-state.ts
- src/renderer/src/components/native-chat/native-chat-composer-state.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
It stayed where the last prompt had it, so Up skipped past a recalled multi-line prompt.
ELI5
Pressing Up in the chat composer now brings back every message you have sent in that chat, one at a time, like a terminal's history. Down walks forward again. Before, it only remembered what you had typed since the composer last appeared, so after a reload or a tab switch you usually got back just the message you had sent a moment ago.
What Changed
Before
After
Mechanism
Why
The old list lived in the composer's memory, which made it a second, weaker copy of something the chat already knows. Reading the conversation directly fixes the reload and remount cases with no new storage and nothing to keep in sync.
Alternatives considered:
Known narrowing: in structured chats, a command that only changes a setting (such as
/model) is not recorded in the conversation, so it is no longer recalled there./compactis recorded and still is.Visual Proof
CleanShot.2026-10-07.at.2.15.04.AM.mp4
Testing
native-chat-composer-prompt-recall.test.tsxdrives the real composer, editor and draft store: walking up and down, a recalled/modelnot handing the arrows to its picker, and an edited recall.native-chat-sent-prompt-history.test.tscovers which messages count as sent prompts (harness turns, subagent prompts and other agents' messages are skipped), back-to-back duplicates, command placement, and keeping position when a message id changes or a new message lands.use-native-chat-composer-keydown.test.tsxcovers modifier keys, attachments, and the first/last-line rule.use-native-chat-recall-position.test.tsxanduse-native-chat-picker-state.test.tsxcover recall ending and the picker staying closed.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Renderer-only. No wire, storage, or shared-type change, so SSH, mixed versions and mobile are unaffected; the web client picks it up through the shared renderer. Plain arrow keys only, no platform-specific modifier. The list is derived once per arrow press over the loaded messages.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)