Windows support: tray, toasts, single-instance, native dialogs, icon pipeline - #1
Open
ChampionDesigns wants to merge 1 commit into
Open
Windows support: tray, toasts, single-instance, native dialogs, icon pipeline#1ChampionDesigns wants to merge 1 commit into
ChampionDesigns wants to merge 1 commit into
Conversation
…pipeline Make the app run cleanly on Windows while keeping every macOS code path byte-identical (win32 behavior is gated on process.platform in main.js and a .win32 <html> class in the renderer): - app.setAppUserModelId + toast icon so Windows notifications work - win32-only single-instance lock (second launch focuses the running app instead of EADDRINUSE-ing the OAuth loopback port) - close-to-tray: closing the window hides to the system tray so background ping polling survives; guarded so shutdown/logoff are never blocked and the window is never hidden without a tray to bring it back - native dialog IPC (dialog:confirm/alert) replaces window.confirm/alert on Windows only (Electron-on-Windows dead-keyboard-after-dialog bug) - Menu.setApplicationMenu(null) on win32 (default menu renders inside the window) with F12 / Ctrl+Shift+I rebound for main-window DevTools - clamp the 1240x840 window to the display work area (no-op where it fits) - best-effort [::1] twin for the OAuth callback server; EACCES port errors get an actionable message (Windows excluded port ranges) - setup screen shows the real per-OS config path from state:get - win32-scoped thin scrollbar CSS; Ctrl variant of the webview DevTools chord - tools/make-ico.js: dependency-free ICNS->ICO converter; icon.ico committed as a runtime asset (tray + window icon); npm run package:win builds dist/bping-win32-x64 with proper exe metadata - HTML-escape the error param reflected by the OAuth callback page - README + CLAUDE.md Windows sections Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes bping run cleanly on Windows 10/11 from the same codebase, with zero macOS behavior changes — every divergent behavior is gated (
process.platform === 'win32'in main.js, a.win32class on<html>for renderer CSS), per the conventions now documented in CLAUDE.md's new "Windows support" section.What Windows needed
app.setAppUserModelId(toasts are silently dropped without it) + toast iconEADDRINUSE-ing the OAuth loopback port; close-to-tray so background ping polling survives the window closing (guarded: never blocks shutdown/logoff, never hides the window if tray creation failed)window.confirm/alertleave the keyboard dead after closing on Windows (long-standing Electron bug), so win32 routes throughdialog.showMessageBoxIPC; macOS keeps nativeconfirm/alertverbatimMenu.setApplicationMenu(null)on win32 (the default menu renders inside the window, over the 100vh layout); F12 / Ctrl+Shift+I rebound for main-window DevTools, Ctrl+Alt+Shift+I falls through to the webview chord[::1]twin listener (browsers resolvelocalhostto::1first; a stray IPv6 listener could swallow the callback);EACCESgets an actionable message (Windows excluded port ranges); the reflectederrorparam is now HTML-escapedstate:get; thin scrollbars scoped under.win32(Windows scrollbars are always-visible and ate into the fixed 320px sidebar)tools/make-ico.js— dependency-free ICNS→ICO converter (PNG entries 32/64/128/256);icon.icocommitted as a runtime asset (tray + window icon);npm run package:win→dist/bping-win32-x64/bping.exewith proper exe metadata.build-dmg.shand the darwin scripts are untouchedVerified on Windows 11
Boots to the setup screen (real
%APPDATA%\bping\config.jsonpath shown, no in-window menu bar), tray created, WM_CLOSE → process survives hidden with polling alive, second launch hands off and re-shows the window, packaged exe boots with close-to-tray intact, full OAuth sign-in flow completed against a real Basecamp account.Note for review
macOS safety was verified by code trace only (no Mac on hand) — a quick
npm startsmoke on your machine would be a welcome double-check. The macOS deltas are limited to: restore-if-minimized on notification click, the work-area clamp (no-op on displays where 1240×840 fits), the::1twin listener, and the setup screen showing the expanded config path instead of the~-literal.🤖 Generated with Claude Code