Skip to content
Source
Sign inSign up
pingdotgg/t3code

refactor(desktop): Drop the unused Linux --class switch #14482

Mergedmwolson(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/14482/headmerged by maria-rcks View on GitHub

Problem

T3 Code still appends a --class=t3code Chromium switch on Linux, fed by a linuxWmClass value. Since Electron 43 the main window's X11 class and Wayland app id both come from setDesktopName("com.t3tools.T3Code.desktop"), so the switch no longer sets them. Keeping it suggested the window class was still t3code, which is how the launchers ended up with StartupWMClass=t3code (#10895 linux-wayland-desktop-icon).

Change

Removes the switch and the linuxWmClass value that only fed it. Nothing visible changes.

The switch still reaches GTK windows in T3's process. In practice that is T3's own folder picker on X11 when no file-chooser portal is running: its class changes from t3code to T3code, GTK's default for the t3code executable, so a user's own case-sensitive window rule for that dialog would need updating. On Wayland the picker's app id is t3code either way, and with a portal the picker belongs to the portal.

SnapShots are unaffected: they only run in Wayland sessions, take their identity from the desktop entry name, and find T3's own window by process id and title.

Scope and approval

Julius suggested this cleanup as a non-blocking follow-up in his review of #10895 linux-wayland-desktop-icon: "--class=t3code / linuxWmClass no longer affects the window class and could be removed."

Verification

Before and after builds (both with #10895's launcher fix) ran in isolated GNOME Shell 50.1 sessions (native Wayland, and X11 through Xwayland with and without xdg-desktop-portal) and an XFCE 4.20 X11 session, each opening T3's folder picker. The main window's class and app id were identical everywhere. GNOME grouped the dialog with T3 in both builds, and XFCE showed the same single taskbar button and the same title-bar icon.

GNOME, X11 without a portal:

GNOME X11 folder picker before and after

XFCE 4.20, X11 without a portal:

XFCE X11 folder picker before and after

GNOME, native Wayland:

GNOME Wayland folder picker before and after

SnapShots also behaved the same with and without the switch on GNOME 50.1 Wayland with xdg-desktop-portal-gnome and T3's GNOME extension: Ctrl+Shift+2 registered through the GlobalShortcuts portal and captured the focused window in both builds (comparison). KDE, Hyprland and niri were checked by source review only.


Sent by Mike's agent (Claude Opus 5.5 in T3 Code)

    1. Screenshots

      Before and after builds (both with #10895's launcher fix), opening T3's own folder picker. The main window is identical everywhere; the only difference is the X11 class of the GTK picker when no portal is running (t3code to T3code). Also inlined in the description.

      GNOME Shell 50.1, X11 without a portal:

      GNOME X11 folder picker before and after

      XFCE 4.20, X11 without a portal:

      XFCE X11 folder picker before and after

      GNOME Shell 50.1, native Wayland:

      GNOME Wayland folder picker before and after

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      No actionable comments were generated in the recent review.

      Recent review info
      Run configuration
      Commits

      Reviewing files that changed from the base of the PR and between 0a2384496cc0337235ca0694a1a4bbf2c8caff6d and 8de88416977123fef292a37e283860ded4d9816b.

      Files selected for processing: 4
      • apps/desktop/src/app/DesktopEarlyElectronStartup.ts
      • apps/desktop/src/app/DesktopEnvironment.ts
      • apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts
      • apps/desktop/src/app/DesktopPreReadyPlatform.ts
      Files with no reviewable changes: 4
      • apps/desktop/src/app/DesktopPreReadyPlatform.ts
      • apps/desktop/src/app/DesktopEnvironment.ts
      • apps/desktop/src/app/DesktopEarlyElectronStartup.ts
      • apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

      Walkthrough

      The Linux desktop environment and early startup options no longer expose or resolve linuxWmClass. Linux pre-ready setup no longer appends the class command-line switch, and the Linux URL-handler test fixture no longer sets linuxWmClass.

      Changes: Linux window class removal

      Layer / File(s)Summary
      Remove window class from Linux options
      apps/desktop/src/app/DesktopEarlyElectronStartup.ts, apps/desktop/src/app/DesktopEnvironment.ts
      The early startup options and desktop environment no longer define or provide linuxWmClass.
      Stop passing the Linux class switch
      apps/desktop/src/app/DesktopPreReadyPlatform.ts, apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts
      Linux pre-ready setup no longer appends the class switch. The URL-handler test fixture no longer sets linuxWmClass.
      Priority: Low

      Estimated code review effort: 2 (Simple) | ~5 minutes

      Change: Refactor

      Merge Risk: Minimal · up to 8de88

      No merge-blocking issue is established for this change; it is ready for normal checks.

      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main change: removing the unused Linux --class switch.
      Description checkPassedThe description covers the problem, change, scope and approval, verification steps, observed results, limitations, screenshots, and agent attribution. It is complete and directly related to the pull r…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Description check

      Explanation

      The description covers the problem, change, scope and approval, verification steps, observed results, limitations, screenshots, and agent attribution. It is complete and directly related to the pull request.

      Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Autopilot is currently an internal CodeRabbit preview.

      Comment `@coderabbitai help` to get the list of available commands.
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at ca45022

      Macroscope's review found this PR approvable — Removes an obsolete Linux Electron --class switch and its unused plumbing across four files. The only remaining effect is a narrow GTK window-class fallback on Linux; application identity and other startup behavior remain unchanged.

      No code changes detected at 6a37783. Prior analysis still applies.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. iirc this was required to get Snapshots working

    6. I tested this on GNOME 50.1 Wayland with xdg-desktop-portal-gnome and T3's GNOME extension, using the same .deb built with and without --class. In both builds Ctrl+Shift+2 registered through the GlobalShortcuts portal and captured the focused window the same way:

      SnapShot with and without --class

      --class came in with #1201 linux-desktop-identity, before SnapShots landed in #8103 window-capture. SnapShots only run in Wayland sessions, and every Linux backend (portal shortcut, GNOME extension, Hyprland, niri, KDE) keys on the app id from setDesktopName, com.t3tools.T3Code, which this PR leaves as is. If you remember a specific desktop where it mattered, I'll test that one too.

    7. maria-rckscommented

      Note

      Written by gpt-6.1-sol on behalf of Maria

      Verified in a real dev environment

      Verified unchanged head 8de88416977123fef292a37e283860ded4d9816b on this Linux X11/Openbox VM. No fixes or pushes were needed.

      • First ran github/main (15fe283272) from a separate worktree, then the exact PR head, with vp i and one background dev environment at a time. Used actual Electron clients (main: 44.10.0; PR: 44.9.3), plus repo Playwright and /usr/bin/google-chrome against the dev web app.
      • Reproduced the cleanup's premise on main: the main window already used the desktop-entry identity despite the class switch. On the PR it still reports WM_CLASS = "com.t3tools.t3code.development", "com.t3tools.T3Code.Development".
      • Used Add project > Local folder > Open in Files. With --xdg-portal-required-version=999 selecting the real GTK fallback, its class changed from "electron", "t3code-dev" to "electron", "Electron". This is the default for the raw development Electron executable. Its transient parent remained the T3 window. Folder selection worked. With the default portal path, the chooser remained owned by xdg-desktop-portal-gtk; selection, cancellation, and reopening after cancellation worked.
      • Created a real git project through the app. On both main and the PR, started a Codex gpt-6.1-sol turn in that project: pwd and git status --short exited 0 and the final reply rendered. After restarting the PR in web mode, opened the persisted thread in Chrome and sent a follow-up: git rev-parse --is-inside-work-tree returned true, exited 0, and its final reply rendered. No mocks, replay provider, fixtures, or seeded conversations.
      • Blacksmith ran the existing DesktopEarlyElectronStartup.test.ts and DesktopLinuxUrlHandler.test.ts: 33 tests passed. The PR head also has 31 successful CI checks, with none pending or failing.

      Short runtime transcript

      Main, GTK fallback chooser in the home directory:

      main GTK fallback chooser

      PR, same directory and chooser crop:

      PR GTK fallback chooser

      Real Codex turn in the PR desktop client:

      PR Codex commands and completed reply

      Opening the default portal chooser from the PR's project picker. Inspected the clip and checked uploaded playback and seeking in T3's browser:

      PR project picker opens the native portal chooser

      Not verified

      • Native Wayland app IDs, SnapShots/global shortcuts, GNOME/KDE/Hyprland/niri integration, and taskbar grouping on those desktops. This VM runs X11/Openbox, so this pass does not resolve the discussion's Wayland SnapShots concern by runtime evidence.
      • Packaged release binary identity, including the claimed T3code GTK fallback class. This pass exercised development Electron executables.
      • Native iOS/Android and macOS/Windows behavior. The changed startup branch is Linux-specific.
      • Default Linux secret-store startup. This disposable VM's keyring was locked; both desktop comparisons used --password-store=basic to avoid accessing it.
    8. maria-rcks merged this8473d15

    9. maria-rcks closed this

Sign in to join this conversation.