Commit graph

85 commits

Author SHA1 Message Date
Johannes Millan
40a7f9e849 fix(snap): set TMPDIR to XDG_RUNTIME_DIR for tray icon on Ubuntu 24.04+
Chromium's StatusIconLinuxDbus writes the tray PNG to TMPDIR and hands
gnome-shell the path via DBus IconThemePath. Inside a strict snap, /tmp
is bind-mounted to /tmp/snap-private-tmp/snap.<name>/tmp with mode 0700
on the parent, so gnome-shell (outside the mount namespace) cannot
stat the file and falls back to the three-dot placeholder icon.
Redirecting TMPDIR to \$XDG_RUNTIME_DIR (/run/user/\$UID) puts the
write where both sides can read it. Matches Signal Desktop's snap and
the official Electron snapcraft guide. electron-builder's SnapOptions
docstring still claims this is a default but app-builder-lib 26.8.1's
snap target no longer injects it.

Refs #7298
2026-04-24 17:40:28 +02:00
Johannes Millan
297aeb30ab fix(electron): harden Snap+Wayland argv wrapper after multi-review
Address findings from code-reviewer + debugger-assistant +
refactor-specialist multi-review on 8e1c47ebc2:

- afterPack: read wrapper source before rename; on writeFile failure,
  roll the rename back so a broken intermediate state can't ship a
  package with no launcher. Strengthen idempotency check to require a
  shebang at binPath (both files alone no longer counts as "installed").
- wrapper: gate the X11 injection on \$SNAP_NAME = "superproductivity",
  not just \$SNAP set. An xdg-open from a sibling snap (e.g. Firefox)
  leaks \$SNAP into the child env, which previously would have silently
  forced XWayland on .deb/.rpm users. Derive BIN_DIR from \$SNAP
  directly when we are our snap, avoiding fragile \$0 resolution
  through snapd's wrapper chain. Stop argv scanning at -- so positional
  args that resemble --ozone-platform aren't misread as a user override.
- app-control: point app.relaunch() execPath at the sibling shell
  wrapper instead of the default process.execPath (which is the renamed
  ELF and would bypass the flag injection on a relaunched Snap+Wayland
  instance).
- Move build/snap-wrapper.sh -> build/linux/snap-wrapper.sh to match
  the existing build/linux/ layout convention.
- Update research doc §18 to reflect the tightened predicate and the
  relaunch fix.
2026-04-21 15:03:42 +02:00
Johannes Millan
7f503c9bf0 fix(electron): inject ozone-platform=x11 via argv wrapper for Snap+Wayland
Field reports on issue #7270 (v18.2.4 / v18.2.5) show that
app.commandLine.appendSwitch('ozone-platform','x11') is not equivalent
to the CLI flag on Snap+Wayland: Chromium's Ozone init dlopens
libEGL/libgbm on the core22 Mesa path before the switch is honored and
segfaults under host-vs-snap Mesa ABI drift, while the same flag on
argv consistently works.

Install an afterPack hook that renames the Electron binary and drops a
shell wrapper at the original name. The wrapper injects the flag into
argv only when \$SNAP is set AND the session is Wayland — non-Snap
targets (AppImage, .deb, .rpm) and X11 sessions pass through untouched.
Matches the mechanism used by snapcrafters/signal-desktop and
snapcrafters/mattermost-desktop.

