Repository navigation
Conversation
…gg#40874) Co-authored-by: Abhiram-745 <237478249+Abhiram-745@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
…nder its full name (pingdotgg#40877) Co-authored-by: Abhiram-745 <237478249+Abhiram-745@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
…l finds no match (pingdotgg#40886) Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Abhiram-745 <237478249+Abhiram-745@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
smirea
force-pushed
the
fix/edit-message-pasted-image
branch
from
November 22, 2026 15:47
7f69469 to
86fa8d0
Compare
…ingdotgg#40858) Co-authored-by: LVC-Chakresh <chakresh@example.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
smirea
force-pushed
the
fix/edit-message-pasted-image
branch
from
November 22, 2026 16:29
88252b9 to
9250d74
Compare
…e-send /compact to the user (pingdotgg#40934)
Co-Authored-By: stefan <steven.mirea@gmail.com>
…ource Co-Authored-By: stefan <steven.mirea@gmail.com>
Co-Authored-By: stefan <steven.mirea@gmail.com>
…atching Co-Authored-By: stefan <steven.mirea@gmail.com>
Co-Authored-By: stefan <steven.mirea@gmail.com>
Co-Authored-By: stefan <steven.mirea@gmail.com>
…istory Co-Authored-By: stefan <steven.mirea@gmail.com>
Co-Authored-By: stefan <steven.mirea@gmail.com>
…ions Co-Authored-By: stefan <steven.mirea@gmail.com>
Co-Authored-By: stefan <steven.mirea@gmail.com>
…tion Co-Authored-By: stefan <steven.mirea@gmail.com>
Co-Authored-By: stefan <steven.mirea@gmail.com>
smirea
force-pushed
the
fix/edit-message-pasted-image
branch
from
November 22, 2026 17:02
918e482 to
252f4d8
Compare
Owner
Author
|
Moved upstream to pingdotgg#40945 (fixes pingdotgg#40944). |
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.
Problem
When a user pastes an image (or attaches a file) into a message with text, sends it while a turn is active so it queues, and then edits the queued message, the inline attachment chip in the composer breaks and renders as an unavailable chip (
This context is no longer available. Remove it or attach it again.) even though the attachment is still shown in the thumbnail row above the editor and sent on save.Expected behavior (
docs/internals/composer-context-references.md): pasting an image or attaching a file inserts a resolved inline chip backed by the attachment, while unresolved chips are only for missing records. A prior fix (pingdotgg#30850 / pingdotgg#30889) restoredthreadandenvironmentcontext records when opening a queued edit inuseQueuedRunEdit.ts, but leftimageandfilerecords unmapped.apps/mobile/src/state/queued-run-edit.tsalready seeds its edit draft with the full message context and does not have this bug.Root cause:
useQueuedRunEditkeeps the queued message's existing attachments inediting.existingAttachmentsrather than in the edit draft'simages/filesarrays. BecausecomposerContextRecordsFromDraftonly indexed live draftimages/files, inlinet3-context://v1/image/<contextId>(andfile) links had no matching record inComposerContextRecordsContext.Change
apps/web/src/components/chat/queuedMessageEdit.ts&apps/web/src/components/chat/useQueuedRunEdit.ts:contextIdsfromediting.context(attachmentContextIdsForRecord), matchingrecord.attachmentId === attachment.idandrecord.kind === attachment.type.removeEditingAttachment), strip its inline references from the edit draft prompt so removing the attachment doesn't leave an unavailable chip behind.recoverQueuedMessageEdit), strip existing queued attachment inline references first (or discard the recovery if nothing else remains) since the thread draft does not own those server attachments.apps/web/src/components/composerContextPresentation.tsx&apps/web/src/lib/composerContextRecords.ts:composerContextRecordsFromDraftto acceptexistingAttachmentsandenvironmentId, registering image and file records under their original wirecontextIds withuploadedAttachmentId(anduploadEnvironmentIdfor files/SVGs so they don't show as needing reattach).contextIdpassthrough inuploadedAttachmentContextRecord/attachmentContextRecordsouploadedContextRecordFromDraftpreserves the original wirecontextId.apps/web/src/components/chat/ChatComposer.tsx:editingQueuedAttachmentsandenvironmentIdintocomposerContextRecordsFromDraft(also covering collapsed mobile-web prompt preview).composerContextActions(expandImage,openFile,expandVideo) andbuildContextClipboardFragmentto resolve existing queued attachments alongside live draft attachments.composerContextPresentation.test.ts,queuedMessageEdit.test.ts, anduseQueuedRunEdit.browser.test.tsx.Scope
Fixes #<issue>(placeholder for upstream PR)apps/web): fixed for queued-message editing across inline image, file, and video attachment chips (chip rendering in expanded and collapsed composer, clicking the chip to preview/open, editing/saving/re-editing, removing the thumbnail via×, copying the chip, and recovering an unsaved edit when the queued run starts or is cancelled).rewindToMessage): left unchanged —recallComposerMessageintentionally strips inline attachment chips when recalling into a new draft (composerPromptHistory.ts), so no unavailable chip appears.apps/mobile): left unchanged —apps/mobile/src/state/queued-run-edit.tsalready copies the full message context into the edit draft.Verification
Reproducible on a Linux VM with no provider account
All checks below run headless using the
Replay (dev)(showcase) agent with no external provider account:vp run scenarios:prove scripts/scenarios/queued-edit-keeps-pasted-image-chip.e2e.ts --base origin/main):ad2bdc76a5: ❌ failed (expect.toHaveCountongetByRole("textbox") >> getByRole("button", name: "Image attachment"), expected1, observed0— inline chip rendered as unavailable).057fda86a1: ✅ passed (inline image chip resolves on queued edit, clicking the chip opens and closes the expanded image preview, editing text around the chip + saving + re-editing keeps the chip resolved, and clicking×on the thumbnail removes the inline chip without leaving an unavailable chip).ad2bdc76a5(broken)057fda86a1(fixed)Scenario source (scripts/scenarios/queued-edit-keeps-pasted-image-chip.e2e.ts)
vp run check:changed: passed all 7 checks (format, lint with 0 warnings/errors, knip, typecheck across 2 packages, 48/48 tests across 4 files, React compiler 5/5).origin/maincaused its covering test or scenario to fail (composerContextRecords.ts&composerContextPresentation.tsx->composerContextPresentation.test.ts;queuedMessageEdit.ts->queuedMessageEdit.test.ts;useQueuedRunEdit.ts->useQueuedRunEdit.browser.test.tsx;ChatComposer.tsx->queued-edit-keeps-pasted-image-chip.e2e.ts).vp run scenarios --target web scenarios/queued-edit-keeps-thread-mention.e2e.ts scenarios/distinct-same-size-pasted-images-both-attach.e2e.ts: both passed on the fix.Needs more than a Linux VM
None — the entire bug and verification reproduce in headless web with
Replay (dev)and no provider account.Written with Gemini 4 Neon in T3 Code (Antigravity harness).