Repository navigation
feat: preview images in tool output cards - #75
Merged
Merged
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
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.
Tool output cards now preserve image results from saved history and live events, with separate Show image controls and bounded raster previews. Image-only results no longer appear empty, and text copies, exports and handoff drafts explain that image bytes are omitted.
Part of #2.
Closes #74.
Verification
bun install --frozen-lockfilepassed.mise exec -- bun run lintpassed.mise exec -- bun run typecheckpassed.mise exec -- bun run test:unitpassed, 98 tests across 10 files.mise exec -- bun run test:integrationpassed, 102 tests across 13 files.mise run buildpassed, including the production bundle.git diff --checkpassed.Proof
Local app launch and screenshot capture are blocked by the incomplete Electron runtime installation. Hosted macOS Playwright capture succeeded on commit
43318bb, with every Electron test passing.The artefact contains five new PNGs under
Users/runner/work/pidex/pidex/test-results/tool-preview/.tool-image-controls.pngshows the read card, accompanying text, image notice and disclosure control.tool-image-desktop.pngandtool-image-narrow.pngshow the decoded image at native desktop and 900 by 600 minimum window sizes.tool-image-unavailable.pngshows both unsupported-format and decoding-failure explanations.tool-image-live.pngshows the decoded image after a live tool replaces its partial result with the final result.All five screenshots were downloaded, visually reviewed and copied to local
.tmp/proof/. Separate control and preview frames keep the proof readable on the hosted display, which clamps the requested window height. No scratch captures are committed. Inline attachment upload is blocked because the browser access host is unavailable and native browser access returnedcgWindowNotFound; the screenshots are uploaded through the existing CI artefact workflow and linked above.New unit coverage
keeps text and numbered image notices in saved tool results without copying image bytes.explains unsupported and malformed images without treating them as empty output or URLs.replaces image snapshots during streaming and clears them when the final result has text only.exports image result notices and accompanying text without inline image data.New component coverage
loads images on demand, keeps them independent and restores disclosure after row recycling.explains a broken image and allows a replacement streamed image to load.explains unsupported image results without mounting a preview.New Electron cases cover saved images at native desktop and minimum window sizes, real clipboard text for output and portable context, broken and unsupported images, and a live partial result replaced by its final snapshot. PNG proof is written to
.tmp/proof/andtest-results/tool-preview/for CI upload. No scratch captures are committed.PNG, JPEG, GIF and WebP inline data are supported. Previews fit the card width and 320 pixels in height. SVG, tool-supplied URLs and missing or malformed data receive a text explanation; decoding failures retain the readable result. Full-size viewing, image copying and image-bearing exports remain possible follow-up work. All earlier tool-card children are merged, so this slice completes the original #2 scope of read, write, edit and bash cards with streaming states and output inspection. The parent will be closed with its child history recorded after merge.