Skip to content

Commit 137789d

Browse files
GameGodS3claude
andauthored
[Feature] Electron 21→43 upgrade, preload bridge fix, and CI modernization (#57)
* Add project planning doc: history, architecture critique, diagrams Baseline snapshot of DropPoint's commit history, current architecture (with Mermaid component/sequence diagrams), a critique of known architecture issues, the open-issue backlog grouped by theme, and a tentative future-architecture diagram for the next roadmap phase (move mode, configurable shortcuts, Electron/security modernization, finishing instance history). Open questions are tracked for follow-up. * Upgrade Electron 21 -> 43, modernize CI, add boot smoke test Dependency bumps: - electron 21.3.1 -> 43.2.0 - electron-builder 23.0.2 -> 26.15.3 - electron-updater 4.3.9 -> 6.8.9 - electron-store held at ^8.x (v9+ is ESM-only) Blocker fix: File.path was removed in Electron 32+, which breaks the core drag-in path. Dropped-file paths now resolve via webUtils.getPathForFile, exposed through the preload contextBridge and called from renderer/droppoint.js. CI: bump actions to v4, Node 18 -> 22 (Electron 43 needs >=22.12), and replace the archived samuelmeuli/action-electron-builder with explicit npm ci + build/release steps (release still gated on v* tags). Add a smoke_test job running under xvfb. Tests: add a Playwright _electron smoke test that boots the app and asserts the shelf window opens and the getPathForFile bridge is exposed. Cleanup: remove the dead <webview> tag from settings.html (webviewTag was never enabled) and document the raised OS floor (Windows 10+, macOS 12+) in the README. Note: nodeIntegration hardening was intentionally deferred; it is a suspected deliberate workaround and needs its own investigation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NfJxwvs65kVRNnVym5UsYe * Pin supported Node to 22 LTS to fix Electron install on newer Node Electron 43's post-install runs @electron/get v5 (pure ESM), which does a bare ESM import of the CommonJS sumchecker package. Node's newer "Current" releases (e.g. 26.x) have a legacyMainResolve regression that fails to resolve sumchecker's legacy `main` field, crashing the binary download so `npm start` reports "Electron failed to install correctly." Add an engines floor (>=22.12.0, matching @electron/get) and an .nvmrc pinning Node 22 LTS, and document the requirement in the README so this footgun is caught early instead of surfacing as a cryptic ESM error. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NfJxwvs65kVRNnVym5UsYe * Fix blank Windows tray icon by not resizing the .ico On Windows the tray icon was built by resizing a nativeImage created from the multi-resolution droppoint.ico down to 16px. On HiDPI Windows displays this renders a blank (but still clickable) tray slot. Pass the .ico through untouched on Windows so the OS selects the correct frame for the display DPI; keep the 16px resize for macOS/Linux, which expect a small image. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NfJxwvs65kVRNnVym5UsYe * Fix CI: invalid win build config and smoke-test binary-download race Builds (all 3 OSes) failed electron-builder 26 schema validation: win.publisherName is no longer allowed on WindowsConfiguration (additionalProperties: false; it moved to the Windows signing config). Removed it — the app doesn't code-sign, so it had no effect. smoke_test timed out because the Electron binary was downloading during the test, exceeding the 60s timeout. Pre-download the binary in a dedicated CI step before running the test, and raise the Playwright timeout to 120s for cold-runner launch margin. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NfJxwvs65kVRNnVym5UsYe * Harden smoke test for xvfb: no-sandbox/disable-gpu + log piping The smoke test hung the full timeout under CI because Electron's transparent shelf window wedges the GPU/sandbox process under xvfb, so _electron.launch() never settled. Launch with --no-sandbox, --disable-gpu, --disable-dev-shm-usage and --disable-software-rasterizer (standard CI flags), and pipe the Electron main-process stdout/stderr into the test output so any further failure is diagnosable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NfJxwvs65kVRNnVym5UsYe * Fix CI: builds must not publish; smoke test must not eval blank splash Build jobs packaged successfully but failed at the end trying to publish to GitHub Releases ("GH_TOKEN not set"). push-triggered runs don't get a token and shouldn't publish — only the tag-gated release step should. Set the build script to `electron-builder --publish never`; `release` keeps `--publish always`. Smoke test: the app boots fine (logs confirm the shelf Instance is created), but getShelfWindow called `.title()` on the hidden splash BrowserWindow, which loads no content and hangs the eval, timing out the whole test. Match the shelf by `win.url()` (no in-page eval) instead, and read title + preload-bridge presence in a single evaluate after domcontentloaded. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NfJxwvs65kVRNnVym5UsYe * Make smoke test process-level to avoid CDP wedge under xvfb Playwright's _electron CDP driver hung the full timeout (teardown included) introspecting DropPoint's transparent, always-on-top shelf window under a bare xvfb X server with no window manager. The app itself boots fine — CI logs show it logging "Instance ID" every run. Replace the CDP approach with a robust process-level boot check: spawn the app, wait for its own "Instance ID" ready-log on stdout (proving it launched and created the shelf without crashing on Electron 43), then SIGKILL it. Add a fast source-level guard that the File.path -> webUtils.getPathForFile fix stays wired in preload.js and droppoint.js. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NfJxwvs65kVRNnVym5UsYe --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8f1efa0 commit 137789d

13 files changed

Lines changed: 3783 additions & 2370 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 71 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,102 @@ name: Build
22
on: [push, pull_request]
33

44
jobs:
5+
smoke_test:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Check out Git repository
9+
uses: actions/checkout@v4
10+
11+
- name: Install Node.js and NPM
12+
uses: actions/setup-node@v4
13+
with:
14+
node-version: 22
15+
cache: npm
16+
17+
- name: Install dependencies
18+
run: npm ci
19+
20+
- name: Pre-download Electron binary
21+
run: node node_modules/electron/install.js
22+
23+
- name: Run Electron smoke test
24+
run: xvfb-run -a npm test
25+
526
build_on_linux:
627
runs-on: ubuntu-latest
728
steps:
829
- name: Check out Git repository
9-
uses: actions/checkout@v1
30+
uses: actions/checkout@v4
1031

1132
- name: Install libarchive-tools for pacman
1233
run: |
1334
sudo apt-get update -y && sudo apt-get install -y libarchive-tools
1435
15-
- name: Install Node.js, NPM and Yarn
16-
uses: actions/setup-node@v1
36+
- name: Install Node.js and NPM
37+
uses: actions/setup-node@v4
1738
with:
18-
node-version: 18
39+
node-version: 22
40+
cache: npm
1941

20-
- name: Build/release Electron app
21-
uses: samuelmeuli/action-electron-builder@v1
22-
with:
23-
# GitHub token, automatically provided to the action
24-
# (No need to define this secret in the repo settings)
25-
github_token: ${{ secrets.github_token }}
42+
- name: Install dependencies
43+
run: npm ci
44+
45+
- name: Build Electron app
46+
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
47+
run: npm run build
2648

27-
# If the commit is tagged with a version (e.g. "v1.0.0"),
28-
# release the app after building
29-
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
49+
- name: Build & release Electron app
50+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
51+
run: npm run release
52+
env:
53+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3054

3155
build_on_mac:
3256
runs-on: macos-latest
3357
steps:
3458
- name: Check out Git repository
35-
uses: actions/checkout@v1
59+
uses: actions/checkout@v4
3660

37-
- name: Install Node.js, NPM and Yarn
38-
uses: actions/setup-node@v1
61+
- name: Install Node.js and NPM
62+
uses: actions/setup-node@v4
3963
with:
40-
node-version: 18
64+
node-version: 22
65+
cache: npm
66+
67+
- name: Install dependencies
68+
run: npm ci
69+
70+
- name: Build Electron app
71+
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
72+
run: npm run build
73+
74+
- name: Build & release Electron app
75+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
76+
run: npm run release
77+
env:
78+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4179

42-
- name: Build/release Electron app
43-
uses: samuelmeuli/action-electron-builder@v1
44-
with:
45-
# GitHub token, automatically provided to the action
46-
# (No need to define this secret in the repo settings)
47-
github_token: ${{ secrets.github_token }}
48-
49-
# If the commit is tagged with a version (e.g. "v1.0.0"),
50-
# release the app after building
51-
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
52-
5380
build_on_win:
5481
runs-on: windows-latest
5582
steps:
5683
- name: Check out Git repository
57-
uses: actions/checkout@v1
84+
uses: actions/checkout@v4
5885

59-
- name: Install Node.js, NPM and Yarn
60-
uses: actions/setup-node@v1
86+
- name: Install Node.js and NPM
87+
uses: actions/setup-node@v4
6188
with:
62-
node-version: 18
89+
node-version: 22
90+
cache: npm
6391

64-
- name: Build/release Electron app
65-
uses: samuelmeuli/action-electron-builder@v1
66-
with:
67-
# GitHub token, automatically provided to the action
68-
# (No need to define this secret in the repo settings)
69-
github_token: ${{ secrets.github_token }}
92+
- name: Install dependencies
93+
run: npm ci
94+
95+
- name: Build Electron app
96+
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
97+
run: npm run build
7098

71-
# If the commit is tagged with a version (e.g. "v1.0.0"),
72-
# release the app after building
73-
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
99+
- name: Build & release Electron app
100+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
101+
run: npm run release
102+
env:
103+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/node_modules/
22
/node_modules/*
33
/release_builds/
4+
/dist/
5+
/test-results/
6+
/playwright-report/
47
build_installer.js
58
test.html
69
instanceHistory.json

‎.nvmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

‎README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ DropPoint helps you drag content without having to open side-by-side windows
2323

2424
Works on **Windows**, **Linux** and **MacOS**.
2525

26+
> **Minimum OS versions:** Windows 10 or later, macOS 12 (Monterey) or later, and a modern 64-bit Linux distribution. Older releases (pre-`1.3.x`) are available for legacy systems on the [Releases Page](https://github.com/GameGodS3/DropPoint/releases).
27+
2628
## Table of Contents
2729
- [:sparkles: Demo](#sparkles-demo)
2830
* [Across maximized windows in the same desktop](#across-maximized-windows-in-the-same-desktop)
@@ -67,7 +69,9 @@ Go to the [Releases Page](https://github.com/GameGodS3/DropPoint/releases) to do
6769

6870
## :gear: Developer Installation
6971

70-
**You must have NPM and Git installed in your PC**
72+
**You must have Node.js and Git installed in your PC.**
73+
74+
> Use **Node.js 22 LTS** (the version this project is built and tested against — see `.nvmrc`). Newer non-LTS "Current" releases such as Node 26 have ESM module-resolution regressions that break Electron's binary install (`@electron/get` fails to load `sumchecker`). If you use [nvm](https://github.com/nvm-sh/nvm), run `nvm use`.
7175
7276
1. Clone repo and change into directory
7377
```bash

0 commit comments

Comments
 (0)