Repository navigation
feat(chat,preview): download for chat images and previewed PDFs - #2013
Open
aarontrowbridge wants to merge 2 commits into
Open
aarontrowbridge wants to merge 2 commits into
aarontrowbridge wants to merge 2 commits into
Conversation
Chat image frames and the full-size preview gain a Download button next to Copy. Inside the chat iframe the PNG rides the existing save-file bridge kind, so the extension host opens a native Save dialog (default ~/Downloads) on the machine the user is at; unframed, an anchor download stands. The file keeps the authored basename (or the alt text), saved as .png since both save and copy rasterize to PNG. Adds the outline-download v2 icon and the ui.message.download string.
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
The side-panel file preview gains a Download control beside zoom whenever it holds binary content (PDF, image). Inside the webview the bytes ride the save-file bridge to a native Save dialog on the user's machine; unframed, an anchor download stands. save-file's validation moves into saveFileRequest: the allow-list grows from png/md/txt to images, PDF and markdown, each offered under its own dialog filter; payloads stay basename-only, base64, ~18 MB max.
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.
Important
Problem: Chat image previews (the inline frame and the full-size preview) could be copied but not saved. In the chat iframe a plain
<a download>has nowhere to go, so a figure could only reach disk by pasting it somewhere first.Approach: Add a Download button next to Copy, in the image's hover frame and in the preview header. Inside the iframe the PNG goes over the existing
save-filebridge kind, so the extension host opens a native Save dialog (default~/Downloads) on the machine the user is at. Outside the iframe it falls back to an ordinary anchor download.Scope: Chat images (session-ui overlay, a v2
outline-downloadicon, theui.message.downloadstring in all 18 locales) and the side-panel file preview, which gets a Download control beside zoom for PDFs and images. Extension:save-file's validation moves into an exportedsaveFileRequest, and its allow-list grows from png/md/txt to images, PDF and markdown, each with its own dialog filter.Details
image. It always ends in.png, because save, like copy, rasterizes to PNG, and PNG is the only image type the bridge accepts.data-slot="markdown-copy-button",data-action="download"), so render/dispose, the morphdom skip and label refresh all apply to it. Clicking it shows no "copied" state, since the host owns the Save dialog and its outcome.Verification
chat_bridge.test.ts73/73, including the newsaveFileRequestcases (PDF bytes and filter, the run-card PNG and markdown export paths, refusals). Extension typecheck clean.preview-file-routing93 pass;preview-human-write-gate11 pass.imageFileNamecases and frame tests inmarkdown-local-images.test.ts.ops/hub/deploy-dist.sh --overrideon top of the servedlane/0.4.0tip4c44931b(bundleindex-EfKEEcdi.js).The same commit is on
image-preview-copy(#1993, targetsmain).