Skip to content

Fix/#847 MacOS drag and drop shapes#848

Open
Ivanruii wants to merge 5 commits into
devfrom
fix/#847-macos-drag-and-drop
Open

Fix/#847 MacOS drag and drop shapes#848
Ivanruii wants to merge 5 commits into
devfrom
fix/#847-macos-drag-and-drop

Conversation

@Ivanruii
Copy link
Copy Markdown
Collaborator

Closes #847

@Ivanruii Ivanruii force-pushed the fix/#847-macos-drag-and-drop branch 2 times, most recently from 296fd64 to 113cd57 Compare May 13, 2026 08:07
Copy link
Copy Markdown

Copilot AI left a comment

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
File Description
packages/vscode-extension/src/webview/main.ts Registers the drag bridge in the webview shell.
packages/vscode-extension/src/webview/drag-bridge.ts Adds shell-side drag/drop interception and preview forwarding.
packages/vscode-extension/src/webview/bridge.ts Prevents drag bridge messages from being forwarded to the extension host.
packages/vscode-extension/src/editor/panel.ts Allows data URL images for the shell drag preview CSP.
packages/bridge-protocol/src/model.ts Defines drag bridge message payload types.
packages/bridge-protocol/src/constant.ts Adds drag bridge message constants.
apps/web/src/pods/canvas/canvas.pod.tsx Hooks the canvas into the macOS webview drag bridge.
apps/web/src/core/vscode/use-mac-webview-drag-bridge.hook.ts Reconstructs gallery drops inside the iframe.
apps/web/src/core/vscode/mac-webview-drag-bridge.utils.ts Adds bridge utility functions and thumbnail data URL loading.
apps/web/src/common/utils/vscode-bridge.utils.ts Exports the resolved parent origin for bridge messaging.
apps/web/src/common/helpers/platform.helpers.ts Updates macOS detection to prefer userAgentData.platform.
apps/web/src/common/components/gallery/components/item-component.tsx Sends drag lifecycle messages and suppresses native preview on macOS VS Code.
.changeset/tired-mammals-cough.md Adds 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
);
Comment on lines +49 to +50
const dataUrl = thumbnailDataUrlRef.current ?? item.thumbnailSrc;
notifyDragStartToWebviewShell(item.type as ShapeType, dataUrl);
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.

[VSCode Extension] Fix MacOs drag & drop issue

2 participants