fix(web): queued message preview keeps inline image labels in place#33405

merged2
main
GitHub fork: fix/queued-preview-inline-image-labels
opened3d agobyRRagulsundaram
View on GitHubTwo-way sync enabledPR last imported 4h ago

Fixes #33237

Problem

When a queued message has inline image references, the dashed queued preview replaces each reference with an empty string whenever the message has image thumbnails. The text reads "Make the header look like and keep the logo." and you can't tell which image goes where. Once sent, the timeline row shows the image labels in place, so the two disagree.

Fix

QueuedRunsControl now replaces every inline reference with its label, images included, the same as the other preview paths (mobile's ThreadFeed already does this). The thumbnail strip stays as it is.

This is a one-line fix for an obvious display bug, so I submitted it without a prior discussion under the small-fix exception in CONTRIBUTING.

Verification

  • Extended the existing preview case in QueuedRunsControl.browser.test.tsx with a queued run whose text has an inline image reference and a matching image attachment. It asserts the preview reads Make the header look like header.png and keep the logo.
  • vp test run src/components/chat/QueuedRunsControl.browser.test.tsx -t "previews assistant quotes": fails on main (the label is missing), passes with the fix.
  • vp run check:changed: format, lint, knip, typecheck, tests and react compiler all pass.
  • Surfaces: web and desktop share this component. Mobile already rendered labels, so it needs no change.

Not checked: I did not take before/after screenshots in a running client. The browser test covers the rendered preview text.

Fixes pingdotgg/t3code#33237

Checks

24 successful · 15 skipped
All checks passed
342884a

Added 1 commit

  • fix(web): queued message preview keeps inline image labels in place1cdc710
Synced from GitHub

Approvability

Verdict: Approved at 1cdc710

Macroscope's review found this PR approvable — Queued-message previews retain inline image labels alongside thumbnails. The change is confined to displayed text and leaves message submission and attachment handling unchanged.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Queued-message previews now show image reference labels even when image thumbnails are present. A browser test queues a message with an inline image reference and checks that the preview displays its label.

Changes: Queued preview

Layer / File(s)Summary
Preserve image labels
apps/web/src/components/chat/QueuedRunsControl.tsx, apps/web/src/components/chat/QueuedRunsControl.browser.test.tsx
The preview uses image reference labels when thumbnails are present. The browser test checks that a queued inline image reference appears as header.png.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested labels: bugfix

Suggested reviewers: juliusmarminge

Merge Risk: External image Minimal · up to 34288

Queued message previews will now show inline image labels instead of blank gaps. The change is small and display-only, with test coverage, and no merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check nameStatusExplanation
Title checkPassedThe title names the change: queued message previews keep inline image labels in place. The changeset replaces every inline composer reference, including images, with its label in QueuedRunsControl.tsx…
Description checkPassedThe description follows the template. It has Problem, Fix (Change), Scope, and Verification sections, and it links issue #33237. The Problem section gives the bug, its reproduction context, and the ex…
Linked Issues checkPassed[#33237] The issue requires queued-message previews to show inline image references with their label, not an empty gap, when image thumbnails exist. The whole-PR diff against the merge base (e0d0fb33)…
Out of Scope Changes checkPassedThe whole-PR diff against the merge base touches two files. The source change in QueuedRunsControl.tsx is a one-line change to the queued-preview label mapping. It directly implements #33237. The test…
Full details: Title check

Explanation

The title names the change: queued message previews keep inline image labels in place. The changeset replaces every inline composer reference, including images, with its label in QueuedRunsControl.tsx, and adds a browser test for it. The title follows the conventional commit format and is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description follows the template. It has Problem, Fix (Change), Scope, and Verification sections, and it links issue #33237. The Problem section gives the bug, its reproduction context, and the expected behavior. The Fix section explains the one-line change and why no prior discussion was needed under the small-fix exception. Verification lists a focused test, the failing and passing results on main and with the fix, and the broader check run. The author states that screenshots were not taken, which the template requires for UI changes. The template also asks for the model and harness when an agent was used, and the description does not mention that. This is a minor omission, so the check passes.

Full details: Linked Issues check

Explanation

[#33237] The issue requires queued-message previews to show inline image references with their label, not an empty gap, when image thumbnails exist. The whole-PR diff against the merge base (e0d0fb33) changes apps/web/src/components/chat/QueuedRunsControl.tsx. The preview builder now calls replaceComposerContextReferences(item.text, (reference) => reference.label) for every reference. The former branch that returned "" for kind "image" when item.thumbnails.length > 0 is removed. The issue names reference.label as an acceptable fix, so inline chip rendering is not required. The thumbnail strip is unchanged. The browser test diff in QueuedRunsControl.browser.test.tsx adds a queued run with an inline header.png reference and a matching image attachment, and asserts the preview text 'Make the header look like header.png and keep the logo.'. This covers the automated test requirement. The current head (342884a) source diff matches the previously reviewed head (1cdc710) for this file. The failing-on-main result and check:changed results were not re-run in this assessment. The code and test evidence support the behavior.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base touches two files. The source change in QueuedRunsControl.tsx is a one-line change to the queued-preview label mapping. It directly implements #33237. The test change in QueuedRunsControl.browser.test.tsx adds an inline image queued run and one assertion in the existing preview case. These support the implemented behavior. The isAttachmentOnlyBootstrapPrompt branch and the thumbnail rendering are unchanged. No unrelated change was found. The test file content was assessed from the change summary and the PR description, not from a full diff read. This does not change the result.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
External image Recent review info

External image Run configuration

External image Commits

Reviewing files that changed from the base of the PR and between 1cdc71062a2813910e0165de4b1b358280cbba3d and 342884a81809b5e15a22f131fdce78f875cf9a85.

External image Files selected for processing: 2

  • apps/web/src/components/chat/QueuedRunsControl.browser.test.tsx
  • apps/web/src/components/chat/QueuedRunsControl.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified unchanged head 1cdc71062a2813910e0165de4b1b358280cbba3d on linux, using the real dev web app in google chrome through playwright and codex gpt-6.1-sol through the local provider proxy. projects, threads, turns and attachments were created through the app; no mocks or seeded data.

  • reproduced on github/main at d1aeed2492: queued text lost header.png while its thumbnail remained.
  • repeated the same prompt and image on this head: the dashed queued row reads Make the header look like header.png and keep the logo. and retains its loaded thumbnail.
  • edited and saved the queued message: the image reference and attachment survived, and the updated suffix appeared in the preview.
  • queued and removed a second plain-text message: its preview remained readable and removing it left the image message intact.
  • let the queue dispatch automatically: the sent timeline kept the image and inline label, and codex read the uploaded image as HEADER 33405.

vp i completed on main and the pr head. blacksmith ran all 3 existing QueuedRunsControl.browser.test.tsx cases successfully. vp run check:changed b8c2cfad6b3363c4da144a859073b41ec77579ab passed format, lint, both knip checks, affected typechecks, tests and react compiler. the remote runner needed its playwright browser installed and its shallow history deepened before these checks could run.

before on main: inline image label missing from queued text

after on pr head: inline image label retained beside its thumbnail

editing and updating the queued image message in the running app

automatic dispatch: sent image and codex reading HEADER 33405

Not verified

native electron desktop, ios and android clients were not exercised on this linux vm. desktop shares the changed web component; mobile is unchanged. other providers, relay/tunnel connections and additional themes or viewport sizes were not exercised.

Added 1 commit

  • Merge remote-tracking branch 'origin/main' into fix/queued-preview-inline-image-labels342884a

Evidence

Real web client, Chromium, 1280×800, light theme, fresh synthetic state on both commits. Start a replay turn; compose Make the header look like , paste header.png, append and keep the logo., and queue with Control+Enter. Inspect the dashed preview, then let it dispatch and compare the inline reference.

Proven: the scenario fails on base e0d0fb33dd and passes on head 342884a818.

Scenario source

The replay agent rejects image prompts after dispatch; the dispatched user message and its inline reference are visible on both sides, but the subsequent agent turn cannot start.

AI-assisted; verified with the tests and tools listed above.

Not shown:

  • Successful agent processing of the dispatched image: replay does not negotiate image prompt support. The queued preview and dispatched user-message rendering were captured on both commits.