@devries-cameron20 / t3code-1 / commits / 5a5fd540df
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

refactor(mobile): share settings and connection actions (#21941)

Julius Marminge committed Oct 19, 2026 at 15:04 UTC 5a5fd540dfdede945f189d4a21c4adc5fd4a1730
9 files changed +64 -98
apps/mobile/src/features/cloud/ConnectOnboardingRouteScreen.tsx
+3 -9
@@ -1,10 +1,11 @@
1 +import { Button } from "../../components/ui/Button";
2 import { Toolbar } from "../../components/ui/Toolbar";
3 import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollView";
4
5 import { useAuth } from "@clerk/expo";
6 import { StackActions, useNavigation } from "@react-navigation/native";
7 import { useEffect, useState } from "react";
7 -import { Platform, Pressable, RefreshControl, View } from "react-native";
8 +import { Platform, RefreshControl, View } from "react-native";
9 import { useSafeAreaInsets } from "react-native-safe-area-context";
10
11 import { reportAtomCommandResult, settlePromise } from "@t3tools/client-runtime/state/runtime";
@@ -125,14 +126,7 @@ function ConfiguredConnectOnboardingRouteScreen() {
126 )}
127
128 {userId ? (
128 - <Pressable
129 - accessibilityRole="button"
130 - hitSlop={8}
131 - onPress={handleDontShowAgain}
132 - className="items-center py-1 active:opacity-70"
133 - >
134 - <Text className="text-xs text-foreground-muted">{"Don't show this again"}</Text>
135 - </Pressable>
129 + <Button label={"Don't show this again"} tone="text" onPress={handleDontShowAgain} />
130 ) : null}
131 </ScrollView>
132 </View>
apps/mobile/src/features/connection/CloudEnvironmentRows.tsx
+10 -18
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
3 import { ConnectionTraceId } from "./ConnectionTraceId";
4 import { useAuth } from "@clerk/expo";
@@ -161,15 +162,13 @@ function CloudEnvironmentRowsContent(
162 {controller.relayDiscovery.errorTraceId ? (
163 <CopyTraceIdButton traceId={controller.relayDiscovery.errorTraceId} />
164 ) : null}
164 - <Pressable
165 - accessibilityRole="button"
165 + <Button
166 + label="Try again"
167 + tone="secondary"
168 onPress={() => {
169 void controller.refreshRelayEnvironments();
170 }}
169 - className="self-start rounded-full bg-subtle px-3.5 py-2 active:opacity-70"
170 - >
171 - <Text className="text-xs font-t3-bold text-foreground">Try again</Text>
172 - </Pressable>
171 + />
172 </View>
173 ) : null}
174 </View>
@@ -432,20 +431,13 @@ function CloudEnvironmentRowShell(props: {
431
432 function CopyTraceIdButton(props: { readonly traceId: string }) {
433 return (
435 - <Pressable
436 - accessibilityRole="button"
434 + <Button
435 + label="Copy trace ID"
436 + tone="secondary"
437 onPress={() => {
438 copyTextWithHaptic(props.traceId, { target: "connection-trace-id" });
439 }}
440 - className="self-start flex-row items-center gap-1.5 rounded-full bg-subtle px-3 py-2 active:opacity-70"
441 - >
442 - <SymbolView
443 - name="doc.on.doc"
444 - size={12}
445 - tintColorClassName={"accent-icon"}
446 - type="monochrome"
447 - />
448 - <Text className="text-xs font-t3-bold text-foreground">Copy trace ID</Text>
449 - </Pressable>
440 + icon="doc.on.doc"
441 + />
442 );
443 }
apps/mobile/src/features/connection/EnvironmentConnectionNotice.tsx
+5 -8
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
3 import { ConnectionTraceId } from "./ConnectionTraceId";
4 import {
@@ -5,7 +6,7 @@ import {
6 type EnvironmentConnectionPresentation,
7 } from "@t3tools/client-runtime/connection";
8 import { SymbolView } from "../../components/ui/AppSymbol";
8 -import { Pressable, View } from "react-native";
9 +import { View } from "react-native";
10
11 import { AppText as Text } from "../../components/ui/AppText";
12
@@ -87,13 +88,9 @@ export function EnvironmentConnectionNotice(props: {
88 </Text>
89
90 {props.connection.phase !== "offline" && props.connection.phase !== "unsupported" ? (
90 - <Pressable
91 - accessibilityRole="button"
92 - className="mt-1 rounded-full bg-subtle px-4 py-2.5 active:opacity-70"
93 - onPress={props.onRetry}
94 - >
95 - <Text className="text-sm font-t3-bold text-foreground">Retry now</Text>
96 - </Pressable>
91 + <View className="mt-1">
92 + <Button label="Retry now" tone="secondary" onPress={props.onRetry} />
93 + </View>
94 ) : null}
95 </View>
96 </View>
apps/mobile/src/features/projects/AddProjectScreen.tsx
+7 -6
@@ -433,12 +433,13 @@ function EmptyEnvironmentState() {
433 <Text className="text-center text-sm leading-normal text-foreground-muted">
434 Start or reconnect an environment before adding a project.
435 </Text>
436 - <Pressable
437 - onPress={() => navigation.dispatch(StackActions.replace("ConnectionsNew"))}
438 - className="mt-1 rounded-full bg-primary px-4 py-2.5 active:opacity-70"
439 - >
440 - <Text className="text-sm font-t3-bold text-primary-foreground">Add environment</Text>
441 - </Pressable>
436 + <View className="mt-1">
437 + <Button
438 + label="Add environment"
439 + tone="primary"
440 + onPress={() => navigation.dispatch(StackActions.replace("ConnectionsNew"))}
441 + />
442 + </View>
443 </View>
444 );
445 }
apps/mobile/src/features/settings/EnvironmentRoutesSection.tsx
+5 -8
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import * as Dialog from "../../components/ui/Dialog";
3 import { useAtomValue } from "@effect/atom-react";
4 import {
@@ -132,15 +133,11 @@ export function EnvironmentRoutesSection({
133 title="Routes"
134 trailing={
135 routes.length > 1 ? (
135 - <Pressable
136 - accessibilityRole="button"
136 + <Button
137 + label={editing ? "Done" : "Edit"}
138 + tone="text"
139 onPress={() => setEditing((value) => !value)}
138 - className="px-2 py-1 active:opacity-70"
139 - >
140 - <Text className="text-sm font-t3-medium text-foreground android:text-primary-text">
141 - {editing ? "Done" : "Edit"}
142 - </Text>
143 - </Pressable>
140 + />
141 ) : undefined
142 }
143 >
apps/mobile/src/features/settings/SettingsMicrophoneRouteScreen.tsx
+5 -8
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollView";
3 import { useAtomSet, useAtomValue } from "@effect/atom-react";
4 import { AsyncResult } from "effect/reactivity";
@@ -166,15 +167,11 @@ export function SettingsMicrophoneRouteScreen() {
167 title="Preferred order"
168 trailing={
169 hasDevices ? (
169 - <Pressable
170 - accessibilityRole="button"
170 + <Button
171 + label={editing ? "Done" : "Edit"}
172 + tone="text"
173 onPress={() => setEditing((value) => !value)}
172 - className="px-2 py-1 active:opacity-70"
173 - >
174 - <Text className="text-sm font-t3-medium text-foreground">
175 - {editing ? "Done" : "Edit"}
176 - </Text>
177 - </Pressable>
174 + />
175 ) : undefined
176 }
177 >
apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx
+5 -9
@@ -1067,9 +1067,9 @@ function WebhookScheduleDetails({
1067 {resolved.note !== null ? (
1068 <Text className="text-sm text-foreground-muted">{resolved.note}</Text>
1069 ) : null}
1070 - <Pressable
1071 - accessibilityRole="button"
1072 - accessibilityState={{ disabled: disabled || rotating }}
1070 + <Button
1071 + label={rotating ? "Rotating…" : "Rotate URL"}
1072 + tone="danger"
1073 disabled={disabled || rotating}
1074 onPress={() =>
1075 Dialog.alert("Rotate URL?", "The current URL stops working immediately.", [
@@ -1092,12 +1092,8 @@ function WebhookScheduleDetails({
1092 },
1093 ])
1094 }
1095 - className="min-h-11 justify-center active:opacity-70 disabled:opacity-50"
1096 - >
1097 - <Text className="text-base text-danger-foreground">
1098 - {rotating ? "Rotating…" : "Rotate URL"}
1099 - </Text>
1100 - </Pressable>
1095 + loading={rotating}
1096 + />
1097 </>
1098 )}
1099 {signatureConfigured ? (
apps/mobile/src/features/settings/SettingsThreadsRouteScreen.tsx
+6 -9
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import { AuthSettingsWriteScope } from "@t3tools/contracts";
3 import { readEnvironmentScope, useEnvironmentsWithScope } from "../../state/session";
4 import { AutoSettleDaysField } from "./components/AutoSettleDaysField";
@@ -5,7 +6,7 @@ import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScroll
6 import { useAtomSet, useAtomValue } from "@effect/atom-react";
7 import { AsyncResult } from "effect/reactivity";
8 import { useRef, useState } from "react";
8 -import { Pressable, View } from "react-native";
9 +import { View } from "react-native";
10 import { useSafeAreaInsets } from "react-native-safe-area-context";
11
12 import { DEFAULT_SERVER_SETTINGS } from "@t3tools/contracts";
@@ -228,16 +229,12 @@ function AutoSettleSettingsRows() {
229 <Text className="text-sm text-foreground-muted">
230 {mismatches.map((mismatch) => mismatch.label).join(", ")}
231 </Text>
231 - <Pressable
232 - accessibilityRole="button"
232 + <Button
233 + label="Apply auto-settle defaults"
234 + tone="secondary"
235 disabled={disabled}
236 onPress={() => writeToAll(autoSettlePatch)}
235 - className="self-start rounded-full bg-subtle px-4 py-2 active:opacity-70"
236 - >
237 - <Text className="text-sm font-t3-medium text-foreground">
238 - Apply auto-settle defaults
239 - </Text>
240 - </Pressable>
237 + />
238 </View>
239 </SettingsSection>
240 ) : null}
apps/mobile/src/features/threads/NewTaskRouteScreen.tsx
+18 -23
@@ -400,33 +400,28 @@ export function NewTaskRouteScreen({ route }: StaticScreenProps<NewTaskRoutePara
400 ) : null}
401 </>
402 ) : !catalogState.hasReadyEnvironment ? (
403 - <Pressable
404 - className="mt-1 rounded-full bg-primary px-4 py-2.5 active:opacity-70"
405 - onPress={() => navigation.navigate("ConnectionsNew")}
406 - >
407 - <Text className="text-sm font-t3-bold text-primary-foreground">
408 - Add environment
409 - </Text>
410 - </Pressable>
403 + <View className="mt-1">
404 + <Button
405 + label="Add environment"
406 + tone="primary"
407 + onPress={() => navigation.navigate("ConnectionsNew")}
408 + />
409 + </View>
410 ) : (
411 <>
413 - <Pressable
414 - className="mt-1 rounded-full bg-primary px-4 py-2.5 active:opacity-70"
415 - onPress={() => navigation.dispatch(StackActions.push("AddProject"))}
416 - >
417 - <Text className="text-sm font-t3-bold text-primary-foreground">
418 - Add new project
419 - </Text>
420 - </Pressable>
412 + <View className="mt-1">
413 + <Button
414 + label="Add new project"
415 + tone="primary"
416 + onPress={() => navigation.dispatch(StackActions.push("AddProject"))}
417 + />
418 + </View>
419 {canStartScratch ? (
422 - <Pressable
423 - className="rounded-full bg-subtle px-4 py-2.5 active:opacity-70"
420 + <Button
421 + label="Start without a project"
422 + tone="secondary"
423 onPress={() => void startScratch()}
425 - >
426 - <Text className="text-sm font-t3-bold text-foreground">
427 - Start without a project
428 - </Text>
429 - </Pressable>
424 + />
425 ) : null}
426 </>
427 )}