Skip to content

Commit dcb8b54

Browse files
committed
merge main into feat/usage-all-providers
2 parents 1b5811a + ac1264e commit dcb8b54

255 files changed

Lines changed: 21980 additions & 2332 deletions

File tree

Some content is hidden

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

‎.github/VOUCHED.td‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ github:shivamhwp
3737
github:jappyjan
3838
github:justsomelegs
3939
github:UtkarshUsername
40+
github:SunkenInTime

‎.github/workflows/mobile-eas-production.yml‎

Lines changed: 83 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ name: Mobile EAS Production
88
#
99
# Every merge to main that touches the mobile app reconciles, per platform:
1010
# 1. Store builds: if the latest production build's version differs from
11-
# app.config.ts, cut a new build with --auto-submit (TestFlight +
12-
# Play internal track). Bumping `version` is therefore all it takes to
11+
# app.config.ts, cut a new build and submit it (TestFlight + Play internal
12+
# track). Bumping `version` is therefore all it takes to
1313
# start the next release train — the first build of a version enters
1414
# external-TestFlight beta review immediately, and later builds of the
15-
# same version auto-approve. Releasing to the App Store stays a manual
16-
# App Store Connect step.
15+
# same version auto-approve until that version is released. After App
16+
# Store approval, Apple closes the release train and `version` must be
17+
# bumped before another iOS build can be submitted. Releasing to the App
18+
# Store stays a manual App Store Connect step.
1719
# 2. OTA: publish a production-channel update for each platform where at
1820
# least one finished production build matches the current native
1921
# fingerprint. Old-version binaries with a matching fingerprint receive
@@ -42,6 +44,10 @@ on:
4244
- ios
4345
- android
4446
- all
47+
version:
48+
description: "Optional build version override (blank uses app.config.ts; an override is committed before building)"
49+
required: false
50+
type: string
4551
message:
4652
description: "OTA update message (mode=update only)"
4753
required: false
@@ -89,11 +95,21 @@ jobs:
8995
echo "EXPO_TOKEN is not available; skipping EAS production job."
9096
fi
9197
98+
- id: version_app_token
99+
name: Mint release app token for version override
100+
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build' && inputs.version != ''
101+
uses: actions/create-github-app-token@v2
102+
with:
103+
app-id: ${{ secrets.RELEASE_APP_ID }}
104+
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
105+
owner: ${{ github.repository_owner }}
106+
92107
- name: Checkout
93108
if: steps.expo-token.outputs.present == 'true'
94109
uses: actions/checkout@v6
95110
with:
96111
fetch-depth: 0
112+
token: ${{ steps.version_app_token.outputs.token || github.token }}
97113
# No sparse-checkout here: it makes actions/checkout fetch with
98114
# --filter=blob:none, and eas-cli archives the project via
99115
# `git clone --depth 1 file://<workspace>`, which fails (exit 128)
@@ -135,6 +151,65 @@ jobs:
135151
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
136152
run: eas env:pull production --non-interactive
137153

