Repository navigation
Show a queued chat message as pending, not as sent - #260
Merged
Merged
Conversation
PR #258's own report claimed it added a "queued" badge, but the diff never touched a message bubble: it only stopped the composer from locking. A message sent while a turn is in flight renders exactly like an already-delivered one, because `deliveryNotices()` only ever produced a notice for a `failed` or `uncertain` delivery, never for one the server already reports as `queued`. Surface the existing `queued` delivery-ledger state the same way a failed or unconfirmed one already is: a distinct `Queued` notice (no Retry offered, since nothing has been attempted) and a dimmed bubble, both driven by the same delivery row `GET /main-thread` and `GET /sessions/{id}/native` already return. The indicator clears on its own once that row is promoted off `queued` — no client-side timer or guess. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
web/design/build.ts output for the component docs this PR changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oldsj
force-pushed
the
mainloop/fix-queued-message-indicator
branch
from
October 18, 2026 22:29
ad7dabd to
d295645
Compare
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.
Summary
Follow-up to #258. That PR's own report claimed it added a small "queued" badge/state on the message, but its diff never touched a message bubble at all — it only stopped the composer from locking while a turn is in flight (
Composer.tsx,ThreadBody.tsx). A message sent while a turn is open — which the server durably queues and 202s asstatus: "queued"— rendered in the transcript exactly like an already-delivered message, becausedeliveryNotices()only ever produced a notice for afailedoruncertaindelivery row, never for one the server already reports asqueued.The server already carries everything needed to distinguish this:
NativeDeliveryInfo.stateincludesqueuedin the delivery ledger (api/openapi.yaml), andGET /main-thread/GET /sessions/{id}/nativealready return that row live (confirmed by reading the server code — this is not a client-only guess). No server change was needed.web/src/lib/delivery.ts:deliveryNotices()now also emits a notice for aqueueddelivery (labelQueued, not retryable — nothing has been attempted yet).web/src/features/chat/DeliveryNotice.tsx: a distinct muted style and explanatory text for the queued notice, separate from the failed (red) and unconfirmed (yellow) ones.web/src/features/chat/MessageBubble.tsx: the bubble itself is dimmed while queued (not just the notice below it), so it reads as pending at a glance; the dimming and notice both clear automatically once the server reports the delivery promoted offqueued— no client-side timer.docs/specs/chat.mdand themessage/delivery-receiptdesign docs to describe the new per-messageQueuedstate (distinct from the thread-level status words, which are unaffected).Test plan
web/src/lib/delivery.test.ts: new unit tests for thequeuednotice and its clearing once promoted.web/src/features/chat/MessageBubble.test.tsx: queued bubble renders dimmed with aQueuednotice and no Retry; reverts to normal once the notice is gone.web/src/features/chat/ChatPage.test.tsx: end-to-end repro — a message sent while a turn is in flight showsQueuedand a dimmed bubble, and both clear once the backend promotes the delivery row. Verified this test (and the two unit ones above) fail against the pre-fix code, reproducing the reported bug, and pass after the fix.tsc -b,eslint .,vitest runall clean (one unrelated flaky test inhitl-card.test.tsxfailed once in the full run and passed in isolation — not touched by this change).🤖 Generated with Claude Code