🖼️ fix: Hide Duplicate Image Placeholder During Image Generation#12654
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a UI issue in the chat image-generation tool output where an extra (empty) image skeleton was being rendered beneath the PixelCard generation animation by preventing the Image component from mounting until a real filepath exists.
Changes:
- Conditionally render the
Imagecomponent only whenfilepathis truthy. - Remove the empty-string fallback (
filepath ?? '') so an emptyimagePathis never passed toImage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {filepath && ( | ||
| <Image | ||
| altText={filename} | ||
| imagePath={filepath} | ||
| width={Number(dimensions.width?.split('px')[0])} | ||
| height={Number(dimensions.height?.split('px')[0])} | ||
| args={parsedArgs} | ||
| /> | ||
| )} |
There was a problem hiding this comment.
This changes the render contract for the Image component (it no longer mounts when attachments/filepath is missing). There are existing unit tests that currently expect <Image /> to be present even when attachments is undefined (e.g., client/src/components/Chat/Messages/Content/__tests__/OpenAIImageGen.test.tsx cases like “keeps Image mounted during generation” and the args parsing tests). Those tests will fail and should be updated to assert the new behavior (no Image until filepath is available) and/or to provide an attachment with a filepath when an Image is expected.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
GitNexus: 🚀 deployedThe |
…ny-avila#12654) * fix: Hide duplicate image placeholder during image generation * test: Update OpenAIImageGen tests for conditional Image rendering
…ny-avila#12654) * fix: Hide duplicate image placeholder during image generation * test: Update OpenAIImageGen tests for conditional Image rendering
Summary
I fixed a visual bug where a duplicate image placeholder (skeleton) was rendered below the PixelCard canvas animation during image generation. The
Imagecomponent was always mounted regardless of whether afilepathexisted, causing an empty skeleton to appear beneath the generation animation. Now theImagecomponent only renders whenfilepathis available, so the PixelCard animation serves as the sole visual indicator during generation.Imagecomponent only whenfilepathis truthy in theOpenAIImageGencomponent?? ''fallback forimagePathsince the component no longer renders without a valid pathChange Type
Testing
Checklist