154+
- name: Apply manual version override
155+
if: steps.version_app_token.outcome == 'success'
156+
env:
157+
GH_TOKEN: ${{ steps.version_app_token.outputs.token }}
158+
APP_SLUG: ${{ steps.version_app_token.outputs.app-slug }}
159+
RELEASE_VERSION: ${{ inputs.version }}
160+
run: |
161+
if [ "$GITHUB_REF_TYPE" != "branch" ]; then
162+
echo "Version overrides require dispatching this workflow from a branch; received $GITHUB_REF_TYPE '$GITHUB_REF_NAME'." >&2
163+
exit 1
164+
fi
165+
if ! [[ "$RELEASE_VERSION" =~ ^[0-9]+(\.[0-9]+){1,2}$ ]]; then
166+
echo "Version override must contain two or three dot-separated integers; received '$RELEASE_VERSION'." >&2
167+
exit 1
168+
fi
169+
170+
node --input-type=module -e '
171+
import fs from "node:fs";
172+
const path = "apps/mobile/app.config.ts";
173+
const source = fs.readFileSync(path, "utf8");
174+
const next = source.replace(
175+
/^( version: ")[^"]+(".*)$/m,
176+
`$1${process.env.RELEASE_VERSION}$2`,
177+
);
178+
if (next === source && !source.includes(` version: "${process.env.RELEASE_VERSION}"`)) {
179+
throw new Error("Could not update app version");
180+
}
181+
fs.writeFileSync(path, next);
182+
'
183+
vp fmt apps/mobile/app.config.ts
184+
185+
if git diff --quiet -- apps/mobile/app.config.ts; then
186+
echo "app.config.ts is already at $RELEASE_VERSION; no version commit needed."
187+
exit 0
188+
fi
189+
190+
user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)"
191+
git config user.name "${APP_SLUG}[bot]"
192+
git config user.email "${user_id}+${APP_SLUG}[bot]@users.noreply.github.com"
193+
git add apps/mobile/app.config.ts
194+
git commit \
195+
-m "chore(mobile): bump app version to $RELEASE_VERSION" \
196+
-m "Co-authored-by: codex <[email protected]>"
197+
git push origin "HEAD:refs/heads/${GITHUB_REF_NAME}"
198+
199+
- name: Summarize manual build version
200+
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build'
201+
working-directory: apps/mobile
202+
run: |
203+
version="$(npx expo config --json --type public | jq -r '.version')"
204+
{
205+
echo "## Manual production build"
206+
echo
207+
echo "- App version: \`$version\`"
208+
echo "- Platform: \`${{ inputs.platform }}\`"
209+
echo
210+
echo "> Apple closes an iOS release train after App Store approval. Before building iOS, confirm \`$version\` is newer than the approved App Store version."
211+
} >> "$GITHUB_STEP_SUMMARY"
212+
138213
- name: Build and submit (manual)
139214
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build'
140215
working-directory: apps/mobile
@@ -157,10 +232,8 @@ jobs:
157232
158233
# No --status filter on build:list: an in-queue/in-progress build must
159234
# count as existing, or every merge during the build window would cut a
160-
# duplicate. Builds started here stay attached to this serialized run so
161-
# the queued run for a later merge cannot overtake them and lose its OTA.
162-
# After an errored build, retry via workflow_dispatch mode=build — pushes
163-
# won't re-trigger it until the app version changes.
235+
# duplicate. After an errored build, retry via workflow_dispatch
236+
# mode=build — pushes won't re-trigger it until the app version changes.
164237
- id: store_builds
165238
name: Ensure store builds exist for the current app version
166239
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'push'
@@ -178,8 +251,8 @@ jobs:
178251
continue
179252
fi
180253
echo "$platform: latest production build is $latest, app.config.ts says $version — building"
181-
if eas build --platform "$platform" --profile production --auto-submit --non-interactive; then
182-
echo ":building_construction: $platform: cut production build for $version (auto-submitted)" >> "$GITHUB_STEP_SUMMARY"
254+
if eas build --platform "$platform" --profile production --auto-submit --non-interactive --no-wait; then
255+
echo ":building_construction: $platform: scheduled production build and submission for $version" >> "$GITHUB_STEP_SUMMARY"
183256
else
184257
failed=1
185258
echo ":x: $platform: production build or submission failed for $version" >> "$GITHUB_STEP_SUMMARY"

