feat(tui): press up to edit queued messages#656
Conversation
Pressing up with a message queued pops it back into the composer for editing, taking priority over history recall. While a message is queued the empty composer shows a hint placeholder. A second prompt queued during the same run now stacks under the first instead of replacing it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughChangesQueued follow-up messages now stack, can be restored into the composer with ArrowUp, and display an edit hint while pending. Tests cover restoration, draft merging, hint visibility, and stacking. Queued message editing
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Composer
participant Model
participant QueuedMessage
Composer->>Model: ArrowUp
Model->>QueuedMessage: popQueuedMessageForEdit
QueuedMessage->>Model: queued text plus draft
Model->>Composer: restore composer value and cursor
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
anandh8x
left a comment
There was a problem hiding this comment.
Real UX fix, tight scope. Up-arrow pop + hint + stacking-second-prompt all land cleanly; the silent overwrite was a data-loss class worth fixing. CI green, CodeRabbit approved, tests cover the new behavior. Approving.
Vasanthdev2004
left a comment
There was a problem hiding this comment.
I checked the up-arrow priority carefully: with a message queued, up pops it back into the composer (above any in-progress draft), and with an empty queue the existing history-recall still works. The new branch sits between composer cursor movement and history recall, and since queueing clears the composer there's no collision with either. The edit path routes through setComposerState/syncInputFromComposer, so multiline text and the draft are preserved correctly. Build and vet are clean, and the full internal/tui suite passes apart from the pre-existing TestAltScreenTranscriptScrollKeepsFooterFixed failure that also fails on main. The four new tests cover the pop, draft ordering, hint, and stacking.
One small thing before merge: the two new comments in queued_message.go attribute the behavior to a specific external project by name. Could you drop that and just describe the behavior on its own? Otherwise this looks good to me.
What
Pressing the up arrow while a message is queued pops it back into the composer for editing, instead of navigating input history. While a message is queued, the empty composer shows a placeholder hint: "Press up to edit queued messages".
Why
Once a prompt was queued during an active run there was no way to take it back for editing; the only options were letting it send or discarding it with Esc. This mirrors the flow in other agent TUIs where up recalls the queued message.
Changes
Testing
Four new tests in queued_message_test.go cover the pop, queued-above-draft ordering, hint visibility, and stacking. Full internal/tui suite passes.
Summary by CodeRabbit