Skip to content

Fix/#847 MacOS drag and drop shapes - #848

Merged
manudous merged 8 commits into
devfrom
fix/#847-macos-drag-and-drop
May 19, 2026
Merged

Fix/#847 MacOS drag and drop shapes#848
manudous merged 8 commits into
devfrom
fix/#847-macos-drag-and-drop

Conversation

@Ivanruii

Copy link
Copy Markdown
Collaborator

Closes#847

@Ivanruii
Ivanruiiforce-pushed the fix/#847-macos-drag-and-drop branch 2 times, most recently from 296fd64 to 113cd57CompareMay 13, 2026 08:07

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a macOS-specific drag-and-drop bridge for the VS Code extension webview to work around iframe drag event routing issues described in #847.

Changes:

  • Adds bridge protocol messages for drag lifecycle and reconstructed gallery drops.
  • Adds shell-side drag interception/preview handling and iframe-side drop reconstruction.
  • Updates gallery drag behavior, platform detection, CSP, and VS Code bridge filtering for drag messages.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
packages/vscode-extension/src/webview/main.tsRegisters the drag bridge in the webview shell.
packages/vscode-extension/src/webview/drag-bridge.tsAdds shell-side drag/drop interception and preview forwarding.
packages/vscode-extension/src/webview/bridge.tsPrevents drag bridge messages from being forwarded to the extension host.
packages/vscode-extension/src/editor/panel.tsAllows data URL images for the shell drag preview CSP.
packages/bridge-protocol/src/model.tsDefines drag bridge message payload types.
packages/bridge-protocol/src/constant.tsAdds drag bridge message constants.
apps/web/src/pods/canvas/canvas.pod.tsxHooks the canvas into the macOS webview drag bridge.
apps/web/src/core/vscode/use-mac-webview-drag-bridge.hook.tsReconstructs gallery drops inside the iframe.
apps/web/src/core/vscode/mac-webview-drag-bridge.utils.tsAdds bridge utility functions and thumbnail data URL loading.
apps/web/src/common/utils/vscode-bridge.utils.tsExports the resolved parent origin for bridge messaging.
apps/web/src/common/helpers/platform.helpers.tsUpdates macOS detection to prefer userAgentData.platform.
apps/web/src/common/components/gallery/components/item-component.tsxSends drag lifecycle messages and suppresses native preview on macOS VS Code.
.changeset/tired-mammals-cough.mdAdds a patch changeset describing the fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +72 to +76
const screenPosition = { x: clientX, y: clientY };
const relativeDivPosition = portScreenPositionToDivCoordinates(
dropDivElement,
screenPosition
);

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

Fixed

Comment on lines +49 to +50
const dataUrl = thumbnailDataUrlRef.current ?? item.thumbnailSrc;
notifyDragStartToWebviewShell(item.type as ShapeType, dataUrl);

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

Fixed

@manudous
manudous merged commit 045a587 into devMay 19, 2026
3 checks passed
@manudous
manudous deleted the fix/#847-macos-drag-and-drop branch May 19, 2026 07:41
Sign up for freeto 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.

[VSCode Extension] Fix MacOs drag & drop issue

3 participants

@Ivanruii@manudous