Skip to content

Commit 5d53eb0

Browse files
authored
Merge branch 'main' into feat/terminal-context-menu-copy-upstream-main
2 parents 003f7ad + ebe8afb commit 5d53eb0

55 files changed

Lines changed: 2303 additions & 372 deletions

Some content is hidden

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

‎apps/desktop/src/electron/ElectronMenu.test.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ const TestLayer = ElectronMenu.layer.pipe(
3131
Layer.provide(Layer.succeed(HostProcessPlatform, "linux")),
3232
);
3333

34+
const makeWindow = (zoomFactor = 1): Electron.BrowserWindow =>
35+
({
36+
id: 7,
37+
webContents: { getZoomFactor: () => zoomFactor },
38+
}) as unknown as Electron.BrowserWindow;
39+
3440
describe("ElectronMenu", () => {
3541
beforeEach(() => {
3642
buildFromTemplateMock.mockReset();
@@ -70,7 +76,7 @@ describe("ElectronMenu", () => {
7076

7177
const electronMenu = yield* ElectronMenu.ElectronMenu;
7278
const selectedItemId = yield* electronMenu.showContextMenu({
73-
window: {} as Electron.BrowserWindow,
79+
window: makeWindow(),
7480
items: [{ id: "copy", label: "Copy" }],
7581
position: Option.none(),
7682
});
@@ -81,20 +87,24 @@ describe("ElectronMenu", () => {
8187

8288
it.effect("resolves with none when the menu closes without a click", () =>
8389
Effect.gen(function* () {
90+
let popupOptions: Electron.PopupOptions | undefined;
8491
buildFromTemplateMock.mockImplementation(() => ({
8592
popup: (options: Electron.PopupOptions) => {
93+
popupOptions = options;
8694
options.callback?.();
8795
},
8896
}));
8997

9098
const electronMenu = yield* ElectronMenu.ElectronMenu;
9199
const selectedItemId = yield* electronMenu.showContextMenu({
92-
window: {} as Electron.BrowserWindow,
100+
window: makeWindow(2),
93101
items: [{ id: "copy", label: "Copy" }],
94102
position: Option.some({ x: 10.8, y: 20.2 }),
95103
});
96104

97105
assert.isTrue(Option.isNone(selectedItemId));
106+
assert.equal(popupOptions?.x, 21);
107+
assert.equal(popupOptions?.y, 40);
98108
assert.deepEqual(buildFromTemplateMock.mock.calls[0]?.[0][0], {
99109
label: "Copy",
100110
enabled: true,

‎apps/desktop/src/electron/ElectronMenu.ts‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,20 @@ function normalizeContextMenuItems(source: readonly ContextMenuItem[]): ContextM
9494
return normalizedItems;
9595
}
9696

97+
// Renderer positions arrive in CSS pixels; popup() expects window points, so
98+
// page zoom must be factored in or menus drift proportionally to their
99+
// distance from the window origin.
97100
const normalizePosition = (
98101
position: Option.Option<ElectronMenuPosition>,
102+
zoomFactor: number,
99103
): Option.Option<ElectronMenuPosition> =>
100104
Option.filter(
101105
position,
102-
({ x, y }) => Number.isFinite(x) && Number.isFinite(y) && x >= 0 && y >= 0,
103-
).pipe(Option.map(({ x, y }) => ({ x: Math.floor(x), y: Math.floor(y) })));
106+
({ x, y }) =>
107+
Number.isFinite(x) && Number.isFinite(y) && x >= 0 && y >= 0 && Number.isFinite(zoomFactor),
108+
).pipe(
109+
Option.map(({ x, y }) => ({ x: Math.floor(x * zoomFactor), y: Math.floor(y * zoomFactor) })),
110+
);
104111

105112
export const make = Effect.gen(function* () {
106113
const platform = yield* HostProcessPlatform;
@@ -214,7 +221,10 @@ export const make = Effect.gen(function* () {
214221

215222
try {
216223
const menu = Electron.Menu.buildFromTemplate(buildTemplate(normalizedItems, complete));
217-
const popupPosition = normalizePosition(input.position);
224+
const popupPosition = normalizePosition(
225+
input.position,
226+
input.window.webContents.getZoomFactor(),
227+
);
218228
const popupOptions = Option.match(popupPosition, {
219229
onNone: (): Electron.PopupOptions => ({
220230
window: input.window,

‎apps/desktop/src/wsl/DesktopWslEnvironment.test.ts‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
formatNodePtyProbeFailureReason,
1717
formatWslShellTransportFailureReason,
1818
parseNodePath,
19+
parseNodeVersion,
1920
parseResolvedPath,
2021
parseToolchainReport,
2122
probeWslDistros,
@@ -173,6 +174,29 @@ describe("parseNodePath", () => {
173174
});
174175
});
175176

177+
describe("parseNodeVersion", () => {
178+
it("extracts the node version from a nodeVersion: line", () => {
179+
expect(parseNodeVersion("nodeVersion:24.10.0")).toBe("24.10.0");
180+
});
181+
182+
it("returns null when the version value is empty", () => {
183+
expect(parseNodeVersion("nodeVersion:")).toBeNull();
184+
});
185+
186+
it("returns null when there is no nodeVersion line at all", () => {
187+
expect(parseNodeVersion("nodePath:/usr/bin/node\nresolvedPath:/usr/bin")).toBeNull();
188+
});
189+
190+
it("ignores surrounding noise and trims whitespace", () => {
191+
const stdout = [
192+
"some preamble noise",
193+
" nodeVersion:22.16.0 ",
194+
"nodePath:/usr/bin/node",
195+
].join("\n");
196+
expect(parseNodeVersion(stdout)).toBe("22.16.0");
197+
});
198+
});
199+
176200
describe("parseResolvedPath", () => {
177201
it("preserves spaces and apostrophes in the resolved login-shell PATH", () => {
178202
const resolvedPath = "/home/test user/bin:/opt/test's tools/bin:/usr/bin:/bin";

‎apps/desktop/src/wsl/DesktopWslEnvironment.ts‎

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ export interface EnsureWslNodePtyOptions {
3232
}
3333

3434
export type EnsureWslNodePtyResult =
35-
| { readonly ok: true; readonly nodePath: string; readonly resolvedPath: string }
35+
| {
36+
readonly ok: true;
37+
readonly nodePath: string;
38+
readonly resolvedPath: string;
39+
}
3640
| {
3741
readonly ok: false;
3842
readonly reason: string;
@@ -222,6 +226,7 @@ export const formatNodePtyProbeFailureReason = (exitCode: number): string | null
222226
const NODE_PTY_PROBE_SCRIPT = (
223227
linuxServerDir: string,
224228
) => `printf 'nodePath:%s\\n' "$(command -v node 2>/dev/null)"
229+
printf 'nodeVersion:%s\\n' "$(node -p 'process.versions.node' 2>/dev/null)"
225230
printf 'resolvedPath:%s\\n' "$PATH"
226231
cd ${shellQuote(linuxServerDir)} && node <<'NODE' >/dev/null 2>&1
227232
// The server bundle externalizes its deps to node_modules, and the WSL Node
@@ -318,6 +323,16 @@ export const parseNodePath = (stdout: string): string | null => {
318323
return path ?? null;
319324
};
320325

326+
export const parseNodeVersion = (stdout: string): string | null => {
327+
const version = stdout
328+
.split("\n")
329+
.map((line) => line.trim())
330+
.filter((line) => line.startsWith("nodeVersion:"))
331+
.map((line) => line.slice("nodeVersion:".length).trim())
332+
.find((value) => value.length > 0);
333+
return version ?? null;
334+
};
335+
321336
// Captures the login-shell PATH after the shared resolver has loaded version
322337
// managers. Preserve the value byte-for-byte apart from a Windows-style CR so
323338
// paths containing spaces or apostrophes can be forwarded as one env argv.
@@ -404,7 +419,11 @@ const ensureNodePtyImpl = (
404419

405420
const transportFailureReason = formatWslShellTransportFailureReason(probe.transportFailure);
406421
if (transportFailureReason !== null) {
407-
return { ok: false, reason: transportFailureReason, fatal: false } as const;
422+
return {
423+
ok: false,
424+
reason: transportFailureReason,
425+
fatal: false,
426+
} as const;
408427
}
409428

410429
// No node at all, even after the shared resolver repaired PATH. Surface
@@ -457,12 +476,31 @@ const ensureNodePtyImpl = (
457476
} as const;
458477
}
459478

460-
if (probe.exitCode === 0) return { ok: true, nodePath, resolvedPath } as const;
479+
if (probe.exitCode === 0) {
480+
const rawVersion = parseNodeVersion(probe.stdout);
481+
if (
482+
rawVersion !== null &&
483+
options.nodeEngineRange &&
484+
!satisfiesSemverRange(rawVersion, options.nodeEngineRange.trim())
485+
) {
486+
const range = options.nodeEngineRange.trim();
487+
return {
488+
ok: false,
489+
reason: `WSL Node.js ${rawVersion} does not satisfy the server's required engine range (${range}). Install a compatible version, and restart the desktop app.`,
490+
fatal: true,
491+
} as const;
492+
}
493+
return { ok: true, nodePath, resolvedPath } as const;
494+
}
461495

462496
if (options.allowBuild !== true) {
463497
const packagedProbeFailure = formatNodePtyProbeFailureReason(probe.exitCode);
464498
if (packagedProbeFailure !== null) {
465-
return { ok: false, reason: packagedProbeFailure, fatal: true } as const;
499+
return {
500+
ok: false,
501+
reason: packagedProbeFailure,
502+
fatal: true,
503+
} as const;
466504
}
467505
}
468506

Lines changed: 4 additions & 0 deletions
Loading

‎apps/marketing/src/pages/index.astro‎

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ const mobileEndorsementRows = [
3333
<span class="hero-float-mark hf-cursor" title="Cursor">
3434
<img src="/harnesses/cursor_light.svg" alt="" />
3535
</span>
36+
<span class="hero-float-mark hf-grok" title="Grok">
37+
<img src="/harnesses/grok-dark.svg" alt="" />
38+
</span>
3639
</div>
3740

3841
<div class="container hero-inner">
@@ -41,7 +44,7 @@ const mobileEndorsementRows = [
4144
</h1>
4245

4346
<p class="hero-sub">
44-
Orchestrate Claude Code, Codex, OpenCode and Cursor from one surface.
47+
Orchestrate Claude Code, Codex, OpenCode, Cursor, and Grok from one surface.
4548
Bring your own subscription. Fork the whole thing.
4649
</p>
4750

@@ -173,7 +176,7 @@ const mobileEndorsementRows = [
173176
<h2>Bring your own sub</h2>
174177
<p>
175178
T3 Code doesn't resell tokens. Plug in Claude Code, Codex, OpenCode,
176-
or Cursor with the credentials you already have — we orchestrate
179+
Cursor, or Grok with the credentials you already have — we orchestrate
177180
them, you keep your plan.
178181
</p>
179182
</div>
@@ -207,6 +210,13 @@ const mobileEndorsementRows = [
207210
<div class="harness-tag">cursor-agent</div>
208211
</div>
209212
</div>
213+
<div class="harness">
214+
<div class="harness-mark"><img src="/harnesses/grok-dark.svg" alt="" /></div>
215+
<div class="harness-meta">
216+
<div class="harness-name">Grok CLI</div>
217+
<div class="harness-tag">grok login</div>
218+
</div>
219+
</div>
210220
</div>
211221

212222
<div class="harness-footer">
@@ -615,8 +625,9 @@ const mobileEndorsementRows = [
615625

616626
.hero-float-mark.hf-claude { background: radial-gradient(circle at 30% 25%, rgba(217, 119, 87, 0.22), rgba(20, 20, 24, 0.92) 65%); top: 8%; left: 7%; animation-delay: 0s; transform: rotate(-8deg); }
617627
.hero-float-mark.hf-codex { background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.08), rgba(20, 20, 24, 0.92) 65%); top: 6%; right: 7%; animation-delay: -2.5s; transform: rotate(6deg); }
618-
.hero-float-mark.hf-opencode { background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.06), rgba(20, 20, 24, 0.92) 65%); top: 32%; left: 5%; animation-delay: -5s; transform: rotate(4deg); }
628+
.hero-float-mark.hf-opencode { background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.06), rgba(20, 20, 24, 0.92) 65%); top: 30%; left: 5%; animation-delay: -5s; transform: rotate(4deg); }
619629
.hero-float-mark.hf-cursor { background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.08), rgba(20, 20, 24, 0.92) 65%); top: 30%; right: 5%; animation-delay: -7s; transform: rotate(-5deg); }
630+
.hero-float-mark.hf-grok { background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.08), rgba(20, 20, 24, 0.92) 65%); top: 52%; left: 6%; animation-delay: -1.2s; transform: rotate(3deg); }
620631

621632
@media (max-width: 1180px) {
622633
.hero-float-mark { width: 76px; height: 76px; border-radius: 20px; }
@@ -625,6 +636,7 @@ const mobileEndorsementRows = [
625636
.hero-float-mark.hf-codex { top: 2%; right: 3%; }
626637
.hero-float-mark.hf-opencode { top: 26%; left: 2%; }
627638
.hero-float-mark.hf-cursor { top: 24%; right: 2%; }
639+
.hero-float-mark.hf-grok { top: 48%; left: 2%; transform: rotate(3deg); }
628640
}
629641

630642
@media (max-width: 820px) {
@@ -659,17 +671,18 @@ const mobileEndorsementRows = [
659671
height: 44px;
660672
}
661673

662-
/* Two above the title, two flanking the call-to-action area. */
674+
/* Three stacked on the left, two on the right — keeps the center CTA clear. */
663675
.hero-float-mark.hf-claude {
664676
top: 44px;
665677
left: 10px;
666678
transform: rotate(-10deg);
667679
}
668680

669-
.hero-float-mark.hf-codex {
670-
top: 44px;
671-
right: 10px;
672-
transform: rotate(8deg);
681+
.hero-float-mark.hf-grok {
682+
top: 240px;
683+
left: 4px;
684+
right: auto;
685+
transform: rotate(-4deg);
673686
}
674687

675688
.hero-float-mark.hf-opencode {
@@ -679,6 +692,12 @@ const mobileEndorsementRows = [
679692
transform: rotate(-6deg);
680693
}
681694

695+
.hero-float-mark.hf-codex {
696+
top: 44px;
697+
right: 10px;
698+
transform: rotate(8deg);
699+
}
700+
682701
.hero-float-mark.hf-cursor {
683702
top: 474px;
684703
right: 4px;
@@ -688,6 +707,14 @@ const mobileEndorsementRows = [
688707
}
689708

690709
@media (max-width: 340px) {
710+
.hero-float-mark.hf-grok {
711+
top: 220px;
712+
left: 0;
713+
width: 52px;
714+
height: 52px;
715+
border-radius: 14px;
716+
}
717+
691718
.hero-float-mark.hf-opencode,
692719
.hero-float-mark.hf-cursor {
693720
top: 580px;
@@ -704,6 +731,7 @@ const mobileEndorsementRows = [
704731
right: 0;
705732
}
706733

734+
.hero-float-mark.hf-grok img,
707735
.hero-float-mark.hf-opencode img,
708736
.hero-float-mark.hf-cursor img {
709737
width: 30px;
@@ -750,7 +778,7 @@ const mobileEndorsementRows = [
750778

751779
.harness-grid {
752780
display: grid;
753-
grid-template-columns: repeat(4, 1fr);
781+
grid-template-columns: repeat(5, 1fr);
754782
gap: 0;
755783
border: 1px solid var(--border);
756784
border-radius: var(--radius);
@@ -1205,6 +1233,10 @@ const mobileEndorsementRows = [
12051233
.harness-grid { grid-template-columns: 1fr 1fr; }
12061234
.harness { border-right: 0; border-bottom: 1px solid var(--border); }
12071235
.harness:nth-child(odd) { border-right: 1px solid var(--border); }
1236+
.harness:nth-child(5):last-child {
1237+
grid-column: 1 / -1;
1238+
border-right: 0;
1239+
}
12081240
.git-inner { grid-template-columns: 1fr; gap: 40px; }
12091241
.open-grid { grid-template-columns: 1fr; }
12101242
}

‎apps/mobile/src/Stack.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { DynamicColorIOS, Platform, Pressable, ScrollView, StyleSheet } from "re
1515
import { useResolveClassNames } from "uniwind";
1616

1717
import { AppText as Text } from "./components/AppText";
18+
import { renderCompactBrandTitle } from "./components/CompactBrandTitle";
1819
import { ArchivedThreadsRouteScreen } from "./features/archive/ArchivedThreadsRouteScreen";
1920
import { useAgentNotificationNavigation } from "./features/agent-awareness/notificationNavigation";
2021
import { ClerkSettingsSheetDetentProvider } from "./features/cloud/ClerkSettingsSheetDetent";
@@ -377,7 +378,8 @@ export const RootStack = createNativeStackNavigator({
377378
...GLASS_HEADER_OPTIONS,
378379
contentStyle: { backgroundColor: "transparent" },
379380
headerBackVisible: false,
380-
title: "Threads",
381+
headerTitle: renderCompactBrandTitle,
382+
title: "T3 Code",
381383
},
382384
}),
383385
Thread: createNativeStackScreen({

0 commit comments

Comments
 (0)