Repository navigation
fix(chat): show images by root-relative and relative URLs - #442
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes — Reviewed the relative-image URL handling, its public contract, and regression coverage across all three chat renderers.
- Relative image sources:
read()accepts root-relative, path-relative, query-relative, and protocol-relative image URLs while preserving the originalsrcand rejecting non-web schemes. - Unchanged link policy: Image-source support expands without changing file links, downloads, or source links; existing data-image and blob support is retained.
- Framework coverage: Adds URL acceptance/rejection tests and a Vue, React, and Svelte rendering regression test, including a new bundled Svelte SSR helper.
- Public documentation: Updates the
Block.imagetype documentation and Chat page to describe relative image URLs.
Validation: all 16 chat tests, targeted lint and strict typechecking, the chat package build with publint, and its Vite Doctor pass. Additional public-reader checks cover both file and reasoning-file parts. Browser behavior was not exercised; the full workspace build reached [timed out after 120000ms], so only the focused package build is confirmed complete.
gpt-6.1-sol(xhigh) | 𝕏
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
Latest result Pull request merged. Final answersSession Pull request merged. |

MessagePartsshows no image when a file part's URL is relative, such as/uploads/a.png. An app that serves its own uploads gets a bare file name instead of the picture, in Vue, React and Svelte. ViteHub works around it by overriding thefileslot in@vite-hub/ui.read()accepted only absolute http and https URLs, data image URLs and blob URLs as image sources. This PR also accepts a URL relative to the page. It resolves the URL against a stand-in https origin with the URL parser, so the check reads it the same way the browser does:/uploads/a.png,../a.pngand//cdn.example.com/a.pngload, whilejavascript:,java\tscript:,file:and an empty string still don't. Thesrcstays as written, so the browser resolves it against the page. Links (href) are unchanged.The new tests fail on
mainand pass here:read()cases for the accepted and refused URLs, and a render of/uploads/a.pngin Vue, React and Svelte. Svelte is server-rendered in the test for the first time, from a small Vite SSR bundle of the components.vp testinpackages/chat(16 tests),vp lint, the package build with publint, and its Vite Doctor pass. I checked server-rendered HTML only, not a browser.🤖 Generated with Claude Code