The best way to control Claude Code, Codex and more from any computer or phone
refactor(mobile): settings use web's pages and groups (#25686)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 26, 2026 at 17:18 UTC
9bc0c334383a43af5390283e9b10f999acc021b8
22 files changed
+342
-289
apps/mobile/src/Stack.tsx
+27
-16
@@ -97,9 +97,9 @@ import { SettingsEnvironmentDetailRouteScreen } from "./features/settings/Settin
97
import { SettingsEnvironmentsRouteScreen } from "./features/settings/SettingsEnvironmentsRouteScreen";
98
import { SettingsFollowUpRouteScreen } from "./features/settings/SettingsFollowUpRouteScreen";
99
import {
100
- SettingsEnvironmentAgentBehaviorRouteScreen,
100
SettingsEnvironmentMaintenanceRouteScreen,
102
- SettingsEnvironmentNewThreadsRouteScreen,
101
+ SettingsThreadsRouteScreen,
102
+ SettingsWorktreesRouteScreen,
103
SettingsEnvironmentSourceControlRouteScreen,
104
} from "./features/settings/SettingsServerControlsRouteScreen";
105
import {
@@ -125,7 +125,7 @@ import { UsageRouteScreen } from "./features/usage/UsageRouteScreen";
125
import { SettingsAboutRouteScreen } from "./features/settings/SettingsAboutRouteScreen";
126
import { SettingsNotificationsRouteScreen } from "./features/settings/SettingsNotificationsRouteScreen";
127
import { SettingsRouteScreen } from "./features/settings/SettingsRouteScreen";
128
-import { SettingsThreadsRouteScreen } from "./features/settings/SettingsThreadsRouteScreen";
128
+import { SettingsLabsRouteScreen } from "./features/settings/ThreadSettingsSections";
129
import { SettingsEnvironmentFilterProvider } from "./features/settings/settings-environment-filter";
130
import { openSettings, settingsOpenIn } from "./features/settings/settings-navigation";
131
import { DEFAULT_SETTINGS_PAGE } from "./features/workspace/workspace-tab-navigation";
@@ -261,10 +261,11 @@ const SETTINGS_SCREENS = {
261
linking: "settings/environments/:environmentId",
262
options: { ...SETTINGS_PAGE_OPTIONS, title: "Environment" },
263
}),
264
+ // Old links to New threads and Agent behavior open Threads, which absorbed them.
265
SettingsEnvironmentNewThreads: createNativeStackScreen({
265
- screen: SettingsEnvironmentNewThreadsRouteScreen,
266
+ screen: SettingsThreadsRouteScreen,
267
linking: "settings/new-threads",
267
- options: { ...SETTINGS_PAGE_OPTIONS, title: "New threads" },
268
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Threads" },
269
}),
270
SettingsEnvironmentSourceControl: createNativeStackScreen({
271
screen: SettingsEnvironmentSourceControlRouteScreen,
@@ -272,14 +273,24 @@ const SETTINGS_SCREENS = {
273
options: { ...SETTINGS_PAGE_OPTIONS, title: "Source control" },
274
}),
275
SettingsEnvironmentAgentBehavior: createNativeStackScreen({
275
- screen: SettingsEnvironmentAgentBehaviorRouteScreen,
276
+ screen: SettingsThreadsRouteScreen,
277
linking: "settings/agent-behavior",
277
- options: { ...SETTINGS_PAGE_OPTIONS, title: "Agent behavior" },
278
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Threads" },
279
+ }),
280
+ SettingsWorktrees: createNativeStackScreen({
281
+ screen: SettingsWorktreesRouteScreen,
282
+ linking: "settings/worktrees",
283
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Worktrees" },
284
+ }),
285
+ SettingsLabs: createNativeStackScreen({
286
+ screen: SettingsLabsRouteScreen,
287
+ linking: "settings/labs",
288
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Labs" },
289
}),
290
SettingsProviderAccounts: createNativeStackScreen({
291
screen: SettingsProviderAccountsRouteScreen,
292
linking: "settings/provider-accounts",
282
- options: { ...SETTINGS_PAGE_OPTIONS, title: "Provider accounts" },
293
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Providers" },
294
}),
295
SettingsEnvironmentMaintenance: createNativeStackScreen({
296
screen: SettingsEnvironmentMaintenanceRouteScreen,
@@ -294,12 +305,12 @@ const SETTINGS_SCREENS = {
305
SettingsThreads: createNativeStackScreen({
306
screen: SettingsThreadsRouteScreen,
307
linking: "settings/thread-preferences",
297
- options: { ...SETTINGS_PAGE_OPTIONS, title: "Thread behavior" },
308
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Threads" },
309
}),
310
SettingsAbout: createNativeStackScreen({
311
screen: SettingsAboutRouteScreen,
312
linking: "settings/about",
302
- options: { ...SETTINGS_PAGE_OPTIONS, title: "About T3 Code" },
313
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "About" },
314
}),
315
SettingsEnvironmentNew: createNativeStackScreen({
316
screen: ConnectionsNewRouteScreen,
@@ -314,7 +325,7 @@ const SETTINGS_SCREENS = {
325
linking: "settings/archive",
326
options: {
327
...SETTINGS_PAGE_OPTIONS,
317
- title: "Archived Threads",
328
+ title: "Archive",
329
},
330
}),
331
SettingsNavigation: createNativeStackScreen({
@@ -335,7 +346,7 @@ const SETTINGS_SCREENS = {
346
linking: "settings/project-grouping",
347
options: {
348
...SETTINGS_PAGE_OPTIONS,
338
- title: "Organization",
349
+ title: "General",
350
},
351
}),
352
SettingsOrganization: createNativeStackScreen({
@@ -343,13 +354,13 @@ const SETTINGS_SCREENS = {
354
linking: "settings/organization",
355
options: {
356
...SETTINGS_PAGE_OPTIONS,
346
- title: "Organization",
357
+ title: "General",
358
},
359
}),
360
SettingsProjectOverview: createNativeStackScreen({
361
screen: SettingsProjectOverviewRouteScreen,
362
linking: "settings/project",
352
- options: { ...SETTINGS_PAGE_OPTIONS, title: "Project overview" },
363
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Projects" },
364
}),
365
SettingsKeyboard: createNativeStackScreen({
366
screen: SettingsKeyboardRouteScreen,
@@ -372,7 +383,7 @@ const SETTINGS_SCREENS = {
383
linking: "settings/follow-ups",
384
options: {
385
...SETTINGS_PAGE_OPTIONS,
375
- title: "Follow-ups",
386
+ title: "Chat",
387
},
388
}),
389
SettingsScheduledTasks: createNativeStackScreen({
@@ -380,7 +391,7 @@ const SETTINGS_SCREENS = {
391
linking: "settings/scheduled-tasks",
392
options: {
393
...SETTINGS_PAGE_OPTIONS,
383
- title: "Scheduled Tasks",
394
+ title: "Scheduled tasks",
395
headerTitleStyle: { fontSize: 16, fontWeight: "800" },
396
},
397
}),
apps/mobile/src/components/ui/ListChoiceRow.tsx
+2
-4
@@ -26,10 +26,8 @@ export function ListChoiceRow(props: {
26
onPress={props.onPress}
27
android_ripple={{ color: rippleStyle.backgroundColor }}
28
unstable_pressDelay={Platform.OS === "android" ? 50 : undefined}
29
- className={cn(
30
- props.selected ? "bg-subtle" : "bg-grouped-card",
31
- props.separated && "border-t border-border-subtle",
32
- )}
29
+ // Like UIKit and Material lists, only the checkmark or radio marks the selected row.
30
+ className={cn("bg-grouped-card", props.separated && "border-t border-border-subtle")}
31
>
32
<ListRowLayout
33
label={props.label}
apps/mobile/src/features/settings/SettingsAboutRouteScreen.tsx
+1
-1
@@ -23,7 +23,7 @@ export function SettingsAboutRouteScreen() {
23
const insets = useSafeAreaInsets();
24
25
return (
26
- <SettingsScreen title="About T3 Code">
26
+ <SettingsScreen title="About">
27
<ScrollView
28
contentInsetAdjustmentBehavior="automatic"
29
showsVerticalScrollIndicator={false}
apps/mobile/src/features/settings/SettingsFollowUpRouteScreen.tsx
+1
-1
@@ -45,7 +45,7 @@ export function SettingsFollowUpRouteScreen() {
45
{Platform.OS === "android" ? (
46
<>
47
<NativeStackScreenOptions options={{ headerShown: false }} />
48
- <AndroidScreenHeader title="Follow-ups" onBack={() => navigation.goBack()} />
48
+ <AndroidScreenHeader title="Chat" onBack={() => navigation.goBack()} />
49
</>
50
) : null}
51
<ScrollView
apps/mobile/src/features/settings/SettingsMicrophoneRouteScreen.tsx
+11
-19
@@ -19,6 +19,7 @@ import {
19
microphoneOrder,
20
} from "../../lib/microphonePriority";
21
import { mobilePreferencesAtom, updateMobilePreferencesAtom } from "../../state/preferences";
22
+import { ListRowLayout } from "../../components/ui/ListRowLayout";
23
import { SettingsActionRow } from "./components/SettingsActionRow";
24
import { SettingsDragHandle } from "./components/SettingsDragHandle";
25
import { SettingsSection } from "./components/SettingsSection";
@@ -252,10 +253,9 @@ function MicrophoneRow(props: {
253
style={style}
254
onLayout={(event) => props.onHeight(event.nativeEvent.layout.height)}
255
className={cn(
255
- "flex-row items-center gap-4 pl-4",
256
+ "flex-row items-center",
257
props.position > 1 && !lifted && "border-t border-border-subtle",
258
lifted && "bg-grouped-card shadow-md",
258
- !props.reorderable && "pr-4",
259
)}
260
>
261
{props.editing && props.onForget ? (
@@ -264,7 +264,7 @@ function MicrophoneRow(props: {
264
accessibilityLabel={`Forget ${title}`}
265
hitSlop={8}
266
onPress={props.onForget}
267
- className="active:opacity-70"
267
+ className="pl-4 active:opacity-70"
268
>
269
<SymbolView
270
name="xmark.circle.fill"
@@ -274,28 +274,20 @@ function MicrophoneRow(props: {
274
/>
275
</Pressable>
276
) : props.editing ? (
277
- <View style={{ width: REMOVE_SIZE }} />
277
+ <View className="pl-4">
278
+ <View style={{ width: REMOVE_SIZE }} />
279
+ </View>
280
) : null}
281
<View
282
accessible
283
accessibilityLabel={`${title}, ${kind.label}, ${props.position} of ${props.count}`}
282
- className="min-w-0 flex-1 flex-row items-center gap-4 py-4"
284
+ className="min-w-0 flex-1"
285
>
284
- <SymbolView
285
- name={kind.icon}
286
- size={22}
287
- tintColorClassName="accent-icon"
288
- type="monochrome"
289
- weight="regular"
286
+ <ListRowLayout
287
+ icon={kind.icon}
288
+ label={title}
289
+ description={isMicrophoneDevice(entry) ? kind.label : kind.rowDescription}
290
/>
291
- <View className="min-w-0 flex-1 gap-0.5">
292
- <Text numberOfLines={1} className="text-lg text-foreground">
293
- {title}
294
- </Text>
295
- <Text numberOfLines={1} className="text-sm text-foreground-muted">
296
- {isMicrophoneDevice(entry) ? kind.label : kind.rowDescription}
297
- </Text>
298
- </View>
291
</View>
292
{props.reorderable ? (
293
<SettingsDragHandle
apps/mobile/src/features/settings/SettingsProjectGroupingRouteScreen.tsx
+3
-1
@@ -12,6 +12,7 @@ import {
12
import { mobilePreferencesAtom, updateMobilePreferencesAtom } from "../../state/preferences";
13
import { SettingsChoiceRow } from "./components/SettingsChoiceRow";
14
import { SettingsSection } from "./components/SettingsSection";
15
+import { WorkingSectionSettings } from "./ThreadSettingsSections";
16
17
const GROUPING_OPTIONS: ReadonlyArray<{
18
readonly mode: SidebarProjectGroupingMode;
@@ -45,7 +46,7 @@ export function SettingsProjectGroupingRouteScreen() {
46
: null;
47
48
return (
48
- <SettingsScreen title="Organization">
49
+ <SettingsScreen title="General">
50
<ScrollView
51
contentInsetAdjustmentBehavior="automatic"
52
showsVerticalScrollIndicator={false}
@@ -66,6 +67,7 @@ export function SettingsProjectGroupingRouteScreen() {
67
/>
68
))}
69
</SettingsSection>
70
+ <WorkingSectionSettings />
71
</ScrollView>
72
</SettingsScreen>
73
);
apps/mobile/src/features/settings/SettingsProjectOverviewRouteScreen.tsx
+6
-2
@@ -83,7 +83,7 @@ export function SettingsProjectOverviewRouteScreen() {
83
return (
84
<>
85
<SettingsEnvironmentFilterHeader />
86
- <SettingsScreen title="Project overview" trailing={<AndroidSettingsEnvironmentFilter />}>
86
+ <SettingsScreen title="Projects" trailing={<AndroidSettingsEnvironmentFilter />}>
87
<ScrollView
88
contentInsetAdjustmentBehavior="automatic"
89
showsVerticalScrollIndicator={false}
@@ -91,7 +91,11 @@ export function SettingsProjectOverviewRouteScreen() {
91
contentContainerClassName="gap-6 px-5 pt-4"
92
contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 18) + 18 }}
93
>
94
- {members.length === 0 ? (
94
+ {selectedProjectKey === null ? (
95
+ <Text className="px-2 text-base text-foreground-muted">
96
+ Choose a project with the filter above to manage its name, checkouts and removal.
97
+ </Text>
98
+ ) : members.length === 0 ? (
99
<Text className="px-2 text-base text-foreground-muted">
100
This project has no checkout on the selected connected environments. Change the filter
101
above.
apps/mobile/src/features/settings/SettingsProviderAccountsRouteScreen.tsx
+1
-1
@@ -38,7 +38,7 @@ export function SettingsProviderAccountsRouteScreen() {
38
return (
39
<>
40
<SettingsEnvironmentFilterHeader />
41
- <SettingsScreen title="Provider accounts" trailing={<AndroidSettingsEnvironmentFilter />}>
41
+ <SettingsScreen title="Providers" trailing={<AndroidSettingsEnvironmentFilter />}>
42
<ScreenScrollView
43
className="flex-1"
44
contentInsetAdjustmentBehavior="automatic"
apps/mobile/src/features/settings/SettingsRouteScreen.tsx
+23
-22
@@ -185,8 +185,8 @@ function SettingsList(props: { readonly connections: readonly SettingsListRow[]
185
}}
186
>
187
{sections.length ? (
188
- sections.map((section) => (
189
- <SettingsSection key={section.title ?? "tabs"} title={section.title}>
188
+ sections.map((section, index) => (
189
+ <SettingsSection key={section.title ?? `untitled-${index}`} title={section.title}>
190
{section.rows.map(({ id, ...row }) => (
191
<SettingsRow key={id} {...row} />
192
))}
@@ -229,11 +229,13 @@ function useSettingsIndexSections(): SettingsListSection[] {
229
): SettingsListRow => ({ id: target, icon, label, target, ...extra });
230
const serverPage = (target: SettingsPageTarget, icon: SettingsListRow["icon"], label: string) =>
231
page(target, icon, label, { disabled: noServerTargets });
232
+ // The same pages and groups as Settings on web, minus what mobile has no setting for.
233
return [
234
{
234
- title: "Interface",
235
rows: [
236
+ page("SettingsOrganization", "gearshape", "General"),
237
page("SettingsAppearance", "paintbrush", "Appearance"),
238
+ page("SettingsFollowUp", "bubble.left.and.bubble.right", "Chat"),
239
...(navigationCustomizationAvailable()
240
? [page("SettingsNavigation", "line.3.horizontal", "Navigation tabs")]
241
: []),
@@ -246,34 +248,33 @@ function useSettingsIndexSections(): SettingsListSection[] {
248
],
249
},
250
{
249
- title: "Automations",
250
- rows: [page("SettingsScheduledTasks", "clock", "Scheduled tasks")],
251
- },
252
- {
253
- title: "Projects & threads",
251
+ title: "Agents",
252
rows: [
255
- ...(selectedProjectKey !== null
256
- ? [page("SettingsProjectOverview", "folder", "Overview", { value: projectLabel })]
257
- : []),
258
- page("SettingsOrganization", "folder", "Organization"),
259
- page("SettingsThreads", "text.bubble", "Thread behavior"),
260
- page("SettingsFollowUp", "arrow.turn.left.up", "Follow-ups"),
261
- page("SettingsArchive", "archivebox", "Archived Threads"),
253
+ serverPage("SettingsProviderAccounts", "person.crop.circle", "Providers"),
254
+ serverPage("SettingsThreads", "text.bubble", "Threads"),
255
+ page("SettingsScheduledTasks", "clock", "Scheduled tasks"),
256
],
257
},
258
{
265
- title: "Server settings",
259
+ title: "Code",
260
rows: [
267
- serverPage("SettingsProviderAccounts", "person.crop.circle", "Provider accounts"),
268
- serverPage("SettingsEnvironmentNewThreads", "text.bubble", "New threads"),
261
+ page(
262
+ "SettingsProjectOverview",
263
+ "folder",
264
+ "Projects",
265
+ selectedProjectKey !== null ? { value: projectLabel } : undefined,
266
+ ),
267
serverPage("SettingsEnvironmentSourceControl", "arrow.triangle.branch", "Source control"),
270
- serverPage("SettingsEnvironmentAgentBehavior", "text.alignleft", "Agent behavior"),
271
- serverPage("SettingsEnvironmentMaintenance", "arrow.clockwise", "Maintenance"),
268
+ serverPage("SettingsWorktrees", "square.on.square", "Worktrees"),
269
],
270
},
271
{
275
- title: "App",
276
- rows: [page("SettingsAbout", "info.circle", "About T3 Code")],
272
+ rows: [
273
+ serverPage("SettingsEnvironmentMaintenance", "arrow.clockwise", "Maintenance"),
274
+ page("SettingsLabs", "sparkles", "Labs"),
275
+ page("SettingsAbout", "info.circle", "About"),
276
+ page("SettingsArchive", "archivebox", "Archive"),
277
+ ],
278
},
279
];
280
}
apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx
+37
-14
@@ -186,7 +186,11 @@ function SelectRow(props: {
186
const value = (
187
<View className="min-w-0 flex-1 flex-row items-center justify-end gap-2">
188
{props.valueIcon}
189
- <Text className="shrink text-right text-base text-foreground-muted" numberOfLines={1}>
189
+ <Text
190
+ textRole="footnote"
191
+ className="shrink text-right text-foreground-muted"
192
+ numberOfLines={1}
193
+ >
194
{props.value}
195
</Text>
196
</View>
@@ -200,7 +204,9 @@ function SelectRow(props: {
204
: "min-h-14 flex-row items-center gap-3 px-4 py-3"
205
}
206
>
203
- <Text className="text-lg text-foreground">{props.label}</Text>
207
+ <Text textRole="body" className="text-foreground">
208
+ {props.label}
209
+ </Text>
210
{value}
211
</View>
212
);
@@ -219,7 +225,9 @@ function SelectRow(props: {
225
: "min-h-14 flex-row items-center gap-3 px-4 py-3 active:opacity-70"
226
}
227
>
222
- <Text className="text-lg text-foreground">{props.label}</Text>
228
+ <Text textRole="body" className="text-foreground">
229
+ {props.label}
230
+ </Text>
231
{value}
232
<SymbolView
233
name="chevron.down"
@@ -296,7 +304,9 @@ function WebhookFilterRows(props: {
304
onPress={() => props.onChange([...props.filters, emptyWebhookFilterDraft()])}
305
className="min-h-14 flex-row items-center gap-3 border-t border-border-subtle px-4 py-3 active:opacity-70"
306
>
299
- <Text className="min-w-0 flex-1 text-lg text-foreground">Add filter</Text>
307
+ <Text textRole="body" className="min-w-0 flex-1 text-foreground">
308
+ Add filter
309
+ </Text>
310
<SymbolView name="plus" size={16} tintColorClassName="accent-icon" />
311
</Pressable>
312
) : null}
@@ -330,8 +340,14 @@ function PickerRow(props: {
340
: "min-h-14 flex-row items-center gap-3 px-4 py-3 active:opacity-70 disabled:opacity-50"
341
}
342
>
333
- <Text className="text-lg text-foreground">{props.label}</Text>
334
- <Text className="min-w-0 flex-1 text-right text-base text-foreground-muted" numberOfLines={1}>
343
+ <Text textRole="body" className="text-foreground">
344
+ {props.label}
345
+ </Text>
346
+ <Text
347
+ textRole="footnote"
348
+ className="min-w-0 flex-1 text-right text-foreground-muted"
349
+ numberOfLines={1}
350
+ >
351
{props.value}
352
</Text>
353
<SymbolView
@@ -389,7 +405,7 @@ export function SettingsScheduledTasksRouteScreen() {
405
]}
406
/>
407
<SettingsScreen
392
- title="Scheduled Tasks"
408
+ title="Scheduled tasks"
409
trailing={
410
<View className="flex-row items-center">
411
<AndroidSettingsEnvironmentFilter />
@@ -962,8 +978,13 @@ function TaskForm({
978
onPress={() => setTimePickerOpen((open) => !open)}
979
className="min-h-14 flex-row items-center gap-3 border-t border-border-subtle px-4 py-3 active:opacity-70"
980
>
965
- <Text className="text-lg text-foreground">Time</Text>
966
- <Text className="min-w-0 flex-1 text-right text-base text-foreground-muted">
981
+ <Text textRole="body" className="text-foreground">
982
+ Time
983
+ </Text>
984
+ <Text
985
+ textRole="footnote"
986
+ className="min-w-0 flex-1 text-right text-foreground-muted"
987
+ >
988
{formatTime(draft.schedule.timeOfDay)}
989
</Text>
990
<SymbolView
@@ -1119,7 +1140,9 @@ function TaskForm({
1140
</>
1141
)}
1142
<View className="min-h-14 flex-row items-center gap-3 border-t border-border-subtle px-4 py-3">
1122
- <Text className="min-w-0 flex-1 text-lg text-foreground">Enabled</Text>
1143
+ <Text textRole="body" className="min-w-0 flex-1 text-foreground">
1144
+ Enabled
1145
+ </Text>
1146
<ThemedSwitch
1147
accessibilityLabel="Task enabled"
1148
value={draft.enabled}
@@ -1185,7 +1208,7 @@ function WebhookScheduleDetails({
1208
onPress={() => void tryCopyTextWithHaptic(resolved.address)}
1209
className="gap-1 active:opacity-70"
1210
>
1188
- <Text className="text-lg text-foreground">
1211
+ <Text textRole="body" className="text-foreground">
1212
{resolved.copyable ? "Webhook URL" : "Webhook path"}
1213
</Text>
1214
<Text className="text-sm text-foreground-muted" numberOfLines={2} selectable>
@@ -1310,8 +1333,8 @@ function EnvironmentTasks({
1333
key={task.id}
1334
className={
1335
index === 0
1313
- ? "flex-row items-start gap-1 px-4 py-4"
1314
- : "flex-row items-start gap-1 border-t border-border-subtle px-4 py-4"
1336
+ ? "flex-row items-start gap-1 px-4 py-3"
1337
+ : "flex-row items-start gap-1 border-t border-border-subtle px-4 py-3"
1338
}
1339
>
1340
<Pressable
@@ -1322,7 +1345,7 @@ function EnvironmentTasks({
1345
}}
1346
className="min-w-0 flex-1 gap-1 active:opacity-70"
1347
>
1325
- <Text className="text-lg font-t3-medium text-foreground" numberOfLines={1}>
1348
+ <Text textRole="body" className="text-foreground" numberOfLines={1}>
1349
{task.title}
1350
</Text>
1351
<Text className="text-sm text-foreground-muted" numberOfLines={2}>
apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.test.tsx
+45
-3
@@ -12,6 +12,7 @@ const { Children, mocks } = vi.hoisted(() => ({
12
updateSettings: vi.fn(),
13
alert: vi.fn(),
14
targets: [] as ReturnType<typeof environment>[],
15
+ readOnly: new Set<string>(),
16
projectSelected: false,
17
},
18
}));
@@ -48,7 +49,12 @@ vi.mock("react-native-safe-area-context", () => ({ useSafeAreaInsets: () => ({ b
49
vi.mock("@react-navigation/native", () => ({ useNavigation: () => ({}) }));
50
vi.mock("../../state/session", () => ({
51
readEnvironmentScope: () => true,
51
- useEnvironmentsWithScope: () => new Set(mocks.targets.map((target) => target.environmentId)),
52
+ useEnvironmentsWithScope: () =>
53
+ new Set(
54
+ mocks.targets
55
+ .map((target) => target.environmentId)
56
+ .filter((environmentId) => !mocks.readOnly.has(environmentId)),
57
+ ),
58
}));
59
vi.mock("../../state/server", () => ({ serverEnvironment: { updateSettings: {} } }));
60
vi.mock("../../state/use-atom-command", () => ({
@@ -125,7 +131,10 @@ vi.mock("./settings-environment-filter", () => ({
131
}),
132
}));
133
128
-import { SettingsEnvironmentSourceControlRouteScreen } from "./SettingsServerControlsRouteScreen";
134
+import {
135
+ SettingsThreadsRouteScreen,
136
+ SettingsWorktreesRouteScreen,
137
+} from "./SettingsServerControlsRouteScreen";
138
139
function environment(environmentId: string, label: string) {
140
return {
@@ -154,6 +163,7 @@ beforeEach(() => {
163
root = createRoot(container);
164
mocks.targets = [environment("local", "Local")];
165
mocks.projectSelected = false;
166
+ mocks.readOnly = new Set();
167
mocks.alert.mockReset();
168
mocks.updateSettings.mockReset();
169
mocks.updateSettings.mockResolvedValue(AsyncResult.success(undefined));
@@ -167,7 +177,7 @@ describe("SettingsServerControlsRouteScreen", () => {
177
it("sends a draft saved during a pending write once that write settles", async () => {
178
const pending = Promise.withResolvers<AsyncResult.Success<void>>();
179
mocks.updateSettings.mockReturnValueOnce(pending.promise);
170
- act(() => root.render(<SettingsEnvironmentSourceControlRouteScreen />));
180
+ act(() => root.render(<SettingsWorktreesRouteScreen />));
181
182
act(() => mocks.branchNaming.onChange({ branchNamingMode: "custom" }));
183
act(() => mocks.branchNaming.onChange({ branchNameInstructions: "Use issue IDs." }));
@@ -183,4 +193,36 @@ describe("SettingsServerControlsRouteScreen", () => {
193
},
194
});
195
});
196
+
197
+ it("holds auto-settle changes until a pending project override write settles", async () => {
198
+ mocks.projectSelected = true;
199
+ const pending = Promise.withResolvers<AsyncResult.Success<void>>();
200
+ mocks.updateSettings.mockReturnValueOnce(pending.promise);
201
+ act(() => root.render(<SettingsThreadsRouteScreen />));
202
+ const toggle = (label: string) =>
203
+ [...container.querySelectorAll<HTMLButtonElement>('[role="switch"]')].find(
204
+ (button) => button.textContent === label,
205
+ )!;
206
+
207
+ act(() => toggle("Agent browser access").click());
208
+ act(() => toggle("Auto-settle merged threads").click());
209
+
210
+ // Both rewrite the whole project override, so a second write planned now would drop the first.
211
+ expect(mocks.updateSettings).toHaveBeenCalledOnce();
212
+ await act(async () => pending.resolve(AsyncResult.success(undefined)));
213
+ });
214
+
215
+ it("disables auto-settle when a selected environment cannot save settings", () => {
216
+ const remote = environment("remote", "Remote");
217
+ // Auto-settle rows skip a server without auto-settlement, but the page still saves to it.
218
+ remote.serverConfig.environment.capabilities.threadAutoSettlement = false;
219
+ mocks.targets = [environment("local", "Local"), remote];
220
+ mocks.readOnly = new Set(["remote"]);
221
+ act(() => root.render(<SettingsThreadsRouteScreen />));
222
+
223
+ const autoSettle = [...container.querySelectorAll<HTMLButtonElement>('[role="switch"]')].find(
224
+ (button) => button.textContent === "Auto-settle merged threads",
225
+ )!;
226
+ expect(autoSettle.disabled).toBe(true);
227
+ });
228
});
apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.tsx
+98
-63
@@ -39,27 +39,35 @@ import {
39
type ScopedMobileSettingsTarget,
40
} from "./settings-scoped-server";
41
import { PullRequestGlyph } from "../pull-requests/pullRequestGlyphs";
42
+import { AutoSettleSettingsRows } from "./ThreadSettingsSections";
43
+import { supportsSharedSettingsSync } from "@t3tools/client-runtime/state/shared-settings";
44
43
-type SettingsPage = "new-threads" | "source-control" | "agent-behavior" | "maintenance";
45
+type SettingsPage = "threads" | "source-control" | "worktrees" | "maintenance";
46
47
const PAGE_TITLES: Record<SettingsPage, string> = {
46
- "new-threads": "New threads",
48
+ threads: "Threads",
49
"source-control": "Source control",
48
- "agent-behavior": "Agent behavior",
50
+ worktrees: "Worktrees",
51
maintenance: "Maintenance",
52
};
53
54
const PAGE_PROJECT_KEYS: Record<SettingsPage, readonly ProjectScopedServerSettingKey[]> = {
53
- "new-threads": ["defaultThreadEnvMode", "worktreeSubmodules", "defaultRuntimeMode"],
54
- "source-control": [
55
- "defaultAutoPull",
56
- "removeAgentCreditsOnMerge",
55
+ threads: [
56
+ "defaultThreadEnvMode",
57
+ "defaultRuntimeMode",
58
+ "responseStreamingMode",
59
+ "enableAgentBrowserAccess",
60
+ "sidebarAutoSettleOnMerge",
61
+ "sidebarAutoSettleAfterDays",
62
+ ],
63
+ "source-control": ["defaultAutoPull", "removeAgentCreditsOnMerge"],
64
+ worktrees: [
65
"newWorktreesStartFromOrigin",
66
+ "worktreeSubmodules",
67
"branchNamingMode",
68
"branchNamePrefix",
69
"branchNameInstructions",
70
],
62
- "agent-behavior": ["responseStreamingMode", "enableAgentBrowserAccess"],
71
maintenance: ["continueThreadsAfterServerUpdate"],
72
};
73
@@ -121,16 +129,42 @@ const STREAMING_CHOICES: ReadonlyArray<{
129
},
130
];
131
124
-export function SettingsEnvironmentNewThreadsRouteScreen() {
125
- return <ServerSettingsDetail page="new-threads" />;
132
+// Only servers with thread auto-settlement store these, so other targets get the rest of a patch.
133
+const AUTO_SETTLE_SETTING_KEYS: ReadonlySet<string> = new Set([
134
+ "sidebarAutoSettleOnMerge",
135
+ "sidebarAutoSettleAfterDays",
136
+ "autoResumeLimitedThreads",
137
+ "snoozeLimitedThreads",
138
+]);
139
+
140
+function planServerSettingsWrites(
141
+ targets: readonly ScopedMobileSettingsTarget[],
142
+ projectSelected: boolean,
143
+ patch: ServerSettingsPatch,
144
+) {
145
+ const capable = targets.filter((target) => supportsSharedSettingsSync(target.environment));
146
+ const others = targets.filter((target) => !supportsSharedSettingsSync(target.environment));
147
+ const othersPatch = Object.fromEntries(
148
+ Object.entries(patch).filter(([key]) => !AUTO_SETTLE_SETTING_KEYS.has(key)),
149
+ ) as ServerSettingsPatch;
150
+ return [
151
+ ...planMobileScopedSettingsPatch(capable, projectSelected, patch),
152
+ ...(Object.keys(othersPatch).length > 0
153
+ ? planMobileScopedSettingsPatch(others, projectSelected, othersPatch)
154
+ : []),
155
+ ];
156
+}
157
+
158
+export function SettingsThreadsRouteScreen() {
159
+ return <ServerSettingsDetail page="threads" />;
160
}
161
162
export function SettingsEnvironmentSourceControlRouteScreen() {
163
return <ServerSettingsDetail page="source-control" />;
164
}
165
132
-export function SettingsEnvironmentAgentBehaviorRouteScreen() {
133
- return <ServerSettingsDetail page="agent-behavior" />;
166
+export function SettingsWorktreesRouteScreen() {
167
+ return <ServerSettingsDetail page="worktrees" />;
168
}
169
170
export function SettingsEnvironmentMaintenanceRouteScreen() {
@@ -187,7 +221,7 @@ function ServerSettingsDetail(props: { readonly page: SettingsPage }) {
221
)
222
)
223
return;
190
- const writes = planMobileScopedSettingsPatch(targets, projectSelected, patch);
224
+ const writes = planServerSettingsWrites(targets, projectSelected, patch);
225
if (writes.length === 0) return;
226
writeInFlight.current = true;
227
setPendingTargets(targets);
@@ -278,7 +312,7 @@ function ServerSettingsDetail(props: { readonly page: SettingsPage }) {
312
onClear={clearProjectOverrides}
313
/>
314
) : null}
281
- {props.page === "new-threads" ? (
315
+ {props.page === "threads" ? (
316
<>
317
<SettingsSection
318
title="Default workspace"
@@ -306,63 +340,61 @@ function ServerSettingsDetail(props: { readonly page: SettingsPage }) {
340
))}
341
</SettingsSection>
342
<SettingsSection
309
- title="Worktree submodules"
343
+ title="Default permissions"
344
trailing={
311
- pendingWrites === 0 && isMixed("worktreeSubmodules") ? (
345
+ pendingWrites === 0 && uniform("defaultRuntimeMode") === null ? (
346
<MixedValuesLabel projectSelected={projectSelected} />
347
) : null
348
}
349
>
316
- {SUBMODULE_CHOICES.filter(
317
- (choice) => choice.mode !== null || !projectSelected,
318
- ).map((choice, index) => (
350
+ {RUNTIME_MODE_CHOICES.map((choice, index) => (
351
<SettingsChoiceRow
320
- key={choice.mode ?? "inherit"}
352
+ key={choice.mode}
353
label={choice.label}
354
description={choice.description}
323
- selected={
324
- !isMixed("worktreeSubmodules") &&
325
- uniform("worktreeSubmodules") === choice.mode
326
- }
355
+ selected={uniform("defaultRuntimeMode") === choice.mode}
356
separated={index > 0}
328
- disabled={disabledFor("worktreeSubmodules")}
329
- onPress={() => write({ worktreeSubmodules: choice.mode })}
357
+ disabled={disabledFor("defaultRuntimeMode")}
358
+ onPress={() => write({ defaultRuntimeMode: choice.mode })}
359
/>
360
))}
361
</SettingsSection>
362
<SettingsSection
334
- title="Default permissions"
363
+ title="Response streaming"
364
trailing={
336
- pendingWrites === 0 && uniform("defaultRuntimeMode") === null ? (
365
+ pendingWrites === 0 && uniform("responseStreamingMode") === null ? (
366
<MixedValuesLabel projectSelected={projectSelected} />
367
) : null
368
}
369
>
341
- {RUNTIME_MODE_CHOICES.map((choice, index) => (
370
+ {STREAMING_CHOICES.map((choice, index) => (
371
<SettingsChoiceRow
372
key={choice.mode}
373
label={choice.label}
374
description={choice.description}
346
- selected={uniform("defaultRuntimeMode") === choice.mode}
375
+ selected={uniform("responseStreamingMode") === choice.mode}
376
separated={index > 0}
348
- disabled={disabledFor("defaultRuntimeMode")}
349
- onPress={() => write({ defaultRuntimeMode: choice.mode })}
377
+ disabled={disabledFor("responseStreamingMode")}
378
+ onPress={() => write({ responseStreamingMode: choice.mode })}
379
/>
380
))}
381
</SettingsSection>
382
+ <SettingsSection title="Preview browser">
383
+ <SettingsSwitchRow
384
+ icon="globe"
385
+ label="Agent browser access"
386
+ subtitle="Allow agents to use the in-app preview browser."
387
+ value={uniform("enableAgentBrowserAccess")}
388
+ disabled={disabledFor("enableAgentBrowserAccess")}
389
+ onValueChange={(value) => write({ enableAgentBrowserAccess: value })}
390
+ />
391
+ </SettingsSection>
392
+ <AutoSettleSettingsRows write={write} pending={pendingWrites > 0} />
393
</>
394
) : null}
395
396
{props.page === "source-control" ? (
397
<>
358
- <BranchNamingSettings
359
- key={targetsKey}
360
- mode={uniform("branchNamingMode")}
361
- prefix={uniform("branchNamePrefix")}
362
- instructions={uniform("branchNameInstructions")}
363
- disabled={disabledFor("branchNamingMode")}
364
- onChange={write}
365
- />
398
<SettingsSection title="Pull requests">
399
<SettingsSwitchRow
400
icon={PullRequestGlyph.merged}
@@ -383,7 +415,12 @@ function ServerSettingsDetail(props: { readonly page: SettingsPage }) {
415
onValueChange={(value) => write({ defaultAutoPull: value })}
416
/>
417
</SettingsSection>
386
- <SettingsSection title="Worktrees">
418
+ </>
419
+ ) : null}
420
+
421
+ {props.page === "worktrees" ? (
422
+ <>
423
+ <SettingsSection title="New worktrees">
424
<SettingsSwitchRow
425
icon="arrow.triangle.branch"
426
label="Start from remote"
@@ -393,41 +430,39 @@ function ServerSettingsDetail(props: { readonly page: SettingsPage }) {
430
onValueChange={(value) => write({ newWorktreesStartFromOrigin: value })}
431
/>
432
</SettingsSection>
396
- </>
397
- ) : null}
398
-
399
- {props.page === "agent-behavior" ? (
400
- <>
433
<SettingsSection
402
- title="Response streaming"
434
+ title="Worktree submodules"
435
trailing={
404
- pendingWrites === 0 && uniform("responseStreamingMode") === null ? (
436
+ pendingWrites === 0 && isMixed("worktreeSubmodules") ? (
437
<MixedValuesLabel projectSelected={projectSelected} />
438
) : null
439
}
440
>
409
- {STREAMING_CHOICES.map((choice, index) => (
441
+ {SUBMODULE_CHOICES.filter(
442
+ (choice) => choice.mode !== null || !projectSelected,
443
+ ).map((choice, index) => (
444
<SettingsChoiceRow
411
- key={choice.mode}
445
+ key={choice.mode ?? "inherit"}
446
label={choice.label}
447
description={choice.description}
414
- selected={uniform("responseStreamingMode") === choice.mode}
448
+ selected={
449
+ !isMixed("worktreeSubmodules") &&
450
+ uniform("worktreeSubmodules") === choice.mode
451
+ }
452
separated={index > 0}
416
- disabled={disabledFor("responseStreamingMode")}
417
- onPress={() => write({ responseStreamingMode: choice.mode })}
453
+ disabled={disabledFor("worktreeSubmodules")}
454
+ onPress={() => write({ worktreeSubmodules: choice.mode })}
455
/>
456
))}
457
</SettingsSection>
421
- <SettingsSection title="Preview browser">
422
- <SettingsSwitchRow
423
- icon="globe"
424
- label="Agent browser access"
425
- subtitle="Allow agents to use the in-app preview browser."
426
- value={uniform("enableAgentBrowserAccess")}
427
- disabled={disabledFor("enableAgentBrowserAccess")}
428
- onValueChange={(value) => write({ enableAgentBrowserAccess: value })}
429
- />
430
- </SettingsSection>
458
+ <BranchNamingSettings
459
+ key={targetsKey}
460
+ mode={uniform("branchNamingMode")}
461
+ prefix={uniform("branchNamePrefix")}
462
+ instructions={uniform("branchNameInstructions")}
463
+ disabled={disabledFor("branchNamingMode")}
464
+ onChange={write}
465
+ />
466
</>
467
) : null}
468
apps/mobile/src/features/settings/ThreadSettingsSections.tsx
renamed
+40
-112
@@ -1,11 +1,10 @@
1
import { Button } from "../../components/ui/Button";
2
-import { AuthSettingsWriteScope } from "@t3tools/contracts";
3
-import { readEnvironmentScope, useEnvironmentsWithScope } from "../../state/session";
2
+import { AuthSettingsWriteScope, type ServerSettingsPatch } from "@t3tools/contracts";
3
+import { useEnvironmentsWithScope } from "../../state/session";
4
import { AutoSettleDaysField } from "./components/AutoSettleDaysField";
5
import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollView";
6
import { useAtomSet, useAtomValue } from "@effect/atom-react";
7
import { AsyncResult } from "effect/reactivity";
8
-import { useRef, useState } from "react";
8
import { View } from "react-native";
9
import { useSafeAreaInsets } from "react-native-safe-area-context";
10
@@ -14,71 +13,58 @@ import { supportsSharedSettingsSync } from "@t3tools/client-runtime/state/shared
13
import { AppText as Text } from "../../components/ui/AppText";
14
import { mobilePreferencesAtom, updateMobilePreferencesAtom } from "../../state/preferences";
15
import { SettingsSection } from "./components/SettingsSection";
17
-import { SettingsProjectOverridesSection } from "./components/SettingsProjectOverridesSection";
16
import { SettingsSwitchRow } from "./components/SettingsSwitchRow";
17
import { SettingsScreen } from "./components/SettingsScreen";
20
-import {
21
- AndroidSettingsEnvironmentFilter,
22
- SettingsEnvironmentFilterHeader,
23
-} from "./components/SettingsEnvironmentFilterHeader";
18
import { planAutoSettleSettingsSync, type AutoSettleSettings } from "./autoSettleSettingsSync";
19
import { useSettingsEnvironmentFilter } from "./settings-environment-filter";
26
-import { useSettingsWriter } from "./useSettingsWriter";
27
-import {
28
- planMobileScopedSettingsClear,
29
- planMobileScopedSettingsPatch,
30
- resolveMobileSettingsTargets,
31
- uniformMobileSetting,
32
- type ScopedMobileSettingsTarget,
33
-} from "./settings-scoped-server";
20
+import { resolveMobileSettingsTargets, uniformMobileSetting } from "./settings-scoped-server";
21
35
-export function SettingsThreadsRouteScreen() {
22
+export function SettingsLabsRouteScreen() {
23
const insets = useSafeAreaInsets();
24
25
return (
39
- <>
40
- <SettingsEnvironmentFilterHeader />
41
- <SettingsScreen title="Thread behavior" trailing={<AndroidSettingsEnvironmentFilter />}>
42
- <ScrollView
43
- contentInsetAdjustmentBehavior="automatic"
44
- showsVerticalScrollIndicator={false}
45
- className="flex-1"
46
- contentContainerClassName="gap-6 px-5 pt-4"
47
- contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 18) + 18 }}
48
- >
49
- <AutoSettleSettingsRows />
50
- <BetaSettingsSection />
51
- <LegacySettingsSection />
52
- </ScrollView>
53
- </SettingsScreen>
54
- </>
26
+ <SettingsScreen title="Labs">
27
+ <ScrollView
28
+ contentInsetAdjustmentBehavior="automatic"
29
+ showsVerticalScrollIndicator={false}
30
+ className="flex-1"
31
+ contentContainerClassName="gap-6 px-5 pt-4"
32
+ contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 18) + 18 }}
33
+ >
34
+ <LegacySettingsSection />
35
+ </ScrollView>
36
+ </SettingsScreen>
37
);
38
}
39
40
const AUTO_SETTLE_DEFAULT_DAYS = DEFAULT_SERVER_SETTINGS.sidebarAutoSettleAfterDays ?? 3;
41
60
-function AutoSettleSettingsRows() {
42
+/**
43
+ * Usage-limit and auto-settle rows. The Threads page owns their writes, so they share its queue
44
+ * with the page's other project overrides, and their project override reset.
45
+ */
46
+export function AutoSettleSettingsRows(props: {
47
+ readonly write: (patch: ServerSettingsPatch) => void;
48
+ readonly pending: boolean;
49
+}) {
50
const { selectedTargets, projectGroups, selectedProjectKey } = useSettingsEnvironmentFilter();
51
const selectedProject = projectGroups.find((group) => group.key === selectedProjectKey);
52
const writableEnvironments = useEnvironmentsWithScope(selectedTargets, AuthSettingsWriteScope);
53
const projectSelected = selectedProjectKey !== null;
65
- const [pendingWrites, setPendingWrites] = useState(0);
66
- const writeInFlight = useRef(false);
67
- const [pendingTargets, setPendingTargets] = useState<
68
- readonly ScopedMobileSettingsTarget[] | null
69
- >(null);
70
- const writeSettings = useSettingsWriter();
54
72
- const syncEnvironments = selectedTargets.filter(supportsSharedSettingsSync);
73
- const syncTargets = resolveMobileSettingsTargets(
74
- syncEnvironments,
75
- projectSelected ? (selectedProject?.members.map((member) => member.project) ?? []) : null,
55
+ const projectMembers = projectSelected
56
+ ? (selectedProject?.members.map((member) => member.project) ?? [])
57
+ : null;
58
+ const displayTargets = resolveMobileSettingsTargets(
59
+ selectedTargets.filter(supportsSharedSettingsSync),
60
+ projectMembers,
61
);
62
+ // The page saves to all its targets, so any read-only one blocks the save.
63
const canWriteSettings =
78
- syncTargets.length > 0 &&
79
- syncTargets.every((target) => writableEnvironments.has(target.environment.environmentId));
80
- const displayTargets =
81
- pendingWrites > 0 && pendingTargets !== null ? pendingTargets : syncTargets;
64
+ displayTargets.length > 0 &&
65
+ resolveMobileSettingsTargets(selectedTargets, projectMembers).every((target) =>
66
+ writableEnvironments.has(target.environment.environmentId),
67
+ );
68
const reference = displayTargets[0] ?? null;
69
const referenceSettings = reference?.settings ?? null;
70
@@ -91,25 +77,7 @@ function AutoSettleSettingsRows() {
77
autoResumeLimitedThreads?: boolean;
78
snoozeLimitedThreads?: boolean;
79
},
94
- ) => {
95
- if (
96
- writeInFlight.current ||
97
- !syncTargets.every((target) =>
98
- readEnvironmentScope(target.environment.environmentId, AuthSettingsWriteScope),
99
- )
100
- )
101
- return;
102
- const writes = planMobileScopedSettingsPatch(syncTargets, projectSelected, patch);
103
- if (writes.length === 0) return;
104
- writeInFlight.current = true;
105
- setPendingTargets(syncTargets);
106
- setPendingWrites((count) => count + 1);
107
- void writeSettings(syncTargets, writes).finally(() => {
108
- writeInFlight.current = false;
109
- setPendingTargets(null);
110
- setPendingWrites((count) => count - 1);
111
- });
112
- };
80
+ ) => props.write(patch);
81
82
const { patch: autoSettlePatch, mismatches } = planAutoSettleSettingsSync(
83
{
@@ -125,56 +93,16 @@ function AutoSettleSettingsRows() {
93
})),
94
);
95
128
- const supportsProjectOverrides = syncTargets.every(
96
+ const supportsProjectOverrides = displayTargets.every(
97
(target) =>
98
target.environment.serverConfig.environment.capabilities.projectSettingsOverrides === true,
99
);
100
const disabled =
133
- !canWriteSettings || pendingWrites > 0 || (projectSelected && !supportsProjectOverrides);
134
- const hasProjectOverrides =
135
- projectSelected &&
136
- syncTargets.some(
137
- (target) =>
138
- target.sources.sidebarAutoSettleOnMerge === "project" ||
139
- target.sources.sidebarAutoSettleAfterDays === "project",
140
- );
141
- const clearProjectOverrides = () => {
142
- if (
143
- writeInFlight.current ||
144
- !syncTargets.every((target) =>
145
- readEnvironmentScope(target.environment.environmentId, AuthSettingsWriteScope),
146
- )
147
- )
148
- return;
149
- const writes = planMobileScopedSettingsClear(syncTargets, [
150
- "sidebarAutoSettleOnMerge",
151
- "sidebarAutoSettleAfterDays",
152
- ]);
153
- if (writes.length === 0) return;
154
- writeInFlight.current = true;
155
- setPendingTargets(syncTargets);
156
- setPendingWrites((count) => count + 1);
157
- void writeSettings(syncTargets, writes).finally(() => {
158
- writeInFlight.current = false;
159
- setPendingTargets(null);
160
- setPendingWrites((count) => count - 1);
161
- });
162
- };
163
-
101
+ !canWriteSettings || props.pending || (projectSelected && !supportsProjectOverrides);
102
const afterDays = referenceSettings.sidebarAutoSettleAfterDays;
103
104
return (
105
<View className="gap-6">
168
- {projectSelected ? (
169
- <SettingsProjectOverridesSection
170
- projectLabel={selectedProject?.label ?? "Unavailable project"}
171
- hasOverrides={hasProjectOverrides}
172
- supportsOverrides={supportsProjectOverrides}
173
- pending={pendingWrites > 0}
174
- disabled={!canWriteSettings}
175
- onClear={clearProjectOverrides}
176
- />
177
- ) : null}
106
{!projectSelected ? (
107
<SettingsSection title="Usage limits">
108
<SettingsSwitchRow
@@ -222,7 +150,7 @@ function AutoSettleSettingsRows() {
150
</View>
151
) : null}
152
</SettingsSection>
225
- {pendingWrites === 0 && mismatches.length > 0 ? (
153
+ {!props.pending && mismatches.length > 0 ? (
154
<SettingsSection title="Across environments">
155
<View className="gap-3 p-4">
156
<Text className="text-base text-foreground">Auto-settle defaults differ</Text>
@@ -242,7 +170,7 @@ function AutoSettleSettingsRows() {
170
);
171
}
172
245
-function BetaSettingsSection() {
173
+export function WorkingSectionSettings() {
174
const savePreferences = useAtomSet(updateMobilePreferencesAtom);
175
const preferences = useAtomValue(mobilePreferencesAtom);
176
const workingShelfEnabled =
@@ -250,7 +178,7 @@ function BetaSettingsSection() {
178
179
return (
180
<View className="gap-3">
253
- <SettingsSection title="Beta">
181
+ <SettingsSection title="Sidebar">
182
<SettingsSwitchRow
183
icon="bolt.circle"
184
label="Working section"
apps/mobile/src/features/settings/components/settings-page-targets.ts
+2
-2
@@ -9,9 +9,9 @@ export const SETTINGS_PAGE_TARGETS = [
9
"SettingsNavigation",
10
"SettingsOrganization",
11
"SettingsProjectOverview",
12
- "SettingsEnvironmentNewThreads",
12
"SettingsEnvironmentSourceControl",
14
- "SettingsEnvironmentAgentBehavior",
13
+ "SettingsWorktrees",
14
+ "SettingsLabs",
15
"SettingsEnvironmentMaintenance",
16
"SettingsProviderAccounts",
17
"SettingsKeyboard",
apps/mobile/src/features/settings/settings-search.test.ts
+1
-1
@@ -47,7 +47,7 @@ describe("filterSettingsSections", () => {
47
{ query: "appear", expected: [["Interface", ["Appearance"]]] },
48
{ query: "KEYBOARD", expected: [["Interface", ["Keyboard"]]] },
49
{ query: "dark mode", expected: [["Interface", ["Appearance"]]] },
50
- { query: "branch naming", expected: [["Server settings", ["Source control"]]] },
50
+ { query: "agent credits", expected: [["Server settings", ["Source control"]]] },
51
{
52
query: "server settings",
53
expected: [["Server settings", ["Provider accounts", "Source control"]]],
apps/mobile/src/features/settings/settings-search.ts
+33
-15
@@ -31,39 +31,57 @@ const SETTINGS_SEARCH_TERMS = {
31
SettingsKeyboard: ["return key", "send message", "new line", "hardware keyboard"],
32
SettingsMicrophone: ["voice", "dictation", "audio input", "bluetooth"],
33
SettingsScheduledTasks: ["automations", "schedule", "cron", "recurring", "webhook"],
34
- SettingsProjectOverview: ["project", "checkouts", "worktrees", "delete project"],
35
- SettingsOrganization: ["project grouping", "group projects", "sidebar"],
34
+ SettingsProjectOverview: ["project", "overview", "checkouts", "delete project"],
35
+ SettingsOrganization: [
36
+ "project grouping",
37
+ "group projects",
38
+ "organization",
39
+ "sidebar",
40
+ "working section",
41
+ ],
42
SettingsThreads: [
43
+ "new threads",
44
+ "default workspace",
45
+ "default permissions",
46
+ "access",
47
+ "response streaming",
48
+ "preview browser",
49
+ "browser access",
50
"auto-settle",
51
"settle",
52
"snooze",
53
"usage limits",
54
"auto-resume",
42
- "plan mode",
43
- "working section",
55
+ "thread behavior",
56
],
45
- SettingsFollowUp: ["queue", "steer", "while the agent is running"],
57
+ SettingsFollowUp: ["follow-ups", "queue", "steer", "while the agent is running"],
58
SettingsArchive: ["archive", "archived", "restore", "unarchive"],
47
- SettingsProviderAccounts: ["codex", "claude", "cursor", "opencode", "sign in", "login", "auth"],
48
- SettingsEnvironmentNewThreads: [
49
- "default workspace",
50
- "worktree",
51
- "submodules",
52
- "default permissions",
53
- "access",
59
+ SettingsProviderAccounts: [
60
+ "provider accounts",
61
+ "codex",
62
+ "claude",
63
+ "cursor",
64
+ "opencode",
65
+ "sign in",
66
+ "login",
67
+ "auth",
68
],
69
SettingsEnvironmentSourceControl: [
70
"git",
57
- "branch naming",
71
"pull requests",
72
"co-authors",
73
"agent credits",
74
"default branch",
75
"automatically pull",
63
- "worktrees",
76
+ ],
77
+ SettingsWorktrees: [
78
+ "worktree",
79
+ "branch naming",
80
+ "branch prefix",
81
+ "submodules",
82
"start from remote",
83
],
66
- SettingsEnvironmentAgentBehavior: ["response streaming", "preview browser", "browser access"],
84
+ SettingsLabs: ["legacy", "plan mode", "beta"],
85
SettingsEnvironmentMaintenance: ["updates", "provider updates", "restart", "manage environments"],
86
SettingsAbout: [
87
"version",
docs/user/composer.md
+1
-1
@@ -72,7 +72,7 @@ Press `Option+Up` on macOS or `Alt+Up` on Windows and Linux with the cursor at t
72
start of the composer to edit the most recently queued message. Change
73
`thread.editQueuedMessage` to use another shortcut.
74
75
-Mobile has the same choice under **Settings → Follow-ups**. While a turn is
75
+Mobile has the same choice under **Settings → Chat**. While a turn is
76
running the send button shows which action it will take. Long-press it to use the
77
other action for a single message, or hold `Cmd` while sending from a hardware
78
keyboard. The button only offers Steer when the running agent supports it.
docs/user/cursor.md
+1
-1
@@ -19,7 +19,7 @@ not expose yet.
19
20
Choose **Sign in**, then open the sign-in page and complete it in your browser. T3 Code
21
updates automatically when sign-in finishes. This works when connected to a remote environment too.
22
-On mobile, use **Settings > Provider accounts** for an already configured Cursor instance.
22
+On mobile, use **Settings > Providers** for an already configured Cursor instance.
23
24
Each provider instance keeps its own login on the environment that runs it. Your Cursor editor and
25
CLI login are separate. A configured `CURSOR_API_KEY` overrides browser sign-in; remove that override
docs/user/project-settings.md
+3
-3
@@ -37,10 +37,10 @@ machine's setting. Every other provider setting stays per machine.
37
38
On mobile, open **Settings** and use the filter in its header to choose connected environments
39
and a project. The filter stays available in server-setting pages. With **All projects** selected,
40
-the **Server settings** categories and auto-settle controls in **Thread behavior** edit the
41
-selected environments' defaults. Choosing a project edits its overrides on the selected
40
+the server-setting pages, such as Threads, Source control and Worktrees, edit the selected
41
+environments' defaults. Choosing a project edits its overrides on the selected
42
environments. Use **Use defaults** in a page to remove that page's project overrides.
43
-Open **Settings → Projects & threads → Overview** to rename the project across its selected
43
+Open **Settings → Projects** to rename the project across its selected
44
connected checkouts and see where those checkouts live.
45
Settings that are environment-wide stay read-only while a project is selected. When selected
46
targets disagree, a control shows **Mixed** until you choose one value. Appearance, keyboard,
docs/user/providers-acp.md
+1
-1
@@ -54,7 +54,7 @@ but keeps package installs. To use an existing local binary, set **Executable ov
54
55
Open the agent's account section in **Settings → Providers** on web or desktop. Choose
56
**Sign in** and, if the agent offers several methods, select one. For an installed, configured
57
-provider, mobile also offers **Settings → Provider accounts**.
57
+provider, mobile also offers **Settings → Providers**.
58
59
Browser sign-in shows the agent's URL and waits for you to open or copy it before telling the
60
agent to proceed. The page opens on your device, while the agent runs on the environment.
docs/user/providers-antigravity.md
+2
-2
@@ -10,7 +10,7 @@ On web or desktop, open **Settings > Providers**, choose the environment that ru
10
your project, and enable Antigravity. Install its runtime there, then choose
11
**Sign in** and complete the browser sign-in. Wait for T3 Code to confirm
12
account access and load models before starting a thread. Once the runtime is installed,
13
-you can also sign in from **Settings > Provider accounts** in the mobile app.
13
+you can also sign in from **Settings > Providers** in the mobile app.
14
15
Installation continues if you leave settings or reconnect. Setup requires
16
permission to operate the environment; update an older server if it does not offer
@@ -134,7 +134,7 @@ until a session, a refresh, or a sign-out reports something new.
134
135
To check access and reload models, use **Refresh provider status** in web or desktop
136
provider settings, or **Refresh models** in mobile thread settings. If asked to
137
-sign in again, use provider settings on web or desktop, or **Provider accounts** on mobile.
137
+sign in again, use provider settings on web or desktop, or **Settings > Providers** on mobile.
138
139
If Google reports `SUBSCRIPTION_REQUIRED`, an account restriction, or a usage limit,
140
follow the provider's message and any retry time. See [Google's account plans][plans]
docs/user/thread-sidebar.md
+3
-4
@@ -127,7 +127,7 @@ answer. The Working section lists the thread you last sent work to first. Pinned
127
the pinned section.
128
129
This is on by default. Turn it off with **Settings → General → Working section** on web and desktop,
130
-or **Settings → Thread behavior → Working section** on iOS and Android. Each device keeps its own
130
+or **Settings → General → Working section** on iOS and Android. Each device keeps its own
131
choice.
132
133
While this is on, the active list is ordered by when each thread last came back to you, so you
@@ -170,7 +170,7 @@ choose **Auto-settle behavior**, and pick **Disabled**. The current option is ch
170
**Enabled** to return to the usual rules. Manual settle, snooze, and archive still work while it
171
is disabled.
172
173
-Change these rules in **Settings → Threads** on web and desktop, or **Settings → Thread behavior** on mobile.
173
+Change these rules in **Settings → Threads**.
174
They continue to run when your apps are closed. On web and desktop, choose an environment at the
175
top to change only its rules, or **All environments** to update connected environments together.
176
Mixed values show where the selected environments disagree. Mobile applies these
@@ -219,8 +219,7 @@ the continuation finishes. If the queue was held by a restart, resume it then.
219
220
When the provider reports a reset time, choose **Resume at reset** to schedule a
221
continuation. You can cancel it from the thread. Enable **Resume after
222
-usage limits** in **Settings → Threads** on web and desktop, or **Settings → Thread
223
-behavior** on mobile, to schedule limit stops by default.
222
+usage limits** in **Settings → Threads** to schedule limit stops by default.
223
The environment must be running when the reset arrives; it resumes overdue
224
continuations after a restart. Stopping the thread, sending a new message,
225
archiving, or settling it prevents a pending continuation from starting.