Compare commits

...
Author SHA1 Message Date
Gabriel De Andrade aadd5f0327 fix(server): tombstone deletion of missing threads
- Make thread deletion idempotent for stale client entries
- Add coverage for emitting a deletion tombstone when the thread is missing
2026-07-30 21:49:09 -04:00
Julius MarmingeandClaude Fable 5 df78cda8bf fix(contracts): decode growing config unions forward-compatibly (#5055)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 01:11:46 +02:00
Alex 605c2bb734 fix(mobile): show the correct build channel in Android's Threads page header (#4861) 2026-07-30 22:30:46 +00:00
Aditya Vardhan Sharma cb11a71d63 fix(mobile): accept Android clipboard images in composer (#4836) 2026-07-31 00:20:33 +02:00
Simon DobaandClaude Opus 5 41124c7260 fix(desktop): link release notes from the update downloaded toast (#4771)
Co-authored-by: Claude Opus 5 <[email protected]>
2026-07-31 00:19:34 +02:00
Max Anderson b0b275227b chore: add mobile issue template area (#4895) 2026-07-31 00:19:00 +02:00
Alex cb293fe790 fix(mobile): restore iOS Threads branding (#4862) 2026-07-31 00:17:47 +02:00
Simone 1d694dcbd8 fix(mobile): default bare IP pairing to HTTP (#4990) 2026-07-30 22:17:38 +00:00
Arham AminandClaude Opus 4.8 32407df9c5 fix(shared): lenient JSON parser deletes commas inside string values (#5025)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-30 22:16:22 +00:00
Elaine Lyons 162e774294 fix(mobile): remove unnecessary photo library permission (#4929) 2026-07-31 00:15:38 +02:00
Arham AminandClaude Opus 4.8 063ed7120a feat(shared): support shorthand (major-only) versions in the semver helpers (#5027)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-30 22:13:46 +00:00
Utkarsh Patil 34b15a9ace perf(server): cache default branch name and origin existence across status refreshes (#5008) 2026-07-31 00:08:59 +02:00
Julius MarmingeandClaude Fable 5 fbecb7365e fix(desktop): bump Clerk Electron SDK to 0.0.24 and register t3code:// scheme on Linux (#5015)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-31 00:06:49 +02:00
Julius MarmingeandClaude Fable 5 4029b858ea fix(ci): drop sparse-checkout from EAS workflows
actions/checkout implements sparse-checkout with --filter=blob:none, so
the runner repo is a partial clone missing the .repos/ blobs. eas-cli
archives the project via `git clone --depth 1 file://<workspace>`,
which upload-pack cannot serve from a partial clone and exits 128
(#4802 broke both EAS build workflows this way).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-30 13:15:03 -07:00
maria 5b2577f6a9 style(web): make scroll-to-end pill translucent (#5036) 2026-07-30 20:08:05 +00:00
Julius MarmingeandClaude Fable 5 bc142f84a2 chore(mobile): bump app version to 1.0.1
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-30 13:07:10 -07:00
59 changed files with 1088 additions and 234 deletions

No files matched your search

+1 -1
View File
@@ -66,7 +66,7 @@ Use these client origins:
- Android Emulator: `http://10.0.2.2:<server-port>`
- Physical device: bind the backend to `0.0.0.0` and use the host's reachable LAN origin
Always enter the complete `http://` origin; the mobile host field otherwise assumes HTTPS. When testing web and mobile together, run `vp run dev --home-dir <base-dir> --host 127.0.0.1` instead and do not launch a second backend over the same base directory.
Enter the complete `http://` origin to make the test transport explicit. Bare IP addresses default to HTTP, while bare hostnames default to HTTPS. When testing web and mobile together, run `vp run dev --home-dir <base-dir> --host 127.0.0.1` instead and do not launch a second backend over the same base directory.
## Start or reuse Metro safely
+1
View File
@@ -30,6 +30,7 @@ body:
- apps/web
- apps/server
- apps/desktop
- apps/mobile
- packages/contracts or packages/shared
- Build, CI, or release tooling
- Docs
@@ -30,6 +30,7 @@ body:
- apps/web
- apps/server
- apps/desktop
- apps/mobile
- packages/contracts or packages/shared
- Build, CI, or release tooling
- Docs
+4 -4
View File
@@ -39,10 +39,10 @@ jobs:
uses: actions/checkout@v6
with:
fetch-depth: 0
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
# No sparse-checkout here: it makes actions/checkout fetch with
# --filter=blob:none, and eas-cli archives the project via
# `git clone --depth 1 file://<workspace>`, which fails (exit 128)
# when the partial clone can't serve the unfetched blobs.
- name: Setup Vite+
if: steps.expo-token.outputs.present == 'true'
+4 -4
View File
@@ -57,10 +57,10 @@ jobs:
uses: actions/checkout@v6
with:
fetch-depth: 0
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
# No sparse-checkout here: it makes actions/checkout fetch with
# --filter=blob:none, and eas-cli archives the project via
# `git clone --depth 1 file://<workspace>`, which fails (exit 128)
# when the partial clone can't serve the unfetched blobs.
- name: Setup Vite+
if: steps.expo-token.outputs.present == 'true'
@@ -54,7 +54,6 @@ const makeElectronAppLayer = (calls: ElectronAppCalls) =>
calls.setAboutPanelOptions.push(options);
}),
setAppUserModelId: () => Effect.void,
requestSingleInstanceLock: Effect.succeed(true),
getAppMetrics: Effect.succeed([]),
isDefaultProtocolClient: () => Effect.succeed(false),
setAsDefaultProtocolClient: () => Effect.succeed(true),
+27 -19
View File
@@ -45,6 +45,27 @@ const normalizeCommitHash = (value: string): Option.Option<string> => {
: Option.none();
};
export const resolveUserDataPath = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
const fileSystem = yield* FileSystem.FileSystem;
const legacyPath = environment.path.join(
environment.appDataDirectory,
environment.legacyUserDataDirName,
);
const legacyPathExists = yield* fileSystem.exists(legacyPath).pipe(
Effect.mapError(
(cause) =>
new DesktopUserDataPathResolutionError({
legacyPath,
cause,
}),
),
);
return legacyPathExists
? legacyPath
: environment.path.join(environment.appDataDirectory, environment.userDataDirName);
}).pipe(Effect.withSpan("desktop.appIdentity.resolveUserDataPath"));
export const make = Effect.gen(function* () {
const assets = yield* DesktopAssets.DesktopAssets;
const electronApp = yield* ElectronApp.ElectronApp;
@@ -90,24 +111,11 @@ export const make = Effect.gen(function* () {
return commitHash;
});
const resolveUserDataPath = Effect.gen(function* () {
const legacyPath = environment.path.join(
environment.appDataDirectory,
environment.legacyUserDataDirName,
);
const legacyPathExists = yield* fileSystem.exists(legacyPath).pipe(
Effect.mapError(
(cause) =>
new DesktopUserDataPathResolutionError({
legacyPath,
cause,
}),
),
);
return legacyPathExists
? legacyPath
: environment.path.join(environment.appDataDirectory, environment.userDataDirName);
}).pipe(Effect.withSpan("desktop.appIdentity.resolveUserDataPath"));
const userDataPath = resolveUserDataPath.pipe(
Effect.provide(
yield* Effect.context<DesktopEnvironment.DesktopEnvironment | FileSystem.FileSystem>(),
),
);
const configure = Effect.gen(function* () {
const commitHash = yield* resolveAboutCommitHash;
@@ -136,7 +144,7 @@ export const make = Effect.gen(function* () {
}).pipe(Effect.withSpan("desktop.appIdentity.configure"));
return DesktopAppIdentity.of({
resolveUserDataPath,
resolveUserDataPath: userDataPath,
configure,
});
});
+90 -5
View File
@@ -22,17 +22,38 @@ vi.mock("@clerk/electron/storage", () => ({
storage: storageMock,
}));
import * as Exit from "effect/Exit";
import * as FileSystem from "effect/FileSystem";
import * as ElectronApp from "../electron/ElectronApp.ts";
import * as ElectronWindow from "../electron/ElectronWindow.ts";
import * as DesktopClerk from "./DesktopClerk.ts";
import * as DesktopEnvironment from "./DesktopEnvironment.ts";
const makeDesktopClerkLayer = (isDevelopment = true) => {
const makeDesktopClerkLayer = (isDevelopment = true, events: string[] = []) => {
const environment = DesktopEnvironment.DesktopEnvironment.of({
stateDir: "/tmp/t3-state",
isDevelopment,
appDataDirectory: "/tmp/app-data",
userDataDirName: isDevelopment ? "t3code-dev" : "t3code",
legacyUserDataDirName: isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)",
path: { join: (...parts: ReadonlyArray<string>) => parts.join("/") },
} as unknown as DesktopEnvironment.DesktopEnvironment["Service"]);
const electronApp = {
setPath: (name: string, value: string) =>
Effect.sync(() => {
events.push(`setPath:${name}:${value}`);
}),
} as unknown as ElectronApp.ElectronApp["Service"];
return DesktopClerk.layer.pipe(
Layer.provide(Layer.succeed(DesktopEnvironment.DesktopEnvironment, environment)),
Layer.provide(
Layer.mergeAll(
Layer.succeed(DesktopEnvironment.DesktopEnvironment, environment),
Layer.succeed(ElectronApp.ElectronApp, electronApp),
FileSystem.layerNoop({ exists: () => Effect.succeed(false) }),
),
),
);
};
@@ -55,11 +76,15 @@ describe("DesktopClerk", () => {
it.effect("acquires and releases the SDK bridge with the layer", () => {
const cleanup = vi.fn();
const events: string[] = [];
storageMock.mockReturnValue(storageAdapter);
createClerkBridgeMock.mockReturnValue({ cleanup });
createClerkBridgeMock.mockImplementation(() => {
events.push("createClerkBridge");
return { cleanup, isPrimaryInstance: true };
});
return Effect.gen(function* () {
yield* Effect.scoped(Layer.build(makeDesktopClerkLayer()));
yield* Effect.scoped(Layer.build(makeDesktopClerkLayer(true, events)));
assert.deepEqual(createClerkBridgeMock.mock.calls, [
[
@@ -71,6 +96,10 @@ describe("DesktopClerk", () => {
],
]);
assert.equal(cleanup.mock.calls.length, 1);
// The bridge acquires Electron's single-instance lock at creation, and
// the lock both lives in and creates the userData directory — so the
// real path must be set before the bridge exists.
assert.deepEqual(events, ["setPath:userData:/tmp/app-data/t3code-dev", "createClerkBridge"]);
storageMock.mockClear();
createClerkBridgeMock.mockClear();
});
@@ -124,11 +153,67 @@ describe("DesktopClerk", () => {
});
});
it.effect("registers the second-instance handler in the primary instance", () => {
storageMock.mockReturnValue(storageAdapter);
createClerkBridgeMock.mockReturnValue({ cleanup: vi.fn(), isPrimaryInstance: true });
const quit = vi.fn();
const registeredEvents: string[] = [];
const electronApp = {
quit: Effect.sync(quit),
on: (eventName: string) =>
Effect.sync(() => {
registeredEvents.push(eventName);
}),
} as unknown as ElectronApp.ElectronApp["Service"];
const electronWindow = {} as ElectronWindow.ElectronWindow["Service"];
return Effect.gen(function* () {
const clerk = yield* DesktopClerk.DesktopClerk;
const exit = yield* Effect.exit(Effect.scoped(clerk.configure));
assert.isTrue(Exit.isSuccess(exit));
assert.equal(quit.mock.calls.length, 0);
assert.deepEqual(registeredEvents, ["second-instance"]);
}).pipe(
Effect.provide(makeDesktopClerkLayer()),
Effect.provideService(ElectronApp.ElectronApp, electronApp),
Effect.provideService(ElectronWindow.ElectronWindow, electronWindow),
);
});
it.effect("quits and interrupts startup in a secondary instance", () => {
storageMock.mockReturnValue(storageAdapter);
createClerkBridgeMock.mockReturnValue({ cleanup: vi.fn(), isPrimaryInstance: false });
const quit = vi.fn();
const registeredEvents: string[] = [];
const electronApp = {
quit: Effect.sync(quit),
on: (eventName: string) =>
Effect.sync(() => {
registeredEvents.push(eventName);
}),
} as unknown as ElectronApp.ElectronApp["Service"];
const electronWindow = {} as ElectronWindow.ElectronWindow["Service"];
return Effect.gen(function* () {
const clerk = yield* DesktopClerk.DesktopClerk;
const exit = yield* Effect.exit(Effect.scoped(clerk.configure));
assert.isTrue(Exit.hasInterrupts(exit));
assert.equal(quit.mock.calls.length, 1);
assert.deepEqual(registeredEvents, []);
}).pipe(
Effect.provide(makeDesktopClerkLayer()),
Effect.provideService(ElectronApp.ElectronApp, electronApp),
Effect.provideService(ElectronWindow.ElectronWindow, electronWindow),
);
});
it.each([
{ isDevelopment: true, scheme: "t3code-dev" },
{ isDevelopment: false, scheme: "t3code" },
])("configures the SDK with the $scheme renderer origin", ({ isDevelopment, scheme }) => {
const bridge = { cleanup: vi.fn() };
const bridge = { cleanup: vi.fn(), isPrimaryInstance: true };
storageMock.mockReturnValue(storageAdapter);
createClerkBridgeMock.mockReturnValue(bridge);
+19 -2
View File
@@ -11,6 +11,7 @@ import { clerkFrontendApiHostnameFromPublishableKey } from "@t3tools/shared/rela
import * as ElectronApp from "../electron/ElectronApp.ts";
import * as ElectronProtocol from "../electron/ElectronProtocol.ts";
import * as ElectronWindow from "../electron/ElectronWindow.ts";
import * as DesktopAppIdentity from "./DesktopAppIdentity.ts";
import * as DesktopEnvironment from "./DesktopEnvironment.ts";
declare const __T3CODE_BUILD_CLERK_PUBLISHABLE_KEY__: string | undefined;
@@ -84,7 +85,18 @@ export function createDesktopClerkBridge(stateDir: string, isDevelopment: boolea
export const make = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
yield* Effect.acquireRelease(
const electronApp = yield* ElectronApp.ElectronApp;
// Electron scopes the single-instance lock to the userData directory and
// creates that directory when the lock is acquired. The SDK bridge takes
// the lock at creation, so userData must already point at the real
// directory here — under the default productName-derived path, acquiring
// the lock would create "T3 Code (Alpha)" and make the legacy-install
// detection in resolveUserDataPath match on fresh installs.
const userDataPath = yield* DesktopAppIdentity.resolveUserDataPath;
yield* electronApp.setPath("userData", userDataPath);
const bridge = yield* Effect.acquireRelease(
Effect.try({
try: () => createDesktopClerkBridge(environment.stateDir, environment.isDevelopment),
catch: (cause) =>
@@ -113,7 +125,12 @@ export const make = Effect.gen(function* () {
const context = yield* Effect.context<ElectronWindow.ElectronWindow>();
const runPromise = Effect.runPromiseWith(context);
if (!(yield* electronApp.requestSingleInstanceLock)) {
// The SDK bridge holds Electron's single-instance lock (acquired at
// bridge creation) so OAuth deep-link callbacks on Windows/Linux are
// forwarded to the running app. In a secondary instance the bridge has
// already begun quitting the app; app.quit() is asynchronous, so stop
// bootstrap here before whenReady can fire.
if (!bridge.isPrimaryInstance) {
yield* electronApp.quit;
return yield* Effect.interrupt;
}
@@ -29,7 +29,6 @@ describe("DesktopLifecycle", () => {
setName: () => Effect.void,
setAboutPanelOptions: () => Effect.void,
setAppUserModelId: () => Effect.void,
requestSingleInstanceLock: Effect.succeed(true),
getAppMetrics: Effect.succeed([]),
isDefaultProtocolClient: () => Effect.succeed(false),
setAsDefaultProtocolClient: () => Effect.succeed(true),
@@ -14,7 +14,6 @@ const {
quitMock,
relaunchMock,
removeListenerMock,
requestSingleInstanceLockMock,
setAboutPanelOptionsMock,
setAppUserModelIdMock,
setAsDefaultProtocolClientMock,
@@ -35,7 +34,6 @@ const {
quitMock: vi.fn(),
relaunchMock: vi.fn(),
removeListenerMock: vi.fn(),
requestSingleInstanceLockMock: vi.fn(() => true),
setAboutPanelOptionsMock: vi.fn(),
setAppUserModelIdMock: vi.fn(),
setAsDefaultProtocolClientMock: vi.fn(() => true),
@@ -67,7 +65,6 @@ vi.mock("electron", () => ({
quit: quitMock,
relaunch: relaunchMock,
removeListener: removeListenerMock,
requestSingleInstanceLock: requestSingleInstanceLockMock,
runningUnderARM64Translation: false,
setAboutPanelOptions: setAboutPanelOptionsMock,
setAsDefaultProtocolClient: setAsDefaultProtocolClientMock,
-2
View File
@@ -56,7 +56,6 @@ export class ElectronApp extends Context.Service<
options: Electron.AboutPanelOptionsOptions,
) => Effect.Effect<void>;
readonly setAppUserModelId: (id: string) => Effect.Effect<void>;
readonly requestSingleInstanceLock: Effect.Effect<boolean>;
readonly getAppMetrics: Effect.Effect<ReadonlyArray<Electron.ProcessMetric>>;
readonly isDefaultProtocolClient: (protocol: string) => Effect.Effect<boolean>;
readonly setAsDefaultProtocolClient: (
@@ -153,7 +152,6 @@ export const make = ElectronApp.of({
Effect.sync(() => {
Electron.app.setAppUserModelId(id);
}),
requestSingleInstanceLock: Effect.sync(() => Electron.app.requestSingleInstanceLock()),
getAppMetrics: Effect.sync(() => Electron.app.getAppMetrics()),
isDefaultProtocolClient: (protocol) =>
Effect.sync(() => Electron.app.isDefaultProtocolClient(protocol)),
@@ -34,7 +34,6 @@ function makeElectronAppLayer(
setName: () => Effect.void,
setAboutPanelOptions: () => Effect.void,
setAppUserModelId: () => Effect.void,
requestSingleInstanceLock: Effect.succeed(true),
getAppMetrics: Effect.sync(() => {
onMetricsRead();
return metrics;
@@ -39,7 +39,6 @@ const electronAppLayer = Layer.succeed(ElectronApp.ElectronApp, {
setName: () => Effect.void,
setAboutPanelOptions: () => Effect.void,
setAppUserModelId: () => Effect.void,
requestSingleInstanceLock: Effect.succeed(true),
getAppMetrics: Effect.succeed([]),
isDefaultProtocolClient: () => Effect.succeed(false),
setAsDefaultProtocolClient: () => Effect.succeed(true),
+3 -1
View File
@@ -161,7 +161,7 @@ const config: ExpoConfig = {
slug: "t3-code",
platforms: ["ios", "android"],
scheme: variant.scheme,
version: "0.1.0",
version: "1.0.1",
runtimeVersion: {
// Fingerprint (not appVersion) so an OTA only reaches binaries whose native
// project — native deps, config plugins, AND patches/ — matches the update.
@@ -275,10 +275,12 @@ const config: ExpoConfig = {
"expo-camera",
{
cameraPermission: "Allow T3 Code to access your camera so you can scan pairing QR codes.",
microphonePermission: false,
barcodeScannerEnabled: true,
recordAudioAndroid: false,
},
],
["expo-image-picker", { photosPermission: false, microphonePermission: false }],
[
"expo-splash-screen",
{
+1 -1
View File
@@ -11,7 +11,7 @@
"start:dev": "APP_VARIANT=development expo start",
"start:preview": "APP_VARIANT=preview expo start",
"start:prod": "APP_VARIANT=production expo start",
"showcase": "APP_VARIANT=development EXPO_PUBLIC_SHOWCASE=1 expo start --dev-client --scheme t3code-dev --clear",
"showcase": "APP_VARIANT=production EXPO_PUBLIC_SHOWCASE=1 expo start --dev-client --scheme t3code --clear",
"screenshots": "node ../../scripts/mobile-showcase.ts",
"android": "EXPO_NO_GIT_STATUS=1 expo prebuild --clean --platform android && expo run:android",
"android:dev": "APP_VARIANT=development EXPO_NO_GIT_STATUS=1 expo prebuild --clean --platform android && REACT_NATIVE_PACKAGER_HOSTNAME=localhost expo run:android",
+2 -1
View File
@@ -15,6 +15,7 @@ import { DynamicColorIOS, Platform, Pressable, ScrollView, StyleSheet } from "re
import { useResolveClassNames } from "uniwind";
import { AppText as Text } from "./components/AppText";
import { getCompactBrandHeaderOptions } from "./components/CompactBrandTitle";
import { ArchivedThreadsRouteScreen } from "./features/archive/ArchivedThreadsRouteScreen";
import { useAgentNotificationNavigation } from "./features/agent-awareness/notificationNavigation";
import { ClerkSettingsSheetDetentProvider } from "./features/cloud/ClerkSettingsSheetDetent";
@@ -392,7 +393,7 @@ export const RootStack = createNativeStackNavigator({
...GLASS_HEADER_OPTIONS,
contentStyle: { backgroundColor: "transparent" },
headerBackVisible: false,
title: "Threads",
...getCompactBrandHeaderOptions(),
},
}),
Thread: createNativeStackScreen({
@@ -0,0 +1,121 @@
import Constants from "expo-constants";
import type {
NativeStackHeaderItem,
NativeStackNavigationOptions,
} from "@react-navigation/native-stack";
import { Platform, View } from "react-native";
import { AppText as Text } from "./AppText";
import { T3Wordmark } from "./T3Wordmark";
import { IPAD_HOME_TITLE_OFFSET } from "../lib/layoutMetrics";
import { resolveMobileStageLabel } from "../lib/mobileBranding";
import { useThemeColor } from "../lib/useThemeColor";
import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../native/native-glass";
// Native leading items inherit different UIKit margins than title views.
const IOS_NATIVE_LEADING_TITLE_OFFSET = -6;
const IPAD_NATIVE_LEADING_TITLE_OFFSET = 7;
/**
* Compact brand lockup sized for native navigation bars.
*/
export function CompactBrandTitle(
props: {
readonly nativeLeadingItem?: boolean;
} = {},
) {
const iconColor = useThemeColor("--color-icon");
const mutedColor = useThemeColor("--color-foreground-muted");
const subtleColor = useThemeColor("--color-subtle");
const stageLabel = resolveMobileStageLabel(Constants.expoConfig?.extra?.appVariant);
const titleOffset =
Platform.OS !== "ios"
? 0
: props.nativeLeadingItem
? Platform.isPad
? IPAD_NATIVE_LEADING_TITLE_OFFSET
: IOS_NATIVE_LEADING_TITLE_OFFSET
: Platform.isPad
? IPAD_HOME_TITLE_OFFSET
: 0;
return (
<View
aria-level={1}
accessibilityLabel="T3 Code, Threads"
accessible
role="heading"
style={{
alignItems: "center",
flexDirection: "row",
gap: 6,
marginLeft: titleOffset,
}}
>
<T3Wordmark color={iconColor} height={15} />
<Text
style={{
color: mutedColor,
fontFamily: "DMSans-Medium",
fontSize: 21,
letterSpacing: -0.5,
}}
>
Code
</Text>
<View
style={{
backgroundColor: subtleColor,
borderRadius: 999,
paddingHorizontal: 6,
paddingVertical: 2,
}}
>
<Text
style={{
color: mutedColor,
fontFamily: "DMSans-Bold",
fontSize: 9,
letterSpacing: 0.9,
textTransform: "uppercase",
}}
>
{stageLabel}
</Text>
</View>
</View>
);
}
export function renderCompactBrandTitle() {
return <CompactBrandTitle />;
}
export function renderCompactBrandHeaderItems(): NativeStackHeaderItem[] {
return [
{
element: <CompactBrandTitle nativeLeadingItem />,
hidesSharedBackground: true,
type: "custom",
},
];
}
export function getCompactBrandHeaderOptions(
fallbackTitleStyle?: NativeStackNavigationOptions["headerTitleStyle"],
): NativeStackNavigationOptions {
if (Platform.OS === "ios" && NATIVE_LIQUID_GLASS_SUPPORTED) {
return {
headerTitle: "Threads",
headerTitleStyle: { color: "transparent", fontSize: 18, fontWeight: "800" },
title: "Threads",
unstable_headerLeftItems: renderCompactBrandHeaderItems,
};
}
return {
headerTitle: renderCompactBrandTitle,
headerTitleStyle: fallbackTitleStyle,
title: "Threads",
};
}
@@ -1,11 +1,32 @@
import { describe, expect, it } from "vite-plus/test";
import {
buildPairingUrl,
extractPairingUrlFromQrPayload,
PairingQrPayloadEmptyError,
parsePairingUrl,
} from "./pairing";
describe("buildPairingUrl", () => {
it("uses HTTP for a schemeless IP address", () => {
expect(buildPairingUrl("192.168.1.100:3773", "pairing-token")).toBe(
"http://192.168.1.100:3773/#token=pairing-token",
);
});
it("keeps HTTPS as the default for a schemeless hostname", () => {
expect(buildPairingUrl("remote.example.com", "pairing-token")).toBe(
"https://remote.example.com/#token=pairing-token",
);
});
it("preserves an explicit scheme for an IP address", () => {
expect(buildPairingUrl("https://192.168.1.100:3773", "pairing-token")).toBe(
"https://192.168.1.100:3773/#token=pairing-token",
);
});
});
describe("extractPairingUrlFromQrPayload", () => {
it("trims raw pairing urls from qr payloads", () => {
expect(
+16 -1
View File
@@ -3,6 +3,21 @@ import * as Schema from "effect/Schema";
const MOBILE_PAIRING_URL_PARAM = "pairingUrl";
function isIpLiteral(host: string): boolean {
try {
const hostname = new URL(`http://${host}`).hostname.replace(/^\[|\]$/g, "");
if (hostname.includes(":")) return true;
const octets = hostname.split(".");
return (
octets.length === 4 &&
octets.every((octet) => /^\d{1,3}$/.test(octet) && Number(octet) <= 255)
);
} catch {
return false;
}
}
export class PairingQrPayloadEmptyError extends Schema.TaggedErrorClass<PairingQrPayloadEmptyError>()(
"PairingQrPayloadEmptyError",
{},
@@ -19,7 +34,7 @@ export function buildPairingUrl(host: string, code: string): string {
if (!c) return h;
try {
const url = new URL(h.includes("://") ? h : `https://${h}`);
const url = new URL(h.includes("://") ? h : `${isIpLiteral(h) ? "http" : "https"}://${h}`);
url.hash = new URLSearchParams([["token", c]]).toString();
return url.toString();
} catch {
+7 -2
View File
@@ -1,5 +1,6 @@
import type { EnvironmentId, SidebarThreadSortOrder } from "@t3tools/contracts";
import type { MenuAction } from "@react-native-menu/menu";
import Constants from "expo-constants";
import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/StackHeader";
import { useCallback, useMemo, useRef } from "react";
import { Platform, Pressable, Text as RNText, TextInput, View } from "react-native";
@@ -9,6 +10,8 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
import { ControlPillMenu } from "../../components/ControlPill";
import { SymbolView } from "../../components/AppSymbol";
import { T3Wordmark } from "../../components/T3Wordmark";
import { HOME_HORIZONTAL_INSET } from "../../lib/layoutMetrics";
import { resolveMobileStageLabel } from "../../lib/mobileBranding";
import { useThemeColor } from "../../lib/useThemeColor";
import { useThreadListV2Enabled } from "../threads/use-thread-list-v2-enabled";
import { useHardwareKeyboardCommand } from "../keyboard/hardwareKeyboardCommands";
@@ -64,6 +67,7 @@ function AndroidHomeHeader(props: HomeHeaderProps) {
const insets = useSafeAreaInsets();
const iconColor = useThemeColor("--color-icon");
const mutedColor = useThemeColor("--color-foreground-muted");
const stageLabel = resolveMobileStageLabel(Constants.expoConfig?.extra?.appVariant);
// Thread List v2 lays the list out in fixed creation order, so the
// sort/group filter controls would be silently ignored — hide them and
// key the "customized" icon state off the environment filter alone.
@@ -195,8 +199,9 @@ function AndroidHomeHeader(props: HomeHeaderProps) {
<>
<NativeStackScreenOptions options={{ headerShown: false }} />
<View
className="border-b border-header-border bg-header px-4 pb-3"
className="border-b border-header-border bg-header pb-3"
style={{
paddingHorizontal: HOME_HORIZONTAL_INSET,
paddingTop: Math.max(insets.top, 12),
}}
>
@@ -210,7 +215,7 @@ function AndroidHomeHeader(props: HomeHeaderProps) {
</RNText>
<View className="rounded-full bg-subtle px-2 py-0.75">
<RNText className="text-[11px] font-t3-bold tracking-[1.1px] text-foreground-muted uppercase">
Alpha
{stageLabel}
</RNText>
</View>
</View>
@@ -3,6 +3,7 @@ import * as Order from "effect/Order";
import { useNavigation } from "@react-navigation/native";
import { useEffect, useMemo, useState } from "react";
import { getCompactBrandHeaderOptions } from "../../components/CompactBrandTitle";
import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/StackHeader";
import { useProjects, useThreadShells } from "../../state/entities";
import { usePendingNewTasks } from "../../state/use-pending-new-tasks";
@@ -93,7 +94,9 @@ export function HomeRouteScreen() {
if (layout.usesSplitView) {
return (
<>
<NativeStackScreenOptions options={{ title: "", headerTitle: "" }} />
<NativeStackScreenOptions
options={{ title: "", headerTitle: "", unstable_headerLeftItems: () => [] }}
/>
<WorkspaceSidebarToolbar
afterSidebarButton={
<NativeHeaderToolbar.Button
@@ -115,8 +118,8 @@ export function HomeRouteScreen() {
onStartNewTask={() => navigation.navigate("NewTaskSheet", { screen: "NewTask" })}
>
<>
{/* Restore the compact title in case the split branch blanked it. */}
<NativeStackScreenOptions options={{ title: "Threads", headerTitle: "Threads" }} />
{/* Restore the compact title after the split branch blanks the detail header. */}
<NativeStackScreenOptions options={getCompactBrandHeaderOptions()} />
<HomeHeader
environments={environments}
projects={projectFilterOptions}
@@ -11,6 +11,7 @@ import {
import type { ReactNode } from "react";
import { Platform, useColorScheme } from "react-native";
import { getCompactBrandHeaderOptions } from "../../components/CompactBrandTitle";
import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass";
import { nativeHeaderScrollEdgeEffects } from "../../native/StackHeader";
@@ -35,10 +36,9 @@ const SIDEBAR_SCREEN_OPTIONS: SidebarScreenOptions = {
headerShadowVisible: false,
headerShown: true,
headerStyle: NATIVE_LIQUID_GLASS_SUPPORTED ? { backgroundColor: "transparent" } : undefined,
headerTitleStyle: { fontSize: 18, fontWeight: "800" },
...getCompactBrandHeaderOptions({ fontSize: 18, fontWeight: "800" }),
headerTransparent: NATIVE_LIQUID_GLASS_SUPPORTED,
scrollEdgeEffects: NATIVE_LIQUID_GLASS_SUPPORTED ? SCROLL_EDGE_EFFECTS : undefined,
title: "Threads",
unstable_navigationItemStyle: NATIVE_LIQUID_GLASS_SUPPORTED ? "editor" : undefined,
};
@@ -15,6 +15,7 @@ import { AppText as Text } from "../../components/AppText";
import { ControlPillMenu } from "../../components/ControlPill";
import { ProjectFavicon } from "../../components/ProjectFavicon";
import { cn } from "../../lib/cn";
import { HOME_HORIZONTAL_INSET } from "../../lib/layoutMetrics";
import { relativeTime } from "../../lib/time";
import { useThemeColor } from "../../lib/useThemeColor";
import type { PendingNewTask } from "../../state/use-pending-new-tasks";
@@ -33,7 +34,7 @@ import { ThreadSearchMatchExcerpt } from "./thread-search-match";
export type ThreadListVariant = "compact" | "sidebar";
/** Left inset that aligns compact secondary rows with the title column. */
export const THREAD_LIST_COMPACT_INSET = 20;
export const THREAD_LIST_COMPACT_INSET = HOME_HORIZONTAL_INSET;
const SIDEBAR_ROW_RADIUS = 12;
function pullRequestTintColor(
-8
View File
@@ -65,14 +65,6 @@ export async function pickComposerImages(input: { readonly existingCount: number
};
}
const permission = await imagePicker.requestMediaLibraryPermissionsAsync();
if (!permission.granted) {
return {
images: [],
error: "Allow photo library access to attach images.",
};
}
const result = await imagePicker.launchImageLibraryAsync({
mediaTypes: ["images"],
allowsMultipleSelection: true,
+5
View File
@@ -0,0 +1,5 @@
/** Horizontal inset shared by the home header and compact thread list. */
export const HOME_HORIZONTAL_INSET = 20;
/** Compensates for the tighter native sidebar title margin on iPad. */
export const IPAD_HOME_TITLE_OFFSET = 10;
@@ -0,0 +1,14 @@
import { describe, expect, it } from "vite-plus/test";
import { resolveMobileStageLabel } from "./mobileBranding";
describe("resolveMobileStageLabel", () => {
it.each([
["development", "Dev"],
["preview", "Nightly"],
["production", "Alpha"],
[undefined, "Alpha"],
])("maps %s builds to %s", (appVariant, expected) => {
expect(resolveMobileStageLabel(appVariant)).toBe(expected);
});
});
+7
View File
@@ -0,0 +1,7 @@
export type MobileStageLabel = "Alpha" | "Dev" | "Nightly";
export function resolveMobileStageLabel(appVariant: unknown): MobileStageLabel {
if (appVariant === "development") return "Dev";
if (appVariant === "preview") return "Nightly";
return "Alpha";
}
+2 -1
View File
@@ -370,7 +370,8 @@ function NativeHeaderToolbarRoot(props: {
const navigation = useNativeStackNavigation();
const items = useMemo(() => collectToolbarItems(props.children), [props.children]);
useEffect(() => {
// Swap toolbar owners before paint so split and compact headers cannot clear each other.
useLayoutEffect(() => {
if (!navigation) {
return;
}
@@ -1,5 +1,6 @@
import { collectComposerInlineTokens } from "@t3tools/shared/composerInlineTokens";
import { requireNativeView } from "expo";
import { TextInputWrapper } from "expo-paste-input";
import {
useCallback,
useEffect,
@@ -9,12 +10,13 @@ import {
useState,
type Ref,
} from "react";
import type { NativeSyntheticEvent, StyleProp, ViewProps, ViewStyle } from "react-native";
import type { NativeSyntheticEvent, ViewProps } from "react-native";
import { Image, StyleSheet } from "react-native";
import { markdownFileIconSource } from "@t3tools/mobile-markdown-text/file-icons";
import { resolveMarkdownFileIcon } from "@t3tools/mobile-markdown-text/links";
import { MOBILE_TYPOGRAPHY } from "../lib/typography";
import { useNativePaste } from "../lib/useNativePaste";
import { useFontFamily } from "../lib/useFontFamily";
import { useThemeColor } from "../lib/useThemeColor";
import {
@@ -117,6 +119,7 @@ export function ComposerEditor({
const skillBorder = useThemeColor("--color-inline-skill-border");
const skillText = useThemeColor("--color-inline-skill-foreground");
const fileTint = useThemeColor("--color-icon-muted");
const handlePaste = useNativePaste((uris) => onPasteImages?.(uris));
useImperativeHandle(
ref,
@@ -221,61 +224,63 @@ export function ComposerEditor({
const resolvedTextStyle = StyleSheet.flatten(textStyle) ?? {};
const regularFontFamily = useFontFamily("regular");
return (
<NativeView
ref={nativeRef}
controlledDocumentJson={controlledDocumentJson}
themeJson={themeJson}
placeholder={props.placeholder ?? ""}
fontFamily={
typeof resolvedTextStyle.fontFamily === "string"
? resolvedTextStyle.fontFamily
: regularFontFamily
}
fontSize={
typeof resolvedTextStyle.fontSize === "number"
? resolvedTextStyle.fontSize
: MOBILE_TYPOGRAPHY.body.fontSize
}
lineHeight={
typeof resolvedTextStyle.lineHeight === "number"
? resolvedTextStyle.lineHeight
: MOBILE_TYPOGRAPHY.body.lineHeight
}
contentInsetVertical={contentInsetVertical}
singleLineCentered={props.singleLineCentered ?? false}
editable={props.editable ?? true}
scrollEnabled={props.scrollEnabled ?? true}
autoFocus={props.autoFocus ?? false}
autoCorrect={props.autoCorrect ?? true}
spellCheck={props.spellCheck ?? true}
style={style as StyleProp<ViewStyle>}
onComposerChange={(event) => {
const acknowledgedEventCount = acceptNativeEvent(
event.nativeEvent.eventCount,
event.nativeEvent.value,
event.nativeEvent.selection,
);
if (acknowledgedEventCount === false) return;
onChangeText(event.nativeEvent.value);
onSelectionChange?.(event.nativeEvent.selection);
setMostRecentEventCount(acknowledgedEventCount);
setNativeEventSequence((sequence) => sequence + 1);
}}
onComposerSelectionChange={(event) => {
const acknowledgedEventCount = acceptNativeEvent(
event.nativeEvent.eventCount,
event.nativeEvent.value,
event.nativeEvent.selection,
);
if (acknowledgedEventCount === false) return;
onSelectionChange?.(event.nativeEvent.selection);
setMostRecentEventCount(acknowledgedEventCount);
setNativeEventSequence((sequence) => sequence + 1);
}}
onComposerPasteImages={(event) => onPasteImages?.(event.nativeEvent.uris)}
onComposerFocus={onFocus}
onComposerBlur={onBlur}
/>
<TextInputWrapper onPaste={handlePaste} style={[{ minHeight: 0 }, style]}>
<NativeView
ref={nativeRef}
controlledDocumentJson={controlledDocumentJson}
themeJson={themeJson}
placeholder={props.placeholder ?? ""}
fontFamily={
typeof resolvedTextStyle.fontFamily === "string"
? resolvedTextStyle.fontFamily
: regularFontFamily
}
fontSize={
typeof resolvedTextStyle.fontSize === "number"
? resolvedTextStyle.fontSize
: MOBILE_TYPOGRAPHY.body.fontSize
}
lineHeight={
typeof resolvedTextStyle.lineHeight === "number"
? resolvedTextStyle.lineHeight
: MOBILE_TYPOGRAPHY.body.lineHeight
}
contentInsetVertical={contentInsetVertical}
singleLineCentered={props.singleLineCentered ?? false}
editable={props.editable ?? true}
scrollEnabled={props.scrollEnabled ?? true}
autoFocus={props.autoFocus ?? false}
autoCorrect={props.autoCorrect ?? true}
spellCheck={props.spellCheck ?? true}
style={{ flex: 1, minHeight: 0 }}
onComposerChange={(event) => {
const acknowledgedEventCount = acceptNativeEvent(
event.nativeEvent.eventCount,
event.nativeEvent.value,
event.nativeEvent.selection,
);
if (acknowledgedEventCount === false) return;
onChangeText(event.nativeEvent.value);
onSelectionChange?.(event.nativeEvent.selection);
setMostRecentEventCount(acknowledgedEventCount);
setNativeEventSequence((sequence) => sequence + 1);
}}
onComposerSelectionChange={(event) => {
const acknowledgedEventCount = acceptNativeEvent(
event.nativeEvent.eventCount,
event.nativeEvent.value,
event.nativeEvent.selection,
);
if (acknowledgedEventCount === false) return;
onSelectionChange?.(event.nativeEvent.selection);
setMostRecentEventCount(acknowledgedEventCount);
setNativeEventSequence((sequence) => sequence + 1);
}}
onComposerPasteImages={(event) => onPasteImages?.(event.nativeEvent.uris)}
onComposerFocus={onFocus}
onComposerBlur={onBlur}
/>
</TextInputWrapper>
);
}
@@ -137,6 +137,34 @@ function normalizeDeleteEvent(event: PlannedEvent | ReadonlyArray<PlannedEvent>)
}
it.layer(NodeServices.layer)("decider deletion flows", (it) => {
it.effect("emits a deletion tombstone for a missing thread", () =>
Effect.gen(function* () {
const threadId = asThreadId("ghost-thread");
const commandId = asCommandId("cmd-delete-ghost-thread");
const readModel = yield* seedReadModel;
const result = yield* decideOrchestrationCommand({
command: {
type: "thread.delete",
commandId,
threadId,
},
readModel,
});
expect(normalizeDeleteEvent(result)).toEqual([
{
type: "thread.deleted",
aggregateKind: "thread",
aggregateId: threadId,
commandId,
correlationId: commandId,
payload: { threadId },
},
]);
}),
);
it.effect("rejects deleting a non-empty project without force", () =>
Effect.gen(function* () {
const readModel = yield* seedReadModel;
+2 -5
View File
@@ -379,11 +379,8 @@ export const decideOrchestrationCommand = Effect.fn("decideOrchestrationCommand"
}
case "thread.delete": {
yield* requireThread({
readModel,
command,
threadId: command.threadId,
});
// Keep deletion idempotent for clients holding a stale shell entry. The
// tombstone advances the stream and lets every client remove that ghost.
const occurredAt = yield* nowIso;
return {
...(yield* withEventBase({
@@ -153,6 +153,51 @@ it.effect("uses stable diagnostics for every parsed non-repository command", ()
}).pipe(Effect.provide(layer));
});
it.effect("invalidates origin remote cache when a driver mutation adds origin", () =>
Effect.gen(function* () {
const driver = yield* GitVcsDriver.GitVcsDriver;
const cwd = yield* makeTmpDir();
const remote = yield* makeTmpDir("git-vcs-driver-remote-");
yield* initRepoWithCommit(cwd);
yield* git(remote, ["init", "--bare"]);
const before = yield* driver.statusDetailsLocal(cwd);
assert.equal(before.hasOriginRemote, false);
yield* driver.ensureRemote({ cwd, preferredName: "origin", url: remote });
const after = yield* driver.statusDetailsLocal(cwd);
assert.equal(after.hasOriginRemote, true);
}).pipe(Effect.provide(TestLayer)),
);
it.effect("re-reads origin remote status after cache TTL expiry and bypassed invalidation", () =>
Effect.gen(function* () {
const driver = yield* GitVcsDriver.GitVcsDriver;
const cwd = yield* makeTmpDir();
const remote = yield* makeTmpDir("git-vcs-driver-remote-");
yield* initRepoWithCommit(cwd);
yield* git(remote, ["init", "--bare"]);
// First call caches hasOriginRemote = false (5-min TTL)
assert.equal((yield* driver.statusDetailsLocal(cwd)).hasOriginRemote, false);
// Add origin via raw git (bypasses invalidation hook)
yield* git(cwd, ["remote", "add", "origin", remote]);
// Cache still has the stale false (TTL not yet expired)
const stillCached = yield* driver.statusDetailsLocal(cwd);
assert.equal(stillCached.hasOriginRemote, false);
// Advance past the 5-minute TTL so the cache entry expires
yield* TestClock.adjust("6 minutes");
// After expiry, the next call re-executes and picks up the remote
const afterExpiry = yield* driver.statusDetailsLocal(cwd);
assert.equal(afterExpiry.hasOriginRemote, true);
}).pipe(Effect.provide(TestLayer)),
);
it.effect("coalesces concurrent ref pages into one repository snapshot", () =>
Effect.scoped(
Effect.gen(function* () {
+78 -13
View File
@@ -61,6 +61,8 @@ const LIST_REFS_SNAPSHOT_CACHE_CAPACITY = 64;
const LIST_REFS_SNAPSHOT_CACHE_TTL = Duration.minutes(2);
const LIST_REFS_REFRESH_COALESCE_TTL = Duration.seconds(5);
const LIST_REFS_REFRESH_FAILURE_COOLDOWN = Duration.seconds(30);
const STATUS_DEFAULT_BRANCH_CACHE_TTL = Duration.minutes(5);
const STATUS_ORIGIN_EXISTS_CACHE_TTL = Duration.minutes(5);
const STATUS_UPSTREAM_REFRESH_ENV = Object.freeze({
GCM_INTERACTIVE: "never",
GIT_ASKPASS: "",
@@ -1119,6 +1121,63 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
return Cache.get(refresh ? repositoryPathsRefreshCache : repositoryPathsCache, cacheKey);
};
const defaultBranchCache = yield* Cache.makeWith(
(gitCommonDir: string) =>
Effect.gen(function* () {
const path = yield* Path.Path;
const fetchCwd =
path.basename(gitCommonDir) === ".git" ? path.dirname(gitCommonDir) : gitCommonDir;
return yield* executeGit(
"GitVcsDriver.statusDetails.defaultBranch",
fetchCwd,
["--git-dir", gitCommonDir, "symbolic-ref", "refs/remotes/origin/HEAD"],
{ allowNonZeroExit: true },
).pipe(
Effect.map((result) => {
if (result.exitCode !== 0) return null;
return parseDefaultBranchFromRemoteHeadRef(result.stdout, "origin");
}),
);
}),
{
capacity: 2_048,
timeToLive: Exit.match({
onSuccess: () => STATUS_DEFAULT_BRANCH_CACHE_TTL,
onFailure: () => Duration.zero,
}),
},
);
const originExistsCache = yield* Cache.makeWith(
(gitCommonDir: string) =>
Effect.gen(function* () {
const path = yield* Path.Path;
const fetchCwd =
path.basename(gitCommonDir) === ".git" ? path.dirname(gitCommonDir) : gitCommonDir;
return yield* executeGit(
"GitVcsDriver.statusDetails.originExists",
fetchCwd,
["--git-dir", gitCommonDir, "remote", "get-url", "origin"],
{ allowNonZeroExit: true },
).pipe(Effect.map((result) => result.exitCode === 0));
}),
{
capacity: 2_048,
timeToLive: Exit.match({
onSuccess: () => STATUS_ORIGIN_EXISTS_CACHE_TTL,
onFailure: () => Duration.zero,
}),
},
);
const invalidateStatusStaticCaches = (cwd: string) =>
Effect.gen(function* () {
const repositoryPaths = yield* resolveRepositoryPaths(cwd).pipe(
Effect.catchTags({ GitCommandError: () => Effect.succeed(null) }),
);
const cacheKey = repositoryPaths?.gitCommonDir ?? normalizeRepositoryPathsCacheKey(cwd);
yield* Cache.invalidate(defaultBranchCache, cacheKey);
yield* Cache.invalidate(originExistsCache, cacheKey);
});
const resolveGitCommonDir = Effect.fn("resolveGitCommonDir")(function* (cwd: string) {
const repositoryPaths = yield* resolveRepositoryPaths(cwd);
if (repositoryPaths !== null) {
@@ -1517,7 +1576,11 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
});
}
const [numstatStdout, defaultRefResult, hasPrimaryRemote] = yield* Effect.all(
const repositoryPaths = yield* resolveRepositoryPaths(cwd).pipe(
Effect.catchTags({ GitCommandError: () => Effect.succeed(null) }),
);
const statusCacheKey = repositoryPaths?.gitCommonDir;
const [numstatStdout, defaultBranch, hasPrimaryRemote] = yield* Effect.all(
[
executeGitWithStableDiagnostics(
"GitVcsDriver.statusDetails.numstat",
@@ -1574,21 +1637,16 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
);
}),
),
executeGit(
"GitVcsDriver.statusDetails.defaultRef",
cwd,
["symbolic-ref", "refs/remotes/origin/HEAD"],
{ allowNonZeroExit: true },
),
originRemoteExists(cwd).pipe(Effect.orElseSucceed(() => false)),
statusCacheKey
? Cache.get(defaultBranchCache, statusCacheKey).pipe(Effect.orElseSucceed(() => null))
: resolveDefaultBranchName(cwd, "origin").pipe(Effect.orElseSucceed(() => null)),
statusCacheKey
? Cache.get(originExistsCache, statusCacheKey).pipe(Effect.orElseSucceed(() => false))
: originRemoteExists(cwd).pipe(Effect.orElseSucceed(() => false)),
],
{ concurrency: "unbounded" },
);
const statusStdout = statusResult.stdout;
const defaultBranch =
defaultRefResult.exitCode === 0
? defaultRefResult.stdout.trim().replace(/^refs\/remotes\/origin\//, "")
: null;
let refName: string | null = null;
let upstreamRef: string | null = null;
@@ -2809,7 +2867,14 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
cwd: string,
effect: Effect.Effect<A, E>,
): Effect.Effect<A, E> =>
effect.pipe(Effect.ensuring(invalidateListRefsSnapshot(cwd).pipe(Effect.ignore)));
effect.pipe(
Effect.ensuring(
Effect.all([
invalidateListRefsSnapshot(cwd).pipe(Effect.ignore),
invalidateStatusStaticCaches(cwd).pipe(Effect.ignore),
]),
),
);
const initRepoWithListRefsInvalidation: GitVcsDriver.GitVcsDriver["Service"]["initRepo"] = (
input,
) =>
+1 -1
View File
@@ -5829,7 +5829,7 @@ function ChatViewContent(props: ChatViewProps) {
aria-label="Scroll to end"
title="Scroll to end"
onClick={() => scrollToEnd(true)}
className="pointer-events-auto flex items-center gap-1.5 rounded-full border border-border/60 bg-card px-3 py-1 text-muted-foreground text-xs shadow-sm transition-colors hover:border-border hover:text-foreground hover:cursor-pointer"
className="chat-composer-glass pointer-events-auto flex items-center gap-1.5 rounded-full border border-border/60 px-3 py-1 text-muted-foreground text-xs shadow-sm transition-colors hover:border-border hover:text-foreground hover:cursor-pointer"
>
<ChevronDownIcon className="size-3.5" />
Scroll to end
+2 -5
View File
@@ -133,6 +133,7 @@ import {
shouldShowArm64IntelBuildWarning,
shouldToastDesktopUpdateActionResult,
} from "./desktopUpdate.logic";
import { showDesktopUpdateDownloadedToast } from "./desktopUpdate.toast";
import { Alert, AlertAction, AlertDescription, AlertTitle } from "./ui/alert";
import { Button } from "./ui/button";
import {
@@ -3509,11 +3510,7 @@ export default function Sidebar() {
.downloadUpdate()
.then((result) => {
if (result.completed) {
toastManager.add({
type: "success",
title: "Update downloaded",
description: "Restart the app from the update button to install it.",
});
showDesktopUpdateDownloadedToast(bridge, result.state);
}
if (!shouldToastDesktopUpdateActionResult(result)) return;
const actionError = getDesktopUpdateActionError(result);
@@ -7,6 +7,7 @@ import {
getDesktopUpdateActionError,
getDesktopUpdateButtonTooltip,
getDesktopUpdateInstallConfirmationMessage,
getDesktopUpdateReleaseUrl,
isDesktopUpdateButtonDisabled,
resolveDesktopUpdateButtonAction,
shouldShowArm64IntelBuildWarning,
@@ -158,6 +159,23 @@ describe("getDesktopUpdateActionError", () => {
});
describe("desktop update UI helpers", () => {
it("builds the stable release URL for a downloaded version", () => {
expect(getDesktopUpdateReleaseUrl("0.0.30")).toBe(
"https://github.com/pingdotgg/t3code/releases/tag/v0.0.30",
);
});
it("builds the nightly release URL without dropping its version suffix", () => {
expect(getDesktopUpdateReleaseUrl("0.0.30-nightly.20260728.931")).toBe(
"https://github.com/pingdotgg/t3code/releases/tag/v0.0.30-nightly.20260728.931",
);
});
it("omits the release URL when the updater does not report a version", () => {
expect(getDesktopUpdateReleaseUrl(null)).toBeNull();
expect(getDesktopUpdateReleaseUrl(" ")).toBeNull();
});
it("toasts only for actionable updater errors", () => {
expect(
shouldToastDesktopUpdateActionResult({
@@ -3,6 +3,24 @@ import { isWindowsPlatform } from "../lib/utils";
export type DesktopUpdateButtonAction = "download" | "install" | "none";
const DESKTOP_RELEASE_TAG_URL = "https://github.com/pingdotgg/t3code/releases/tag";
/**
* The main process fills `downloadedVersion` from the updater's `update-downloaded`
* event, which is dispatched on its own fiber. A download RPC can therefore resolve
* before that write lands, so fall back to the version the download was started for.
*/
export function getDesktopUpdateDownloadedVersion(state: DesktopUpdateState): string | null {
return state.downloadedVersion ?? state.availableVersion;
}
/** Release notes for an exact downloaded build; nightly suffixes are part of the tag. */
export function getDesktopUpdateReleaseUrl(version: string | null): string | null {
const normalizedVersion = version?.trim();
if (!normalizedVersion) return null;
return `${DESKTOP_RELEASE_TAG_URL}/v${encodeURIComponent(normalizedVersion)}`;
}
export function resolveDesktopUpdateButtonAction(
state: DesktopUpdateState,
): DesktopUpdateButtonAction {
@@ -0,0 +1,121 @@
import { isValidElement, type ReactElement, type ReactNode } from "react";
import { beforeEach, describe, expect, it, vi } from "vite-plus/test";
import type { DesktopUpdateState } from "@t3tools/contracts";
const testState = vi.hoisted(() => ({
addToast: vi.fn(),
}));
vi.mock("./ui/toast", () => ({
toastManager: { add: testState.addToast },
}));
import { showDesktopUpdateDownloadedToast } from "./desktopUpdate.toast";
type ClickableElement = ReactElement<{ readonly onClick?: () => void }>;
/** Walks the rendered description, invoking function components, to find the link button. */
function findReleaseNotesLink(node: ReactNode): ClickableElement | null {
if (Array.isArray(node)) {
for (const child of node) {
const found = findReleaseNotesLink(child);
if (found) return found;
}
return null;
}
if (!isValidElement(node)) return null;
const element = node as ReactElement<{ readonly children?: ReactNode }>;
if (element.type === "button") return element as ClickableElement;
if (typeof element.type === "function") {
const render = element.type as (props: unknown) => ReactNode;
return findReleaseNotesLink(render(element.props));
}
return findReleaseNotesLink(element.props.children);
}
function getDescription(): ReactNode {
const toast = testState.addToast.mock.calls[0]?.[0] as { description?: ReactNode } | undefined;
return toast?.description ?? null;
}
function downloadedState(overrides: Partial<DesktopUpdateState> = {}): DesktopUpdateState {
return {
enabled: true,
status: "downloaded",
channel: "latest",
currentVersion: "0.0.29",
hostArch: "arm64",
appArch: "arm64",
runningUnderArm64Translation: false,
availableVersion: "0.0.30",
downloadedVersion: "0.0.30",
releaseNotes: [],
downloadPercent: 100,
checkedAt: null,
message: null,
errorContext: null,
canRetry: true,
...overrides,
};
}
describe("showDesktopUpdateDownloadedToast", () => {
beforeEach(() => {
testState.addToast.mockReset();
});
it("opens the downloaded version's release notes", async () => {
const openExternal = vi.fn().mockResolvedValue(true);
showDesktopUpdateDownloadedToast({ openExternal }, downloadedState());
const link = findReleaseNotesLink(getDescription());
link?.props.onClick?.();
await vi.waitFor(() => {
expect(openExternal).toHaveBeenCalledWith(
"https://github.com/pingdotgg/t3code/releases/tag/v0.0.30",
);
});
expect(testState.addToast).toHaveBeenCalledTimes(1);
});
it("falls back to the version the download was started for", async () => {
const openExternal = vi.fn().mockResolvedValue(true);
// The `update-downloaded` event can land after the download RPC resolves.
showDesktopUpdateDownloadedToast(
{ openExternal },
downloadedState({ downloadedVersion: null }),
);
findReleaseNotesLink(getDescription())?.props.onClick?.();
await vi.waitFor(() => {
expect(openExternal).toHaveBeenCalledWith(
"https://github.com/pingdotgg/t3code/releases/tag/v0.0.30",
);
});
});
it("omits the link when the updater reports no version at all", () => {
showDesktopUpdateDownloadedToast(
{ openExternal: vi.fn() },
downloadedState({ availableVersion: null, downloadedVersion: null }),
);
expect(findReleaseNotesLink(getDescription())).toBeNull();
});
it.each([
["returns false", vi.fn().mockResolvedValue(false)],
["rejects", vi.fn().mockRejectedValue(new Error("open failed"))],
])("shows an error when opening release notes %s", async (_description, openExternal) => {
showDesktopUpdateDownloadedToast({ openExternal }, downloadedState());
findReleaseNotesLink(getDescription())?.props.onClick?.();
await vi.waitFor(() => {
expect(testState.addToast).toHaveBeenLastCalledWith({
type: "error",
title: "Unable to open release notes",
});
});
});
});
@@ -0,0 +1,55 @@
import type { DesktopBridge, DesktopUpdateState } from "@t3tools/contracts";
import { ArrowRightIcon } from "lucide-react";
import {
getDesktopUpdateDownloadedVersion,
getDesktopUpdateReleaseUrl,
} from "./desktopUpdate.logic";
import { toastManager } from "./ui/toast";
type DesktopUpdateShell = Pick<DesktopBridge, "openExternal">;
function ReleaseNotesLink({
shell,
releaseUrl,
}: {
shell: DesktopUpdateShell;
releaseUrl: string;
}) {
return (
<button
className="ml-2 inline-flex cursor-pointer items-center gap-1 align-baseline text-muted-foreground underline decoration-dotted underline-offset-4 transition-colors hover:text-foreground"
onClick={() => {
void (async () => {
try {
if (await shell.openExternal(releaseUrl)) return;
} catch {
// Surface rejected IPC calls through the same user-visible fallback.
}
toastManager.add({ type: "error", title: "Unable to open release notes" });
})();
}}
type="button"
>
Read more
<ArrowRightIcon aria-hidden className="size-3 -rotate-45" strokeWidth={2.25} />
</button>
);
}
export function showDesktopUpdateDownloadedToast(
shell: DesktopUpdateShell,
state: DesktopUpdateState,
): void {
const releaseUrl = getDesktopUpdateReleaseUrl(getDesktopUpdateDownloadedVersion(state));
toastManager.add({
type: "success",
title: "Update downloaded",
description: (
<>
Restart the app from the update button to install it.
{releaseUrl ? <ReleaseNotesLink releaseUrl={releaseUrl} shell={shell} /> : null}
</>
),
});
}
@@ -14,6 +14,7 @@ import {
shouldShowDesktopUpdateButton,
shouldToastDesktopUpdateActionResult,
} from "../desktopUpdate.logic";
import { showDesktopUpdateDownloadedToast } from "../desktopUpdate.toast";
import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
import { Separator } from "../ui/separator";
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
@@ -80,11 +81,7 @@ export function SidebarUpdatePill() {
.downloadUpdate()
.then((result) => {
if (result.completed) {
toastManager.add({
type: "success",
title: "Update downloaded",
description: "Restart the app from the update button to install it.",
});
showDesktopUpdateDownloadedToast(bridge, result.state);
}
if (!shouldToastDesktopUpdateActionResult(result)) return;
const actionError = getDesktopUpdateActionError(result);
@@ -43,7 +43,7 @@ Captures wait for the real environment snapshot to hydrate and for the requested
active. Both platforms record readiness in the simulator/emulator app container. A final settle
delay allows native terminal and Git review data to finish rendering.
A full capture regenerates the selected native project with Expo's clean development prebuild before
A full capture regenerates the selected native project with Expo's clean production prebuild before
building it. Use --skip-build for repeated captures after the first build.
The harness uses fixed Metro port `8199`, which separates it from Expo's normal default port but is
+2
View File
@@ -38,6 +38,8 @@ available. You can set another endpoint as the default from the expanded endpoin
If the copied link points directly at `http://192.168.x.y:3773`, open it from a client that can reach that LAN address. If it points at `https://app.t3.codes/pair?...`, the hosted web app will save the environment and connect directly to the backend URL in the link.
In the mobile app's **Add Environment** form, a numeric IP address without a scheme uses HTTP. Include `https://` explicitly when the backend is served over HTTPS.
### Tailscale Endpoints
When the desktop app can detect Tailscale, it adds Tailnet endpoints to the reachable endpoint list.
@@ -287,6 +287,40 @@ describe("RpcSessionFactory", () => {
}),
);
it.effect("reaches ready when a newer server sends unknown config members", () =>
Effect.gen(function* () {
const { factory, sockets } = yield* makeFactory();
const session = yield* factory.connect(PREPARED);
const readyFiber = yield* Effect.forkChild(session.ready);
const socket = yield* awaitSocket(sockets);
socket.open();
const shortcut = {
key: "p",
metaKey: false,
ctrlKey: false,
shiftKey: false,
altKey: false,
modKey: true,
};
yield* completeInitialConfig(socket, {
...ENCODED_SERVER_CONFIG,
keybindings: [
{ command: "someFuture.toggle", shortcut },
{ command: "terminal.toggle", shortcut },
],
issues: [{ kind: "keybindings.future-issue", message: "From a newer server" }],
availableEditors: ["some-future-editor", "zed"],
});
yield* Fiber.join(readyFiber);
const config = yield* session.initialConfig;
expect(config.keybindings).toEqual([{ command: "terminal.toggle", shortcut }]);
expect(config.issues).toEqual([]);
expect(config.availableEditors).toEqual(["zed"]);
}),
);
it.effect("uses the legacy config RPC for probes when the server lacks the capability", () =>
Effect.scoped(
Effect.gen(function* () {
+25
View File
@@ -1,4 +1,5 @@
import * as Effect from "effect/Effect";
import * as Option from "effect/Option";
import * as Schema from "effect/Schema";
import * as SchemaTransformation from "effect/SchemaTransformation";
@@ -20,6 +21,30 @@ export const PortSchema = Schema.Int.check(Schema.isBetween({ minimum: 1, maximu
export const IsoDateTime = Schema.String;
export type IsoDateTime = typeof IsoDateTime.Type;
/**
* Wire codec for server→client arrays whose element unions grow over time
* (new literal members, new struct variants). Decoding drops elements the
* current build cannot decode instead of failing the whole payload — a client
* has to keep decoding configs sent by servers newer than itself, and
* rejecting the payload would take down the connection over data the client
* couldn't act on anyway. Encoding is the plain array encoding.
*/
export const ForwardCompatibleArray = <Element extends Schema.Top>(element: Element) => {
const decodeElement = Schema.decodeUnknownOption(element as never);
return Schema.Array(Schema.Unknown).pipe(
Schema.decodeTo(
Schema.Array(element),
SchemaTransformation.transform<ReadonlyArray<Element["Encoded"]>, ReadonlyArray<unknown>>({
decode: (values) =>
values.filter((value) => Option.isSome(decodeElement(value))) as ReadonlyArray<
Element["Encoded"]
>,
encode: (values) => values,
}),
),
);
};
/**
* Construct a branded identifier. Enforces non-empty trimmed strings
*/
@@ -20,6 +20,7 @@ const decode = <S extends Schema.Top>(
>;
const decodeResolvedRule = Schema.decodeUnknownEffect(ResolvedKeybindingRule as never);
const encodeResolvedKeybindings = Schema.encodeEffect(ResolvedKeybindingsConfig);
it.effect("parses keybinding rules", () =>
Effect.gen(function* () {
@@ -185,6 +186,70 @@ it.effect("parses resolved keybindings arrays", () =>
}),
);
const shortcut = {
key: "p",
metaKey: false,
ctrlKey: false,
shiftKey: false,
altKey: false,
modKey: true,
};
it.effect("drops resolved rules with commands this build does not know", () =>
Effect.gen(function* () {
const parsed = yield* decode(ResolvedKeybindingsConfig, [
{ command: "terminal.toggle", shortcut },
{ command: "someFuture.toggle", shortcut },
{ command: "filePicker.toggle", shortcut },
]);
assert.deepEqual(
parsed.map((rule) => rule.command),
["terminal.toggle", "filePicker.toggle"],
);
}),
);
it.effect("drops resolved rules with unknown when-node types", () =>
Effect.gen(function* () {
const parsed = yield* decode(ResolvedKeybindingsConfig, [
{
command: "terminal.toggle",
shortcut,
whenAst: { type: "xor", left: 1, right: 2 },
},
{ command: "terminal.split", shortcut },
]);
assert.deepEqual(
parsed.map((rule) => rule.command),
["terminal.split"],
);
}),
);
it.effect("drops malformed resolved rule entries", () =>
Effect.gen(function* () {
const parsed = yield* decode(ResolvedKeybindingsConfig, [
"garbage",
{ command: "terminal.toggle", shortcut },
null,
]);
assert.deepEqual(
parsed.map((rule) => rule.command),
["terminal.toggle"],
);
}),
);
it.effect("encodes resolved keybindings to the plain wire shape", () =>
Effect.gen(function* () {
const rules = [{ command: "terminal.toggle" as const, shortcut }];
const encoded = yield* encodeResolvedKeybindings(rules);
assert.deepEqual(encoded, rules);
const roundTripped = yield* decode(ResolvedKeybindingsConfig, encoded);
assert.deepEqual(roundTripped, rules);
}),
);
it.effect("drops unknown fields in resolved keybinding rules", () =>
decodeResolvedRule({
command: "terminal.toggle",
+9 -2
View File
@@ -1,5 +1,5 @@
import * as Schema from "effect/Schema";
import { TrimmedString } from "./baseSchemas.ts";
import { ForwardCompatibleArray, TrimmedString } from "./baseSchemas.ts";
export const MAX_KEYBINDING_VALUE_LENGTH = 64;
export const MAX_KEYBINDING_WHEN_LENGTH = 256;
@@ -155,7 +155,14 @@ export const ResolvedKeybindingRule = Schema.Struct({
}).annotate({ parseOptions: { onExcessProperty: "ignore" } });
export type ResolvedKeybindingRule = typeof ResolvedKeybindingRule.Type;
export const ResolvedKeybindingsConfig = Schema.Array(ResolvedKeybindingRule).check(
/**
* The command set grows over time, so a client may receive rules it cannot
* represent (a command or `when` node added after that client shipped).
* Decoding drops those rules instead of failing the whole payload —
* rejecting the config would take down the connection over a shortcut the
* client couldn't dispatch anyway.
*/
export const ResolvedKeybindingsConfig = ForwardCompatibleArray(ResolvedKeybindingRule).check(
Schema.isMaxLength(MAX_KEYBINDINGS_COUNT),
);
export type ResolvedKeybindingsConfig = typeof ResolvedKeybindingsConfig.Type;
+25 -1
View File
@@ -1,9 +1,11 @@
import * as Schema from "effect/Schema";
import { describe, expect, it } from "vite-plus/test";
import { ServerProvider } from "./server.ts";
import { ServerConfig, ServerProvider, ServerUpsertKeybindingResult } from "./server.ts";
const decodeServerProvider = Schema.decodeUnknownSync(ServerProvider);
const decodeUpsertKeybindingResult = Schema.decodeUnknownSync(ServerUpsertKeybindingResult);
const decodeAvailableEditors = Schema.decodeUnknownSync(ServerConfig.fields.availableEditors);
describe("ServerProvider", () => {
it("defaults capability arrays when decoding provider snapshots", () => {
@@ -72,3 +74,25 @@ describe("ServerProvider", () => {
expect(parsed.continuation?.groupKey).toBe("codex:home:/Users/julius/.codex");
});
});
describe("server config forward compatibility", () => {
it("drops config issues with kinds this build does not know", () => {
const parsed = decodeUpsertKeybindingResult({
keybindings: [],
issues: [
{ kind: "keybindings.invalid-entry", message: "Bad entry", index: 2 },
{ kind: "keybindings.future-issue", message: "From a newer server" },
],
});
expect(parsed.issues).toEqual([
{ kind: "keybindings.invalid-entry", message: "Bad entry", index: 2 },
]);
});
it("drops editor ids this build does not know", () => {
const parsed = decodeAvailableEditors(["zed", "some-future-editor", "vscode"]);
expect(parsed).toEqual(["zed", "vscode"]);
});
});
+7 -2
View File
@@ -3,6 +3,7 @@ import * as Schema from "effect/Schema";
import { ExecutionEnvironmentDescriptor, ServerSelfUpdateMethod } from "./environment.ts";
import { ServerAuthDescriptor } from "./auth.ts";
import {
ForwardCompatibleArray,
IsoDateTime,
NonNegativeInt,
PositiveInt,
@@ -38,7 +39,9 @@ export const ServerConfigIssue = Schema.Union([
]);
export type ServerConfigIssue = typeof ServerConfigIssue.Type;
const ServerConfigIssues = Schema.Array(ServerConfigIssue);
// Issue kinds grow over time; older clients must not fail the whole config
// decode over a kind they cannot render.
const ServerConfigIssues = ForwardCompatibleArray(ServerConfigIssue);
export const ServerProviderState = Schema.Literals(["ready", "warning", "error", "disabled"]);
export type ServerProviderState = typeof ServerProviderState.Type;
@@ -417,7 +420,9 @@ export const ServerConfig = Schema.Struct({
keybindings: ResolvedKeybindingsConfig,
issues: ServerConfigIssues,
providers: ServerProviders,
availableEditors: Schema.Array(EditorId),
// Editor ids grow over time; drop ones this build does not know rather than
// failing the whole config decode.
availableEditors: ForwardCompatibleArray(EditorId),
observability: ServerObservability,
settings: ServerSettings,
/** Whether shell subscriptions can emit an opt-in catch-up completion marker. */
+9
View File
@@ -57,6 +57,15 @@ Done.`),
expect(() => decodeLenientJson('{ "enabled": true,, }')).toThrow();
});
it("preserves commas before brackets inside string values", () => {
// A comma inside a string value that happens to precede `}`/`]` must not
// be stripped as if it were a trailing comma.
expect(decodeLenientJson('{"note":"a,]"}')).toEqual({ note: "a,]" });
expect(decodeLenientJson('{"list":["x,}"]}')).toEqual({ list: ["x,}"] });
// Genuine trailing commas are still removed.
expect(decodeLenientJson('{"values":[1, 2,],}')).toEqual({ values: [1, 2] });
});
it("formats schema failures with paths without exposing invalid values", () => {
const decodeCredential = decodeJsonResult(Schema.Struct({ token: Schema.Number }));
const decoded = decodeCredential('{"token":"credential=secret-value"}');
+8 -2
View File
@@ -190,8 +190,14 @@ const parseLenientJsonGetter = SchemaGetter.onSome((input: string) => {
(match, stringLiteral: string | undefined) => (stringLiteral ? match : ""),
);
// Strip trailing commas before `}` or `]`.
stripped = stripped.replace(/,(\s*[}\]])/g, "$1");
// Strip trailing commas before `}` or `]`. The alternation preserves quoted
// strings so a comma inside a string value (e.g. `{"note":"a,]"}`) is not
// mistaken for a trailing comma and removed.
stripped = stripped.replace(
/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,
(match, stringLiteral: string | undefined, bracket: string | undefined) =>
stringLiteral ? match : (bracket ?? ""),
);
return decodeJsonString(stripped).pipe(
Effect.map(Option.some),
+25 -1
View File
@@ -1,6 +1,11 @@
import { describe, expect, it } from "vite-plus/test";
import { compareSemverVersions, normalizeSemverVersion, satisfiesSemverRange } from "./semver.ts";
import {
compareSemverVersions,
normalizeSemverVersion,
parseSemver,
satisfiesSemverRange,
} from "./semver.ts";
describe("semver helpers", () => {
it("matches supported range groups", () => {
@@ -18,6 +23,25 @@ describe("semver helpers", () => {
expect(normalizeSemverVersion("2.1")).toBe("2.1.0");
});
it("normalizes and parses shorthand major-only versions", () => {
expect(normalizeSemverVersion("20")).toBe("20.0.0");
expect(normalizeSemverVersion("v18")).toBe("v18.0.0");
expect(normalizeSemverVersion("20-rc.1")).toBe("20.0.0-rc.1");
expect(parseSemver("20")).toEqual({ major: 20, minor: 0, patch: 0, prerelease: [] });
});
it("compares shorthand versions numerically instead of lexically", () => {
// Regression: "20" vs "9" previously fell back to string comparison, which
// ordered "20" before "9" ("2" < "9").
expect(compareSemverVersions("20", "9")).toBeGreaterThan(0);
expect(compareSemverVersions("18", "18.0.0")).toBe(0);
});
it("still rejects non-numeric shorthand and keeps empty input empty", () => {
expect(parseSemver("abc")).toBeNull();
expect(normalizeSemverVersion("")).toBe("");
});
it("compares prerelease versions before stable versions", () => {
expect(compareSemverVersions("2.1.111-beta.1", "2.1.111")).toBeLessThan(0);
});
+6 -1
View File
@@ -17,7 +17,12 @@ export function normalizeSemverVersion(version: string): string {
}
}
if (segments.length === 2) {
// Pad shorthand versions ("20" or "20.1") up to three segments so major-only
// and minor-only inputs parse and compare numerically. This matches
// satisfiesSemverRange, which already treats a missing minor/patch as 0. The
// length > 0 guard keeps empty/garbage input empty (parseSemver still
// rejects it), and inputs with more than three segments are left untouched.
while (segments.length > 0 && segments.length < 3) {
segments.push("0");
}
+48 -48
View File
@@ -35,19 +35,19 @@ catalogs:
version: 0.2.2
overrides:
'@clerk/backend': 3.13.0
'@clerk/clerk-js': 6.25.7
'@clerk/backend': 3.14.0
'@clerk/clerk-js': 6.25.12
'@clerk/clerk-js>@base-org/account': '-'
'@clerk/clerk-js>@coinbase/wallet-sdk': '-'
'@clerk/clerk-js>@solana/wallet-adapter-base': '-'
'@clerk/clerk-js>@solana/wallet-adapter-react': '-'
'@clerk/clerk-js>@solana/wallet-standard': '-'
'@clerk/clerk-js>@wallet-standard/core': '-'
'@clerk/electron': 0.0.18
'@clerk/electron': 0.0.24
'@clerk/electron-passkeys': 0.0.3
'@clerk/expo': 4.0.2
'@clerk/react': 6.12.7
'@clerk/shared': 4.25.7
'@clerk/expo': 4.1.2
'@clerk/react': 6.12.9
'@clerk/shared': 4.25.9
'@effect/atom-react': 4.0.0-beta.102
'@effect/platform-bun': 4.0.0-beta.102
'@effect/platform-node': 4.0.0-beta.102
@@ -111,8 +111,8 @@ importers:
apps/desktop:
dependencies:
'@clerk/electron':
specifier: 0.0.18
version: 0.0.18(@clerk/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
specifier: 0.0.24
version: 0.0.24(@clerk/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
'@clerk/electron-passkeys':
specifier: 0.0.3
version: 0.0.3
@@ -197,8 +197,8 @@ importers:
specifier: ^0.7.1
version: 0.7.1([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])
'@clerk/expo':
specifier: 4.0.2
version: 4.0.2([email protected]([email protected])([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected]))([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]([email protected])([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])))([email protected])([email protected]([email protected]))([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])([email protected])
specifier: 4.1.2
version: 4.1.2([email protected]([email protected])([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected]))([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]([email protected])([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])))([email protected])([email protected]([email protected]))([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])([email protected])
'@effect/atom-react':
specifier: 4.0.0-beta.102
version: 4.0.0-beta.102([email protected](patch_hash=71215759e1ac0a7f65d7b75d816986687ae6c3a6cba02d928d184ca71790d488))([email protected])([email protected])
@@ -514,11 +514,11 @@ importers:
specifier: ^1.4.1
version: 1.5.0(@types/[email protected])([email protected]([email protected]))([email protected])
'@clerk/electron':
specifier: 0.0.18
version: 0.0.18(@clerk/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
specifier: 0.0.24
version: 0.0.24(@clerk/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
'@clerk/react':
specifier: 6.12.7
version: 6.12.7([email protected]([email protected]))([email protected])
specifier: 6.12.9
version: 6.12.9([email protected]([email protected]))([email protected])
'@dnd-kit/core':
specifier: ^6.3.1
version: 6.3.1([email protected]([email protected]))([email protected])
@@ -668,8 +668,8 @@ importers:
infra/relay:
dependencies:
'@clerk/backend':
specifier: 3.13.0
version: 3.13.0([email protected]([email protected]))([email protected])
specifier: 3.14.0
version: 3.14.0([email protected]([email protected]))([email protected])
'@effect/sql-pg':
specifier: 4.0.0-beta.102
version: 4.0.0-beta.102([email protected](patch_hash=71215759e1ac0a7f65d7b75d816986687ae6c3a6cba02d928d184ca71790d488))
@@ -1695,12 +1695,12 @@ packages:
resolution: {integrity: sha512-EYlRokl8szrP9Z25qT5aepMdBjzBvHF9ZEhzIiUBc9guz/T31EqRgvD0QSgZcpE93xiwrr+OkB4nz0BZyF6fSA==}
engines: {node: '>= 20.12.0'}
'@clerk/[email protected]3.0':
resolution: {integrity: sha512-kYOgeR48iXYypudpYITE0L2yxi4TeFXU+ISAOULlVgOcurw8qnm1/JEuK6Mr2IFUbRS9hcHk1HVO0Ceo0XmL8Q==}
'@clerk/[email protected]4.0':
resolution: {integrity: sha512-WsphTvDFHDuQilKI7dyVE5qmt7USu8qSrujAq6SqpEHbVFfNBfINDNuzxlF9M2skOTfHFfgiTE8Jjb1egIBGLg==}
engines: {node: '>=20.9.0'}
'@clerk/[email protected].7':
resolution: {integrity: sha512-GOnbEUzPKAdsdCodZsHhku2YloBBuwLGx5UP0VeezUj73wKLwlSYMlVPuntsJoY7c8+lVrMCY9LQWYVZ7VMLBw==}
'@clerk/[email protected].12':
resolution: {integrity: sha512-N91mFKenMF5e+LRQ0NsqFb8bw+icbwnF8MzjzS4cux72xG4Gekh772tiLIetbURe44Srgjw5lj8jkWbt+yH/FA==}
engines: {node: '>=20.9.0'}
'@clerk/[email protected]':
@@ -1727,8 +1727,8 @@ packages:
resolution: {integrity: sha512-OHhIe88qDL+FxyBalXdXNHAS5eEramr6Rerp+6iNkfkjqT8rx4hHNmfpmjg5/T1/am8QfknbOBZkqoXZlCrjPg==}
engines: {node: '>=20.9.0'}
'@clerk/[email protected].18':
resolution: {integrity: sha512-0lWiITlTxCviglPfPSu+uhERnQyXroiWrSMRpZcEO3FgBt3bnrpfgZUrXW8iaLoUYJrFP2byF7bHJPRwEPVXEw==}
'@clerk/[email protected].24':
resolution: {integrity: sha512-xORO51KLzCqmRQ4IVsa+Amp1M5NjG28QnvsaRBq1v4CUEjH8vAXDKCPiPBKAE+HuQB6HUhzYmzUkyTw2FcDonw==}
engines: {node: '>=20.9.0'}
peerDependencies:
'@clerk/electron-passkeys': 0.0.3
@@ -1744,8 +1744,8 @@ packages:
react-dom:
optional: true
'@clerk/expo@4.0.2':
resolution: {integrity: sha512-afBdV2bLRM55p5L7FoAGV/wCamLxXusjIBPmNo+TwAYabU0oUokMsm+0++xWDA0nxzMt/O08Oj+xAGEtE+Qvxg==}
'@clerk/expo@4.1.2':
resolution: {integrity: sha512-ZyGozbbizcGwEyK0CEXsPHnHnQoaa2CbTsXAqWBygzKEZyFjLjCHwQsQBKj6WgjAgn8mtw2ByIP9qLpItZffgw==}
engines: {node: '>=20.9.0'}
peerDependencies:
'@clerk/expo-google-signin': '>=0.1.0'
@@ -1783,15 +1783,15 @@ packages:
react-dom:
optional: true
'@clerk/[email protected].7':
resolution: {integrity: sha512-K8CK0tS7My/3RT5sAIJTjYgnH0xU+K4Jdnhi76xQdAY4agD/M07BbrBMWXEE0xUEDst2PqPfX660V1LRLOsxOQ==}
'@clerk/[email protected].9':
resolution: {integrity: sha512-lQ1UOJhHGDweLCDf4IgT5r3rgkch1Gx21hNqK2/kOohJrJd/XM89fq2F7VK9Kg/Byc14TsfCh64Dm8ej2MyRWw==}
engines: {node: '>=20.9.0'}
peerDependencies:
react: ^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0
react-dom: ^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0
'@clerk/[email protected].7':
resolution: {integrity: sha512-FfBbDeFkxwDuz/2YcVs4DhyZ0VxnqNtdbO0Tn/lkLAiDvFFspWw+PDYqo7LQiBymEQaOQkb094dX21WWnZbmlA==}
'@clerk/[email protected].9':
resolution: {integrity: sha512-nw3maGzqPrwmUKjGffOM9Zvw24IyOllq0TkQGzsTfQX312WLu2u5CNvjKntMb6Ok6kXa1Zdc77zmPLn1/EAIFA==}
engines: {node: '>=20.9.0'}
peerDependencies:
react: ^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0
@@ -11512,18 +11512,18 @@ snapshots:
fast-wrap-ansi: 0.2.2
sisteransi: 1.0.5
'@clerk/[email protected]3.0([email protected]([email protected]))([email protected])':
'@clerk/[email protected]4.0([email protected]([email protected]))([email protected])':
dependencies:
'@clerk/shared': 4.25.7([email protected]([email protected]))([email protected])
'@clerk/shared': 4.25.9([email protected]([email protected]))([email protected])
standardwebhooks: 1.0.0
tslib: 2.8.1
transitivePeerDependencies:
- react
- react-dom
'@clerk/[email protected].7([email protected]([email protected]))([email protected])':
'@clerk/[email protected].12([email protected]([email protected]))([email protected])':
dependencies:
'@clerk/shared': 4.25.7([email protected]([email protected]))([email protected])
'@clerk/shared': 4.25.9([email protected]([email protected]))([email protected])
'@stripe/stripe-js': 5.6.0
'@swc/helpers': 0.5.21
'@tanstack/query-core': 5.100.14
@@ -11538,9 +11538,9 @@ snapshots:
- react
- react-dom
'@clerk/[email protected].7([email protected]([email protected]))([email protected])':
'@clerk/[email protected].12([email protected]([email protected]))([email protected])':
dependencies:
'@clerk/shared': 4.25.7([email protected]([email protected]))([email protected])
'@clerk/shared': 4.25.9([email protected]([email protected]))([email protected])
'@stripe/stripe-js': 5.6.0
'@swc/helpers': 0.5.21
'@tanstack/query-core': 5.100.14
@@ -11574,11 +11574,11 @@ snapshots:
'@clerk/electron-passkeys-win32-arm64-msvc': 0.0.3
'@clerk/electron-passkeys-win32-x64-msvc': 0.0.3
'@clerk/[email protected].18(@clerk/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])':
'@clerk/[email protected].24(@clerk/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])':
dependencies:
'@clerk/clerk-js': 6.25.7([email protected]([email protected]))([email protected])
'@clerk/react': 6.12.7([email protected]([email protected]))([email protected])
'@clerk/shared': 4.25.7([email protected]([email protected]))([email protected])
'@clerk/clerk-js': 6.25.12([email protected]([email protected]))([email protected])
'@clerk/react': 6.12.9([email protected]([email protected]))([email protected])
'@clerk/shared': 4.25.9([email protected]([email protected]))([email protected])
electron: 41.5.0
react: 19.2.6
tslib: 2.8.1
@@ -11587,11 +11587,11 @@ snapshots:
electron-store: 8.2.0
react-dom: 19.2.6([email protected])
'@clerk/expo@4.0.2([email protected]([email protected])([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected]))([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]([email protected])([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])))([email protected])([email protected]([email protected]))([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])([email protected])':
'@clerk/expo@4.1.2([email protected]([email protected])([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected]))([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]([email protected])([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])))([email protected])([email protected]([email protected]))([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])([email protected])':
dependencies:
'@clerk/clerk-js': 6.25.7([email protected]([email protected]))([email protected])
'@clerk/react': 6.12.7([email protected]([email protected]))([email protected])
'@clerk/shared': 4.25.7([email protected]([email protected]))([email protected])
'@clerk/clerk-js': 6.25.12([email protected]([email protected]))([email protected])
'@clerk/react': 6.12.9([email protected]([email protected]))([email protected])
'@clerk/shared': 4.25.9([email protected]([email protected]))([email protected])
'@expo/config-plugins': 56.0.9([email protected])
base-64: 1.0.0
expo: 56.0.12(8895228379997a2a064f9644cda56ed0)
@@ -11610,21 +11610,21 @@ snapshots:
- supports-color
- typescript
'@clerk/[email protected].7([email protected]([email protected]))([email protected])':
'@clerk/[email protected].9([email protected]([email protected]))([email protected])':
dependencies:
'@clerk/shared': 4.25.7([email protected]([email protected]))([email protected])
'@clerk/shared': 4.25.9([email protected]([email protected]))([email protected])
react: 19.2.3
react-dom: 19.2.3([email protected])
tslib: 2.8.1
'@clerk/[email protected].7([email protected]([email protected]))([email protected])':
'@clerk/[email protected].9([email protected]([email protected]))([email protected])':
dependencies:
'@clerk/shared': 4.25.7([email protected]([email protected]))([email protected])
'@clerk/shared': 4.25.9([email protected]([email protected]))([email protected])
react: 19.2.6
react-dom: 19.2.6([email protected])
tslib: 2.8.1
'@clerk/[email protected].7([email protected]([email protected]))([email protected])':
'@clerk/[email protected].9([email protected]([email protected]))([email protected])':
dependencies:
'@tanstack/query-core': 5.100.14
dequal: 2.0.3
@@ -11634,7 +11634,7 @@ snapshots:
react: 19.2.3
react-dom: 19.2.3([email protected])
'@clerk/[email protected].7([email protected]([email protected]))([email protected])':
'@clerk/[email protected].9([email protected]([email protected]))([email protected])':
dependencies:
'@tanstack/query-core': 5.100.14
dequal: 2.0.3
+12 -12
View File
@@ -23,13 +23,13 @@ allowBuilds:
workerd: false
catalog:
"@clerk/backend": 3.13.0
"@clerk/clerk-js": 6.25.7
"@clerk/electron": 0.0.18
"@clerk/backend": 3.14.0
"@clerk/clerk-js": 6.25.12
"@clerk/electron": 0.0.24
"@clerk/electron-passkeys": 0.0.3
"@clerk/expo": 4.0.2
"@clerk/react": 6.12.7
"@clerk/shared": 4.25.7
"@clerk/expo": 4.1.2
"@clerk/react": 6.12.9
"@clerk/shared": 4.25.9
"@effect/atom-react": 4.0.0-beta.102
"@effect/openapi-generator": 4.0.0-beta.102
"@effect/platform-bun": 4.0.0-beta.102
@@ -52,12 +52,12 @@ catalog:
yaml: ^2.9.0
minimumReleaseAgeExclude:
- "@clerk/[email protected]3.0"
- "@clerk/[email protected].7"
- "@clerk/[email protected].18"
- "@clerk/expo@4.0.2"
- "@clerk/[email protected].7"
- "@clerk/[email protected].7"
- "@clerk/[email protected]4.0"
- "@clerk/[email protected].12"
- "@clerk/[email protected].24"
- "@clerk/expo@4.1.2"
- "@clerk/[email protected].9"
- "@clerk/[email protected].9"
- "@distilled.cloud/[email protected]"
- "@distilled.cloud/[email protected]"
- "@distilled.cloud/[email protected]"
+5
View File
@@ -349,6 +349,11 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
assert.notProperty(mac, "asarUnpack");
assert.notProperty(linux, "asarUnpack");
assert.deepStrictEqual(win.asarUnpack, WINDOWS_ASAR_UNPACK);
// Linux must register the renderer schemes so the generated .desktop
// entry advertises MimeType=x-scheme-handler/t3code; for OAuth deep links.
assert.deepStrictEqual((linux.linux as Record<string, unknown>).protocols, [
{ name: "T3 Code", schemes: ["t3code", "t3code-dev"] },
]);
for (const config of [mac, linux, win]) {
assert.deepStrictEqual(config.electronLanguages, DESKTOP_ELECTRON_LANGUAGES);
assert.deepStrictEqual(config.files, DESKTOP_FILE_EXCLUSIONS);
+9
View File
@@ -1589,6 +1589,15 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* (
executableName: "t3code",
icon: "icons",
category: "Development",
// electron-builder turns these into MimeType=x-scheme-handler/<scheme>;
// in the .desktop entry (Exec already gets %U), so browsers can hand
// t3code:// OAuth callbacks to the app.
protocols: [
{
name: "T3 Code",
schemes: ["t3code", "t3code-dev"],
},
],
desktop: {
entry: {
StartupWMClass: "t3code",
+5 -8
View File
@@ -244,22 +244,19 @@ it("selects a reachable LAN IPv4 address", () => {
});
it("maps capture scenes to the real application routes", () => {
assert.equal(showcaseSceneUrl("threads", "environment-1"), "t3code-dev://");
assert.equal(
showcaseSceneUrl("environments", "environment-1"),
"t3code-dev://settings/environments",
);
assert.equal(showcaseSceneUrl("threads", "environment-1"), "t3code://");
assert.equal(showcaseSceneUrl("environments", "environment-1"), "t3code://settings/environments");
assert.equal(
showcaseSceneUrl("thread", "environment-1"),
"t3code-dev://threads/environment-1/remote-command-center",
"t3code://threads/environment-1/remote-command-center",
);
assert.equal(
showcaseSceneUrl("terminal", "environment-1"),
"t3code-dev://threads/environment-1/remote-command-center/terminal?terminalId=term-1",
"t3code://threads/environment-1/remote-command-center/terminal?terminalId=term-1",
);
assert.equal(
showcaseSceneUrl("review", "environment-1"),
"t3code-dev://threads/environment-1/remote-command-center/review",
"t3code://threads/environment-1/remote-command-center/review",
);
});
+6 -6
View File
@@ -31,14 +31,14 @@ import {
const REPO_ROOT = NodePath.resolve(NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)), "..");
const MOBILE_ROOT = NodePath.join(REPO_ROOT, "apps/mobile");
const ANDROID_PACKAGE = "com.t3tools.t3code.dev";
const APP_SCHEME = "t3code-dev";
const ANDROID_PACKAGE = "com.t3tools.t3code";
const APP_SCHEME = "t3code";
const IOS_READY_FILENAME = "T3ShowcaseReadyScene";
const SERVER_HOST = "0.0.0.0";
const IOS_SIMULATOR_ARCH = NodeProcess.arch === "arm64" ? "arm64" : "x86_64";
const IOS_APP_PATH = NodePath.join(
MOBILE_ROOT,
".showcase/ios-derived-data/Build/Products/Debug-iphonesimulator/T3CodeDev.app",
".showcase/ios-derived-data/Build/Products/Debug-iphonesimulator/T3Code.app",
);
const ANDROID_APK_PATH = NodePath.join(
MOBILE_ROOT,
@@ -58,7 +58,7 @@ const ANDROID_SDK_ROOT = resolveAndroidSdkRoot(NodeProcess.env);
const MOBILE_BUILD_ENV = {
...NodeProcess.env,
ANDROID_HOME: ANDROID_SDK_ROOT,
APP_VARIANT: "development",
APP_VARIANT: "production",
EXPO_NO_GIT_STATUS: "1",
JAVA_HOME:
NodeProcess.env.JAVA_HOME ??
@@ -664,9 +664,9 @@ async function buildIos(): Promise<string> {
"xcodebuild",
[
"-workspace",
NodePath.join(MOBILE_ROOT, "ios/T3CodeDev.xcworkspace"),
NodePath.join(MOBILE_ROOT, "ios/T3Code.xcworkspace"),
"-scheme",
"T3CodeDev",
"T3Code",
"-configuration",
"Debug",
"-sdk",