feat(vscode): edit queued messages in the prompt input - #13556
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Previous Review Summary (commit 52d4247)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 52d4247)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (22 files)
Reviewed by grok-4.6 · Input: 123.9K · Output: 10K · Cached: 433.8K Review guidance: REVIEW.md from base branch |
| copyText?: string | ||
| header?: JSX.Element | ||
| edit?: { label: string; onClick: () => void; disabled?: boolean } | ||
| queuedDisabled?: boolean |
There was a problem hiding this comment.
note: this is one of those boolean fields I have mentioned in other venues. Nothing wrong with it, but just to underline what I was referring to.
| /** When true (subagent viewer), replace the welcome screen with an initializing indicator */ | ||
| readonly?: boolean | ||
| queuedDisabled?: boolean | ||
| editDisabled?: boolean |
There was a problem hiding this comment.
note: two boolean fields added ... I still believe all of them could be aggregated as single, reactive, state field, which most items lack for what I've read so far.
WebReflection
left a comment
There was a problem hiding this comment.
Added comments as notes, as we discussed this internally. Yet looks good to me.
What Problem This Solves
Queued messages can be removed, but correcting one currently requires deleting it and reconstructing the prompt. Editing must also remove the message from the queue before it can run, rather than leave a live queued copy behind.
Why This Change Was Made
Add the standard small Edit action beside queued-message removal. It waits for confirmed, queue-only deletion before restoring the prompt to the input. The backend rejects messages that have already started, including messages that finish before the deletion request arrives. Failed deletion leaves the message untouched.
The implementation reuses the existing prompt restoration and draft storage. It does not add an inline editor or edit-specific toasts. Missing deletion responses time out after 10 seconds; disconnects and session deletion also release the pending edit and its listener.
User Impact
Evidence
Second queued messagefollowed byEdited first message;First queued messagewas never sent.1. Multiple queued messages and an existing draft
With an empty input, both queued messages expose Edit. Entering a draft disables both Edit buttons without changing the draft, deleting either queued message, or showing a toast.
2. Move to input and resubmit without sending the original
Editing the first message removes only that queued row and focuses its content in the input. After editing and resubmitting, the remaining second message runs first, followed by the edited message.
3. Image-only queued messages
An image-only message exposes the same Edit action. Editing removes its queued row and restores the image attachment to the otherwise empty input.
4. Exact file mentions and session-isolated drafts
A filename containing a space and Unicode characters remains a recognized mention after editing. Switching to another tab and entering a different draft does not overwrite the restored prompt. Switching back retains the exact mention; returning to the other tab also retains its draft.