Repository navigation
feat(ui): add bounded static SVG image and code previews - #6292
Draft
Sun-GLiang wants to merge 7 commits into
Draft
Sun-GLiang wants to merge 7 commits into
Sun-GLiang wants to merge 7 commits into
Conversation
Support archived SVG files and settled SVG/XML fences using a shared bounded sanitizer, lazy image presentation and caches. Preserve source access, sanitized downloads and raster-only model/avatar admission. This change is independent of ACP media publication and does not change the tool-result protocol. Generated-by: Codex
Generated-by: Codex
4 of 6 tasks
Keep complete SVG source available without building an oversized syntax-token DOM in fallback, deferred, and source views. Generated-by: Codex
Keep the existing limits and UI behavior while extracting the shared image component, retaining structured loader outcomes, and separating avatar and chat admission policies for independent media changes. Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
This branch has not been deployed
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.
Summary
Saved SVG images and SVG code fences are unsupported by the existing image display path. Add bounded static previews for archived SVG files and completed
svg/ SVG-rootxmlblocks, including source toggling and sanitized SVG downloads.docs/architecture/svg-preview.zh-CN.md.Split from #6230. This PR independently supports SVG on main and contains no ACP mixed-tool-result protocol change or durable receive-job feature. #6230 owns reception recovery and saved-original presentation.
Verification
Tested head:
4f1c86a94b6a0894c93415baeb7d49ac583d5a0c; build/test baseline:222a06fe316f12df3129eff1c16ab3bfaf85c479.diagram.svgand returned a Markdown file image plus an XML fence. The live run verified exact archived bytes. Final independent and combined binaries replayed those same real outputs, exercised source toggling and actual sanitized download, deleted the task-owned source, fully restarted Electron and verified both previews and the original SHA-256. Eight assertions passed per replay. No new generation was requested during final replay.Governance acceptance report · Assertion records, merge simulations and checksums. Earlier before/after, desktop IPC and performance evidence remains in the acceptance release.
Merge independence
Both PRs target
mainand can land in either order. They share a behavior-preserving image presentation/admission foundation; neither requires the other feature. Normal Git merges produce identical trees in both orders. This repository permits squash merges only: after either lands, sync the other with main and reconcilepackages/core/src/image-delivery.ts,packages/ui/src/attachment-image.tsx, andpackages/ui/src/session-media-image.tsx. Both squash orders were simulated against maina4b5f86c5256044d063a62045754e4a3411a8426; the reconciled trees are identical and retain the tested combined implementation. There is no prescribed merge order.AI use
Tool(s) and scope: Codex implemented the split and reception governance, added regression tests, performed real-account Electron acceptance, and updated documentation. Retain
Generated-by: Codexin the squash commit.Checklist
Does this PR entail a change in behavior?