Repository navigation
fix(desktop): fold the send queue into its header; count a stop's rows; fold a shot burst - #1629
Merged
Merged
Conversation
The desktop panel drew every waiting row over the conversation whenever the queue was non-empty, so a reply could come back hidden behind seven rows. Mobile already collapses it and opens it on press; this brings the desktop to the same behaviour — closed by default, the header line (title, count, what will become of them) is what the reader sees, and one press on that line draws the rows. The header itself is the toggle rather than a chevron beside it: it is a line of text and folding a queue should not mean hitting a 14px arrow. Retry for a failed delivery stays outside the toggle so rescuing a message does not also fold the rows, and folding clears an open editor or answer menu so a half-typed edit is not redrawn on the next expand. Shared panel, so both composers (this app's queue and a paired computer's) get it. Tests open the panel first; two new ones cover the closed state and the cleared editor.
The local composer's interrupt control had a branch that said "Stop and send the queued messages" instead of "Stop", and it could never be reached: it reads `Composer.queueCount`, and nothing supplied it. The prop was not always missing. #1485 moved the send queue from the clients into the session and deleted `queueCount={` from both composers with it — the phone's `queueItems.length` and this app's `sendQueue.items.length`. The phone lost nothing, because "Stop and send the queue" was retired along with the client-side queue. Here the deleted source was the only one, the branch that reads it stayed, and the control has said plain "Stop" ever since however many rows were waiting behind the run. The Agent's own queue is the source that replaced it, so the count comes from `agentQueue` now. It has to say something true: ending the run is what lets the waiting rows go (the session starts them at the turn boundary), so the wording holds for the rows that will run. A parked row is counted out rather than in — it waits for a person to release it, and a stop does not release it. `screenshot: send-queue-local-queued` asserted exactly this and had been red on the base commit; it now passes, and reverting only this line reddens it again.
`send-queue-local-interrupt` had been red on the base commit, and the reason was the fixture rather than the product: `drainShotQueue` handed queued messages out one at a time, so pressing "interrupt and send all" with one row held and one in the field left *two* messages in the transcript. The Agent does not work that way. Every send opts into `enqueue_coalescing` (`QUEUED_SEND_POLICY`), and at the turn boundary `drain_coalescing_after_first` joins everything queued directly behind the front request into it — their texts in queue order, one paragraph each — and records the folded rows terminal with reason `merged`, which is how their client learns the submission was answered as part of another run. The fixture's own comment above `streamShotRun` already described that fold, so the behaviour it produced was the one thing the comment did not. `drainShotQueue` now folds the batch and reports the `merged` acks through `session_queue`, whose `recentTerminalAcks` used to be hard-coded empty. That also exercises the notice those acks drive, which no capture could reach before. The scenario's final step asserted the panel was already gone on the same frame the message appeared. The panel reads the queue on its own tick (`QUEUE_POLL_MS`, 2 s) and learns about a folded row from `recentTerminalAcks` on the next read, so that assertion lost a race it was never meant to run: measured 949 ms to the merged message, 2067 ms to the panel going. The wait is now its own step, which keeps "the rows merged" from being judged by a panel that has not caught up yet. Verified: the scenario captures green and says `one message carried both` / `the queue emptied`; a probe confirmed the two sentences land in one `[data-message-id]` row. `send-queue-local-queued`, `send-queue-local-choice`, `send-queue-choice`, `choice-card-queue` and `choice-card-queue-remote` all still capture; 2359 JS tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The desktop send-queue panel used to draw every waiting row over the conversation, so a reply coming back could be hidden behind seven of them. Mobile already collapses such a panel and opens it on press; this brings the desktop to that behaviour, in both composers that share the panel (this app's own queue and a paired computer's). Two follow-ups ride along: the local interrupt control now says how many waiting rows a stop carries, and the screenshot fixture folds a queued burst into one turn the way the Agent does, which is what had
send-queue-local-interruptred on the base commit.Commits
Composer.queueCounthad lost its only supplier in feat(desktop,mobile,agent): a session-owned send queue, paged replay, journal fixes #1485, leaving the "Stop and send the queued messages" branch unreachable; the count now comes fromagentQueue, counting the rows a stop will actually release and leaving a parked row out.drainShotQueuehanded queued messages out one at a time, so "interrupt and send all" produced two transcript rows where the Agent produces one folded message. It now folds the batch and reports themergedterminal acks throughsession_queue. The scenario's "the panel is gone" assertion is a separate step, because the panel learns about a folded row on its next poll.Verification
Run in the main checkout at
a3bf54424(the frozen SHA), Node 26.3.0,ulimit -n 8192. No Rust crate is touched by this branch.npx tsc --noEmit(desktop) → cleannpx eslinton the 6 changed TS/TSX files → cleannpx vitest runonAgentThread.test.tsx,SendQueuePanel.test.tsx,RemoteComposer.test.tsx,i18n.test.ts→ 188 passednpx vitest run --no-file-parallelism src/features/agent src/features/remote-peer→ 157 files / 2355 tests passednpx vitest run src/i18n/localeKeys.test.ts→ 2 passed (the two newqueue.expand/queue.collapsekeys exist in both locales)python3 scripts/tests/test-screenshot-scenario-fragments.py→ ok (fragments merge, override and fail loudly)python3load of the real scenario table throughcapture.load_scenarios→ both changed fragments parse and mergemake check-docs→ 421 docs OK, 0 pairs pending bilingualization, provider matrix 13 rowsNotes
SendQueuePanel.tsx), so the behaviour change reaches the paired-computer composer too.send-queue-local-interruptandsend-queue-local-queuednow capture green instead of red.User-visible changes
7293743a3.queueCounthad been unreachable since feat(desktop,mobile,agent): a session-owned send queue, paged replay, journal fixes #1485). After: "Stop and send the queued messages" when rows are waiting; a parked row, which waits for a person, is counted out. Reverta3164ed24.mergedacks, and thesend-queue/choice-cardsscenarios open the panel before reading rows. Reverte634ee3e5.