Skip to content

feat(site): return a queued chat message to the composer - #28516

Closed
tracyjohnsonux wants to merge 1 commit into
mainfrom
feat/queued-message-edit
Closed

tracyjohnsonux wants to merge 1 commit into
mainfrom
feat/queued-message-edit

Conversation

@tracyjohnsonux

@tracyjohnsonux tracyjohnsonux commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator

Queued messages could only be sent now or removed, so fixing a typo meant deleting the message and retyping it. Queued text was also always clipped to its first line.

The queued text is now a button that toggles between the truncated first line and the full content. A pencil action returns the message to the composer: the queue row is deleted and its text becomes an ordinary draft, persisted like typed input so it survives a reload. From there it is just a prompt being written, so the next Enter takes the normal send path, which queues it at the tail while the chat is busy or sends it immediately when the chat is idle. There is no edit mode, no banner, and nothing enters the chat stream.

The action is disabled, with the reason in its tooltip, when:

  • the composer already holds a draft, since returning a message would overwrite what is being written; or
  • the queued message carries attachments, because composer drafts cannot be seeded with files uploaded in an earlier session (only the file IDs are available, not the bytes).

A failed removal restores the row and leaves the composer untouched.

Implementation notes
  • QueuedMessagesList: per-item expanded state with aria-expanded, plus an optional onEdit action that hides the row optimistically and restores it if the handler rejects, mirroring the existing delete and promote actions. editDisabledReason disables the action and supplies the tooltip.
  • AgentChatInput derives the composer-draft reason from its existing isComposerEffectivelyEmpty state.
  • AgentChatPage.handleEditQueuedMessage reuses handleDeleteQueuedMessage (optimistic queue removal with rollback) and then loads the text through loadDraftIntoComposer, which writes the plain-text draft to the same localStorage key the composer uses and focuses the editor after the remount.
  • getEditableUserMessagePayload now delegates to a content-level getEditableContentPayload shared with queued messages.
  • Frontend only: no API, SDK, database, or state-machine changes.
Design history

Earlier revisions of this branch added PATCH /api/experimental/chats/{chat}/queue/{queuedMessage} with a chatstate.UpdateQueuedMessage transition so a queued message could be edited in place, and later tried to hold a queued message while it was being edited. The hold is not expressible in the current chat state machine: ClassifyExecutionState maps waiting with a non-empty queue to StateInvalid, FinishTurn promotes the queue head in the same transaction as the status write, and a chat parked in an invalid state refuses every transition until a user-triggered reconcile forces it to error. Returning the message to the composer needs no backend change at all, so the endpoint, transition, SDK method, and their tests were dropped and this branch is now a single frontend commit.


Generated by Coder Agents on behalf of @tracyjohnsonux.

@github-actions

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@tracyjohnsonux
tracyjohnsonux force-pushed the feat/queued-message-edit branch from 3a569aa to 2de41ed Compare August 25, 2026 18:59
@tracyjohnsonux tracyjohnsonux changed the title feat: allow editing a queued chat message in place feat(site): return a queued chat message to the composer Aug 25, 2026
@tracyjohnsonux
tracyjohnsonux force-pushed the feat/queued-message-edit branch from 2de41ed to ca8e3d9 Compare August 25, 2026 22:14
@tracyjohnsonux tracyjohnsonux added the experimental Changes that might not necessarily be merged, until its approved to proceed with. label Aug 25, 2026
Queued messages could only be sent now or removed, so fixing a typo meant
deleting the message and retyping it. Queued text was also always clipped
to its first line.

The queued text is now a button that toggles between the first line and
the full content. A pencil action removes the message from the queue and
loads its text into the composer as an ordinary draft, persisted like
typed input, so the next Enter goes through the normal send path: queued
at the tail while the chat is busy, sent immediately when it is idle.
There is no edit mode, no banner, and nothing enters the chat stream.

The action is disabled when the composer already holds a draft, since the
message would overwrite it, and for messages carrying attachments,
because composer drafts cannot be seeded with files that were uploaded in
an earlier session. A failed removal restores the row and leaves the
composer untouched.
@tracyjohnsonux
tracyjohnsonux force-pushed the feat/queued-message-edit branch from ca8e3d9 to c41d70e Compare August 25, 2026 22:24
@tracyjohnsonux

Copy link
Copy Markdown
Collaborator Author

Closing as experimental. The branch feat/queued-message-edit (c41d70e0e3) is preserved for reference: queued-message expand/collapse plus an edit action that returns the queued text to the composer as a plain draft. Not merging at this time.

Posted by Coder Agents on behalf of @tracyjohnsonux.

@github-actions github-actions Bot locked and limited conversation to collaborators Sep 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

experimental Changes that might not necessarily be merged, until its approved to proceed with.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant