Skip to content

fix(desktop): restore clipboard image paste / 修复桌面端剪贴板图片粘贴#3707

Merged
SivanCola merged 5 commits into
esengine:main-v2from
SivanCola:codex/fix-desktop-image-paste
Jun 10, 2026
Merged

fix(desktop): restore clipboard image paste / 修复桌面端剪贴板图片粘贴#3707
SivanCola merged 5 commits into
esengine:main-v2from
SivanCola:codex/fix-desktop-image-paste

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

Summary

  • Restore desktop image paste when WebView exposes clipboard images through DataTransferItem instead of DataTransfer.files.
  • Add a native clipboard fallback using the existing control.SaveClipboardImage path when JS clipboard data is empty or the paste event is not delivered.
  • Keep pasted attachments under the active workspace and add a regression test for that contract.

Root cause

The composer only inspected e.clipboardData.files. In some desktop WebView clipboard states, Ctrl/Cmd+V provides an image hint or item but no files, and plain text is empty, so the textarea paste becomes a no-op with no visible attachment.

Verification

  • pnpm typecheck
  • pnpm test
  • go test . (desktop)
  • git diff --check

@SivanCola SivanCola requested a review from esengine as a code owner June 9, 2026 12:40
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) labels Jun 9, 2026
@SivanCola SivanCola changed the title fix(desktop): restore clipboard image paste fix(desktop): restore clipboard image paste / 修复桌面端剪贴板图片粘贴 Jun 9, 2026
@github-actions github-actions Bot added agent Core agent loop (internal/agent, internal/control) provider Model providers & selection (internal/provider) labels Jun 9, 2026
…image-paste

# Conflicts:
#	internal/control/shell_test.go
#	internal/provider/anthropic/anthropic_test.go
@SivanCola SivanCola enabled auto-merge June 9, 2026 12:57

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid fix — the three-layer fallback (items merge → native clipboard read → keypress timer) is well thought out, with dedup so the layers never double-attach. Nice catch promoting the silent os.Chdir failure to a real error, and good workspace-root test coverage. Thanks!

@SivanCola SivanCola merged commit d6f10b8 into esengine:main-v2 Jun 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) desktop Wails desktop app (desktop/**) provider Model providers & selection (internal/provider) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants