Improve Linux desktop identity packaged builds#1201
Improve Linux desktop identity packaged builds#1201Chrono-byte wants to merge 4 commits intopingdotgg:mainfrom
Conversation
- Set Linux WM class and desktop entry naming consistently - Generate a dev desktop launcher for Electron on Linux - Align desktop artifact packaging with the new app name
📝 WalkthroughWalkthroughThe changes configure the Linux desktop application identity by explicitly setting the WM class and desktop entry name through Electron APIs and electron-builder configuration. A new type alias supports the optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Pull request overview
This PR improves Linux desktop integration for the Electron desktop app by making the packaged app’s Linux identity (executable name, WM class, and desktop entry metadata) consistent, so GNOME/AppImage can correctly associate the running window with the installed desktop entry and icon.
Changes:
- Align Linux packaging metadata by setting a consistent
executableNameandStartupWMClass, and adjust the staged package name used for builds. - Set Linux WM class at runtime (
--class=...) and set the desktop entry name from the Electron main process. - Ensure the dev Electron launcher passes a Linux
--classargument for consistent dev window identity.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/build-desktop-artifact.ts | Aligns Linux electron-builder metadata (executable + WM class) and updates staged packaging identity used to build artifacts. |
| apps/desktop/src/main.ts | Sets Linux WM class at runtime and configures the app’s desktop entry name for better shell association. |
| apps/desktop/scripts/dev-electron.mjs | Passes a Linux --class arg when launching Electron in dev to keep window identity consistent. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR aligns the Linux desktop identity for the packaged Electron app so Linux shells (e.g., GNOME/AppImage integration) correctly associate the running window with the installed desktop entry (name/icon), by making the executable name, WM_CLASS, and desktop entry metadata consistent.
Changes:
- Set Linux
executableNameand desktop entryStartupWMClasstot3codein the electron-builder config. - Rename the staged
package.jsonnameused for packaging fromt3-code-desktoptot3code. - Set Linux runtime WM class (
--class) and desktop entry name (setDesktopName) based on dev vs packaged mode.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/build-desktop-artifact.ts | Aligns electron-builder Linux packaging identity (executableName, StartupWMClass) and staged package name with t3code. |
| apps/desktop/src/main.ts | Ensures the Linux runtime window class and desktop entry name match the packaged desktop metadata. |
| apps/desktop/scripts/dev-electron.mjs | Passes a Linux --class argument during dev launches to influence WM_CLASS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Raging at the fact that I pushed this PR straight from my own main on my fork and not a branch |
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/build-desktop-artifact.ts (1)
627-627: Package name change may affect existing installations.Changing the staged package name from
"t3-code-desktop"to"t3code"is a breaking change for existing Linux installations, as noted in the PR description. The install paths and desktop integration will differ, potentially leaving orphaned files from previous installs.Consider documenting migration steps or uninstall instructions for users with existing
t3-code-desktopinstallations, if not already covered elsewhere.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/build-desktop-artifact.ts` at line 627, The staged package name was changed from "t3-code-desktop" to "t3code", which is a breaking change for existing Linux installs; update the release/build workflow by either reverting or adding explicit migration/uninstall guidance: add a migration/uninstall step (e.g., a postinstall script or an uninstall shell script) that checks for and removes the old package artifacts named "t3-code-desktop" before installing the new package, and add clear instructions to the project README/release notes referencing the changed package name and the "name: \"t3code\"" field so users know how to remove old files or perform migration.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@scripts/build-desktop-artifact.ts`:
- Line 627: The staged package name was changed from "t3-code-desktop" to
"t3code", which is a breaking change for existing Linux installs; update the
release/build workflow by either reverting or adding explicit
migration/uninstall guidance: add a migration/uninstall step (e.g., a
postinstall script or an uninstall shell script) that checks for and removes the
old package artifacts named "t3-code-desktop" before installing the new package,
and add clear instructions to the project README/release notes referencing the
changed package name and the "name: \"t3code\"" field so users know how to
remove old files or perform migration.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 9274f85c-8e3a-4392-aed4-88170eb21e36
📒 Files selected for processing (2)
apps/desktop/src/main.tsscripts/build-desktop-artifact.ts
What Changed
Linux desktop environments were not matching the running Electron app to its packaged desktop entry. The AppImage launched, but the shell surfaced it as t3-code-desktop with the generic icon instead of the proper icon.
This happened because the Linux app identity was inconsistent across packaging and runtime. The staged package name, executable name, desktop entry name, and Chromium/Electron window class were not aligned closely enough for GNOME/AppImage integration to associate the live window with the installed desktop metadata.
This change makes the Linux identity consistent so installed AppImage builds resolve to the correct app name and icon in the shell.
Why
Before:

After:

Checklist
Note
Set Linux WM_CLASS and executable name for desktop packaged builds
t3codeand desktop entry name on Linux in main.ts, so the window is correctly identified by window managers and desktop environments.t3codeand add a desktop entry withStartupWMClass t3code.GitServicewithGitCorethroughout the server layer stack;GitCorenow spawns a realgitchild process with a 30s timeout and 1MB per-stream output cap, and exposes anexecutemethod.CheckpointStore,GitManager, and related test harnesses are updated to depend onGitCoredirectly instead ofGitService.GitCoreoutput cap (1,000,000 bytes per stream) will raise aGitCommandErroron any git command that produces large output.Macroscope summarized 08c4f03.
Summary by CodeRabbit