See docs/research/snap-wayland-gpu-fix-research.md §18 for the full
evidence trail, drawbacks, validation plan, and removal conditions.
2026-04-21 15:03:42 +02:00
Leandro Marques
179700ccda
chore: update electron to v41.x (#7097)
* chore: update electron to v41.1.1

* feat(start-app): clear GPU cache on Electron version change for Linux

* fix(window-decorators): disable custom window title bar for GNOME

This fixes some issues when moving and resizing the window

* refactor: Migrate url.format() (DEP0116) to file:// path approach

* refactor(start-app): remove deprecated protocol.registerFileProtocol in start-app.ts

* feat(electron-builder): update gnome content snap to gnome-42-2204 for improved compatibility and update flatpak permissions

* fix(window-decorators): improve handling of custom window title bar for GNOME

* feat(start-app): implement fallback to X11 in Snap if gnome-42-2204 runtime is unavailable

* chore: update electron to v41.1.1

* chore(package-lock): remove unused dependencies from package-lock.json

* fix(electron): move snap ozone-platform switch before app ready event

app.commandLine.appendSwitch() must be called before Chromium
initializes — after the ready event fires the GPU backend is already
running and the switch is a no-op. Move the Snap X11 fallback (defense-
in-depth for missing gnome-42-2204 runtime) to run synchronously at
startup, alongside the existing gtk-version and speech-dispatcher
switches.

* fix(electron): align IS_GNOME_DESKTOP detection with preload.ts logic

The original implementation only matched Ubuntu's GNOME session
(XDG_CURRENT_DESKTOP contains both 'gnome' AND 'ubuntu'), missing plain
GNOME on Fedora, Arch, etc. The preload.ts isGnomeDesktop() already
used the correct approach: check four environment variables with OR
logic. Align common.const.ts to match, preventing a split-brain where
the main process and renderer disagree on whether the user is on GNOME
— which would produce no title bar at all on non-Ubuntu GNOME desktops.

* fix(electron): restore v41 bump lost in merge and gate title-bar toggle

- Re-apply electron 41.2.0 + minimatch 10.2.5 override (master's 0e9218bd
  reverted the dependabot bump back to 37.10.3 while this branch's
  merge-base still contained 41.2.0, so the pre-merge diff was empty).
- Regenerate root package-lock.json accordingly.
- Drop unrelated esbuild additions from plugin-dev sub-lockfiles.
- misc-settings-form: gate isUseCustomWindowTitleBar on IS_ELECTRON &&
  !IS_GNOME_DESKTOP so the toggle does not appear in the web/PWA build.

---------

Co-authored-by: Johannes Millan <johannes.millan@gmail.com>
2026-04-17 18:12:43 +02:00
Johannes Millan
757b7d4f52 fix(ci): prevent duplicate unsigned exe files in GitHub Releases
Root cause: electron-builder auto-published unsigned files via implicit
tag-based publishing (despite release:false), and spaces in NSIS
artifact names caused naming mismatches — electron-builder sanitized
spaces to hyphens while softprops/action-gh-release converted them
to dots, resulting in three sets of exe files per architecture.

Changes:
- Hardcode NSIS artifactName with hyphens to eliminate spaces
- Add --publish never to explicitly prevent auto-publishing
- Update latest.yml with signed file hashes (preserving EB fields)
- Use lockfile-pinned app-builder-bin for blockmap regeneration
- Scope blockmap publishing to NSIS setup files only
- Fail hard if latest.yml references missing files
2026-03-19 18:58:52 +01:00
Johannes Millan
d401e6169e feat(tasks): add deadlines feature with reminders and planner integration
Add deadline support for tasks with date-only and time-specific deadlines.

Core:
- Add deadlineDay, deadlineWithTime, deadlineRemindAt fields to task model
- Add NgRx actions (setDeadline, removeDeadline, clearDeadlineReminder)
- Add meta-reducer with mutual exclusivity and input validation
- Register deadline actions in ActionType enum and op-log codes

UI:
- Create deadline dialog with calendar, time input, and reminder options
- Add deadline badge to task list row with overdue warning color
- Add deadline item to task detail panel with flag icon
- Add deadline options to task context menu
- Show deadlines in scheduled list page

Reminders:
- Add deadline reminder effects and selectors
- Show reminder dialog with grouped deadline/schedule sections
- Handle deadline reminder clearing on dismiss, done, add-to-today
- Cancel Android native deadline notifications on delete/archive

Planner:
- Show deadline tasks in planner day view and overdue section
- Create dedicated planner-deadline-task component
- Optimize deadline grouping with O(N) single-pass selector

Other:
- Add deadline-today banner effect for unplanned deadline tasks
- Add translation keys for all deadline UI strings
- Add E2E tests for deadline reminder flows
- Add unit tests for deadline reducer and overdue utility
- Extract shared isDeadlineOverdue utility function
- Guard app-state selectors against undefined during teardown
2026-03-15 18:48:00 +01:00
Johannes Millan
c54ce6196a fix(build): prevent duplicate Windows exe files in releases
The action-electron-builder omits --publish when release=false, causing
electron-builder to default to onTag on CI and publish unsigned files.
The signed files were then published separately, creating duplicates.

- Add --publish never to explicitly prevent auto-publishing
- Hardcode NSIS artifactName with hyphens to avoid SignPath converting
  spaces to dots (Super.Productivity → Super-Productivity)
- Skip blockmap regeneration for portable targets, fail loudly if an
  NSIS blockmap is unexpectedly missing
- Update normalization comment and docs filename reference
2026-03-13 18:51:50 +01:00
Johannes Millan
0ea0ba143f fix(electron): improve protocol URL handling and register URL scheme on Linux
Suppress noisy "EXITING due to failed single instance lock" message when
a second instance is launched via xdg-open for protocol URL handling.
Register superproductivity:// as a MIME type handler in the .desktop file
so Linux users no longer need manual xdg-settings configuration.
Remove duplicate requestSingleInstanceLock() call in start-app.ts.

Closes #173
2026-03-05 16:45:05 +01:00
Johannes Millan
94442eab32 fix(linux): set StartupWMClass to fix dock icon on Cosmic DE
Explicitly set StartupWMClass to match Electron's actual WM_CLASS,
preventing generic icon and duplicate dock entries on Cosmic DE.

Closes #5971
2026-02-16 22:01:03 +01:00
Nick Chusovitin
f7b0fc836e
feat: allow installation to custom location on windows (#6451) 2026-02-10 11:31:54 +01:00
johannesjo
d917472a3b fix: mac os icon 2026-01-29 19:48:44 +01:00
Johannes Millan
dbaaab8faa fix(snap): remove duplicate plugs from configuration
The default plug already includes home, desktop, and desktop-legacy.
Explicitly listing them again caused snap store rejection due to duplicates.
2026-01-17 14:50:56 +01:00
Johannes Millan
1c0581bca8 fix(snap): add filesystem and desktop integration plugs
Fixes #6031

- Add home and removable-media plugs for local file sync access
- Add desktop and desktop-legacy plugs for taskbar pinning in Cinnamon
- Update install hook to prompt for home interface connection
- Add documentation warnings about snap limitations and data persistence

All plugs include inline comments explaining their purpose and linking to issue.
2026-01-17 12:44:30 +01:00
Johannes Millan
d8c5dd5c8d fix(build): prevent RPM build-id collisions with other Electron apps
Fixes #5368
2026-01-12 10:23:59 +01:00
Johannes Millan
3d33d94a6c fix(snap): isolate fontconfig cache to fix GTK dialog rendering
Set FC_CACHEDIR to a Snap-specific directory to prevent ABI mismatches
with the host system's fontconfig cache. This fixes unreadable text
(tofu boxes) in GTK dialogs on Ubuntu Snap builds.

Fixes #4920
2026-01-11 11:44:44 +01:00
Johannes Millan
50de4c1fd7 fix(build): remove deprecated win32metadata from electron-builder config
The win32metadata property is no longer valid in electron-builder 26.x.
Windows executable metadata is now automatically derived from productName.
2025-12-22 19:30:34 +01:00
Johannes Millan
fff8596d50 fix(build): ensure consistent Windows EXE metadata for installer and portable
Add explicit win32metadata configuration to electron-builder.yaml to ensure
FileDescription and InternalName are identical between NSIS installer and
portable builds.

Fixes #4625
2025-12-22 14:21:00 +01:00
Johannes Millan
cc7ef3db8f build: attempt to make idle handling work better for flatpak 2025-10-15 11:01:21 +02:00
Johannes Millan
6486b41bd9 build: revert all changes and go back to old electron version #5252 #5260 2025-10-13 19:46:16 +02:00
Johannes Millan
c7ef0ff405 build: next attempt 3 #5252 2025-10-13 18:51:08 +02:00
Johannes Millan
7fd8f57d3e build: next attempt 2 #5252 2025-10-13 17:12:24 +02:00
Johannes Millan
f00f2a18c9 build: fix mac build? :( 2025-10-13 17:01:39 +02:00
Johannes Millan
0e6ab6ed60 build: fix ? :( 2025-10-13 16:34:43 +02:00
Johannes Millan
c14178bc86 build: fix mac? 2025-10-13 16:13:20 +02:00
Johannes Millan
22e3b68497 build: make mac build work again?? #5252 2025-10-13 15:46:42 +02:00
Johannes Millan
336a6e0537 build: attempt to fix snap again 22 #5252 2025-10-13 15:07:26 +02:00
Johannes Millan
8fb0e5e031 build: attempt to fix snap again #5252 2025-10-13 14:52:42 +02:00
Johannes Millan
21746d973b build: fix mac build 2025-10-13 14:33:32 +02:00
Johannes Millan
295f00628c build: attempt to fix build errors for snap and flathub #5252 #5259 #5260 2025-10-13 12:26:48 +02:00
Johannes Millan
422526557b build: attempt to fix build errors for snap and flathub #5252 #5258 2025-10-13 12:06:11 +02:00
Johannes Millan
d8e5233a06 build: attempt to make flatpak wayland work #5252 2025-10-13 11:39:22 +02:00
Johannes Millan
dbb6019527 build: attempt to fix snap once more 14 #5252 2025-10-12 17:21:13 +02:00
Johannes Millan
e412a33ef3 build: attempt to fix snap once more 12 #5252 C 2025-10-12 16:49:59 +02:00
Johannes Millan
f837a71648 build: attempt to fix snap once more 6 #5252 2025-10-12 14:06:05 +02:00
Johannes Millan
b48b0b2169 fix: attempt to fix snap once more 4 #5252 2025-10-12 13:31:46 +02:00
Johannes Millan
dfdbdc9b53 fix: attempt to fix snap once more 3 #5252 2025-10-12 11:39:09 +02:00
Johannes Millan
53eaaddea9 fix: attempt to fix snap once more 2 #5252 2025-10-12 11:34:30 +02:00
Johannes Millan
ac8ebf93cf fix: attempt to fix snap once more #5252 2025-10-12 11:21:40 +02:00
Johannes Millan
b429492e9c build: re-add electron builder stuff 2025-06-27 12:12:13 +02:00
Johannes Millan
75f1b64105 build: update configuration files
Update various configuration files as part of the build system reorganization.
2025-06-27 10:25:00 +02:00
Johannes Millan
6746a7f2bb fix: remove duplicate snap plugs causing build failure
The snap build was failing because plugs were duplicated - the 'default' plug already includes desktop, desktop-legacy, home, x11, wayland, unity7, browser-support, and network. This commit removes the duplicates, keeping only the additional plugs not included in default.
2025-06-21 21:07:16 +02:00
Johannes Millan
fc343b801b fix: idle detection errors and system freezes after hibernation
- Test idle detection methods only once during initialization to prevent repeated failures
- Add snap environment detection with automatic method filtering
- Add proper snap plugs for system-observe and login-session-observe interfaces
- Improve DBus handling by trying gdbus first (works better in snap environments)
- Add rate-limited error logging to prevent log spam
- Add snap install hook to guide users on connecting required interfaces
- Ensure graceful fallback to 0 (not idle) when detection fails

This prevents the system freezes that occurred after hibernation due to repeated
failing idle detection attempts, and improves snap compatibility for DBus access.
2025-06-21 08:43:24 +02:00
Ari Pollak
19c6deb0e2 Update Linux categories in electron-builder.yaml 2024-12-08 17:10:47 +01:00
Johannes Millan
3e4415cbc8 build: fix artifact name 2 2024-10-20 17:47:40 +02:00
Johannes Millan
2f9f3a6722 build: fix artifact name 2024-10-20 16:05:06 +02:00
Johannes Millan
2d73b12fc6 build: adjust binary file names to allow dynamic download link 2024-10-20 14:04:49 +02:00
johannesjo
36d6442fcf build: enable other build types again 2024-09-22 21:40:47 +02:00
johannesjo
9ac6badb8d build: try changing env variables 2024-09-22 21:20:16 +02:00
johannesjo
ba42e2e7ef build: add notarize to dmg specifically 2024-09-22 18:51:48 +02:00
johannesjo
dd93bbf1d7 build: test build target to universal for mas build 2024-09-22 18:29:29 +02:00