Skip to content

Improve Linux desktop identity packaged builds#1201

Open
Chrono-byte wants to merge 4 commits intopingdotgg:mainfrom
Chrono-byte:main
Open

Improve Linux desktop identity packaged builds#1201
Chrono-byte wants to merge 4 commits intopingdotgg:mainfrom
Chrono-byte:main

Conversation

@Chrono-byte
Copy link

@Chrono-byte Chrono-byte commented Mar 18, 2026

  • Set Linux WM class and desktop entry naming consistently
  • Align desktop artifact packaging with the new app name

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:
image

After:
image

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes

Note

Set Linux WM_CLASS and executable name for desktop packaged builds

  • Sets the Electron app's WM_CLASS to t3code and desktop entry name on Linux in main.ts, so the window is correctly identified by window managers and desktop environments.
  • Updates build-desktop-artifact.ts to name the Linux executable t3code and add a desktop entry with StartupWMClass t3code.
  • Replaces GitService with GitCore throughout the server layer stack; GitCore now spawns a real git child process with a 30s timeout and 1MB per-stream output cap, and exposes an execute method.
  • CheckpointStore, GitManager, and related test harnesses are updated to depend on GitCore directly instead of GitService.
  • Risk: the new GitCore output cap (1,000,000 bytes per stream) will raise a GitCommandError on any git command that produces large output.

Macroscope summarized 08c4f03.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Linux desktop application integration to ensure proper identification and display in desktop environments with correct application naming and window manager classification for both development and production builds.

- 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
Copilot AI review requested due to automatic review settings March 18, 2026 23:19
@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

📝 Walkthrough

Walkthrough

The 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 setDesktopName call, and constants define the desktop entry name and WM class used across development and production builds. The staged package metadata is also updated to reflect the normalized application name.

Changes

Cohort / File(s) Summary
Linux Desktop Identity Configuration
apps/desktop/src/main.ts, scripts/build-desktop-artifact.ts
Added WM class and desktop entry name configuration on Linux via Electron API calls and electron-builder settings. Introduced LinuxDesktopNamedApp type alias for optional setDesktopName method. Updated staged package name and build configuration to use consistent "t3code" identifier across development and production environments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A desktop name we set with care,
On Linux, through the Electron air,
WM classes aligned with grace,
From build to app, the perfect place!
Configuration hops along the way,
Making Linux desktops brighter today! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Improve Linux desktop identity packaged builds' accurately and concisely summarizes the main change: improving how Linux packaged builds represent desktop identity.
Description check ✅ Passed PR description follows the template structure with clear sections: What Changed, Why, UI Changes (with before/after screenshots), and completed Checklist items.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 18, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 executableName and StartupWMClass, 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 --class argument 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.

@github-actions github-actions bot added size:S 10-29 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Mar 18, 2026
@Chrono-byte Chrono-byte requested a review from Copilot March 18, 2026 23:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 executableName and desktop entry StartupWMClass to t3code in the electron-builder config.
  • Rename the staged package.json name used for packaging from t3-code-desktop to t3code.
  • 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>
@Chrono-byte
Copy link
Author

Chrono-byte commented Mar 21, 2026

Raging at the fact that I pushed this PR straight from my own main on my fork and not a branch

@Chrono-byte
Copy link
Author

@CodeRabbit review

@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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-desktop installations, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9e29c9d and 05b108e.

📒 Files selected for processing (2)
  • apps/desktop/src/main.ts
  • scripts/build-desktop-artifact.ts

@github-actions github-actions bot added size:XXL 1,000+ changed lines (additions + deletions). size:S 10-29 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). size:XXL 1,000+ changed lines (additions + deletions). labels Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants