refactor(desktop): Drop the unused Linux --class switch #14482
main fromrefs/pull/14482/head·merged by maria-rcks View on GitHubProblem#
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:

XFCE 4.20, X11 without a portal:

GNOME, native Wayland:

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
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
No actionable comments were generated in the recent review.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: a42bdd4
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
db875c9d-0617-49da-a1de-0ba6ee1ded49
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.tsapps/desktop/src/app/DesktopEnvironment.tsapps/desktop/src/app/DesktopLinuxUrlHandler.test.tsapps/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 theclasscommand-line switch, and the Linux URL-handler test fixture no longer setslinuxWmClass.Changes: Linux window class removal
Priority:Layer / File(s) Summary Remove window class from Linux options
apps/desktop/src/app/DesktopEarlyElectronStartup.ts,apps/desktop/src/app/DesktopEnvironment.tsThe 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.tsLinux pre-ready setup no longer appends the classswitch. The URL-handler test fixture no longer setslinuxWmClass. LowEstimated code review effort: 2 (Simple) | ~5 minutes
Change: Refactor
Merge Risk:
Minimal · up to8de88-
No merge-blocking issue is established for this change; it is ready for normal checks.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the main change: removing the unused Linux --class switch. Description check 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 r… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check 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
Comment `@coderabbitai help` to get the list of available commands.Autopilot is currently an internal CodeRabbit preview.
-
Approvability#
Verdict: Approved at
ca45022Macroscope's review found this PR approvable — Removes an obsolete Linux Electron
--classswitch 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
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).6a37783. Prior analysis still applies.iirc this was required to get Snapshots working
I tested this on GNOME 50.1 Wayland with xdg-desktop-portal-gnome and T3's GNOME extension, using the same
.debbuilt with and without--class. In both builds Ctrl+Shift+2 registered through the GlobalShortcuts portal and captured the focused window the same way:
--classcame 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 fromsetDesktopName,com.t3tools.T3Code, which this PR leaves as is. If you remember a specific desktop where it mattered, I'll test that one too.macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Note
Written by
gpt-6.1-solon behalf of MariaVerified in a real dev environment#
Verified unchanged head
8de88416977123fef292a37e283860ded4d9816bon 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, withvp iand 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-chromeagainst 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=999selecting 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 byxdg-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-solturn in that project:pwdandgit status --shortexited 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-treereturnedtrue, exited 0, and its final reply rendered. No mocks, replay provider, fixtures, or seeded conversations. - Blacksmith ran the existing
DesktopEarlyElectronStartup.test.tsandDesktopLinuxUrlHandler.test.ts: 33 tests passed. The PR head also has 31 successful CI checks, with none pending or failing.
Main, GTK fallback chooser in the home directory:

PR, same directory and chooser crop:

Real Codex turn in the PR desktop client:

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

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
T3codeGTK 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=basicto avoid accessing it.
- First ran
maria-rcks merged this8473d15
maria-rcks closed this
Sign in to join this conversation.
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 (
t3codetoT3code). Also inlined in the description.GNOME Shell 50.1, X11 without a portal:
XFCE 4.20, X11 without a portal:
GNOME Shell 50.1, native Wayland: