Skip to content

fix(composer): attach pasted image files as images - #2560

Merged
Tioit-Wang merged 4 commits into
mainfrom
fix/p1-paste-image
Nov 24, 2026
Merged

Tioit-Wang merged 4 commits into
mainfrom
fix/p1-paste-image

Conversation

@Tioit-Wang

Copy link
Copy Markdown
Collaborator

Summary

Continues #2533 on current main, preserving the original contribution. Native clipboard raster images within the import limits become durable image attachments; non-images, SVGs, and out-of-limit files retain the live-reference path. Includes paste-order, source-deletion, image-to-model, and reference-path coverage, plus a Windows fixture-path correction.

Validation

  • pnpm build:js, desktop typecheck, pnpm lint, architecture check
  • Targeted composer/reference tests and clipboard/directory tests passed
  • pnpm test:e2e:composer-paste and file-reference restart E2E passed
  • pnpm check:pr-base, git diff --check
  • NOT RUN: test:e2e:composer-paste-image-file requires macOS native pasteboard; the candidate was validated on Windows instead

Closes #2529 after merge. Keep the macOS native pasteboard E2E as an explicit outstanding platform validation before merging.

zszz3 and others added 3 commits November 23, 2026 16:48
Screenshot tools such as PixPin put a temporary PNG file, not a bitmap,
on the clipboard. Since native disk-file pastes became live path
references, those images reached the model as a path plus size, so
vision models never saw the pixels and the source could vanish once the
tool cleaned its temp directory.

Native clipboard raster images within the existing import bounds are now
copied into session scratch like picker imports, so they attach as image
chips and are stored as content-addressed attachments on send. Other
files, SVGs and images beyond the bounds keep the reference flow.

fixes #2529
Pass the synthetic native selection directly to the file-reference
user-path fixture so Windows file URLs are not parsed as Linux paths.
This keeps the Electron journey portable while platform clipboard parsing
remains covered by its dedicated tests.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Deploying pi-desktop with  Cloudflare Pages  Cloudflare Pages

Latest commit: ea0136d
Status: ✅  Deploy successful!
Preview URL: https://1f1fb856.pi-desktop.pages.dev
Branch Preview URL: https://fix-p1-paste-image.pi-desktop.pages.dev

View logs

@Tioit-Wang
Tioit-Wang merged commit 28921d9 into main Nov 24, 2026
7 checks passed
@Tioit-Wang
Tioit-Wang deleted the fix/p1-paste-image branch November 24, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 新版本无法读取图片内容

2 participants