Repository navigation
feat(chat): copy and download images from the image itself - #1951
Conversation
muzimu217
left a comment
There was a problem hiding this comment.
This is the same change I reviewed as #1918, resubmitted as feat per the maintainer's call, and the two points from that review are both in: SUPPORTED_IMAGE_DATA_URL now accepts jpe?g with a comment explaining that sources emit image/jpg often enough to matter, and downloadMarkdownImage strips [?#] before taking the last path segment, with a test for the alias.
Single commit, rebased onto current main, and the permission story is unchanged from #1918: navigator.clipboard.write works because installLiveMicrophonePermissionHandlers grants every non-media permission on session.defaultSession (microphone-permissions.ts:50-58), which is why no IPC change is needed. Nothing new to object to.
|
Nothing left on the code from my side — the image type handling and the filename cleanup both have tests, all six checks pass, and the two points from the earlier review are addressed. Only a rebase is left, plus a quick look to confirm the menus still look the same afterwards. Thank you for the quick fixes. 代码上我这边没有遗留意见了——图片类型的处理和文件名的清理都有测试,六项检查全绿,之前 review 的两点也都改好了。 只剩变基,变基后再确认一下菜单外观没有变化即可。谢谢你的快速修正。 |
Images in a reply could only be opened or have their path copied, so getting the picture itself into another app meant a detour through the file manager. Generated images and Markdown images now offer Copy image and Download image on right-click; the generated-image viewer also has a copy button and Cmd/Ctrl+C. Copy writes PNG to the clipboard (JPEG, JPG and WebP are re-encoded). Download names come from the URL path without its query or fragment; local paths keep their file name verbatim. Refs vastsa#1917, supersedes vastsa#1918.
0b830f6 to
4145f64
Compare
|
@zszz3 is attempting to deploy a commit to the vastsa's projects Team on Vercel. A member of the Team first needs to authorize it. |
# Conflicts: # docs/spec/06-delivery/04-e2e-test-plan.md
Refs #1917. 接替 #1918:维护者在 #1918 中判定这是新增能力,应以 feat 提交,因此改为 feat 重新提交。代码与 #1918 最终版本相同(含 review 修复:
image/jpg兼容、URL 下载名去掉?/#),已合并到最新 main 后整理为单个提交。功能
<dialog>,菜单 portal 到 dialog 内,复制结果用内联状态提示(toast 会被顶层遮挡)。验证
pnpm build:js、desktop typecheck、pnpm lint、architecture check、git diff --check通过。image-clipboard、image-download-name、generated-image-context-menu,并更新chat-file-open-with-menu的契约断言。