Repository navigation
Conversation
This was referenced Sep 11, 2026
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-frontend
branch
from
September 14, 2026 15:08
fcc2b67 to
e8fc8ee
Compare
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-frontend
branch
2 times, most recently
from
September 14, 2026 16:08
71dc7ce to
604d342
Compare
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-frontend
branch
from
September 15, 2026 10:37
604d342 to
7b6119c
Compare
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-backend
branch
from
September 17, 2026 15:19
28604ca to
c188dec
Compare
Queued rows gain an Edit action. Edit begins a server-side edit (PATCH
{editing:true}) and loads the row into the composer only after the 204;
Save sends {content, editing:false}; Cancel and Escape send
{editing:false}. Nothing is optimistic: editing_since arrives through
queue_update, so queue snapshots are compared by content and
editing_since as well as identity and order.
The row under edit and the rows behind it render as waiting. A chat
whose turn ended at a row under edit has status "paused": the sidebar
shows Paused, the head offers Resume (ends the edit and sends), Edit is
hidden on other rows because the server refuses them, and the send
button reads Queue because a send queues behind the head. A paused turn
is a finished turn for the chime and for discarding late stream parts.
A queue snapshot in which the edited row lost editing_since (another
client ended or moved the edit) or left the queue (sent or removed)
exits edit mode and keeps the typed text as the draft. A 404 on save or
cancel does the same. A row is only counted as having lost the edit
after a snapshot showed it under edit, because the begin request's 204
can arrive before that snapshot.
Edit and Resume are hidden for read-only viewers.
Part of CODAGT-971. Stacked on the backend PR.
Co-authored-by: Coder Agents <noreply@coder.com>
The row-level action on a queued message under edit sends editing:false, which cancels the edit; on a paused chat that also sends the row. It was labelled Resume and shown only while paused, which described the chat and hid that the edit is discarded. It is now Cancel edit, shown for any row under edit, with the paused tooltip stating that the message is sent as it is.
The hook kept composer state and also called the server to end a queued edit, while the page ended it on a history-edit switch and the server moved it on a queued-to-queued switch. Three owners for one rule. The hook is now composer state only: begin, cancel, leave. A 404 on any queued PATCH drops the row from the store instead of throwing a dedicated error class. The existing lost-target effect then leaves edit mode, so the composer has one exit path for a row that is gone. Switching to a history edit now waits for the queued edit to end and stays put on failure, instead of moving the composer while the server row remains marked.
handleBeginEdit, cancel, draft persistence and send rollback do not branch on the target kind, so the queued copies of those tests only re- ran history coverage. The queued describe keeps the two behaviors that differ: a successful save restores the pre-edit draft, and leaveEdit hands the composer text over as the new draft. trackQueuedEditTarget is tested as the snapshot sequence it models rather than six point evaluations, so the stale-then-seen-then-cleared property reads as one case.
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-frontend
branch
from
September 17, 2026 15:24
81aec80 to
577e774
Compare
The four queued row actions become one QueuedMessageActionButton, which also removes the renderActionIcon helper: Spinner already renders its children when not loading. The lost-edit check moves from an effect plus ref to the render-time adjust pattern, so the composer leaves edit mode in the same frame the row disappears. EditingTarget is a single object type since both kinds carry the same fields.
Edit mode opens before the begin request settles, and a refused begin returns the composer to the row the server has under edit. Rows show the local edit state before the queue update arrives. A chat that loads with a row under edit opens the composer on it. Edit stays visible but disabled with a reason while the chat is paused, and the head's Enter hint hides while the composer edits a message.
Member
Author
|
Superseded by a 4-PR stack per review feedback: #29553 (refactors), #29554 (paused and edit markers, read-only), #29555 (edit queued messages, awaited), #29556 (eager updates). Same final tree except that the mutation no longer awaits its invalidations.
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Frontend for CODAGT-971, stacked on #29215.
Queued messages get an Edit action. Edit loads the row into the composer at once and sends
{editing:true}in the background; Save sends{content, editing:false}; Cancel sends{editing:false}. Rows behind the one under edit show Waiting. While the chat is paused (its turn ended at the row under edit) the sidebar shows Paused, the send button reads Queue, Edit on other rows is disabled with the reason, and Cancel edit on the head sends it unchanged. A chat that loads with a row under edit opens the composer on it.Notes for review:
useConversationEditingStatetracks anEditingTarget(historyorqueued) and holds composer state only; the page makes every PATCH. Begin and end markers use their own mutation so they never mark the composer pending, and queued-message requests run in order so an end or save cannot be applied before its begin.QueuedEditOverride(the composer's target, or a row whose end is in flight) ahead of the server marker, so badges and actions do not wait for the queue update.pausedcounts as a finished turn for the completion chime and for discarding late stream parts.The page-level wiring in
AgentChatPage.tsxhas no unit tests; it was exercised in UAT and with Playwright against the backend branch. Visual states are Storybook stories.Closes https://linear.app/codercom/issue/CODAGT-971