Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion flatpak/com.t3tools.t3code.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@
<launchable type="desktop-id">com.t3tools.t3code.desktop</launchable>
<url type="homepage">https://t3.codes</url>
<releases>
<release version="0.1.10" date="2026-11-17">
<url type="details">https://github.com/pingdotgg/t3code/releases/tag/v0.1.10</url>
<description>
<p>Update to T3 Code 0.1.10.</p>
<p>The built-in terminal now works on hosts with an older glibc, such as
Ubuntu 24.04, Debian 13 and Fedora 42.</p>
</description>
</release>
<release version="0.1.9" date="2026-11-11">
<url type="details">https://github.com/pingdotgg/t3code/releases/tag/v0.1.9</url>
<description></description>
<description/>
</release>
<release version="0.1.8" date="2026-11-09">
<url type="details">https://github.com/pingdotgg/t3code/releases/tag/v0.1.8</url>
Expand Down
11 changes: 7 additions & 4 deletions flatpak/modules/t3code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ build-commands:
done
test-rule: ''
test-commands:
# Electron's npm package can use the binary built for this Flatpak.
# Electron's npm package uses the binary built for this Flatpak, so the test setup skips its download.
- ln -s t3code flatpak-output/linux-unpacked/electron
- >-
ln -s "$PWD/flatpak-output/linux-unpacked"
"$(cd apps/desktop && node -p "require('node:path').dirname(require.resolve('electron/package.json'))")/dist"
# Flatpak identity changes desktop behavior; the upstream suite tests an ordinary host app.
# The WSL process-liveness tests need host /proc, which is unavailable in this sandbox.
- >-
ELECTRON_OVERRIDE_DIST_PATH=$PWD/flatpak-output/linux-unpacked
env -u FLATPAK_ID
pnpm --filter @t3tools/desktop exec vp test run
--exclude src/wsl/DesktopWslEnvironment.test.ts
Expand All @@ -66,8 +68,8 @@ test-commands:
sources:
- type: git
url: https://github.com/pingdotgg/t3code.git
tag: v0.1.9
commit: 24e77473ecf41bc1f7142529c7911c1c1aae1d76
tag: v0.1.10
commit: 7d32075e3757ded707914e2450c3e392a9665765
x-checker-data:
type: json
url: https://api.github.com/repos/pingdotgg/t3code/releases/latest
Expand All @@ -91,6 +93,7 @@ sources:
- ../../patches/0013-flatpak-startup-recovery.patch
- ../../patches/0014-flatpak-managed-policy.patch
- ../../patches/0015-flatpak-browser-import.patch
- ../../patches/0016-flatpak-prebuilt-pty.patch
use-git: true
- type: dir
path: ../package
Expand Down
119 changes: 82 additions & 37 deletions patches/0001-flatpak-desktop-integration.patch
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ index d5fed4b228..05f90aedf5 100644
desktopLauncherPath: config.desktopLauncherPath,
appImagePath: config.appImagePath,
diff --git a/apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts b/apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts
index 16d2f8e241..df911a745a 100644
index 8e8a2812ab..a0b203059a 100644
--- a/apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts
+++ b/apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts
@@ -1,5 +1,5 @@
Expand All @@ -96,7 +96,7 @@ index 16d2f8e241..df911a745a 100644
import * as HostProcess from "@t3tools/shared/HostProcess";
import * as Cause from "effect/Cause";
import * as Deferred from "effect/Deferred";
@@ -165,6 +165,15 @@ const emptyRecording = (): RecordedRegistration => ({
@@ -184,6 +184,15 @@ const emptyRecording = (): RecordedRegistration => ({
});

describe("DesktopLinuxUrlHandler", () => {
Expand All @@ -113,7 +113,7 @@ index 16d2f8e241..df911a745a 100644
const entry = DesktopLinuxUrlHandler.renderUrlHandlerDesktopEntry({
displayName: "T3 Code (Nightly)",
diff --git a/apps/desktop/src/app/DesktopLinuxUrlHandler.ts b/apps/desktop/src/app/DesktopLinuxUrlHandler.ts
index cfa8498ae6..4626a2601c 100644
index 35fd46dd7a..f49e96bdf8 100644
--- a/apps/desktop/src/app/DesktopLinuxUrlHandler.ts
+++ b/apps/desktop/src/app/DesktopLinuxUrlHandler.ts
@@ -9,6 +9,7 @@ import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";
Expand All @@ -124,7 +124,7 @@ index cfa8498ae6..4626a2601c 100644
import * as DesktopEnvironment from "./DesktopEnvironment.ts";
import { makeComponentLogger } from "./DesktopObservability.ts";

@@ -287,7 +288,10 @@ export const make = Effect.gen(function* () {
@@ -319,7 +320,10 @@ export const make = Effect.gen(function* () {
);

const register = Effect.gen(function* () {
Expand All @@ -137,10 +137,10 @@ index cfa8498ae6..4626a2601c 100644
}
yield* writeDesktopEntry;
diff --git a/apps/desktop/src/app/DesktopPreReadyPlatform.test.ts b/apps/desktop/src/app/DesktopPreReadyPlatform.test.ts
index 22bfc969c4..da1d29ea71 100644
index 45887a928a..0679d51740 100644
--- a/apps/desktop/src/app/DesktopPreReadyPlatform.test.ts
+++ b/apps/desktop/src/app/DesktopPreReadyPlatform.test.ts
@@ -61,6 +61,24 @@ import * as DesktopConfig from "./DesktopConfig.ts";
@@ -64,6 +64,24 @@ import * as DesktopConfig from "./DesktopConfig.ts";
import * as DesktopPreReadyPlatform from "./DesktopPreReadyPlatform.ts";

describe("DesktopPreReadyPlatform", () => {
Expand All @@ -166,18 +166,18 @@ index 22bfc969c4..da1d29ea71 100644
appendSwitchMock.mockReset();
getSwitchValueMock.mockReset();
diff --git a/apps/desktop/src/app/DesktopPreReadyPlatform.ts b/apps/desktop/src/app/DesktopPreReadyPlatform.ts
index ff8c97b8f8..7214f0d672 100644
index 8ac4654636..8b86fc53b8 100644
--- a/apps/desktop/src/app/DesktopPreReadyPlatform.ts
+++ b/apps/desktop/src/app/DesktopPreReadyPlatform.ts
@@ -56,6 +56,7 @@ const LinuxDesktopEntryConfig = Config.all({
xdgDataHome: trimmedString("XDG_DATA_HOME"),
launcherPath: trimmedString("T3CODE_DESKTOP_LAUNCHER_PATH"),
@@ -61,6 +61,7 @@ const LinuxDesktopEntryConfig = Config.all({
appImagePath: trimmedString("APPIMAGE"),
// electron-updater sets this on the AppImage it relaunches after installing an update.
relaunchedByUpdater: trimmedString("APPIMAGE_SILENT_INSTALL"),
+ flatpakId: trimmedString("FLATPAK_ID"),
});

/** @public */
@@ -85,54 +86,56 @@ export const make = Effect.gen(function* () {
@@ -90,75 +91,80 @@ export const make = Effect.gen(function* () {
});
// The portal also requires a valid desktop entry. An AppImage update may
// have removed the executable referenced by the previous launch's entry.
Expand All @@ -200,27 +200,13 @@ index ff8c97b8f8..7214f0d672 100644
- if (iconPath !== undefined) {
- try {
- NodeFS.mkdirSync(NodePath.posix.dirname(iconPath), { recursive: true });
- NodeFS.copyFileSync(
- NodePath.posix.join(
- Electron.app.getAppPath(),
- "apps/desktop/prod-resources/icon.png",
- ),
- // Electron's copyFileSync from app.asar extracts to a temp file it never deletes.
- NodeFS.writeFileSync(
- iconPath,
- );
- } catch {}
- }
- NodeFS.writeFileSync(
- NodePath.posix.join(applicationsDir, linux.linuxDesktopEntryName),
- renderUrlHandlerDesktopEntry({
- displayName: resolveDesktopAppBranding({
- isDevelopment: linux.isDevelopment,
- appVersion: Electron.app.getVersion(),
- }).displayName,
- execTarget:
- Option.getOrUndefined(
- Option.orElse(
- linuxDesktopEntryConfig.launcherPath,
- () => linuxDesktopEntryConfig.appImagePath,
- NodeFS.readFileSync(
- NodePath.posix.join(
- Electron.app.getAppPath(),
- "apps/desktop/prod-resources/icon.png",
+ if (Option.isNone(linuxDesktopEntryConfig.flatpakId)) {
+ try {
+ const applicationsDir = NodePath.posix.join(
Expand All @@ -241,24 +227,83 @@ index ff8c97b8f8..7214f0d672 100644
+ if (iconPath !== undefined) {
+ try {
+ NodeFS.mkdirSync(NodePath.posix.dirname(iconPath), { recursive: true });
+ NodeFS.copyFileSync(
+ NodePath.posix.join(
+ Electron.app.getAppPath(),
+ "apps/desktop/prod-resources/icon.png",
+ // Electron's copyFileSync from app.asar extracts to a temp file it never deletes.
+ NodeFS.writeFileSync(
+ iconPath,
+ NodeFS.readFileSync(
+ NodePath.posix.join(
+ Electron.app.getAppPath(),
+ "apps/desktop/prod-resources/icon.png",
+ ),
),
- ),
- );
- } catch {}
- }
- const desktopEntryPath = NodePath.posix.join(applicationsDir, linux.linuxDesktopEntryName);
- const { appImagePath } = linuxDesktopEntryConfig;
- if (
- Option.isSome(appImagePath) &&
- Option.isNone(linuxDesktopEntryConfig.launcherPath) &&
- Option.contains(linuxDesktopEntryConfig.relaunchedByUpdater, "true")
- ) {
- try {
- const replacedPath = replacedVersionedAppImagePath({
- previousEntry: NodeFS.readFileSync(desktopEntryPath, "utf8"),
- appImagePath: appImagePath.value,
- });
- // Relative, so the pair survives a moved folder; symlink never overwrites a file.
- if (replacedPath !== null) {
- NodeFS.symlinkSync(NodePath.posix.basename(appImagePath.value), replacedPath);
- }
- } catch {}
- }
- NodeFS.writeFileSync(
- desktopEntryPath,
- renderUrlHandlerDesktopEntry({
- displayName: resolveDesktopAppBranding({
- isDevelopment: linux.isDevelopment,
- appVersion: Electron.app.getVersion(),
- }).displayName,
- execTarget:
- Option.getOrUndefined(
- Option.orElse(
- linuxDesktopEntryConfig.launcherPath,
- () => linuxDesktopEntryConfig.appImagePath,
- ),
- ) ?? process.execPath,
- scheme: ElectronProtocol.getDesktopScheme(linux.isDevelopment),
- ...(iconPath === undefined ? {} : { iconPath }),
- }),
- "utf8",
- );
- } catch {}
+ iconPath,
+ );
+ } catch {}
+ }
+ const desktopEntryPath = NodePath.posix.join(
+ applicationsDir,
+ linux.linuxDesktopEntryName,
+ );
+ const { appImagePath } = linuxDesktopEntryConfig;
+ if (
+ Option.isSome(appImagePath) &&
+ Option.isNone(linuxDesktopEntryConfig.launcherPath) &&
+ Option.contains(linuxDesktopEntryConfig.relaunchedByUpdater, "true")
+ ) {
+ try {
+ const replacedPath = replacedVersionedAppImagePath({
+ previousEntry: NodeFS.readFileSync(desktopEntryPath, "utf8"),
+ appImagePath: appImagePath.value,
+ });
+ // Relative, so the pair survives a moved folder; symlink never overwrites a file.
+ if (replacedPath !== null) {
+ NodeFS.symlinkSync(NodePath.posix.basename(appImagePath.value), replacedPath);
+ }
+ } catch {}
+ }
+ NodeFS.writeFileSync(
+ NodePath.posix.join(applicationsDir, linux.linuxDesktopEntryName),
+ desktopEntryPath,
+ renderUrlHandlerDesktopEntry({
+ displayName: resolveDesktopAppBranding({
+ isDevelopment: linux.isDevelopment,
Expand Down
6 changes: 3 additions & 3 deletions patches/0002-flatpak-host-backend.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/apps/desktop/src/backend/DesktopBackendConfiguration.ts b/apps/desktop/src/backend/DesktopBackendConfiguration.ts
index abadf58f3f..c1d7300493 100644
index 82f0a30a40..ac044abe55 100644
--- a/apps/desktop/src/backend/DesktopBackendConfiguration.ts
+++ b/apps/desktop/src/backend/DesktopBackendConfiguration.ts
@@ -1,5 +1,8 @@
Expand All @@ -11,7 +11,7 @@ index abadf58f3f..c1d7300493 100644
import { parsePersistedServerObservabilitySettings } from "@t3tools/shared/serverSettings";
import { currentDesktopBootstrapToken } from "@t3tools/shared/desktopBootstrapToken";
import * as HostProcess from "@t3tools/shared/HostProcess";
@@ -520,7 +523,7 @@ const resolvePrimaryStartConfig = Effect.fn("desktop.backendConfiguration.resolv
@@ -554,7 +557,7 @@ const resolvePrimaryStartConfig = Effect.fn("desktop.backendConfiguration.resolv
...buildObservabilityFragment(input.observabilitySettings),
};

Expand All @@ -20,7 +20,7 @@ index abadf58f3f..c1d7300493 100644
executablePath: process.execPath,
// Packaged builds have a separate cache; --require prevents cache settings leaking to provider subprocesses.
args: [
@@ -544,6 +547,12 @@ const resolvePrimaryStartConfig = Effect.fn("desktop.backendConfiguration.resolv
@@ -579,6 +582,12 @@ const resolvePrimaryStartConfig = Effect.fn("desktop.backendConfiguration.resolv
captureOutput: true,
preflightFailure: Option.none(),
} satisfies DesktopBackendManager.DesktopBackendStartConfig;
Expand Down
22 changes: 11 additions & 11 deletions patches/0003-flatpak-host-environment.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/apps/desktop/src/shell/DesktopShellEnvironment.test.ts b/apps/desktop/src/shell/DesktopShellEnvironment.test.ts
index 0c78691943..8bf03d24fb 100644
index 7808682dfd..34438f15b3 100644
--- a/apps/desktop/src/shell/DesktopShellEnvironment.test.ts
+++ b/apps/desktop/src/shell/DesktopShellEnvironment.test.ts
@@ -163,6 +163,37 @@ function runShellEnvironment(input: {
@@ -184,6 +184,37 @@ function runShellEnvironment(input: {
}

describe("DesktopShellEnvironment", () => {
Expand Down Expand Up @@ -41,18 +41,18 @@ index 0c78691943..8bf03d24fb 100644
Effect.gen(function* () {
const started = yield* Deferred.make<void>();
diff --git a/apps/desktop/src/shell/DesktopShellEnvironment.ts b/apps/desktop/src/shell/DesktopShellEnvironment.ts
index 9d9e390c95..0f4e738aba 100644
index f2a92069f0..a5dab8d7a5 100644
--- a/apps/desktop/src/shell/DesktopShellEnvironment.ts
+++ b/apps/desktop/src/shell/DesktopShellEnvironment.ts
@@ -23,6 +23,7 @@ import * as Stream from "effect/Stream";
@@ -26,6 +26,7 @@ import * as Stream from "effect/Stream";
import * as ChildProcess from "effect/process/ChildProcess";
import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";

+import { flatpakAppId } from "../app/Flatpak.ts";
import * as DesktopEnvironment from "../app/DesktopEnvironment.ts";

type EnvironmentPatch = Record<string, string>;
@@ -580,6 +581,15 @@ const CACHED_ENV_NAMES = [
@@ -656,6 +657,15 @@ const CACHED_ENV_NAMES = [
/** @public */
export const make = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
Expand All @@ -69,18 +69,18 @@ index 9d9e390c95..0f4e738aba 100644
const path = yield* Path.Path;
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
diff --git a/apps/desktop/src/updates/DesktopUpdates.test.ts b/apps/desktop/src/updates/DesktopUpdates.test.ts
index 604fbeda3c..1b14a0497b 100644
index 33ed00a764..44777e1c70 100644
--- a/apps/desktop/src/updates/DesktopUpdates.test.ts
+++ b/apps/desktop/src/updates/DesktopUpdates.test.ts
@@ -1,6 +1,6 @@
import * as NodeModule from "node:module";

-import { assert, describe, it } from "@effect/vitest";
+import { assert, describe, it, vi } from "@effect/vitest";
import { DESKTOP_UPDATE_RESTART_MARKER_FILE } from "@t3tools/contracts";
import { DESKTOP_UPDATE_RESTART_MARKER_FILE, DesktopUpdateStateSchema } from "@t3tools/contracts";
import { computeReleaseNotes } from "electron-updater/out/providers/GitHubProvider.js";
import * as Cause from "effect/Cause";
@@ -77,6 +77,28 @@ const stableUpdateInfo = (
@@ -80,6 +80,28 @@ const stableUpdateInfo = (
};

describe("DesktopUpdates", () => {
Expand Down Expand Up @@ -110,15 +110,15 @@ index 604fbeda3c..1b14a0497b 100644
Effect.gen(function* () {
const linuxState = (packageType: string | undefined) =>
diff --git a/apps/desktop/src/updates/DesktopUpdates.ts b/apps/desktop/src/updates/DesktopUpdates.ts
index 36492ca7b9..75ef423a27 100644
index 775a9ff6b0..3ca3eacfce 100644
--- a/apps/desktop/src/updates/DesktopUpdates.ts
+++ b/apps/desktop/src/updates/DesktopUpdates.ts
@@ -1,3 +1,4 @@
+import { flatpakAppId } from "../app/Flatpak.ts";
import {
DESKTOP_UPDATE_RESTART_MARKER_FILE,
DesktopUpdateChannelSchema,
@@ -343,6 +344,9 @@ function getAutoUpdateDisabledReason(args: {
DESKTOP_UPDATE_IN_PROGRESS_MARKER_FILE,
@@ -350,6 +351,9 @@ function getAutoUpdateDisabledReason(args: {
disabledByEnv: boolean;
hasUpdateFeedConfig: boolean;
}): string | null {
Expand Down
Loading