Skip to content

Commit dbecd5d

Browse files
Merge remote-tracking branch 'origin/main' into takeover/pr-19570
2 parents e810a33 + 453bf01 commit dbecd5d

246 files changed

Lines changed: 124349 additions & 3610 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.macroscope/ignore.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,8 @@ infra/relay/migrations/**/snapshot.json
274274
# Ghostty build output vendored from upstream.
275275
apps/mobile/modules/t3-terminal/Vendor/**
276276
native/libghostty-vt/include/**
277+
278+
# @pierre/highlights compiled to C by wasm2c, plus the wasm2c runtime and simde
279+
# it needs. Regenerated by apps/mobile/scripts/generate-highlights.mts; review
280+
# that script and cpp/t3_highlights.c instead.
281+
apps/mobile/modules/t3-highlights/Vendor/**

‎apps/desktop/src/app/DesktopConfig.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export const DesktopConfig = Config.all({
5555
otlpProtocol: Config.schema(OtlpProtocol, "T3CODE_OTLP_PROTOCOL").pipe(
5656
Config.withDefault("http/json"),
5757
),
58+
desktopLauncherPath: trimmedString("T3CODE_DESKTOP_LAUNCHER_PATH"),
5859
appImagePath: trimmedString("APPIMAGE"),
5960
disableAutoUpdate: optionalBoolean("T3CODE_DISABLE_AUTO_UPDATE"),
6061
mockUpdates: optionalBoolean("T3CODE_DESKTOP_MOCK_UPDATES"),

‎apps/desktop/src/app/DesktopEnvironment.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export class DesktopEnvironment extends Context.Service<
7777
readonly linuxDesktopEntryName: string;
7878
readonly linuxWmClass: string;
7979
readonly linuxApplicationsDir: string;
80+
readonly desktopLauncherPath: Option.Option<string>;
8081
readonly appImagePath: Option.Option<string>;
8182
readonly defaultDesktopSettings: DesktopAppSettings.DesktopSettings;
8283
readonly runtimeInfo: DesktopRuntimeInfo;
@@ -233,6 +234,7 @@ const make = Effect.fn("desktop.environment.make")(function* (
233234
linuxDesktopEntryName: resolveLinuxDesktopEntryName(isDevelopment),
234235
linuxWmClass: isDevelopment ? "t3code-dev" : "t3code",
235236
linuxApplicationsDir,
237+
desktopLauncherPath: config.desktopLauncherPath,
236238
appImagePath: config.appImagePath,
237239
defaultDesktopSettings: DesktopAppSettings.resolveDefaultDesktopSettings(input.appVersion),
238240
runtimeInfo: resolveDesktopRuntimeInfo({

‎apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const makeEnvironment = (path: Path.Path, overrides: Record<string, unknown> = {
3131
linuxDesktopEntryName: "com.t3tools.T3Code.desktop",
3232
linuxWmClass: "t3code",
3333
linuxApplicationsDir: "/home/alice/.local/share/applications",
34+
desktopLauncherPath: Option.none(),
3435
appImagePath: Option.some("/home/alice/Applications/T3-Code.AppImage"),
3536
path,
3637
...overrides,
@@ -228,6 +229,18 @@ describe("DesktopLinuxUrlHandler", () => {
228229
});
229230
});
230231

232+
it.effect("launches a distribution package through its configured launcher", () => {
233+
const recorded = emptyRecording();
234+
235+
return Effect.gen(function* () {
236+
yield* runRegister(recorded, {
237+
environment: { desktopLauncherPath: Option.some("/opt/T3 Code/t3code") },
238+
});
239+
240+
assert.include(recorded.files[0]?.content, 'Exec="/opt/T3 Code/t3code" %U');
241+
});
242+
});
243+
231244
it.effect("does not rewrite the pre-ready entry while the portal can be reading it", () => {
232245
const recorded = emptyRecording();
233246

‎apps/desktop/src/app/DesktopLinuxUrlHandler.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,14 @@ export const make = Effect.gen(function* () {
141141
const themeIconDir = environment.path.join(hicolorDir, LINUX_THEME_ICON_SIZE, "apps");
142142

143143
const writeDesktopEntry = Effect.gen(function* () {
144+
// Distribution packages that run on a shared Electron set
145+
// T3CODE_DESKTOP_LAUNCHER_PATH, because process.execPath is that Electron.
144146
// Inside the mounted AppImage, process.execPath points at a transient
145147
// /tmp/.mount_* path — the handler must launch the AppImage itself.
146-
const execTarget = Option.getOrElse(environment.appImagePath, () => process.execPath);
148+
const execTarget = environment.desktopLauncherPath.pipe(
149+
Option.orElse(() => environment.appImagePath),
150+
Option.getOrElse(() => process.execPath),
151+
);
147152
const content = renderUrlHandlerDesktopEntry({
148153
displayName: environment.displayName,
149154
execTarget,

‎apps/desktop/src/app/DesktopPreReadyPlatform.test.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,28 @@ describe("DesktopPreReadyPlatform", () => {
166166
).pipe(Effect.ensuring(Effect.sync(() => vi.unstubAllEnvs())));
167167
});
168168

169+
it.effect("points the early portal entry at a configured distribution launcher", () => {
170+
vi.stubEnv("VITE_DEV_SERVER_URL", "");
171+
vi.stubEnv("XDG_DATA_HOME", "/xdg");
172+
vi.stubEnv("APPIMAGE", "/Applications/current.AppImage");
173+
vi.stubEnv("T3CODE_DESKTOP_LAUNCHER_PATH", " /opt/T3 Code/t3code ");
174+
getSwitchValueMock.mockReturnValue("");
175+
176+
return Effect.scoped(
177+
Effect.gen(function* () {
178+
yield* Layer.build(
179+
DesktopPreReadyPlatform.layer.pipe(
180+
Layer.provide(Layer.succeed(HostProcess.Platform, "linux")),
181+
),
182+
);
183+
const entry = writeFileSyncMock.mock.calls.find(
184+
([path]) => path === "/xdg/applications/com.t3tools.T3Code.desktop",
185+
)?.[1];
186+
assert.include(entry, 'Exec="/opt/T3 Code/t3code" %U');
187+
}),
188+
).pipe(Effect.ensuring(Effect.sync(() => vi.unstubAllEnvs())));
189+
});
190+
169191
it.effect(
170192
"acquires a synchronous pre-ready layer before an asynchronous Clerk-shaped layer",
171193
() =>

‎apps/desktop/src/app/DesktopPreReadyPlatform.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ export const make = Effect.gen(function* () {
109109
isDevelopment: linux.isDevelopment,
110110
appVersion: Electron.app.getVersion(),
111111
}).displayName,
112-
execTarget: process.env.APPIMAGE?.trim() || process.execPath,
112+
execTarget:
113+
process.env.T3CODE_DESKTOP_LAUNCHER_PATH?.trim() ||
114+
process.env.APPIMAGE?.trim() ||
115+
process.execPath,
113116
scheme: ElectronProtocol.getDesktopScheme(linux.isDevelopment),
114117
...(iconPath === undefined ? {} : { iconPath }),
115118
}),

‎apps/mobile/.swiftlint.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
included:
22
- ios/T3Code
33
- modules/t3-composer-editor/ios
4+
- modules/t3-highlights/ios
45
- modules/t3-native-controls/ios
56
- modules/t3-terminal/ios
67
- modules/t3-review-diff/ios

‎apps/mobile/README.md‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,6 @@ Build and run the local iOS preview app:
9696
vp run ios:preview
9797
```
9898

99-
Force the review diff highlighter engine:
100-
101-
```bash
102-
EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE=javascript vp run ios:dev
103-
```
104-
105-
`javascript` is the default and recommended setting for the review diff screen. Set `EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE=native` only when you explicitly want to test the native Shiki engine.
106-
10799
Inspect the resolved Expo config for a variant:
108100

109101
```bash

‎apps/mobile/app.config.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@ const config: ExpoConfig = {
454454
...(!isIosPersonalTeamBuild ? ["./plugins/withWidgetLogoAsset.cjs", widgetsPlugin] : []),
455455
"./plugins/withAndroidCleartextTraffic.cjs",
456456
"./plugins/withAndroidGradleHeap.cjs",
457-
"./plugins/withAndroidFbjniVersion.cjs",
458457
"./plugins/withAndroidInputBackground.cjs",
459458
"./plugins/withAndroidModernPopupMenu.cjs",
460459
"./plugins/withAndroidModernAlertDialog.cjs",

0 commit comments

Comments
 (0)