Skip to content

Commit 537348e

Browse files
committed
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
1 parent 4cf45af commit 537348e

11 files changed

Lines changed: 3518 additions & 2369 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 68 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,99 @@ 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: Run Electron smoke test
21+
run: xvfb-run -a npm test
22+
523
build_on_linux:
624
runs-on: ubuntu-latest
725
steps:
826
- name: Check out Git repository
9-
uses: actions/checkout@v1
27+
uses: actions/checkout@v4
1028

1129
- name: Install libarchive-tools for pacman
1230
run: |
1331
sudo apt-get update -y && sudo apt-get install -y libarchive-tools
1432
15-
- name: Install Node.js, NPM and Yarn
16-
uses: actions/setup-node@v1
33+
- name: Install Node.js and NPM
34+
uses: actions/setup-node@v4
1735
with:
18-
node-version: 18
36+
node-version: 22
37+
cache: npm
1938

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 }}
39+
- name: Install dependencies
40+
run: npm ci
41+
42+
- name: Build Electron app
43+
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
44+
run: npm run build
2645

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') }}
46+
- name: Build & release Electron app
47+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
48+
run: npm run release
49+
env:
50+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3051

3152
build_on_mac:
3253
runs-on: macos-latest
3354
steps:
3455
- name: Check out Git repository
35-
uses: actions/checkout@v1
56+
uses: actions/checkout@v4
3657

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

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-
5377
build_on_win:
5478
runs-on: windows-latest
5579
steps:
5680
- name: Check out Git repository
57-
uses: actions/checkout@v1
81+
uses: actions/checkout@v4
5882

59-
- name: Install Node.js, NPM and Yarn
60-
uses: actions/setup-node@v1
83+
- name: Install Node.js and NPM
84+
uses: actions/setup-node@v4
6185
with:
62-
node-version: 18
86+
node-version: 22
87+
cache: npm
6388

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 }}
89+
- name: Install dependencies
90+
run: npm ci
91+
92+
- name: Build Electron app
93+
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
94+
run: npm run build
7095

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') }}
96+
- name: Build & release Electron app
97+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
98+
run: npm run release
99+
env:
100+
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

‎README.md‎

Lines changed: 2 additions & 0 deletions
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)

‎docs/planning/PLANNING.md‎

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22

33
> Living document. Baseline snapshot taken 2026-07-22, covering `main` up to commit `8f1efa0`. Update this file as decisions get made and features land — don't fork a separate doc per feature.
44
5+
## 0. Work log
6+
7+
### 2026-07-22 — Repo hygiene + Electron upgrade (branch `claude-contrib`)
8+
9+
Landed:
10+
11+
- **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` deliberately held at `^8.x` (v9+ is ESM-only; migrating would force a CommonJS→ESM rewrite of the whole main process — out of scope, tracked as a future decision).
12+
- **Blocker fix — `File.path` removal (Electron 32+).** `renderer/droppoint.js` now resolves dropped-file paths via `window.electron.getPathForFile(f)`, backed by `webUtils.getPathForFile` newly exposed through the `src/preload.js` contextBridge. Without this, drag-in throws on every drop on Electron 43.
13+
- **CI modernized.** `.github/workflows/build.yml`: `checkout@v1`/`setup-node@v1` → `@v4`, Node 18 → 22 (Electron 43 requires ≥22.12), and the archived `samuelmeuli/action-electron-builder` replaced with explicit `npm ci` + `npm run build` / `npm run release` steps (release still gated on `v*` tags). Added a `smoke_test` job (ubuntu + xvfb).
14+
- **Smoke test added.** `test/smoke.spec.js` (Playwright `_electron`) boots the app and asserts the shelf window opens and the `getPathForFile` bridge is exposed — directly guarding the blocker fix. `npm test` runs it. Resolves the "zero automated tests" gap for the boot path.
15+
- **Cleanup.** Removed the dead `<webview>` tag from `static/settings.html` (never functional — `webviewTag` was never enabled). Updated README's OS-support floor (Windows 10+, macOS 12 Monterey+) per Electron 43's raised minimums.
16+
17+
Deliberately **skipped** this pass (see §4 annotations):
18+
19+
- `nodeIntegration: true` → `false` + `contextIsolation`/`sandbox` hardening. Still functional on v43; the user flagged `nodeIntegration: true` as a likely deliberate workaround for a past bug, so it's left untouched pending its own investigation.
20+
21+
Known limitations of this pass:
22+
23+
- **Not verified in this environment.** The Electron binary can't be downloaded in the planning sandbox (GitHub release download is 403-blocked; only the npm registry is reachable), so the app was never booted here. The smoke test parses and is discovered locally (`playwright test --list`) but its first *real* execution is in CI / on a dev machine. Transparent/frameless/shadowed window rendering and Tray-under-xvfb behavior are the specific things to watch on that first run.
24+
25+
Follow-up not yet done: **prune stale branches** `imgbot` and `v1.2.0-patch` — `git push --delete` is 403-blocked by the managed git endpoint, so these need deleting via the GitHub UI. (`claude/project-overview-planning-w5yym2` was already gone; `test-suite` and `release` intentionally kept.) PR #36 (ImgBot) was closed.
26+
527
## 1. What DropPoint is
628

729
DropPoint is a cross-platform (Windows/macOS/Linux) Electron desktop utility that acts as a drag-and-drop "shelf". You summon a small floating window with a global shortcut (`Shift+CapsLock` on Windows/Linux, `Shift+Tab` on macOS), drag files into it from one location, then drag them back out at a different location — including across virtual desktops/workspaces and while other apps are fullscreen. It avoids having to tile two windows side-by-side just to move files between them.
@@ -135,13 +157,13 @@ sequenceDiagram
135157

136158
- **Repeated `Store` instantiation.** `App.js`, `Window.js`, `Shortcut.js`, `RequestHandlers.js`, and `Settings.js` each do their own `new Store(configOptions)` instead of sharing one instance/module. Works because `electron-store` is file-backed, but invites schema drift and redundant I/O.
137159
- **Shared preload script conflates two windows' concerns.** Both the shelf window and the settings window load the same `src/preload.js`, which exposes settings-only IPC (`fetchConfig`, `onConfigReceived`, `applySettingsInConfig`) to the shelf renderer and vice versa — unnecessary surface area per window.
138-
- **Mixed-era security posture.** `nodeIntegration: true` is set on `BrowserWindow`s *and* a `contextBridge`-based preload is used. The contextBridge pattern assumes reliance on `contextIsolation` (on by default since Electron 12) instead of `nodeIntegration`. Leaving `nodeIntegration: true` on widens attack surface for no benefit — this is exactly what issue #51 flags.
160+
- **Mixed-era security posture.** `nodeIntegration: true` is set on `BrowserWindow`s *and* a `contextBridge`-based preload is used. The contextBridge pattern assumes reliance on `contextIsolation` (on by default since Electron 12) instead of `nodeIntegration`. Leaving `nodeIntegration: true` on widens attack surface for no benefit — this is exactly what issue #51 flags. _(2026-07-22: deliberately left as-is — `nodeIntegration: true` is a suspected intentional workaround for a past bug; revisit with its own investigation rather than flipping it blind.)_
139161
- **`History.js` persistence bug.** Writes to a bare relative path `"instanceHistory.json"` (resolved against CWD, not a stable app data directory) — lands in whatever directory the app happened to be launched from, not a predictable location. Must be fixed as part of finishing the feature.
140162
- **Dead code left via commenting, not removal.** Tray history submenu, `History` init calls, splash-screen timers are all commented-out rather than deleted, scattered across `App.js`/`Window.js`/`Tray.js` — raises cognitive load reading the main process.
141163
- **No single-instance coordination.** Every shortcut press / tray click spawns a brand-new `BrowserWindow`/`Instance`, with no `app.requestSingleInstanceLock()` or shared registry beyond the in-memory `Instance` class. Intentional today (multi-shelf is a feature), but will need a rethink once CLI control exists — a CLI invocation needs to *talk to* a running instance, not just spawn another one.
142164
- **Settings renderer ships a dead fixture.** `renderer/settings-renderer.js` still contains a large hardcoded `configResponse`/`configObj` stub object left over from before the dynamic config-driven UI was wired up — unused but shipped.
143-
- **Zero automated tests, no type checking.** Plain CommonJS JS, JSDoc only on a handful of functions. Any refactor (especially the Electron major-version upgrade) is currently unverifiable except by manual testing across three OSes.
144-
- **Electron is ~4 majors behind** (v21, Nov 2022, vs. current ~v37). Upgrading is entangled with the `nodeIntegration`/`contextIsolation` cleanup above, so they should land together rather than as separate efforts.
165+
- **Zero automated tests, no type checking.** Plain CommonJS JS, JSDoc only on a handful of functions. Any refactor (especially the Electron major-version upgrade) is currently unverifiable except by manual testing across three OSes. _(2026-07-22: first automated test added — `test/smoke.spec.js` boots the app and checks the preload bridge. Still no type checking and no coverage beyond the boot path.)_
166+
- **Electron is ~4 majors behind** (v21, Nov 2022, vs. current ~v37). ~~Upgrading is entangled with the `nodeIntegration`/`contextIsolation` cleanup above, so they should land together rather than as separate efforts.~~ _(2026-07-22: **done** — upgraded to Electron 43.2.0. The `nodeIntegration` cleanup was intentionally decoupled and deferred rather than bundled in.)_
145167

146168
## 5. Backlog snapshot (26 open issues, 2 stale open PRs)
147169

@@ -151,7 +173,7 @@ Grouped by theme, cross-referenced to the priorities picked for the next phase (
151173
|---|---|---|
152174
| **Move mode (not just copy)** | #9, #45 | Prioritized next |
153175
| **Configurable shortcuts** | #52, #42, #10 (meta) | Prioritized next |
154-
| **Electron/security modernization** | #51 | Prioritized next |
176+
| **Electron/security modernization** | #51 | Electron upgrade **done** (2026-07-22); `nodeIntegration`/navigation-guard hardening from #51 still open |
155177
| **Instance file history** | (feature exists, disabled) | Prioritized next — finish it |
156178
| CLI / external automation | #55 | Backlog, not prioritized now |
157179
| Multi-monitor support | #8 | Backlog |
@@ -160,7 +182,7 @@ Grouped by theme, cross-referenced to the priorities picked for the next phase (
160182
| Auto-sense drag / gesture launch | #46, #4 | Backlog |
161183
| Homebrew / ARM Windows packaging | #37, #54 | Backlog |
162184
| Launch-minimized / no-instance-on-startup | #38, #43 | Already partially addressed (`spawnOnLaunch` setting exists) |
163-
| Stale open PRs | #35 (macOS shortcut → Option+Tab), #36 (ImgBot image optimization) | Need a decision: merge, close, or supersede |
185+
| Stale open PRs | #35 (macOS shortcut → Option+Tab), ~~#36 (ImgBot)~~ | #36 **closed** (2026-07-22). #35 left open — may be superseded by configurable-shortcuts work |
164186

165187
## 6. Future architecture (tentative)
166188

0 commit comments

Comments
 (0)