fix(desktop): improve Niri AppImage and remote environment#2538
fix(desktop): improve Niri AppImage and remote environment#2538mwolson wants to merge 2 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR introduces new Linux desktop environment detection logic, a new user-configurable You can customize Macroscope's approvability policy. Learn more. |
dba46b4 to
bfc4a7c
Compare
Summary
desktop-settings.json.Closes #2331.
Fixes #2539.
Repro
For the icon issue:
For the credential-store issue:
--password-store=gnome-libsecretto the desktop launcher.Diagnosis
Electron chooses the Linux
safeStoragebackend from the desktop environment or from--password-store. Niri is not one of Electron's recognized desktop names, so the app needed a launcher workaround to forcegnome-libsecret.This PR moves that into the app startup path:
desktop-settings.jsonnow acceptslinuxPasswordStore.automode leaves Electron alone for known GNOME and KDE desktops.autoappends--password-store=gnome-libsecret.The icon fix from #2332 stages standard Linux icon sizes and points electron-builder at the generated icon directory.
Scope
This is intentionally Linux desktop only.
The two fixes are combined because they were both found while testing the same Linux AppImage flow under Niri, and because this PR is intended to replace the narrower icon-only PR #2332.
Test plan
bun fmtbun lintbun typecheckbun run testbun dist:desktop:linuxsafe storage backend=gnome_libsecret encryptionAvailable=true.16,22,24,32,48,64,128,256, and512.Note
Medium Risk
Medium risk because it changes Linux desktop startup flags and secret-storage error handling, and updates the Linux build pipeline to require ImageMagick for icon generation, which could affect packaging/runtime behavior on Linux.
Overview
Improves Linux AppImage integration by generating and packaging a full hicolor icon set (16–512px) during desktop artifact builds, updating
electron-builderto use anicons/directory instead of a single PNG, and installing ImageMagick in the Linux release workflow to support icon resizing.Adds a new Linux-only
linuxPasswordStoresetting indesktop-settings.json(defaultauto) and introduces heuristics to append Electron’s--password-storeswitch on unrecognized desktops (e.g. Niri) while honoring explicit user choices.Tightens saved-environment credential persistence: the desktop app now fails early with actionable GNOME Keyring/KWallet remediation messages when
safeStorageencryption is unavailable, logs the selected backend on Linux, and the web runtime refactors bearer-token persistence to ensure registry rollback while preserving original error details.Reviewed by Cursor Bugbot for commit bfc4a7c. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Improve Niri AppImage integration with Linux secret storage and multi-size icons
linuxPasswordStoretoDesktopSettings, allowing users to configure the Electron password-store backend; on Linux startup, applies the appropriate--password-storeswitch based on the setting and detected desktop environment.resolveLinuxSecretStorageUnavailableMessageto surface tailored GNOME Keyring or KDE KWallet remediation messages when encryption is unavailable, and fails early in theSET_SAVED_ENVIRONMENT_SECRETIPC handler instead of attempting a write.persistSavedEnvironmentBearerTokenOrRollbackin service.ts so registry rollback and original error propagation are guaranteed on token persistence failure.Macroscope summarized bfc4a7c.