[feat] Dock the message queue above the composer - #6414
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
bc743ce to
edaddd8
Compare
|
Regression testing still needs to be done |
b177bfa to
de7d086
Compare
edaddd8 to
90500f4
Compare
Replaces the count-pill popover with an inline collapsible card that both web and /m render, moving the component into @agenta/chat so mobile stops queueing messages with no visible list at all. The card follows the ElicitationDock/ConnectionDock contract — shared card, touch prop, thin host adapters — but sits ABOVE the gate docks and hides entirely while one is open: those are blocked runs wanting an answer, and a second card stacked above one buries the composer. Its header is pinned and only the body scrolls, so a twelve-deep queue takes the same room as a five-deep one. Adds editing. A row's pencil borrows the composer: the target's text goes in, the draft it displaces is stashed and handed back at either end of the session. The next send rewrites the message in place, keeping its FIFO position and merging attachments rather than replacing them. Routed through a separate commitEdit, not a branch inside submit — steer-on-denial and pending-run also call submit and would otherwise overwrite the row being edited. The queue drains on its own, so a target that leaves mid-edit queues the content as a new message instead of dropping it.
90500f4 to
07c9532
Compare
Context
Messages you type while a turn is streaming get held in a queue and released one at a time. On desktop that queue lived behind a count pill in the composer footer: you clicked it, a popover opened, and you could read or remove the held messages. On
/mthere was no queue UI at all. Mobile queued your messages silently, and the only hint was the composer placeholder changing to "type to queue a message".Two problems followed from that. The list nobody could see on mobile, and the fact that the renderer lived in
web/ossrather than in a package, so there was nothing for/mto mount.Changes
The queue is now a dock: a shared
QueuedMessagesDockin@agenta/chatthat both hosts render. It follows the same contract asElicitationDockandConnectionDock(shared card,touchprop, thin host adapters), and sits above the gate docks rather than below them. Those are runs blocked on an answer, so they stay nearest the composer, while this list drains on its own. It hides entirely while any of them is open, because a second card stacked above one buries the composer.The header is pinned and only the body scrolls, capped at five rows. A twelve-deep queue takes the same room as a five-deep one. New messages append at the tail, so the body follows the tail on growth. Without that, queueing past the cap looks like nothing happened.
Editing a held message
New behavior. A row's pencil borrows the composer: the target's text goes in, and the draft it displaces is stashed and handed back when the session ends, either way. The next send rewrites the message in place, keeping its FIFO position and merging attachments rather than replacing them (the composer only submits newly staged files, so replacing would delete the originals on every text-only edit).
This routes through a new
commitEdit, not a branch insidesubmit:submithas three callers in OSS. Putting the edit branch inside it would let a steer or a pending run silently overwrite whatever row the user had open.The queue drains on its own, so the edited message can leave mid-edit. Nothing is left to rewrite then, and the content becomes a new queued message rather than vanishing.
clearQueueis gone. Its only caller was the popover's "Clear all", which the dock does not have.Tests
useAgentChatQueue.test.ts: 14 passing, including the four new edit cases (rewrite in place keeps position and attachments, the stash returns on both cancel and commit and only once, a target that drained mid-edit appends a new slot, and a message edited down to nothing is dropped).Chat/QueuedMessagesDock: default, single, held, overflowing, editing, attachments, touch.tsc --noEmitclean across@agenta/chat,web/oss,web/mobile.pnpm lint-fixclean.opacity: 0to1, the collapse interpolating (125px of 164 andopacity: 0.76at 90ms), and dark mode.Reviewers may want to look at two things. The
queuedBySessionmap is module-level and page-session lived, so an edit survives a pane remount but not a reload, same as before. AndHeightCollapseis deliberately notmotion-safegated (its own docstring says so), so the body collapses for reduced-motion users too. Only the caret rotation is gated.What to QA
/m, where the queue list is new.Demo
Outstanding. I verified the component in Storybook and the state layer in unit tests, but I could not run the full app on this branch, so the captures a UI change should carry are not here yet.
Note on the base
This targets
feat/composer-attachment-cards, not a release branch. It builds on that lane's changes toAgentConversation.tsxand cannot land before it.