Back

While an agent works through a long run, you often know your next message before it finishes. The message queue is where that message waits: a small card on top of the composer that holds what you typed, in order, and sends it when the agent is ready.

I built it for the AI chat at Octolane over two pull requests, then rebuilt it as a standalone component in my playground. It took six versions. Each step below is one of them. Red handwriting marks what the next step fixes, and blue marks what changed. Between the steps, close-ups show the details at actual size.

The queue today, in my playground: messages typed while the agent works, reordered and edited from the keyboard, removed, and sent from the ⋯ menu.

Step 0. Waiting in the thread

Before the queue, the composer refused to send while a reply streamed. The first version let you send anyway. The message waited at the end of the thread as a dimmed bubble, with Interrupt and ×.

When the reply ended, every waiting bubble went out together. Interrupt stopped the reply, kept what it had written, and sent them at once.

Go through every open deal in my pipeline and write a health check for each one

Flagged 11 stale deals · Thinking 12s

Flag anything over $2,000 firstInterruptThen group the rest by stageInterrupt

Ask about a deal, draft a follow-up, or recap a meeting…

The first queue, from pull request 8093. A message sent mid-reply waits at the end of the thread, dimmed, with Interrupt and ×.

Up close. The send button, mid-reply

Before

Flag anything over $2,000 first

Text in the field, and still Stop
After
Send after this reply↵

Flag anything over $2,000 first

Text: send. Empty: Stop
The send button while a reply streams. It used to stay Stop, and whatever you typed went nowhere. Now it is Stop only when the field is empty.

Up close. Three messages, one turn

Waiting
Flag anything over $2,000 firstThen group the rest by stageInclude the deal owner
Sent
Flag anything over $2,000 first

Then group the rest by stage

Include the deal owner
How the first queue sent. The waiting messages were joined with a blank line into one user message, and one reply answered all of them.

Step 1. A card above the composer

I moved the waiting messages out of the thread and into a card 8px above the composer, where you type them. The header counts them in a sentence, 3 queued messages. Its chevron collapses the card and its × clears it.

The card sends one message per turn, in order, so each one gets its own reply. I took Send now out for this version, so nothing could jump the line.

Thinking 27s · 30k tokens

3 queued messages
Flag anything over $2,000 first
Then group the rest by stage
Include the deal owner

Ask about a deal, draft a follow-up, or recap a meeting…

The queue card, 8px above the composer. It counts its messages in a sentence and sends them one per turn, in order.

Up close. One per turn

3 queued messages
Flag anything over $2,000 first
Then group the rest by stage
Include the deal owner
reply ends, “Flag anything over $2,000 first” goes out ↓
2 queued messages
Then group the rest by stage
Include the deal owner
reply ends, “Then group the rest by stage” goes out ↓
1 queued message
Include the deal owner
One message per turn. Each time a reply ends, the head of the card goes out on its own and gets its own reply.

Up close. Collapsed

3 queued messages
Flag anything over $2,000 first
Then group the rest by stage
Include the deal owner

Ask about a deal, draft a follow-up, or recap a meeting…

Click the count to close the list
The header collapses the card to one line. Clicking the count turns the chevron −90° and closes the list over 150ms; clicking again opens it.

Step 2. Room for eight

A long run collects a long queue. The list stops at 160px, five rows, and scrolls past that with its scrollbar hidden. Every message takes one line and ends in an ellipsis.

The edge fades over 24px where rows are scrolled away, from six messages up, and only on that edge.

8 queued messages
Flag anything over $2,000 first
Then group the rest by stage
Include the deal owner
And the close date
Suggest a first line for the outreach to each of them, referencing their most recent funding round, hiring news or product launch
Skip Northwind, it's a $0 deal
Keep each email under 80 words
Sign them from me

Ask about a deal, draft a follow-up, or recap a meeting…

Eight messages. The list stops at 160px and scrolls, every message is one line, and the bottom edge fades because rows are hidden behind it.

Up close. Nested corners

Before
3 queued messages
Flag anything over $2,000 first
Then group the rest by stage
Include the deal owner
8 inside 18: the gap swells at the corners
After
3 queued messages
Flag anything over $2,000 first
Then group the rest by stage
Include the deal owner
18 − 6 = 12: an even 6 all round
The last row's bottom corners. The panel is 18 and the list sits 6 inside it, so the row takes 18 − 6 = 12, and the gap round the corner stays 6.

Up close. When to fade

Before
3 queued messages
Flag anything over $2,000 first
Then group the rest by stage
Include the deal owner
Faded, with nothing behind it
After
3 queued messages
Flag anything over $2,000 first
Then group the rest by stage
Include the deal owner
Every row fits, so no fade
The scroll fade. The first one ran on every list, so a short queue's last row looked disabled. Now it runs from six messages, on an edge with rows behind it.

Step 3. Actions on each row

Hovering a row tints it and shows Edit and Remove. On touch they are always visible. Each control is a 20px box, and the boxes sit flush.

Edit loads the message into the composer. The row says Editing, the other rows lock, and the send button becomes Update queued message. Nothing is sent while you edit.

