Queue stack
Messages typed while the agent works wait above the composer: they send in order as turns end, and each can be sent now, edited, reordered or removed.
oxyn add queue-stackAgent is working · turn ends in a moment
Queued · 3
- 1Also bump the jsonwebtoken crate
- 2Then rerun the auth suite three times
- 3Open a draft PR when it passes
↵ queue
Dioxus
rsx! {
QueueStack {
items: queued,
max_rows: 3,
on_send: move |(text, now): (String, bool)| agent.send(text, now),
}
}Rendered from Rust at build time · goes live when visible
When to use
- The agent is working and the user has the next thought.
- They want to line it up without interrupting, nudge the current run, change their mind, or put a draft aside.
- The queue stack is the visible list of everything waiting to reach the agent, docked above the composer.
When not to use
- Send, stop, queue and steer in one control, in twelve styles: use Send control instead.
- Prompt composer with model picker, voice input, app connections and approval request: use Chat Composer instead.
- The model menu of an AI chat: use Model Picker instead.
Installation
Queue stack is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.
Terminal
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add queue-stackRust
use crate::oxyn::{QueueStack, COMPOSER_CSS};Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{QueueStack, COMPOSER_CSS};
Usage
Dioxus · rust
rsx! {
QueueStack {
items: queued,
max_rows: 3,
on_send: move |(text, now): (String, bool)| agent.send(text, now),
}
}Examples
Queue
Messages wait for the turn to end.
Agent is working · turn ends in a moment
Queued · 3
- 1Also bump the jsonwebtoken crate
- 2Then rerun the auth suite three times
- 3Open a draft PR when it passes
↵ queue
Code
rsx! {
QueueStack {
items: queued,
max_rows: 3,
on_send: move |(text, now): (String, bool)| agent.send(text, now),
}
}Collapsed
Long queues collapse.
Agent is working · turn ends in a moment
Queued · 5
- 1Also bump the jsonwebtoken crate
- 2Then rerun the auth suite three times
↵ queue
Code
rsx! {
QueueStack {
items: queued,
max_rows: 2,
on_send: move |(text, now): (String, bool)| agent.send(text, now),
}
}Paused
Queue paused.
Agent is working · turn ends in a moment
Queued · 3
- 1Also bump the jsonwebtoken crate
- 2Then rerun the auth suite three times
- 3Open a draft PR when it passes
↵ queue
Code
rsx! {
QueueStack {
items: queued,
paused: true,
max_rows: 3,
on_send: move |(text, now): (String, bool)| agent.send(text, now),
}
}Idle
Agent idle: the next item sends.
Agent is idle
Queued · 3
- 1Also bump the jsonwebtoken crate
- 2Then rerun the auth suite three times
- 3Open a draft PR when it passes
↵ send
Code
rsx! {
QueueStack {
items: queued,
max_rows: 3,
on_send: move |(text, now): (String, bool)| agent.send(text, now),
}
}API reference
QueueStack
| Prop | Type | Default | Description |
|---|---|---|---|
itemsrequired | Vec<String> | — | Queued texts. |
busy | bool | true | The agent is running (turns end every `turn_ms`). |
turn_ms | u64 | 6000 | Turn length (ms). |
paused | bool | Default::default() | Start paused. |
max_rows | usize | 3 | Collapse beyond this many rows (0 = never). |
on_send | EventHandler<(String, bool)> | — | An item was sent (`true` = interrupting now). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Each row: send now, edit, remove |
| Alt↑or↓ | Reorder a row |
| EnterorEscape | Save or cancel an edit |
Accessibility
- The stack is a list labelled “Queued messages”.
- Sending, removing and reordering are announced politely.
From the spec
- The stack is a
listlabelled "Queued messages, 3"; each chip is alistitemwith its position: "Message 1 of 3, up next: <first 80 chars>". - Labels per action: "Edit queued message", "Send now — stops the current run", "Steer the current run with this message", "Move up", "Move down", "Stash", "Remove queued message", "Undo remove".
- Live region (polite): "Message queued, 3 in queue", "Sending next message", "Queue paused because you stopped the run", "Steer note delivered", "Message removed. Undo available". Delivered items are announced once, not their full text.
- Keyboard reorder announces "Moved to position 2 of 3". Drag has a full keyboard path (Space to lift, arrows, Space to drop, Esc to cancel).
- Focus order: composer → (Shift+Tab) stack header → chips top-to-bottom in delivery order → each chip's actions. After remove, focus goes to the next chip (or the composer). After edit/save, focus returns to the chip.
- Contrast: paused chips at 70 % opacity must still meet 4.5:1 text contrast (adjust the token, not the rule); Up next badge uses text, not colour alone.
- Reduced motion: see timing table.
Motion & interaction
- Queue exit (chip arrives). On Enter-to-queue, the draft text lifts off the input baseline and the chip unfolds upward from the composer's top edge: height 0 → auto with the text landing on its baseline [R079]. Existing chips shift up together. The input clears in the same commit.
- Header count. "Queued 2 → 3" rolls the digit (odometer, OpenCode-style AnimatedNumber, note 08).
- Up next badge. When chip 1 changes, the badge slides from the old chip to the new one (shared element), it does not blink off/on.
- Hover/focus actions. Actions fade + slide in 4 px from the trailing edge; they are always visible on touch and in
queue-stack/minimal. - Edit. Text flies back down into the composer (reverse of the queue exit); the chip leaves a dashed ghost so its slot is kept [R083]; saving flies it back up into the ghost.
- Drag reorder. Lift: scale 1.02, shadow elevation +1, 1° tilt only in
expressive; others shift with a spring to open the gap; drop settles with no overshoot. Auto-scroll when within 24 px of the stack edge (in overflow scroll mode). - Steer. The chip turns into a ⤷ note; when the agent reaches the next tool boundary the note glides into the plan step or transcript row that consumed it [R080] and leaves an inline "↳ Steered" marker. If the plan component isn't mounted, it glides into the transcript.
- Send now. Header flashes "Stopping current run…"; the status strip drops "Interrupted" into the transcript (see composer-status-strip.md); then the chip delivers.
- Delivery. Up next chip slides down-and-into the transcript as the user bubble; the remaining chips settle down one slot. Read-receipt fade on the bubble until the agent's first event (note 08).
- Stash. Text shrinks into a tab at the composer's top-left with a count badge [R079] ("Stash 2"); the tab is not part of the delivery order. Clicking the tab unfolds the stashed list.
- Remove. Chip collapses to a 28 px "Removed · Undo" row, which collapses fully after 5 s.
- Overflow collapse. When n >
max_expanded(default 3), chips 2..n fold behind chip 1 as a stacked-card edge (2 px offsets, max 2 visible edges) plus "+k more". Expanding fans them up. - Two lanes. Left/top lane "You" (user messages and steer notes), right/bottom lane "Agent" (agent's own queued work items, read-only text, can be skipped or moved up if the adapter allows) [R084]. Lane headers carry their own counts.
Timing
| Transition | Duration | Easing / spring | Notes |
|---|---|---|---|
| Chip unfold upward (enter) | 200 ms + 40 ms stagger (cap 4) | ease.out | same numbers as send-control timing table |
| Other chips shift up | 200 ms | spring.snap | |
| Header count roll | 300 ms | ease.out (cubic-bezier(0.22,1,0.36,1)) | OpenCode's AnimatedNumber uses 560 ms; we use 300 ms for a 1-digit change (proposed) |
| Up next badge slide | 180 ms | spring.snap | shared element |
| Hover actions in | 120 ms, x +4 → 0 | ease.out | out 80 ms |
| Edit fly-down / fly-up | 200 ms | ease.in-out | ghost fades in 120 ms |
| Drag lift | 120 ms | ease.out | scale 1.02 |
| Gap open while dragging | 160 ms | spring.soft | |
| Drop settle | 140 ms | spring.snap (no overshoot) | |
| Steer glide to plan step | 320 ms | ease.in-out | path-arc, opacity 1 → 0 at the end |
| Delivery into transcript | ≤ 260 ms | ease.in | matches send-control's draft → bubble |
| Read-receipt fade 0.6 → 1 | 160 ms | ease.out | on agent's first event |
| Draining grace | 600 ms | linear ring | Esc holds |
| Stash shrink to tab | 220 ms | ease.in | tab count pops 1.0 → 1.15 → 1.0, 180 ms |
| Remove collapse / undo window | 160 ms / 5 s | ease.in | |
| Overflow fold / fan | 200 ms + 30 ms stagger | spring.soft | |
| Paused dim | 160 ms | ease.out | opacity 1 → 0.7 |
| Reduced motion | all moves become 0–80 ms opacity crossfades; no lift/tilt (drag shows an outline at the target index); steer and delivery simply fade out of the stack and in at their destination; counts change without rolling | — | — |
Responsive behaviour
- Rows truncate to one line; edit opens the full text.
Edge cases (spec)
- Long text. Chips clamp to 2 lines (1 line in
compact) with an end fade; full text on hover tooltip after 500 ms and in edit. Attachments show as a count chip ("📎 3"), never thumbnails. - Overflow.
max_expandeddefault 3; stack height capped at min(40 % of viewport, 240 px); beyond the cap the list scrolls inside with a top fade mask. Header always pinned. - Many items. Above 50 items the list virtualises; drag reorder still works with keyboard moves.
- Very fast agent. If the run ends < 600 ms after queueing, the chip may deliver before its enter animation ends: interrupt the enter and go straight to delivery (never queue the animations).
- Very slow agent / long runs. Queue may sit for hours: show "queued 2h ago" relative time on hover; steer notes older than the current step's start are flagged "may be stale".
- Steer with no tool boundary. Pure-streaming runs have no boundary; steer note waits until the turn ends, then becomes a message (label changes to "Will send next"). Apps whose adapter can't steer hide the Steer action (
can_steer = false). - Edit while it becomes Up next and the run ends. Editing locks that chip: draining skips to the next item or waits, never sends a half-edited message.
- Send now on an item with an open approval. Ask: "Stop and discard the pending approval?" — consequential, so a confirm (proposed).
- Error mid-queue. Failed chip stays in place with retry; later chips wait (order is preserved).
- Persistence. Stored per thread via the app's
QueueStore(drafts + order + kind + attachments refs). On restore the stack isPaused("Restored"); nothing is auto-sent after a reload or crash. Attachments whose upload expired show "Re-attach file". - Multiple windows / devices. Last writer wins per item id; a chip edited elsewhere shows "Changed on another device" and reloads its text.
- RTL. Actions mirror to the leading edge; drag handle moves to the trailing edge; lanes swap sides.
- Tiny sizes / dense IDE. At 28 px rows the header merges into one line "Queued 3 ▾"; drag handle hidden, reorder via
Alt+Shift+↑/↓only. - Touch. Actions always visible (no hover); long-press 350 ms starts drag; 44 px hit areas.
- Slow networks. Queue writes are local first; "Saving…" never blocks typing.
Notes for AI
- Import
QueueStackfromoxyn_dioxusand includeCOMPOSER_CSSplus the token stylesheet once. - A GPUI version exists:
QueueStackElinoxyn_gpui. - Props to set first:
items. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.