‎apps/mobile/app.config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ const config: ExpoConfig = {
161161
slug: "t3-code",
162162
platforms: ["ios", "android"],
163163
scheme: variant.scheme,
164-
version: "1.0.2",
164+
version: "1.0.3",
165165
runtimeVersion: {
166166
// Fingerprint (not appVersion) so an OTA only reaches binaries whose native
167167
// project — native deps, config plugins, AND patches/ — matches the update.

‎apps/mobile/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@expo-google-fonts/dm-sans": "^0.4.2",
5050
"@expo/metro-runtime": "~56.0.15",
5151
"@expo/ui": "~56.0.18",
52-
"@legendapp/list": "3.3.3",
52+
"@legendapp/list": "catalog:",
5353
"@noble/curves": "catalog:",
5454
"@noble/hashes": "catalog:",
5555
"@pierre/diffs": "catalog:",

‎apps/mobile/src/Stack.tsx‎

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { AppText as Text } from "./components/AppText";
1818
import { getCompactBrandHeaderOptions } from "./components/CompactBrandTitle";
1919
import { ArchivedThreadsRouteScreen } from "./features/archive/ArchivedThreadsRouteScreen";
2020
import { useAgentNotificationNavigation } from "./features/agent-awareness/notificationNavigation";
21-
import { ClerkSettingsSheetDetentProvider } from "./features/cloud/ClerkSettingsSheetDetent";
2221
import { ConnectOnboardingRouteScreen } from "./features/cloud/ConnectOnboardingRouteScreen";
2322
import { useConnectOnboardingNavigation } from "./features/cloud/connectOnboardingNavigation";
2423
import { ThreadFilesTreeScreen, ThreadFileScreen } from "./features/files/ThreadFilesRouteScreen";
@@ -134,7 +133,7 @@ const LEGAL_DOCUMENT_HEADER_OPTIONS: AppScreenOptions = {
134133
presentation: "fullScreenModal",
135134
};
136135

137-
const SettingsSheetStack = createNativeStackNavigator({
136+
const SettingsContentStack = createNativeStackNavigator({
138137
initialRouteName: "Settings",
139138
screenOptions: {
140139
...GLASS_HEADER_OPTIONS,
@@ -198,20 +197,30 @@ const SettingsSheetStack = createNativeStackNavigator({
198197
title: "Usage",
199198
},
200199
}),
200+
},
201+
});
202+
203+
// The outer stack never owns visible chrome. Settings routes render inside a
204+
// nested stack whose native header remains mounted, while Clerk owns auth chrome.
205+
// Keeping bar visibility invariant avoids iOS 26's headerless-to-headered jump.
206+
const SettingsSheetStack = createNativeStackNavigator({
207+
initialRouteName: "SettingsContent",
208+
screenOptions: {
209+
headerShown: false,
210+
},
211+
screens: {
212+
SettingsContent: createNativeStackScreen({
213+
screen: SettingsContentStack,
214+
linking: "",
215+
}),
201216
SettingsAuth: createNativeStackScreen({
202217
screen: SettingsAuthRouteScreen,
203218
linking: "auth",
204-
options: {
205-
title: "Sign in",
206-
},
207219
}),
208220
SettingsWaitlist: createNativeStackScreen({
209221
// Keep the old deep link working after the Connect GA launch.
210222
screen: SettingsAuthRouteScreen,
211223
linking: "waitlist",
212-
options: {
213-
title: "Sign in",
214-
},
215224
}),
216225
},
217226
});
@@ -347,11 +356,9 @@ function RootStackLayout(props: {
347356
<HardwareKeyboardCommandProvider pathname={pathname}>
348357
<ThreadOutboxDrainWorker />
349358
<ShowcaseCaptureCoordinator pathname={pathname} />
350-
<ClerkSettingsSheetDetentProvider initiallyExpanded={false}>
351-
<AdaptiveWorkspaceLayout pathname={workspacePathname}>
352-
{props.children}
353-
</AdaptiveWorkspaceLayout>
354-
</ClerkSettingsSheetDetentProvider>
359+
<AdaptiveWorkspaceLayout pathname={workspacePathname}>
360+
{props.children}
361+
</AdaptiveWorkspaceLayout>
355362
</HardwareKeyboardCommandProvider>
356363
);
357364
}

‎apps/mobile/src/components/ControlPill.tsx‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
type ComponentProps,
77
type ReactElement,
88
type ReactNode,
9+
useRef,
910
} from "react";
1011
import { Platform, Pressable, useColorScheme, View } from "react-native";
1112
import { useThemeColor } from "../lib/useThemeColor";
@@ -21,10 +22,31 @@ export function ControlPill(props: {
2122
readonly label?: string;
2223
readonly accessibilityLabel?: string;
2324
readonly onPress?: () => void;
25+
readonly activateOnPressIn?: boolean;
2426
readonly variant?: "circle" | "pill" | "primary" | "danger";
2527
readonly disabled?: boolean;
28+
readonly className?: string;
2629
}) {
2730
const variant = props.variant ?? "circle";
31+
const activatedOnPressInRef = useRef(false);
32+
33+
const handlePressIn = () => {
34+
activatedOnPressInRef.current = true;
35+
props.onPress?.();
36+
};
37+
const handlePressOut = () => {
38+
// Pressability invokes onPressOut immediately before onPress on release.
39+
// Defer the reset so onPress can identify the same physical gesture.
40+
setTimeout(() => {
41+
activatedOnPressInRef.current = false;
42+
}, 0);
43+
};
44+
const handlePress = () => {
45+
if (activatedOnPressInRef.current) {
46+
return;
47+
}
48+
props.onPress?.();
49+
};
2850

2951
const iconColor = useThemeColor("--color-icon");
3052
const iconSubtle = useThemeColor("--color-icon-subtle");
@@ -54,6 +76,7 @@ export function ControlPill(props: {
5476
: variant === "danger"
5577
? "bg-danger"
5678
: "bg-subtle",
79+
props.className,
5780
);
5881
const labelClassName = cn(
5982
"text-center text-xs font-t3-bold",
@@ -68,7 +91,9 @@ export function ControlPill(props: {
6891
<Pressable
6992
accessibilityLabel={props.accessibilityLabel ?? props.label}
7093
accessibilityRole="button"
71-
onPress={props.onPress}
94+
onPress={props.activateOnPressIn ? handlePress : props.onPress}
95+
onPressIn={props.activateOnPressIn ? handlePressIn : undefined}
96+
onPressOut={props.activateOnPressIn ? handlePressOut : undefined}
7297
disabled={props.disabled}
7398
className={containerClassName}
7499
>

‎apps/mobile/src/features/archive/ArchivedThreadsRouteScreen.tsx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { useFocusEffect } from "@react-navigation/native";
55
import { useCallback, useMemo, useState } from "react";
66

77
import { useSavedRemoteConnections } from "../../state/use-remote-environment-registry";
8-
import { useClerkSettingsSheetDetent } from "../cloud/ClerkSettingsSheetDetent";
98
import { useArchivedThreadListActions } from "../home/useThreadListActions";
109
import {
1110
ArchivedThreadsScreen,
@@ -18,7 +17,6 @@ import {
1817
} from "./useArchivedThreadSnapshots";
1918

2019
export function ArchivedThreadsRouteScreen() {
21-
const { expand } = useClerkSettingsSheetDetent();
2220
const { savedConnectionsById } = useSavedRemoteConnections();
2321
const [searchQuery, setSearchQuery] = useState("");
2422
const [selectedEnvironmentId, setSelectedEnvironmentId] = useState<EnvironmentId | null>(null);
@@ -70,9 +68,8 @@ export function ArchivedThreadsRouteScreen() {
7068

7169
useFocusEffect(
7270
useCallback(() => {
73-
expand();
7471
refresh();
75-
}, [expand, refresh]),
72+
}, [refresh]),
7673
);
7774

7875
return (

‎apps/mobile/src/features/cloud/ClerkSettingsSheetDetent.tsx‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

‎apps/mobile/src/features/cloud/connectOnboardingNavigation.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { appAtomRegistry } from "../../state/atom-registry";
66
import { clearConnectOnboardingRequest, connectOnboardingRequestAtom } from "./connectOnboarding";
77
import { isConnectOnboardingOptedOut } from "./connectOnboardingOptOut";
88

9-
// Sign-in happens inside the Settings sheet; give its detent/session-state
10-
// transitions a beat to settle before presenting another formSheet on top.
9+
// Sign-in happens inside the Settings sheet; give its session-state transition
10+
// a beat to settle before presenting another formSheet on top.
1111
const PRESENT_ONBOARDING_DELAY_MS = 600;
1212

1313
/**

0 commit comments

Comments
 (0)