Skip to content

[feat] Dock the message queue above the composer - #6414

Merged
ashrafchowdury merged 2 commits into
release/v0.114.5from
feat/queued-messages-dock
Sep 1, 2026
Merged

[feat] Dock the message queue above the composer#6414
ashrafchowdury merged 2 commits into
release/v0.114.5from
feat/queued-messages-dock

Conversation

@ashrafchowdury

Copy link
Copy Markdown
Contributor

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 /m there 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/oss rather than in a package, so there was nothing for /m to mount.

Changes

The queue is now a dock: a shared QueuedMessagesDock in @agenta/chat that both hosts render. It follows the same contract as ElicitationDock and ConnectionDock (shared card, touch prop, 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 inside submit:

submit()      <- composer, steer-on-denial, pending "Run in playground"
commitEdit()  <- composer only, when editingId is set

submit has 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.

clearQueue is 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).
  • New Storybook stories under Chat/QueuedMessagesDock: default, single, held, overflowing, editing, attachments, touch.
  • tsc --noEmit clean across @agenta/chat, web/oss, web/mobile. pnpm lint-fix clean.
  • Verified in Storybook against the source design: 32px rows at 13px text, the scroll cap holding at five rows with twelve queued, hover moving the row actions from opacity: 0 to 1, the collapse interpolating (125px of 164 and opacity: 0.76 at 90ms), and dark mode.

Reviewers may want to look at two things. The queuedBySession map is module-level and page-session lived, so an edit survives a pane remount but not a reload, same as before. And HeightCollapse is deliberately not motion-safe gated (its own docstring says so), so the body collapses for reduced-motion users too. Only the caret rotation is gated.

What to QA

  • Send a message, then type two more while it streams. The dock appears above the composer listing both. Hover a row: pencil and trash fade in.
  • Click the pencil. The row's text lands in the composer and the row is marked with a Cancel. Edit the text and press Enter. The row updates in place and keeps its position. Nothing is sent.
  • Type something first, then click a pencil. Your typing comes back in the composer after you commit or cancel the edit.
  • Queue eight messages. The card stops growing at five rows and the body scrolls, with the newest visible at the bottom.
  • Trigger a tool approval while messages are queued. The queue card disappears and the approval dock takes its place. It comes back when you answer.
  • Same passes on /m, where the queue list is new.
  • Regression: with an empty queue, sending a message still scrolls the transcript to the bottom and clears any prior "stopped" marker.

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 to AgentConversation.tsx and cannot land before it.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agenta-documentation Ready Ready Preview Sep 1, 2026 6:19pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • release/.*

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: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: b5ce2c23-6329-48a3-a7ec-d817bbbd84fe

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

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.

@ashrafchowdury

Copy link
Copy Markdown
Contributor Author

Regression testing still needs to be done

@ashrafchowdury
ashrafchowdury force-pushed the feat/composer-attachment-cards branch 2 times, most recently from b177bfa to de7d086 Compare September 1, 2026 14:51
@ashrafchowdury
ashrafchowdury force-pushed the feat/queued-messages-dock branch from edaddd8 to 90500f4 Compare September 1, 2026 15:14
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.
@ashrafchowdury
ashrafchowdury force-pushed the feat/queued-messages-dock branch from 90500f4 to 07c9532 Compare September 1, 2026 18:17
@ashrafchowdury
ashrafchowdury changed the base branch from feat/composer-attachment-cards to release/v0.114.5 September 1, 2026 18:57
@ashrafchowdury
ashrafchowdury merged commit 62f16d8 into release/v0.114.5 Sep 1, 2026
18 of 19 checks passed
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.

1 participant