Skip to content

queues: both lists of waiting messages are bounded, keep their scroll, and fold under their count - #1033

Merged
ZacxDev merged 2 commits into
mainfrom
send-queue-fold
Nov 24, 2026
Merged

ZacxDev merged 2 commits into
mainfrom
send-queue-fold

Conversation

@ZacxDev

@ZacxDev ZacxDev commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

What

With several messages waiting, two lists in the Rendered view took too much vertical space: muster's send queue, and the "Queued in Claude Code" region (messages Claude Code itself holds). Both now get the same treatment.

  • Bounded rows. Both lists use one rule, queuedRowsBound: min(8.5rem, 20dvh), which shows two rows and part of a third so the cut row says there is more. The rows scroll (overflow-y-auto, overscroll-contain).
    • Before, the send queue's rows were bounded at 10rem: exactly three whole rows, with nothing to say a fourth existed.
    • Before, the "Queued in Claude Code" region scrolled as a whole, with its label inside the scroll.
  • They fold. Each list is a native <details>, drawn open, with its count line as the <summary>: "6 messages waiting …" (or "N messages not sent" when only failures are listed) and "Queued in Claude Code · 6". A tap on the line folds the list to it.
  • The fold is remembered per window on each device, in localStorage, under two separate keys: muster.sendqueue.closed: plus the list's URL, and muster.ccqueue.closed: plus the view's socket path. Each fold is applied in the same task as each redraw:
    • The send queue's script (fold/put) runs on its 3 s re-read and once before the pinned composer is shown.
    • The view script's patch of the "Queued in Claude Code" region goes through ccqKeep. The first list a socket hears is itself a patch.
    • So a poll or patch never unfolds a list, and a folded list is never painted open on a load.
  • Scroll kept. Both lists keep their rows' scroll position across a re-read or patch; before, it reset to the top.
  • Both lists open at once share the room: each one's rows are bounded at min(6rem, 12dvh) (CSS :has() in web/css/input.css). Folding either list gives the other its full bound back.
  • Every send-queue row action (⋯ menu with Send now, Edit, Copy and Cancel, plus Retry and Delete) is unchanged and sits inside the list. Without JavaScript the <details> still folds natively and starts open.

docs/sending-and-step-up.md describes both.

Measured heights (390×844 phone, six messages in each list)

"Queued in Claude Code" send queue together transcript (#mv-log)
origin/main 160px 234px 394px (46.7%) 219px
each list bounded alone (this PR's first commit) 181px 217px 398px (47.2%) 215px
this branch (shared bound while both are open) 141px 177px 318px (37.7%) 295px

The box and Send stay on screen. The test asserts the two lists together are at most 40% of 844px and the transcript at least 20%.

Tests

Everything is in e2e/tests/send-queue.spec.ts. The "a long queue …" tests run at 390×844 (touch) and at 1280×800.

test origin/main this branch
e2e "a long queue is bounded …" (send queue), phone and desktop red: rows 160px > 136; scroll 0 after a re-read (expected 152); fold leaves the rows visible green
e2e "Claude Code's own long queue …", phone and desktop red: rows 290 / 242px > 136; the rows don't scroll; no count line to fold green
e2e "both lists full", phone red: 394px > 337.6 green
Go send_queue_fold_test.go (3 tests) red green
Go cc_queued_fold_test.go (2 tests) red (key-equality line removed so it compiles against main) green

Mutation checks (local). For the "Queued in Claude Code" list, each mutant failed with its own guard's message:

  • the scroll restore removed: "the patch kept the scroll" goes red (114 → 0)
  • the fold removed from the patch: "a patch does not unfold it" goes red
  • the fold delayed 800 ms (with the toggle store kept): "never painted open on the reload" goes red (181px). That guard samples the region's height every frame from the first.

For the send queue (from round 1), removing the fold from the re-read, or delaying the fold on load, each made its own guard go red.

Also run locally, all green: the full send-queue.spec.ts (46 tests), cls.spec.ts (24 tests), the existing "Queued in Claude Code" tests in mirror-chat.spec.ts (3), go test ./internal/ui/, make css-check and make leakscan.

Known limits

  • In chief mode the send queue is hidden but stays open, so the "Queued in Claude Code" list keeps the smaller shared bound there. CSS :has() can't hold a second :has() to tell.
  • Each fold's default is open, whatever the count. Only the person's own fold is remembered.

🤖 Generated with Claude Code

ZacxDev and others added 2 commits November 23, 2026 18:00
…r its count

Several queued messages took too much of the Rendered view. The queue's rows
are now bounded at min(8.5rem, 20dvh) (two rows and part of a third, so a cut
row says there is more) and scroll; the whole list is a <details> under its
count line ("3 messages waiting ...", or "N messages not sent" when only
failures are listed), which a tap folds to that line. A folded queue stays
folded for that window on that device (localStorage, keyed by the list's URL),
applied in the same task as every draw: the first before the pinned composer
is shown, so a folded load does not shift, and each re-read's, so the poll
never unfolds it. A re-read also keeps the rows' scroll position, which it
used to reset to the top.

Tests: e2e send-queue "a long queue ..." at 390x844 touch and 1280x800 (six
queued messages: rows <= 136px, whole queue <= 30% of the screen, rows
scroll, scroll kept across a re-read, fold survives a re-read and a reload
with no layout shift, the last row cancelled through its menu). Red on
origin/main on the bound (160px), the kept scroll (0) and the fold; green
here. Go: send_queue_fold_test.go, red on origin/main, green here.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…olds too

The "Queued in Claude Code" region gets the send queue's treatment: its
rows (not the region, which used to scroll with its label inside) are
bounded by the same rule, queuedRowsBound (min(8.5rem, 20dvh)), and scroll;
the list is a <details> under its count line ("Queued in Claude Code · 3"),
folded per window on that device under its own localStorage key
(muster.ccqueue.closed: plus the view's socket path). The view applies the
fold and restores the rows' scroll in the same task as every patch of the
region (ccqKeep), and the first list a socket hears is a patch, so a folded
list is never painted open on a load.

Both lists full and open on a 390x844 phone took 398px (47% of the screen)
with each bounded alone; while both are open each one's rows are bounded at
min(6rem, 12dvh) instead (input.css), and the pair measures 318px (ccq 141 +
queue 177, 37.7%), the transcript 295px.

Tests: e2e send-queue "Claude Code's own long queue ..." at 390x844 and
1280x800, and "both lists full" at 390x844; red on origin/main, green here.
Go: cc_queued_fold_test.go, red on origin/main, green here.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ZacxDev ZacxDev changed the title send queue: a long queue is bounded, keeps its scroll, and folds under its count queues: both lists of waiting messages are bounded, keep their scroll, and fold under their count Nov 24, 2026
@ZacxDev
ZacxDev merged commit 46bd8ee into main Nov 24, 2026
33 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