Add native macOS support - #67
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new macOS clipboard fast-path parsing can mis-handle file://host/... URLs (hostname dropped), and the new macOS documentation contains branch-/user-specific wording that should be made generic.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds first-class macOS support to Edge-Drop by introducing a native pasteboard/helper binary, macOS-specific window/tray/login-item behavior, and packaging/CI updates, while keeping existing Windows behavior behind platform checks.
Changes:
- Add macOS native helper + main-process adapters (clipboard files/images, Command+V simulation, fullscreen detection, window layering/geometry).
- Add macOS packaging + CI (electron-builder mac targets, helper build script, GitHub Actions workflow).
- Refine renderer UX for macOS/Retina and expand tests to cover macOS contracts and shared drag/URI parsing.
File summaries
| File | Description |
|---|---|
| tests/trayTheme.test.ts | Skip Windows-only tray theme assertion on non-Windows. |
| tests/storePaths.test.ts | Skip Windows Store/exe interop tests on non-Windows. |
| tests/storePackaging.test.ts | Update packaging contract tests for per-platform build settings. |
| tests/storeLoginItem.test.ts | Skip Windows registry login-item tests on non-Windows. |
| tests/storeLoginApply.test.ts | Skip Windows Store login-item behavior tests on non-Windows. |
| tests/macosPort.test.ts | Add macOS port contract tests (scripts/build/window/CSP/helper). |
| tests/launchAtLoginFixes.test.ts | Skip Windows registry healing tests on non-Windows. |
| tests/imageProtocol.test.ts | Add tests for macOS clipboard file format recognition. |
| tests/geometry.test.ts | Add tests for collapsed-window bounds used by macOS hot-zone strip. |
| tests/dropPayload.test.ts | Add tests for shared external drag detection + URI-list decoding. |
| src/styles/settings.css | Tweak indicator-card active visuals. |
| src/styles/panel.css | Add active/pressed button styles + macOS/Retina-specific chip styling. |
| src/styles/global.css | Normalize button styling and focus-visible outline behavior. |
| src/main.tsx | Expose platform to CSS via data-platform. |
| src/hooks/useEdgeHover.ts | Use shared external-drag detection to open panel during Finder drags. |
| src/components/Panel.tsx | Centralize drag payload detection via shared helper. |
| src/components/IndicatorStyleFlyout.tsx | Update style-card visuals to match new macOS/Retina treatment. |
| src/components/HotkeyRecorder.tsx | Render mac-friendly modifier labels (Command/Option/Control). |
| src/components/Header.tsx | Adjust header sizing/gaps/icons for macOS/Retina metrics. |
| shared/dropPayload.ts | Add shared helpers for drag payload types + URI-list to file paths. |
| shared/bridge.ts | Add platform field to renderer bridge contract. |
| resources/macos/EdgeDropMacHelper.swift | New native helper for pasteboard/files/images/paste/fullscreen. |
| resources/macos/build-helper.sh | Build/universalize/sign the macOS helper binary. |
| README.md | Document macOS support and update platform badge. |
| package.json | Add macOS scripts and electron-builder mac/win extraResources structure. |
| NOTICE | Add macOS-port attribution/notice file. |
| MACOS.md | Add macOS build/run/permissions/distribution documentation. |
| index.html | Allow font-src data: in CSP for packaged fonts. |
| electron/preload/index.ts | Decode Finder URI-list drops into file adds before URL handling. |
| electron/main/window.ts | macOS-specific hot-zone window geometry + Spaces/Mission Control behavior. |
| electron/main/updater.ts | Disable auto-updater on macOS until a release feed exists. |
| electron/main/tray.ts | Use template tray image on macOS and size appropriately. |
| electron/main/macos.ts | Main-process wrapper around the native macOS helper binary. |
| electron/main/loginItems.ts | Add macOS login-item read/apply path and guard Windows-only healing. |
| electron/main/ipc.ts | Route clipboard writes/paste simulation through macOS helper when on darwin. |
| electron/main/index.ts | Set macOS activation policy to accessory (menu-bar utility behavior). |
| electron/main/geometry.ts | Add collapsed-window bounds helper for macOS Finder drag targeting. |
| electron/main/fullscreen.ts | Add macOS fullscreen checks via native helper; expand monitor to darwin. |
| electron/clipboard/formats.ts | Detect/read macOS clipboard file URLs (formats + helper integration). |
| .gitignore | Ignore macOS helper build/bin outputs. |
| .github/workflows/macos.yml | Add macOS CI workflow (typecheck, tests, mac build artifacts). |
Review details
- Files reviewed: 40/42 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const urls = raw.match(/file:\/\/[^\s<>'"]+/g) ?? [] | ||
| const paths = filterValidPaths(urls.flatMap((url) => { | ||
| try { | ||
| return [decodeURIComponent(new URL(url).pathname)] | ||
| } catch { | ||
| return [] | ||
| } | ||
| })) | ||
| if (paths.length) return paths |
| <img src=".github/readme/Logo.gif" alt="Edge-Drop Logo" width="220" style="max-width: 100%; height: auto;" /> | ||
| </p> | ||
|
|
||
| > **macOS port:** the `macos-port` branch adds a native macOS pasteboard helper, menu-bar/Spaces behavior, Finder file copy/paste, Command+V automation, full-screen detection, launch at login, and DMG/ZIP packaging. See [MACOS.md](MACOS.md) for setup and current distribution notes. |
|
@prioneto Thanks for this and give me some time |
let me know if i can keep improving it or if there is something else i can help with! I just loved the idea and wanted it for my macbook. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@prioneto i am really grateful for your contribution but and i have plans for mac port but the problem i i do not have access to a mac at the point i am in the last year of my Computer Science and i have plans to buy a mac after graduation and for now i have a windows laptop and non of my friends have mac too and those who have i can to ask them and its just a difficult situation for me to test or built a version for mac at the point and i in any mean not saying that your contribution is bad or something. |
Summary
Adds a native macOS port of Edge-Drop while preserving the existing Windows behavior.
Testing