Skip to content
Source
Sign inSign up
pingdotgg/t3code

Improve Linux desktop identity packaged builds #1201

MergedChrono-byte(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/1201/headmerged by juliusmarminge View on GitHub

What Changed

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

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 desktop entry name for packaged desktop builds

  • Sets the --class Chromium switch to t3code (or t3code-dev in dev) on Linux startup in main.ts, and calls app.setDesktopName with the matching .desktop filename when supported.
  • Updates build-desktop-artifact.ts to set executableName: 't3code', add StartupWMClass: 't3code' to the .desktop entry, and rename the staged package from t3-code-desktop to t3code.
  • Behavioral Change: the Linux executable name and package metadata name change from t3-code-desktop to t3code, which affects install paths and desktop integration on existing installs.
Macroscope summarized f70d9e9.

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.

Note

Medium Risk Changes Linux app identity (WM class, desktop entry name, executable/package name), which can affect desktop integration and existing installs/shortcuts, but does not touch auth or core runtime logic.

Overview Fixes Linux desktop integration for packaged builds by aligning the running Electron window identity with the installed .desktop metadata.

On Linux startup, the app now sets Chromium’s --class to a stable WM class (t3code / t3code-dev) and (when supported) calls app.setDesktopName() with the matching desktop entry filename.

The desktop artifact build now packages Linux output with a consistent identity: executableName: "t3code", .desktop StartupWMClass: "t3code", and the staged package name changes from t3-code-desktop to t3code to match the runtime/app branding.

Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f70d9e9cc2b8fbcbe12a37d2fc039efa26a98ff0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      📝 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 nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring 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 nameStatusExplanation
      Title check✅ PassedThe title 'Improve Linux desktop identity packaged builds' accurately and concisely summarizes the main change: improving how Linux packaged builds represent desktop identity.
      Description check✅ PassedThe pull request description comprehensively covers all required template sections with clear, focused explanations of changes, reasoning, and before/after screenshots.
      ✏️ 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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. 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.

      FileDescription
      scripts/build-desktop-artifact.tsAligns Linux electron-builder metadata (executable + WM class) and updates staged packaging identity used to build artifacts.
      apps/desktop/src/main.tsSets Linux WM class at runtime and configures the app’s desktop entry name for better shell association.
      apps/desktop/scripts/dev-electron.mjsPasses 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.

    4. 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.

      FileDescription
      scripts/build-desktop-artifact.tsAligns electron-builder Linux packaging identity (executableName, StartupWMClass) and staged package name with t3code.
      apps/desktop/src/main.tsEnsures the Linux runtime window class and desktop entry name match the packaged desktop metadata.
      apps/desktop/scripts/dev-electron.mjsPasses 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.

    5. Noojuno(GitHub profile, opens in a new tab) approved these changes

    6. binbandit(GitHub profile, opens in a new tab) approved these changes

    7. Chrono-byte(GitHub profile, opens in a new tab)commented

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

    8. ✅ 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.

    9. 🧹 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 9e29c9d72895022322da52d8e961b38702bad9cc and 05b108eae5b7959ef40ebf4c4bfeefbba729a3bd.

      📒 Files selected for processing (2)
      • apps/desktop/src/main.ts
      • scripts/build-desktop-artifact.ts
    10. Cursor Bugbot has reviewed your changes and found 1 potential issue.

      Fix All in Cursor Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard?tab=bugbot).
    11. I forgot my main on my fork is this. Again.

    12. juliusmarminge approved these changes

    13. juliusmarminge merged this0a88719

    14. juliusmarminge closed this

Sign in to join this conversation.