Skip to content

[Feature] Electron 21→43 upgrade, preload bridge fix, and CI modernization - #57

Merged
GameGodS3 merged 8 commits into
mainfrom
claude-contrib
Aug 2, 2026
Merged

[Feature] Electron 21→43 upgrade, preload bridge fix, and CI modernization#57
GameGodS3 merged 8 commits into
mainfrom
claude-contrib

Conversation

@GameGodS3

Copy link
Copy Markdown
Owner

Context

This PR addresses the critical blocker introduced by Electron 32+ removing the File.path property, which breaks drag-in/drag-out functionality on the upgraded runtime. It also modernizes the CI pipeline and adds the first automated test coverage for the boot path.

Resolves the zero-test gap and unblocks the app on Electron 43.

Description of the Change

Electron & Dependencies:

  • Upgraded Electron from 21.3.143.2.0
  • Updated electron-builder from 23.0.226.15.3
  • Updated electron-updater from 4.3.96.8.9
  • Held electron-store at ^8.x (v9+ is ESM-only; full CommonJS→ESM migration deferred)
  • Updated Node requirement to >=22.12.0 (Electron 43 minimum)

Critical Blocker Fix — File.path Removal:

  • renderer/droppoint.js now resolves dropped-file paths via window.electron.getPathForFile(f) instead of the removed File.path property
  • Exposed webUtils.getPathForFile through the preload contextBridge in src/preload.js
  • Without this fix, drag-in throws on every drop on Electron 32+

CI Modernization:

  • Replaced archived samuelmeuli/action-electron-builder@v1 with explicit npm ci + npm run build / npm run release steps
  • Updated all action versions: checkout@v1/setup-node@v1@v4
  • Updated Node version in CI from 18 → 22
  • Release still gated on v* tags; added conditional logic to separate build vs. build+release flows

Smoke Test Added:

  • New test/smoke.spec.js (Playwright _electron) boots the app and verifies:
    • The shelf window opens with title "DropPoint"
    • The getPathForFile bridge is exposed on window.electron
  • Runs on Linux CI with xvfb-run (headless display)
  • Added npm test script and playwright.config.js
  • Directly guards the File.path blocker fix

Minor Fixes:

  • Fixed tray icon rendering on HiDPI Windows: skip resizing .ico files (let OS pick the DPI-appropriate frame) while still resizing for macOS/Linux
  • Removed dead <webview> tag from static/settings.html (never functional)
  • Updated README OS-support floor to Windows 10+, macOS 12 Monterey+ per Electron 43's raised minimums
  • Added .nvmrc (Node 22) and updated .gitignore for Playwright artifacts

Deliberately Deferred:

Verification Process

  • Smoke test parses and is discovered locally (playwright test --list)
  • First real execution will be in CI on this PR; watch for:
    • Transparent/frameless/shadowed window rendering on Linux/macOS/Windows
    • Tray icon appearance on HiDPI displays
    • Preload bridge availability in the shelf renderer
  • Manual verification on dev machine recommended before merge to confirm window rendering and tray behavior

Release Notes

DropPoint now runs on Electron 43 (up from 21). Fixed a critical bug where drag-in would fail on Electron 32+ due to the removal of the File.path property. Added the first automated smoke test to guard the boot path and preload bridge.

https://claude.ai/code/session_01NfJxwvs65kVRNnVym5UsYe

claude added 8 commits July 22, 2026 07:33
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.
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
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
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
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
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
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
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
@GameGodS3
GameGodS3 merged commit 137789d into main Aug 2, 2026
8 checks passed
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.

2 participants