Hover
3 queued messages
Flag anything over $2,000 first
Then group the rest by stage
Include the deal owner
Editing
3 queued messages
Flag anything over $2,000 firstEditing
Then group the rest by stage
Include the deal owner

Flag anything over $2,000 first

Hover shows a row's actions, Edit and Remove. Editing loads the message into the composer, marks the row, and the send button saves it in place.

Up close. Hover that snaps

Before
4 queued messages
Flag anything over $2,000 first
Then group the rest by stage
Include the deal owner
And the close date
A trail of half-lit rows
After
4 queued messages
Flag anything over $2,000 first
Then group the rest by stage
Include the deal owner
And the close date
One row lit
The pointer sweeping down three rows. When the fill faded out over 150ms, the rows behind it stayed half lit; now it snaps, and only the row under the pointer is.

Up close. Text gives way

Rest
2 queued messages
Suggest a first line for the outreach to each of them, referencing their most recent funding round, hiring news or product launch
Keep each email under 80 words
Hover
2 queued messages
Suggest a first line for the outreach to each of them, referencing their most recent funding round, hiring news or product launch
Keep each email under 80 words
A long message at rest and with its actions showing. The text gives way to the actions; the row never grows or wraps.

Step 4. Order, and a question

Rows reorder by dragging, or from the keyboard: Space lifts the focused row, the arrows move it, and Space drops it.

Send now came back with a new meaning. It adds the message to the running turn without stopping it, and the agent reads it at its next step. If the turn ends first, the message returns to the front of the queue.

When the agent asks a question, the queue waits. A typed reply is the answer and skips the queue, which resumes once the agent has replied to it.

Reorder
4 queued messages
Flag anything over $2,000 first
Skip Northwind, it's a $0 deal
Then group the rest by stage
Include the deal owner
A question is open

Which deal do you want to prioritise this week?

  1. 1 · Fabrikam ($1,680, Proposal)
  2. 2 · Contoso ($900, Proposal)
2 queued messages · Waiting for your answer
Include the deal ownerSend nowAnswer the question first
And the close date

Or reply directly…

Above, a row on the move: it keeps the hover fill and the rest dim to 45%. Below, the agent has asked a question, so the queue waits and Send now is off.

Up close. The keyboard

4 queued messages
Flag anything over $2,000 first
Then group the rest by stage
Include the deal owner
Skip Northwind, it's a $0 dealSend now

Ask AI Agent

The last row has focus

Pick a shortcut to play it. The keys light up as they are pressed. Focus never falls to the page: after a removal it moves to the next row, the previous one, or the composer.

Up close. A disabled icon

Before
2 queued messages · Waiting for your answer
Include the deal ownerSend now
And the close date
Label muted, icon not
After
2 queued messages · Waiting for your answer
Include the deal ownerSend now
And the close date
Both take currentColor
Send now, disabled while a question is open. The return-key icon had its stroke colour written into it, so it stayed dark when the label went grey.

Step 5. Where it is now

The last version lives in my playground as one stylesheet and a shared core, with React, Vue and Svelte ports on top. Every colour is a token. In dark mode the surface is warm, and every fill on it is translucent white.

A ⋯ menu on each row holds the other ways to send: in parallel, or in a new chat. Editing shows as a yellow badge in the composer. The send button is one 32px slot that swaps between mic, stop and send.

The ⋯ menu
3 queued messages
Flag anything over $2,000 firstSend nowSend and run in parallelSend in a new chatAlways send in chat
Then group the rest by stage
Include the deal owner
Editing
3 queued messages
Flag anything over $2,000 firstEditing
Then group the rest by stage
Include the deal owner

Flag anything over $2,000 first

Editing
The queue today. Each row has Send now, Edit, Remove and a ⋯ menu with the other ways to send. While a message is edited, a yellow badge in the composer says so.

Up close. An 11px padding

Before
Editing
12px padding: 13 on the left, 12 on the right
After
Editing
11px padding: 12 on both ends
The badge's left padding is 11, not 12. The E has a side bearing, so 11px of padding puts its ink 12px from the edge, the same as the × on the right.

Up close. One slot, three icons

empty: mic
100ms in
text: send
Mic, stop and send share one 32px slot. Typing swaps the icon over 200ms: the old one shrinks to 0.25 and blurs 4px as the new one grows in.

Before and after

One rule held from the first version to the last: a message you type while the agent works is never lost, and one you remove is never sent. Everything else moved.

Before

Flagged 11 stale deals · Thinking 12s

Flag anything over $2,000 firstInterrupt
Then group the rest by stageInterrupt
Include the deal ownerInterrupt

Ask about a deal, draft a follow-up, or recap a meeting…

After

Flagged 11 stale deals · Thinking 12s

3 queued messages
Flag anything over $2,000 firstSend now
Then group the rest by stage
Include the deal owner

Ask AI Agent

The same three follow-ups, sent while the agent works: in the first queue, and in the queue today.

Articles are only designed for light and dark, so the other color themes are off here.