Skip to content
TypeScript

refactor(mobile): settings use web's pages and groups (#25686)

Julius Marminge9bc0c334383a
diff --git a/apps/mobile/src/Stack.tsx b/apps/mobile/src/Stack.tsx
index 1ea67736ab1..74a8600f1e3 100644
--- a/apps/mobile/src/Stack.tsx
+++ b/apps/mobile/src/Stack.tsx
@@ -97,9 +97,9 @@ import { SettingsEnvironmentDetailRouteScreen } from "./features/settings/Settin
import { SettingsEnvironmentsRouteScreen } from "./features/settings/SettingsEnvironmentsRouteScreen";
import { SettingsFollowUpRouteScreen } from "./features/settings/SettingsFollowUpRouteScreen";
import {
- SettingsEnvironmentAgentBehaviorRouteScreen,
SettingsEnvironmentMaintenanceRouteScreen,
- SettingsEnvironmentNewThreadsRouteScreen,
+ SettingsThreadsRouteScreen,
+ SettingsWorktreesRouteScreen,
SettingsEnvironmentSourceControlRouteScreen,
} from "./features/settings/SettingsServerControlsRouteScreen";
import {
@@ -125,7 +125,7 @@ import { UsageRouteScreen } from "./features/usage/UsageRouteScreen";
import { SettingsAboutRouteScreen } from "./features/settings/SettingsAboutRouteScreen";
import { SettingsNotificationsRouteScreen } from "./features/settings/SettingsNotificationsRouteScreen";
import { SettingsRouteScreen } from "./features/settings/SettingsRouteScreen";
-import { SettingsThreadsRouteScreen } from "./features/settings/SettingsThreadsRouteScreen";
+import { SettingsLabsRouteScreen } from "./features/settings/ThreadSettingsSections";
import { SettingsEnvironmentFilterProvider } from "./features/settings/settings-environment-filter";
import { openSettings, settingsOpenIn } from "./features/settings/settings-navigation";
import { DEFAULT_SETTINGS_PAGE } from "./features/workspace/workspace-tab-navigation";
@@ -261,10 +261,11 @@ const SETTINGS_SCREENS = {
linking: "settings/environments/:environmentId",
options: { ...SETTINGS_PAGE_OPTIONS, title: "Environment" },
}),
+ // Old links to New threads and Agent behavior open Threads, which absorbed them.
SettingsEnvironmentNewThreads: createNativeStackScreen({
- screen: SettingsEnvironmentNewThreadsRouteScreen,
+ screen: SettingsThreadsRouteScreen,
linking: "settings/new-threads",
- options: { ...SETTINGS_PAGE_OPTIONS, title: "New threads" },
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Threads" },
}),
SettingsEnvironmentSourceControl: createNativeStackScreen({
screen: SettingsEnvironmentSourceControlRouteScreen,
@@ -272,14 +273,24 @@ const SETTINGS_SCREENS = {
options: { ...SETTINGS_PAGE_OPTIONS, title: "Source control" },
}),
SettingsEnvironmentAgentBehavior: createNativeStackScreen({
- screen: SettingsEnvironmentAgentBehaviorRouteScreen,
+ screen: SettingsThreadsRouteScreen,
linking: "settings/agent-behavior",
- options: { ...SETTINGS_PAGE_OPTIONS, title: "Agent behavior" },
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Threads" },
+ }),
+ SettingsWorktrees: createNativeStackScreen({
+ screen: SettingsWorktreesRouteScreen,
+ linking: "settings/worktrees",
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Worktrees" },
+ }),
+ SettingsLabs: createNativeStackScreen({
+ screen: SettingsLabsRouteScreen,
+ linking: "settings/labs",
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Labs" },
}),
SettingsProviderAccounts: createNativeStackScreen({
screen: SettingsProviderAccountsRouteScreen,
linking: "settings/provider-accounts",
- options: { ...SETTINGS_PAGE_OPTIONS, title: "Provider accounts" },
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Providers" },
}),
SettingsEnvironmentMaintenance: createNativeStackScreen({
screen: SettingsEnvironmentMaintenanceRouteScreen,
@@ -294,12 +305,12 @@ const SETTINGS_SCREENS = {
SettingsThreads: createNativeStackScreen({
screen: SettingsThreadsRouteScreen,
linking: "settings/thread-preferences",
- options: { ...SETTINGS_PAGE_OPTIONS, title: "Thread behavior" },
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Threads" },
}),
SettingsAbout: createNativeStackScreen({
screen: SettingsAboutRouteScreen,
linking: "settings/about",
- options: { ...SETTINGS_PAGE_OPTIONS, title: "About T3 Code" },
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "About" },
}),
SettingsEnvironmentNew: createNativeStackScreen({
screen: ConnectionsNewRouteScreen,
@@ -314,7 +325,7 @@ const SETTINGS_SCREENS = {
linking: "settings/archive",
options: {
...SETTINGS_PAGE_OPTIONS,
- title: "Archived Threads",
+ title: "Archive",
},
}),
SettingsNavigation: createNativeStackScreen({
@@ -335,7 +346,7 @@ const SETTINGS_SCREENS = {
linking: "settings/project-grouping",
options: {
...SETTINGS_PAGE_OPTIONS,
- title: "Organization",
+ title: "General",
},
}),
SettingsOrganization: createNativeStackScreen({
@@ -343,13 +354,13 @@ const SETTINGS_SCREENS = {
linking: "settings/organization",
options: {
...SETTINGS_PAGE_OPTIONS,
- title: "Organization",
+ title: "General",
},
}),
SettingsProjectOverview: createNativeStackScreen({
screen: SettingsProjectOverviewRouteScreen,
linking: "settings/project",
- options: { ...SETTINGS_PAGE_OPTIONS, title: "Project overview" },
+ options: { ...SETTINGS_PAGE_OPTIONS, title: "Projects" },
}),
SettingsKeyboard: createNativeStackScreen({
screen: SettingsKeyboardRouteScreen,
@@ -372,7 +383,7 @@ const SETTINGS_SCREENS = {
linking: "settings/follow-ups",
options: {
...SETTINGS_PAGE_OPTIONS,
- title: "Follow-ups",
+ title: "Chat",
},
}),
SettingsScheduledTasks: createNativeStackScreen({
@@ -380,7 +391,7 @@ const SETTINGS_SCREENS = {
linking: "settings/scheduled-tasks",
options: {
...SETTINGS_PAGE_OPTIONS,
- title: "Scheduled Tasks",
+ title: "Scheduled tasks",
headerTitleStyle: { fontSize: 16, fontWeight: "800" },
},
}),
diff --git a/apps/mobile/src/components/ui/ListChoiceRow.tsx b/apps/mobile/src/components/ui/ListChoiceRow.tsx
index 748752f5cd4..9e231b7c25b 100644
--- a/apps/mobile/src/components/ui/ListChoiceRow.tsx
+++ b/apps/mobile/src/components/ui/ListChoiceRow.tsx
@@ -26,10 +26,8 @@ export function ListChoiceRow(props: {
onPress={props.onPress}
android_ripple={{ color: rippleStyle.backgroundColor }}
unstable_pressDelay={Platform.OS === "android" ? 50 : undefined}
- className={cn(
- props.selected ? "bg-subtle" : "bg-grouped-card",
- props.separated && "border-t border-border-subtle",
- )}
+ // Like UIKit and Material lists, only the checkmark or radio marks the selected row.
+ className={cn("bg-grouped-card", props.separated && "border-t border-border-subtle")}
>
<ListRowLayout
label={props.label}
diff --git a/apps/mobile/src/features/settings/SettingsAboutRouteScreen.tsx b/apps/mobile/src/features/settings/SettingsAboutRouteScreen.tsx
index 5267130b1b3..096513c0e0a 100644
--- a/apps/mobile/src/features/settings/SettingsAboutRouteScreen.tsx
+++ b/apps/mobile/src/features/settings/SettingsAboutRouteScreen.tsx
@@ -23,7 +23,7 @@ export function SettingsAboutRouteScreen() {
const insets = useSafeAreaInsets();
return (
- <SettingsScreen title="About T3 Code">
+ <SettingsScreen title="About">
<ScrollView
contentInsetAdjustmentBehavior="automatic"
showsVerticalScrollIndicator={false}
diff --git a/apps/mobile/src/features/settings/SettingsFollowUpRouteScreen.tsx b/apps/mobile/src/features/settings/SettingsFollowUpRouteScreen.tsx
index dac2f93c801..a86ec0c6d35 100644
--- a/apps/mobile/src/features/settings/SettingsFollowUpRouteScreen.tsx
+++ b/apps/mobile/src/features/settings/SettingsFollowUpRouteScreen.tsx
@@ -45,7 +45,7 @@ export function SettingsFollowUpRouteScreen() {
{Platform.OS === "android" ? (
<>
<NativeStackScreenOptions options={{ headerShown: false }} />
- <AndroidScreenHeader title="Follow-ups" onBack={() => navigation.goBack()} />
+ <AndroidScreenHeader title="Chat" onBack={() => navigation.goBack()} />
</>
) : null}
<ScrollView
diff --git a/apps/mobile/src/features/settings/SettingsMicrophoneRouteScreen.tsx b/apps/mobile/src/features/settings/SettingsMicrophoneRouteScreen.tsx
index 77154bb071d..a3a3b4a251e 100644
--- a/apps/mobile/src/features/settings/SettingsMicrophoneRouteScreen.tsx
+++ b/apps/mobile/src/features/settings/SettingsMicrophoneRouteScreen.tsx
@@ -19,6 +19,7 @@ import {
microphoneOrder,
} from "../../lib/microphonePriority";
import { mobilePreferencesAtom, updateMobilePreferencesAtom } from "../../state/preferences";
+import { ListRowLayout } from "../../components/ui/ListRowLayout";
import { SettingsActionRow } from "./components/SettingsActionRow";
import { SettingsDragHandle } from "./components/SettingsDragHandle";
import { SettingsSection } from "./components/SettingsSection";
@@ -252,10 +253,9 @@ function MicrophoneRow(props: {
style={style}
onLayout={(event) => props.onHeight(event.nativeEvent.layout.height)}
className={cn(
- "flex-row items-center gap-4 pl-4",
+ "flex-row items-center",
props.position > 1 && !lifted && "border-t border-border-subtle",
lifted && "bg-grouped-card shadow-md",
- !props.reorderable && "pr-4",
)}
>
{props.editing && props.onForget ? (
@@ -264,7 +264,7 @@ function MicrophoneRow(props: {
accessibilityLabel={`Forget ${title}`}
hitSlop={8}
onPress={props.onForget}
- className="active:opacity-70"
+ className="pl-4 active:opacity-70"
>
<SymbolView
name="xmark.circle.fill"
@@ -274,28 +274,20 @@ function MicrophoneRow(props: {
/>
</Pressable>
) : props.editing ? (
- <View style={{ width: REMOVE_SIZE }} />
+ <View className="pl-4">
+ <View style={{ width: REMOVE_SIZE }} />
+ </View>
) : null}
<View
accessible
accessibilityLabel={`${title}, ${kind.label}, ${props.position} of ${props.count}`}
- className="min-w-0 flex-1 flex-row items-center gap-4 py-4"
+ className="min-w-0 flex-1"
>
- <SymbolView
- name={kind.icon}
- size={22}
- tintColorClassName="accent-icon"
- type="monochrome"
- weight="regular"
+ <ListRowLayout
+ icon={kind.icon}
+ label={title}
+ description={isMicrophoneDevice(entry) ? kind.label : kind.rowDescription}
/>
- <View className="min-w-0 flex-1 gap-0.5">
- <Text numberOfLines={1} className="text-lg text-foreground">
- {title}
- </Text>
- <Text numberOfLines={1} className="text-sm text-foreground-muted">
- {isMicrophoneDevice(entry) ? kind.label : kind.rowDescription}
- </Text>
- </View>
</View>
{props.reorderable ? (
<SettingsDragHandle
diff --git a/apps/mobile/src/features/settings/SettingsProjectGroupingRouteScreen.tsx b/apps/mobile/src/features/settings/SettingsProjectGroupingRouteScreen.tsx
index 50ea1e2a9df..163e63eed92 100644
--- a/apps/mobile/src/features/settings/SettingsProjectGroupingRouteScreen.tsx
+++ b/apps/mobile/src/features/settings/SettingsProjectGroupingRouteScreen.tsx
@@ -12,6 +12,7 @@ import {
import { mobilePreferencesAtom, updateMobilePreferencesAtom } from "../../state/preferences";
import { SettingsChoiceRow } from "./components/SettingsChoiceRow";
import { SettingsSection } from "./components/SettingsSection";
+import { WorkingSectionSettings } from "./ThreadSettingsSections";
const GROUPING_OPTIONS: ReadonlyArray<{
readonly mode: SidebarProjectGroupingMode;
@@ -45,7 +46,7 @@ export function SettingsProjectGroupingRouteScreen() {
: null;
return (
- <SettingsScreen title="Organization">
+ <SettingsScreen title="General">
<ScrollView
contentInsetAdjustmentBehavior="automatic"
showsVerticalScrollIndicator={false}
@@ -66,6 +67,7 @@ export function SettingsProjectGroupingRouteScreen() {
/>
))}
</SettingsSection>
+ <WorkingSectionSettings />
</ScrollView>
</SettingsScreen>
);
diff --git a/apps/mobile/src/features/settings/SettingsProjectOverviewRouteScreen.tsx b/apps/mobile/src/features/settings/SettingsProjectOverviewRouteScreen.tsx
index c252ddd81b3..c848304e751 100644
--- a/apps/mobile/src/features/settings/SettingsProjectOverviewRouteScreen.tsx
+++ b/apps/mobile/src/features/settings/SettingsProjectOverviewRouteScreen.tsx
@@ -83,7 +83,7 @@ export function SettingsProjectOverviewRouteScreen() {
return (
<>
<SettingsEnvironmentFilterHeader />
- <SettingsScreen title="Project overview" trailing={<AndroidSettingsEnvironmentFilter />}>
+ <SettingsScreen title="Projects" trailing={<AndroidSettingsEnvironmentFilter />}>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
showsVerticalScrollIndicator={false}
@@ -91,7 +91,11 @@ export function SettingsProjectOverviewRouteScreen() {
contentContainerClassName="gap-6 px-5 pt-4"
contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 18) + 18 }}
>
- {members.length === 0 ? (
+ {selectedProjectKey === null ? (
+ <Text className="px-2 text-base text-foreground-muted">
+ Choose a project with the filter above to manage its name, checkouts and removal.
+ </Text>
+ ) : members.length === 0 ? (
<Text className="px-2 text-base text-foreground-muted">
This project has no checkout on the selected connected environments. Change the filter
above.
diff --git a/apps/mobile/src/features/settings/SettingsProviderAccountsRouteScreen.tsx b/apps/mobile/src/features/settings/SettingsProviderAccountsRouteScreen.tsx
index 25cd506a553..dfb07954a3a 100644
--- a/apps/mobile/src/features/settings/SettingsProviderAccountsRouteScreen.tsx
+++ b/apps/mobile/src/features/settings/SettingsProviderAccountsRouteScreen.tsx
@@ -38,7 +38,7 @@ export function SettingsProviderAccountsRouteScreen() {
return (
<>
<SettingsEnvironmentFilterHeader />
- <SettingsScreen title="Provider accounts" trailing={<AndroidSettingsEnvironmentFilter />}>
+ <SettingsScreen title="Providers" trailing={<AndroidSettingsEnvironmentFilter />}>
<ScreenScrollView
className="flex-1"
contentInsetAdjustmentBehavior="automatic"
diff --git a/apps/mobile/src/features/settings/SettingsRouteScreen.tsx b/apps/mobile/src/features/settings/SettingsRouteScreen.tsx
index 2f7406d5b78..24309b3db20 100644
--- a/apps/mobile/src/features/settings/SettingsRouteScreen.tsx
+++ b/apps/mobile/src/features/settings/SettingsRouteScreen.tsx
@@ -185,8 +185,8 @@ function SettingsList(props: { readonly connections: readonly SettingsListRow[]
}}
>
{sections.length ? (
- sections.map((section) => (
- <SettingsSection key={section.title ?? "tabs"} title={section.title}>
+ sections.map((section, index) => (
+ <SettingsSection key={section.title ?? `untitled-${index}`} title={section.title}>
{section.rows.map(({ id, ...row }) => (
<SettingsRow key={id} {...row} />
))}
@@ -229,11 +229,13 @@ function useSettingsIndexSections(): SettingsListSection[] {
): SettingsListRow => ({ id: target, icon, label, target, ...extra });
const serverPage = (target: SettingsPageTarget, icon: SettingsListRow["icon"], label: string) =>
page(target, icon, label, { disabled: noServerTargets });
+ // The same pages and groups as Settings on web, minus what mobile has no setting for.
return [
{
- title: "Interface",
rows: [
+ page("SettingsOrganization", "gearshape", "General"),
page("SettingsAppearance", "paintbrush", "Appearance"),
+ page("SettingsFollowUp", "bubble.left.and.bubble.right", "Chat"),
...(navigationCustomizationAvailable()
? [page("SettingsNavigation", "line.3.horizontal", "Navigation tabs")]
: []),
@@ -246,34 +248,33 @@ function useSettingsIndexSections(): SettingsListSection[] {
],
},
{
- title: "Automations",
- rows: [page("SettingsScheduledTasks", "clock", "Scheduled tasks")],
- },
- {
- title: "Projects & threads",
+ title: "Agents",
rows: [
- ...(selectedProjectKey !== null
- ? [page("SettingsProjectOverview", "folder", "Overview", { value: projectLabel })]
- : []),
- page("SettingsOrganization", "folder", "Organization"),
- page("SettingsThreads", "text.bubble", "Thread behavior"),
- page("SettingsFollowUp", "arrow.turn.left.up", "Follow-ups"),
- page("SettingsArchive", "archivebox", "Archived Threads"),
+ serverPage("SettingsProviderAccounts", "person.crop.circle", "Providers"),
+ serverPage("SettingsThreads", "text.bubble", "Threads"),
+ page("SettingsScheduledTasks", "clock", "Scheduled tasks"),
],
},
{
- title: "Server settings",
+ title: "Code",
rows: [
- serverPage("SettingsProviderAccounts", "person.crop.circle", "Provider accounts"),
- serverPage("SettingsEnvironmentNewThreads", "text.bubble", "New threads"),
+ page(
+ "SettingsProjectOverview",
+ "folder",
+ "Projects",
+ selectedProjectKey !== null ? { value: projectLabel } : undefined,
+ ),
serverPage("SettingsEnvironmentSourceControl", "arrow.triangle.branch", "Source control"),
- serverPage("SettingsEnvironmentAgentBehavior", "text.alignleft", "Agent behavior"),
- serverPage("SettingsEnvironmentMaintenance", "arrow.clockwise", "Maintenance"),
+ serverPage("SettingsWorktrees", "square.on.square", "Worktrees"),
],
},
{
- title: "App",
- rows: [page("SettingsAbout", "info.circle", "About T3 Code")],
+ rows: [
+ serverPage("SettingsEnvironmentMaintenance", "arrow.clockwise", "Maintenance"),
+ page("SettingsLabs", "sparkles", "Labs"),
+ page("SettingsAbout", "info.circle", "About"),
+ page("SettingsArchive", "archivebox", "Archive"),
+ ],
},
];
}
diff --git a/apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx b/apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx
index bc768b32ff8..d16e08035ca 100644
--- a/apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx
+++ b/apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx
@@ -186,7 +186,11 @@ function SelectRow(props: {
const value = (
<View className="min-w-0 flex-1 flex-row items-center justify-end gap-2">
{props.valueIcon}
- <Text className="shrink text-right text-base text-foreground-muted" numberOfLines={1}>
+ <Text
+ textRole="footnote"
+ className="shrink text-right text-foreground-muted"
+ numberOfLines={1}
+ >
{props.value}
</Text>
</View>
@@ -200,7 +204,9 @@ function SelectRow(props: {
: "min-h-14 flex-row items-center gap-3 px-4 py-3"
}
>
- <Text className="text-lg text-foreground">{props.label}</Text>
+ <Text textRole="body" className="text-foreground">
+ {props.label}
+ </Text>
{value}
</View>
);
@@ -219,7 +225,9 @@ function SelectRow(props: {
: "min-h-14 flex-row items-center gap-3 px-4 py-3 active:opacity-70"
}
>
- <Text className="text-lg text-foreground">{props.label}</Text>
+ <Text textRole="body" className="text-foreground">
+ {props.label}
+ </Text>
{value}
<SymbolView
name="chevron.down"
@@ -296,7 +304,9 @@ function WebhookFilterRows(props: {
onPress={() => props.onChange([...props.filters, emptyWebhookFilterDraft()])}
className="min-h-14 flex-row items-center gap-3 border-t border-border-subtle px-4 py-3 active:opacity-70"
>
- <Text className="min-w-0 flex-1 text-lg text-foreground">Add filter</Text>
+ <Text textRole="body" className="min-w-0 flex-1 text-foreground">
+ Add filter
+ </Text>
<SymbolView name="plus" size={16} tintColorClassName="accent-icon" />
</Pressable>
) : null}
@@ -330,8 +340,14 @@ function PickerRow(props: {
: "min-h-14 flex-row items-center gap-3 px-4 py-3 active:opacity-70 disabled:opacity-50"
}
>
- <Text className="text-lg text-foreground">{props.label}</Text>
- <Text className="min-w-0 flex-1 text-right text-base text-foreground-muted" numberOfLines={1}>
+ <Text textRole="body" className="text-foreground">
+ {props.label}
+ </Text>
+ <Text
+ textRole="footnote"
+ className="min-w-0 flex-1 text-right text-foreground-muted"
+ numberOfLines={1}
+ >
{props.value}
</Text>
<SymbolView
@@ -389,7 +405,7 @@ export function SettingsScheduledTasksRouteScreen() {
]}
/>
<SettingsScreen
- title="Scheduled Tasks"
+ title="Scheduled tasks"
trailing={
<View className="flex-row items-center">
<AndroidSettingsEnvironmentFilter />
@@ -962,8 +978,13 @@ function TaskForm({
onPress={() => setTimePickerOpen((open) => !open)}
className="min-h-14 flex-row items-center gap-3 border-t border-border-subtle px-4 py-3 active:opacity-70"
>
- <Text className="text-lg text-foreground">Time</Text>
- <Text className="min-w-0 flex-1 text-right text-base text-foreground-muted">
+ <Text textRole="body" className="text-foreground">
+ Time
+ </Text>
+ <Text
+ textRole="footnote"
+ className="min-w-0 flex-1 text-right text-foreground-muted"
+ >
{formatTime(draft.schedule.timeOfDay)}
</Text>
<SymbolView
@@ -1119,7 +1140,9 @@ function TaskForm({
</>
)}
<View className="min-h-14 flex-row items-center gap-3 border-t border-border-subtle px-4 py-3">
- <Text className="min-w-0 flex-1 text-lg text-foreground">Enabled</Text>
+ <Text textRole="body" className="min-w-0 flex-1 text-foreground">
+ Enabled
+ </Text>
<ThemedSwitch
accessibilityLabel="Task enabled"
value={draft.enabled}
@@ -1185,7 +1208,7 @@ function WebhookScheduleDetails({
onPress={() => void tryCopyTextWithHaptic(resolved.address)}
className="gap-1 active:opacity-70"
>
- <Text className="text-lg text-foreground">
+ <Text textRole="body" className="text-foreground">
{resolved.copyable ? "Webhook URL" : "Webhook path"}
</Text>
<Text className="text-sm text-foreground-muted" numberOfLines={2} selectable>
@@ -1310,8 +1333,8 @@ function EnvironmentTasks({
key={task.id}
className={
index === 0
- ? "flex-row items-start gap-1 px-4 py-4"
- : "flex-row items-start gap-1 border-t border-border-subtle px-4 py-4"
+ ? "flex-row items-start gap-1 px-4 py-3"
+ : "flex-row items-start gap-1 border-t border-border-subtle px-4 py-3"
}
>
<Pressable
@@ -1322,7 +1345,7 @@ function EnvironmentTasks({
}}
className="min-w-0 flex-1 gap-1 active:opacity-70"
>
- <Text className="text-lg font-t3-medium text-foreground" numberOfLines={1}>
+ <Text textRole="body" className="text-foreground" numberOfLines={1}>
{task.title}
</Text>
<Text className="text-sm text-foreground-muted" numberOfLines={2}>
diff --git a/apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.test.tsx b/apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.test.tsx
index 6cf6a8853d5..179eceba6c6 100644
--- a/apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.test.tsx
+++ b/apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.test.tsx
@@ -12,6 +12,7 @@ const { Children, mocks } = vi.hoisted(() => ({
updateSettings: vi.fn(),
alert: vi.fn(),
targets: [] as ReturnType<typeof environment>[],
+ readOnly: new Set<string>(),
projectSelected: false,
},
}));
@@ -48,7 +49,12 @@ vi.mock("react-native-safe-area-context", () => ({ useSafeAreaInsets: () => ({ b
vi.mock("@react-navigation/native", () => ({ useNavigation: () => ({}) }));
vi.mock("../../state/session", () => ({
readEnvironmentScope: () => true,
- useEnvironmentsWithScope: () => new Set(mocks.targets.map((target) => target.environmentId)),
+ useEnvironmentsWithScope: () =>
+ new Set(
+ mocks.targets
+ .map((target) => target.environmentId)
+ .filter((environmentId) => !mocks.readOnly.has(environmentId)),
+ ),
}));
vi.mock("../../state/server", () => ({ serverEnvironment: { updateSettings: {} } }));
vi.mock("../../state/use-atom-command", () => ({
@@ -125,7 +131,10 @@ vi.mock("./settings-environment-filter", () => ({
}),
}));
-import { SettingsEnvironmentSourceControlRouteScreen } from "./SettingsServerControlsRouteScreen";
+import {
+ SettingsThreadsRouteScreen,
+ SettingsWorktreesRouteScreen,
+} from "./SettingsServerControlsRouteScreen";
function environment(environmentId: string, label: string) {
return {
@@ -154,6 +163,7 @@ beforeEach(() => {
root = createRoot(container);
mocks.targets = [environment("local", "Local")];
mocks.projectSelected = false;
+ mocks.readOnly = new Set();
mocks.alert.mockReset();
mocks.updateSettings.mockReset();
mocks.updateSettings.mockResolvedValue(AsyncResult.success(undefined));
@@ -167,7 +177,7 @@ describe("SettingsServerControlsRouteScreen", () => {
it("sends a draft saved during a pending write once that write settles", async () => {
const pending = Promise.withResolvers<AsyncResult.Success<void>>();
mocks.updateSettings.mockReturnValueOnce(pending.promise);
- act(() => root.render(<SettingsEnvironmentSourceControlRouteScreen />));
+ act(() => root.render(<SettingsWorktreesRouteScreen />));
act(() => mocks.branchNaming.onChange({ branchNamingMode: "custom" }));
act(() => mocks.branchNaming.onChange({ branchNameInstructions: "Use issue IDs." }));
@@ -183,4 +193,36 @@ describe("SettingsServerControlsRouteScreen", () => {
},
});
});
+
+ it("holds auto-settle changes until a pending project override write settles", async () => {
+ mocks.projectSelected = true;
+ const pending = Promise.withResolvers<AsyncResult.Success<void>>();
+ mocks.updateSettings.mockReturnValueOnce(pending.promise);
+ act(() => root.render(<SettingsThreadsRouteScreen />));
+ const toggle = (label: string) =>
+ [...container.querySelectorAll<HTMLButtonElement>('[role="switch"]')].find(
+ (button) => button.textContent === label,
+ )!;
+
+ act(() => toggle("Agent browser access").click());
+ act(() => toggle("Auto-settle merged threads").click());
+
+ // Both rewrite the whole project override, so a second write planned now would drop the first.
+ expect(mocks.updateSettings).toHaveBeenCalledOnce();
+ await act(async () => pending.resolve(AsyncResult.success(undefined)));
+ });
+
+ it("disables auto-settle when a selected environment cannot save settings", () => {
+ const remote = environment("remote", "Remote");
+ // Auto-settle rows skip a server without auto-settlement, but the page still saves to it.
+ remote.serverConfig.environment.capabilities.threadAutoSettlement = false;
+ mocks.targets = [environment("local", "Local"), remote];
+ mocks.readOnly = new Set(["remote"]);
+ act(() => root.render(<SettingsThreadsRouteScreen />));
+
+ const autoSettle = [...container.querySelectorAll<HTMLButtonElement>('[role="switch"]')].find(
+ (button) => button.textContent === "Auto-settle merged threads",
+ )!;
+ expect(autoSettle.disabled).toBe(true);
+ });
});
diff --git a/apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.tsx b/apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.tsx
index 676f42d35eb..94a54db718d 100644
--- a/apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.tsx
+++ b/apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.tsx
@@ -39,27 +39,35 @@ import {
type ScopedMobileSettingsTarget,
} from "./settings-scoped-server";
import { PullRequestGlyph } from "../pull-requests/pullRequestGlyphs";
+import { AutoSettleSettingsRows } from "./ThreadSettingsSections";
+import { supportsSharedSettingsSync } from "@t3tools/client-runtime/state/shared-settings";
-type SettingsPage = "new-threads" | "source-control" | "agent-behavior" | "maintenance";
+type SettingsPage = "threads" | "source-control" | "worktrees" | "maintenance";
const PAGE_TITLES: Record<SettingsPage, string> = {
- "new-threads": "New threads",
+ threads: "Threads",
"source-control": "Source control",
- "agent-behavior": "Agent behavior",
+ worktrees: "Worktrees",
maintenance: "Maintenance",
};
const PAGE_PROJECT_KEYS: Record<SettingsPage, readonly ProjectScopedServerSettingKey[]> = {
- "new-threads": ["defaultThreadEnvMode", "worktreeSubmodules", "defaultRuntimeMode"],
- "source-control": [
- "defaultAutoPull",
- "removeAgentCreditsOnMerge",
+ threads: [
+ "defaultThreadEnvMode",
+ "defaultRuntimeMode",
+ "responseStreamingMode",
+ "enableAgentBrowserAccess",
+ "sidebarAutoSettleOnMerge",
+ "sidebarAutoSettleAfterDays",
+ ],
+ "source-control": ["defaultAutoPull", "removeAgentCreditsOnMerge"],
+ worktrees: [
"newWorktreesStartFromOrigin",
+ "worktreeSubmodules",
"branchNamingMode",
"branchNamePrefix",
"branchNameInstructions",
],
- "agent-behavior": ["responseStreamingMode", "enableAgentBrowserAccess"],
maintenance: ["continueThreadsAfterServerUpdate"],
};
@@ -121,16 +129,42 @@ const STREAMING_CHOICES: ReadonlyArray<{
},
];
-export function SettingsEnvironmentNewThreadsRouteScreen() {
- return <ServerSettingsDetail page="new-threads" />;
+// Only servers with thread auto-settlement store these, so other targets get the rest of a patch.
+const AUTO_SETTLE_SETTING_KEYS: ReadonlySet<string> = new Set([
+ "sidebarAutoSettleOnMerge",
+ "sidebarAutoSettleAfterDays",
+ "autoResumeLimitedThreads",
+ "snoozeLimitedThreads",
+]);
+
+function planServerSettingsWrites(
+ targets: readonly ScopedMobileSettingsTarget[],
+ projectSelected: boolean,
+ patch: ServerSettingsPatch,
+) {
+ const capable = targets.filter((target) => supportsSharedSettingsSync(target.environment));
+ const others = targets.filter((target) => !supportsSharedSettingsSync(target.environment));
+ const othersPatch = Object.fromEntries(
+ Object.entries(patch).filter(([key]) => !AUTO_SETTLE_SETTING_KEYS.has(key)),
+ ) as ServerSettingsPatch;
+ return [
+ ...planMobileScopedSettingsPatch(capable, projectSelected, patch),
+ ...(Object.keys(othersPatch).length > 0
+ ? planMobileScopedSettingsPatch(others, projectSelected, othersPatch)
+ : []),
+ ];
+}
+
+export function SettingsThreadsRouteScreen() {
+ return <ServerSettingsDetail page="threads" />;
}
export function SettingsEnvironmentSourceControlRouteScreen() {
return <ServerSettingsDetail page="source-control" />;
}
-export function SettingsEnvironmentAgentBehaviorRouteScreen() {
- return <ServerSettingsDetail page="agent-behavior" />;
+export function SettingsWorktreesRouteScreen() {
+ return <ServerSettingsDetail page="worktrees" />;
}
export function SettingsEnvironmentMaintenanceRouteScreen() {
@@ -187,7 +221,7 @@ function ServerSettingsDetail(props: { readonly page: SettingsPage }) {
)
)
return;
- const writes = planMobileScopedSettingsPatch(targets, projectSelected, patch);
+ const writes = planServerSettingsWrites(targets, projectSelected, patch);
if (writes.length === 0) return;
writeInFlight.current = true;
setPendingTargets(targets);
@@ -278,7 +312,7 @@ function ServerSettingsDetail(props: { readonly page: SettingsPage }) {
onClear={clearProjectOverrides}
/>
) : null}
- {props.page === "new-threads" ? (
+ {props.page === "threads" ? (
<>
<SettingsSection
title="Default workspace"
@@ -306,63 +340,61 @@ function ServerSettingsDetail(props: { readonly page: SettingsPage }) {
))}
</SettingsSection>
<SettingsSection
- title="Worktree submodules"
+ title="Default permissions"
trailing={
- pendingWrites === 0 && isMixed("worktreeSubmodules") ? (
+ pendingWrites === 0 && uniform("defaultRuntimeMode") === null ? (
<MixedValuesLabel projectSelected={projectSelected} />
) : null
}
>
- {SUBMODULE_CHOICES.filter(
- (choice) => choice.mode !== null || !projectSelected,
- ).map((choice, index) => (
+ {RUNTIME_MODE_CHOICES.map((choice, index) => (
<SettingsChoiceRow
- key={choice.mode ?? "inherit"}
+ key={choice.mode}
label={choice.label}
description={choice.description}
- selected={
- !isMixed("worktreeSubmodules") &&
- uniform("worktreeSubmodules") === choice.mode
- }
+ selected={uniform("defaultRuntimeMode") === choice.mode}
separated={index > 0}
- disabled={disabledFor("worktreeSubmodules")}
- onPress={() => write({ worktreeSubmodules: choice.mode })}
+ disabled={disabledFor("defaultRuntimeMode")}
+ onPress={() => write({ defaultRuntimeMode: choice.mode })}
/>
))}
</SettingsSection>
<SettingsSection
- title="Default permissions"
+ title="Response streaming"
trailing={
- pendingWrites === 0 && uniform("defaultRuntimeMode") === null ? (
+ pendingWrites === 0 && uniform("responseStreamingMode") === null ? (
<MixedValuesLabel projectSelected={projectSelected} />
) : null
}
>
- {RUNTIME_MODE_CHOICES.map((choice, index) => (
+ {STREAMING_CHOICES.map((choice, index) => (
<SettingsChoiceRow
key={choice.mode}
label={choice.label}
description={choice.description}
- selected={uniform("defaultRuntimeMode") === choice.mode}
+ selected={uniform("responseStreamingMode") === choice.mode}
separated={index > 0}
- disabled={disabledFor("defaultRuntimeMode")}
- onPress={() => write({ defaultRuntimeMode: choice.mode })}
+ disabled={disabledFor("responseStreamingMode")}
+ onPress={() => write({ responseStreamingMode: choice.mode })}
/>
))}
</SettingsSection>
+ <SettingsSection title="Preview browser">
+ <SettingsSwitchRow
+ icon="globe"
+ label="Agent browser access"
+ subtitle="Allow agents to use the in-app preview browser."
+ value={uniform("enableAgentBrowserAccess")}
+ disabled={disabledFor("enableAgentBrowserAccess")}
+ onValueChange={(value) => write({ enableAgentBrowserAccess: value })}
+ />
+ </SettingsSection>
+ <AutoSettleSettingsRows write={write} pending={pendingWrites > 0} />
</>
) : null}
{props.page === "source-control" ? (
<>
- <BranchNamingSettings
- key={targetsKey}
- mode={uniform("branchNamingMode")}
- prefix={uniform("branchNamePrefix")}
- instructions={uniform("branchNameInstructions")}
- disabled={disabledFor("branchNamingMode")}
- onChange={write}
- />
<SettingsSection title="Pull requests">
<SettingsSwitchRow
icon={PullRequestGlyph.merged}
@@ -383,7 +415,12 @@ function ServerSettingsDetail(props: { readonly page: SettingsPage }) {
onValueChange={(value) => write({ defaultAutoPull: value })}
/>
</SettingsSection>
- <SettingsSection title="Worktrees">
+ </>
+ ) : null}
+
+ {props.page === "worktrees" ? (
+ <>
+ <SettingsSection title="New worktrees">
<SettingsSwitchRow
icon="arrow.triangle.branch"
label="Start from remote"
@@ -393,41 +430,39 @@ function ServerSettingsDetail(props: { readonly page: SettingsPage }) {
onValueChange={(value) => write({ newWorktreesStartFromOrigin: value })}
/>
</SettingsSection>
- </>
- ) : null}
-
- {props.page === "agent-behavior" ? (
- <>
<SettingsSection
- title="Response streaming"
+ title="Worktree submodules"
trailing={
- pendingWrites === 0 && uniform("responseStreamingMode") === null ? (
+ pendingWrites === 0 && isMixed("worktreeSubmodules") ? (
<MixedValuesLabel projectSelected={projectSelected} />
) : null
}
>
- {STREAMING_CHOICES.map((choice, index) => (
+ {SUBMODULE_CHOICES.filter(
+ (choice) => choice.mode !== null || !projectSelected,
+ ).map((choice, index) => (
<SettingsChoiceRow
- key={choice.mode}
+ key={choice.mode ?? "inherit"}
label={choice.label}
description={choice.description}
- selected={uniform("responseStreamingMode") === choice.mode}
+ selected={
+ !isMixed("worktreeSubmodules") &&
+ uniform("worktreeSubmodules") === choice.mode
+ }
separated={index > 0}
- disabled={disabledFor("responseStreamingMode")}
- onPress={() => write({ responseStreamingMode: choice.mode })}
+ disabled={disabledFor("worktreeSubmodules")}
+ onPress={() => write({ worktreeSubmodules: choice.mode })}
/>
))}
</SettingsSection>
- <SettingsSection title="Preview browser">
- <SettingsSwitchRow
- icon="globe"
- label="Agent browser access"
- subtitle="Allow agents to use the in-app preview browser."
- value={uniform("enableAgentBrowserAccess")}
- disabled={disabledFor("enableAgentBrowserAccess")}
- onValueChange={(value) => write({ enableAgentBrowserAccess: value })}
- />
- </SettingsSection>
+ <BranchNamingSettings
+ key={targetsKey}
+ mode={uniform("branchNamingMode")}
+ prefix={uniform("branchNamePrefix")}
+ instructions={uniform("branchNameInstructions")}
+ disabled={disabledFor("branchNamingMode")}
+ onChange={write}
+ />
</>
) : null}
diff --git a/apps/mobile/src/features/settings/SettingsThreadsRouteScreen.tsx b/apps/mobile/src/features/settings/ThreadSettingsSections.tsx
similarity index 61%
rename from apps/mobile/src/features/settings/SettingsThreadsRouteScreen.tsx
rename to apps/mobile/src/features/settings/ThreadSettingsSections.tsx
index c8f3c4c7d17..1de8d5452e3 100644
--- a/apps/mobile/src/features/settings/SettingsThreadsRouteScreen.tsx
+++ b/apps/mobile/src/features/settings/ThreadSettingsSections.tsx
@@ -1,11 +1,10 @@
import { Button } from "../../components/ui/Button";
-import { AuthSettingsWriteScope } from "@t3tools/contracts";
-import { readEnvironmentScope, useEnvironmentsWithScope } from "../../state/session";
+import { AuthSettingsWriteScope, type ServerSettingsPatch } from "@t3tools/contracts";
+import { useEnvironmentsWithScope } from "../../state/session";
import { AutoSettleDaysField } from "./components/AutoSettleDaysField";
import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollView";
import { useAtomSet, useAtomValue } from "@effect/atom-react";
import { AsyncResult } from "effect/reactivity";
-import { useRef, useState } from "react";
import { View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
@@ -14,71 +13,58 @@ import { supportsSharedSettingsSync } from "@t3tools/client-runtime/state/shared
import { AppText as Text } from "../../components/ui/AppText";
import { mobilePreferencesAtom, updateMobilePreferencesAtom } from "../../state/preferences";
import { SettingsSection } from "./components/SettingsSection";
-import { SettingsProjectOverridesSection } from "./components/SettingsProjectOverridesSection";
import { SettingsSwitchRow } from "./components/SettingsSwitchRow";
import { SettingsScreen } from "./components/SettingsScreen";
-import {
- AndroidSettingsEnvironmentFilter,
- SettingsEnvironmentFilterHeader,
-} from "./components/SettingsEnvironmentFilterHeader";
import { planAutoSettleSettingsSync, type AutoSettleSettings } from "./autoSettleSettingsSync";
import { useSettingsEnvironmentFilter } from "./settings-environment-filter";
-import { useSettingsWriter } from "./useSettingsWriter";
-import {
- planMobileScopedSettingsClear,
- planMobileScopedSettingsPatch,
- resolveMobileSettingsTargets,
- uniformMobileSetting,
- type ScopedMobileSettingsTarget,
-} from "./settings-scoped-server";
+import { resolveMobileSettingsTargets, uniformMobileSetting } from "./settings-scoped-server";
-export function SettingsThreadsRouteScreen() {
+export function SettingsLabsRouteScreen() {
const insets = useSafeAreaInsets();
return (
- <>
- <SettingsEnvironmentFilterHeader />
- <SettingsScreen title="Thread behavior" trailing={<AndroidSettingsEnvironmentFilter />}>
- <ScrollView
- contentInsetAdjustmentBehavior="automatic"
- showsVerticalScrollIndicator={false}
- className="flex-1"
- contentContainerClassName="gap-6 px-5 pt-4"
- contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 18) + 18 }}
- >
- <AutoSettleSettingsRows />
- <BetaSettingsSection />
- <LegacySettingsSection />
- </ScrollView>
- </SettingsScreen>
- </>
+ <SettingsScreen title="Labs">
+ <ScrollView
+ contentInsetAdjustmentBehavior="automatic"
+ showsVerticalScrollIndicator={false}
+ className="flex-1"
+ contentContainerClassName="gap-6 px-5 pt-4"
+ contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 18) + 18 }}
+ >
+ <LegacySettingsSection />
+ </ScrollView>
+ </SettingsScreen>
);
}
const AUTO_SETTLE_DEFAULT_DAYS = DEFAULT_SERVER_SETTINGS.sidebarAutoSettleAfterDays ?? 3;
-function AutoSettleSettingsRows() {
+/**
+ * Usage-limit and auto-settle rows. The Threads page owns their writes, so they share its queue
+ * with the page's other project overrides, and their project override reset.
+ */
+export function AutoSettleSettingsRows(props: {
+ readonly write: (patch: ServerSettingsPatch) => void;
+ readonly pending: boolean;
+}) {
const { selectedTargets, projectGroups, selectedProjectKey } = useSettingsEnvironmentFilter();
const selectedProject = projectGroups.find((group) => group.key === selectedProjectKey);
const writableEnvironments = useEnvironmentsWithScope(selectedTargets, AuthSettingsWriteScope);
const projectSelected = selectedProjectKey !== null;
- const [pendingWrites, setPendingWrites] = useState(0);
- const writeInFlight = useRef(false);
- const [pendingTargets, setPendingTargets] = useState<
- readonly ScopedMobileSettingsTarget[] | null
- >(null);
- const writeSettings = useSettingsWriter();
- const syncEnvironments = selectedTargets.filter(supportsSharedSettingsSync);
- const syncTargets = resolveMobileSettingsTargets(
- syncEnvironments,
- projectSelected ? (selectedProject?.members.map((member) => member.project) ?? []) : null,
+ const projectMembers = projectSelected
+ ? (selectedProject?.members.map((member) => member.project) ?? [])
+ : null;
+ const displayTargets = resolveMobileSettingsTargets(
+ selectedTargets.filter(supportsSharedSettingsSync),
+ projectMembers,
);
+ // The page saves to all its targets, so any read-only one blocks the save.
const canWriteSettings =
- syncTargets.length > 0 &&
- syncTargets.every((target) => writableEnvironments.has(target.environment.environmentId));
- const displayTargets =
- pendingWrites > 0 && pendingTargets !== null ? pendingTargets : syncTargets;
+ displayTargets.length > 0 &&
+ resolveMobileSettingsTargets(selectedTargets, projectMembers).every((target) =>
+ writableEnvironments.has(target.environment.environmentId),
+ );
const reference = displayTargets[0] ?? null;
const referenceSettings = reference?.settings ?? null;
@@ -91,25 +77,7 @@ function AutoSettleSettingsRows() {
autoResumeLimitedThreads?: boolean;
snoozeLimitedThreads?: boolean;
},
- ) => {
- if (
- writeInFlight.current ||
- !syncTargets.every((target) =>
- readEnvironmentScope(target.environment.environmentId, AuthSettingsWriteScope),
- )
- )
- return;
- const writes = planMobileScopedSettingsPatch(syncTargets, projectSelected, patch);
- if (writes.length === 0) return;
- writeInFlight.current = true;
- setPendingTargets(syncTargets);
- setPendingWrites((count) => count + 1);
- void writeSettings(syncTargets, writes).finally(() => {
- writeInFlight.current = false;
- setPendingTargets(null);
- setPendingWrites((count) => count - 1);
- });
- };
+ ) => props.write(patch);
const { patch: autoSettlePatch, mismatches } = planAutoSettleSettingsSync(
{
@@ -125,56 +93,16 @@ function AutoSettleSettingsRows() {
})),
);
- const supportsProjectOverrides = syncTargets.every(
+ const supportsProjectOverrides = displayTargets.every(
(target) =>
target.environment.serverConfig.environment.capabilities.projectSettingsOverrides === true,
);
const disabled =
- !canWriteSettings || pendingWrites > 0 || (projectSelected && !supportsProjectOverrides);
- const hasProjectOverrides =
- projectSelected &&
- syncTargets.some(
- (target) =>
- target.sources.sidebarAutoSettleOnMerge === "project" ||
- target.sources.sidebarAutoSettleAfterDays === "project",
- );
- const clearProjectOverrides = () => {
- if (
- writeInFlight.current ||
- !syncTargets.every((target) =>
- readEnvironmentScope(target.environment.environmentId, AuthSettingsWriteScope),
- )
- )
- return;
- const writes = planMobileScopedSettingsClear(syncTargets, [
- "sidebarAutoSettleOnMerge",
- "sidebarAutoSettleAfterDays",
- ]);
- if (writes.length === 0) return;
- writeInFlight.current = true;
- setPendingTargets(syncTargets);
- setPendingWrites((count) => count + 1);
- void writeSettings(syncTargets, writes).finally(() => {
- writeInFlight.current = false;
- setPendingTargets(null);
- setPendingWrites((count) => count - 1);
- });
- };
-
+ !canWriteSettings || props.pending || (projectSelected && !supportsProjectOverrides);
const afterDays = referenceSettings.sidebarAutoSettleAfterDays;
return (
<View className="gap-6">
- {projectSelected ? (
- <SettingsProjectOverridesSection
- projectLabel={selectedProject?.label ?? "Unavailable project"}
- hasOverrides={hasProjectOverrides}
- supportsOverrides={supportsProjectOverrides}
- pending={pendingWrites > 0}
- disabled={!canWriteSettings}
- onClear={clearProjectOverrides}
- />
- ) : null}
{!projectSelected ? (
<SettingsSection title="Usage limits">
<SettingsSwitchRow
@@ -222,7 +150,7 @@ function AutoSettleSettingsRows() {
</View>
) : null}
</SettingsSection>
- {pendingWrites === 0 && mismatches.length > 0 ? (
+ {!props.pending && mismatches.length > 0 ? (
<SettingsSection title="Across environments">
<View className="gap-3 p-4">
<Text className="text-base text-foreground">Auto-settle defaults differ</Text>
@@ -242,7 +170,7 @@ function AutoSettleSettingsRows() {
);
}
-function BetaSettingsSection() {
+export function WorkingSectionSettings() {
const savePreferences = useAtomSet(updateMobilePreferencesAtom);
const preferences = useAtomValue(mobilePreferencesAtom);
const workingShelfEnabled =
@@ -250,7 +178,7 @@ function BetaSettingsSection() {
return (
<View className="gap-3">
- <SettingsSection title="Beta">
+ <SettingsSection title="Sidebar">
<SettingsSwitchRow
icon="bolt.circle"
label="Working section"
diff --git a/apps/mobile/src/features/settings/components/settings-page-targets.ts b/apps/mobile/src/features/settings/components/settings-page-targets.ts
index 21267a08714..6a98023f2ed 100644
--- a/apps/mobile/src/features/settings/components/settings-page-targets.ts
+++ b/apps/mobile/src/features/settings/components/settings-page-targets.ts
@@ -9,9 +9,9 @@ export const SETTINGS_PAGE_TARGETS = [
"SettingsNavigation",
"SettingsOrganization",
"SettingsProjectOverview",
- "SettingsEnvironmentNewThreads",
"SettingsEnvironmentSourceControl",
- "SettingsEnvironmentAgentBehavior",
+ "SettingsWorktrees",
+ "SettingsLabs",
"SettingsEnvironmentMaintenance",
"SettingsProviderAccounts",
"SettingsKeyboard",
diff --git a/apps/mobile/src/features/settings/settings-search.test.ts b/apps/mobile/src/features/settings/settings-search.test.ts
index 6c11a3dae7f..db51f64f838 100644
--- a/apps/mobile/src/features/settings/settings-search.test.ts
+++ b/apps/mobile/src/features/settings/settings-search.test.ts
@@ -47,7 +47,7 @@ describe("filterSettingsSections", () => {
{ query: "appear", expected: [["Interface", ["Appearance"]]] },
{ query: "KEYBOARD", expected: [["Interface", ["Keyboard"]]] },
{ query: "dark mode", expected: [["Interface", ["Appearance"]]] },
- { query: "branch naming", expected: [["Server settings", ["Source control"]]] },
+ { query: "agent credits", expected: [["Server settings", ["Source control"]]] },
{
query: "server settings",
expected: [["Server settings", ["Provider accounts", "Source control"]]],
diff --git a/apps/mobile/src/features/settings/settings-search.ts b/apps/mobile/src/features/settings/settings-search.ts
index f82f90dfe83..ed39fc0acfa 100644
--- a/apps/mobile/src/features/settings/settings-search.ts
+++ b/apps/mobile/src/features/settings/settings-search.ts
@@ -31,39 +31,57 @@ const SETTINGS_SEARCH_TERMS = {
SettingsKeyboard: ["return key", "send message", "new line", "hardware keyboard"],
SettingsMicrophone: ["voice", "dictation", "audio input", "bluetooth"],
SettingsScheduledTasks: ["automations", "schedule", "cron", "recurring", "webhook"],
- SettingsProjectOverview: ["project", "checkouts", "worktrees", "delete project"],
- SettingsOrganization: ["project grouping", "group projects", "sidebar"],
+ SettingsProjectOverview: ["project", "overview", "checkouts", "delete project"],
+ SettingsOrganization: [
+ "project grouping",
+ "group projects",
+ "organization",
+ "sidebar",
+ "working section",
+ ],
SettingsThreads: [
+ "new threads",
+ "default workspace",
+ "default permissions",
+ "access",
+ "response streaming",
+ "preview browser",
+ "browser access",
"auto-settle",
"settle",
"snooze",
"usage limits",
"auto-resume",
- "plan mode",
- "working section",
+ "thread behavior",
],
- SettingsFollowUp: ["queue", "steer", "while the agent is running"],
+ SettingsFollowUp: ["follow-ups", "queue", "steer", "while the agent is running"],
SettingsArchive: ["archive", "archived", "restore", "unarchive"],
- SettingsProviderAccounts: ["codex", "claude", "cursor", "opencode", "sign in", "login", "auth"],
- SettingsEnvironmentNewThreads: [
- "default workspace",
- "worktree",
- "submodules",
- "default permissions",
- "access",
+ SettingsProviderAccounts: [
+ "provider accounts",
+ "codex",
+ "claude",
+ "cursor",
+ "opencode",
+ "sign in",
+ "login",
+ "auth",
],
SettingsEnvironmentSourceControl: [
"git",
- "branch naming",
"pull requests",
"co-authors",
"agent credits",
"default branch",
"automatically pull",
- "worktrees",
+ ],
+ SettingsWorktrees: [
+ "worktree",
+ "branch naming",
+ "branch prefix",
+ "submodules",
"start from remote",
],
- SettingsEnvironmentAgentBehavior: ["response streaming", "preview browser", "browser access"],
+ SettingsLabs: ["legacy", "plan mode", "beta"],
SettingsEnvironmentMaintenance: ["updates", "provider updates", "restart", "manage environments"],
SettingsAbout: [
"version",
diff --git a/docs/user/composer.md b/docs/user/composer.md
index e93139044fc..35b425faf31 100644
--- a/docs/user/composer.md
+++ b/docs/user/composer.md
@@ -72,7 +72,7 @@ Press `Option+Up` on macOS or `Alt+Up` on Windows and Linux with the cursor at t
start of the composer to edit the most recently queued message. Change
`thread.editQueuedMessage` to use another shortcut.
-Mobile has the same choice under **Settings → Follow-ups**. While a turn is
+Mobile has the same choice under **Settings → Chat**. While a turn is
running the send button shows which action it will take. Long-press it to use the
other action for a single message, or hold `Cmd` while sending from a hardware
keyboard. The button only offers Steer when the running agent supports it.
diff --git a/docs/user/cursor.md b/docs/user/cursor.md
index 3def8de7c02..6a6b1c8f284 100644
--- a/docs/user/cursor.md
+++ b/docs/user/cursor.md
@@ -19,7 +19,7 @@ not expose yet.
Choose **Sign in**, then open the sign-in page and complete it in your browser. T3 Code
updates automatically when sign-in finishes. This works when connected to a remote environment too.
-On mobile, use **Settings > Provider accounts** for an already configured Cursor instance.
+On mobile, use **Settings > Providers** for an already configured Cursor instance.
Each provider instance keeps its own login on the environment that runs it. Your Cursor editor and
CLI login are separate. A configured `CURSOR_API_KEY` overrides browser sign-in; remove that override
diff --git a/docs/user/project-settings.md b/docs/user/project-settings.md
index 286ecb7a012..718f8723468 100644
--- a/docs/user/project-settings.md
+++ b/docs/user/project-settings.md
@@ -37,10 +37,10 @@ machine's setting. Every other provider setting stays per machine.
On mobile, open **Settings** and use the filter in its header to choose connected environments
and a project. The filter stays available in server-setting pages. With **All projects** selected,
-the **Server settings** categories and auto-settle controls in **Thread behavior** edit the
-selected environments' defaults. Choosing a project edits its overrides on the selected
+the server-setting pages, such as Threads, Source control and Worktrees, edit the selected
+environments' defaults. Choosing a project edits its overrides on the selected
environments. Use **Use defaults** in a page to remove that page's project overrides.
-Open **Settings → Projects & threads → Overview** to rename the project across its selected
+Open **Settings → Projects** to rename the project across its selected
connected checkouts and see where those checkouts live.
Settings that are environment-wide stay read-only while a project is selected. When selected
targets disagree, a control shows **Mixed** until you choose one value. Appearance, keyboard,
diff --git a/docs/user/providers-acp.md b/docs/user/providers-acp.md
index aef165d96eb..c40d2e0fec6 100644
--- a/docs/user/providers-acp.md
+++ b/docs/user/providers-acp.md
@@ -54,7 +54,7 @@ but keeps package installs. To use an existing local binary, set **Executable ov
Open the agent's account section in **Settings → Providers** on web or desktop. Choose
**Sign in** and, if the agent offers several methods, select one. For an installed, configured
-provider, mobile also offers **Settings → Provider accounts**.
+provider, mobile also offers **Settings → Providers**.
Browser sign-in shows the agent's URL and waits for you to open or copy it before telling the
agent to proceed. The page opens on your device, while the agent runs on the environment.
diff --git a/docs/user/providers-antigravity.md b/docs/user/providers-antigravity.md
index 5d675e6eaa7..0b1cd2f2c6d 100644
--- a/docs/user/providers-antigravity.md
+++ b/docs/user/providers-antigravity.md
@@ -10,7 +10,7 @@ On web or desktop, open **Settings > Providers**, choose the environment that ru
your project, and enable Antigravity. Install its runtime there, then choose
**Sign in** and complete the browser sign-in. Wait for T3 Code to confirm
account access and load models before starting a thread. Once the runtime is installed,
-you can also sign in from **Settings > Provider accounts** in the mobile app.
+you can also sign in from **Settings > Providers** in the mobile app.
Installation continues if you leave settings or reconnect. Setup requires
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.
To check access and reload models, use **Refresh provider status** in web or desktop
provider settings, or **Refresh models** in mobile thread settings. If asked to
-sign in again, use provider settings on web or desktop, or **Provider accounts** on mobile.
+sign in again, use provider settings on web or desktop, or **Settings > Providers** on mobile.
If Google reports `SUBSCRIPTION_REQUIRED`, an account restriction, or a usage limit,
follow the provider's message and any retry time. See [Google's account plans][plans]
diff --git a/docs/user/thread-sidebar.md b/docs/user/thread-sidebar.md
index 60cf5a9cb0a..8bf55006bd7 100644
--- a/docs/user/thread-sidebar.md
+++ b/docs/user/thread-sidebar.md
@@ -127,7 +127,7 @@ answer. The Working section lists the thread you last sent work to first. Pinned
the pinned section.
This is on by default. Turn it off with **Settings → General → Working section** on web and desktop,
-or **Settings → Thread behavior → Working section** on iOS and Android. Each device keeps its own
+or **Settings → General → Working section** on iOS and Android. Each device keeps its own
choice.
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
**Enabled** to return to the usual rules. Manual settle, snooze, and archive still work while it
is disabled.
-Change these rules in **Settings → Threads** on web and desktop, or **Settings → Thread behavior** on mobile.
+Change these rules in **Settings → Threads**.
They continue to run when your apps are closed. On web and desktop, choose an environment at the
top to change only its rules, or **All environments** to update connected environments together.
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.
When the provider reports a reset time, choose **Resume at reset** to schedule a
continuation. You can cancel it from the thread. Enable **Resume after
-usage limits** in **Settings → Threads** on web and desktop, or **Settings → Thread
-behavior** on mobile, to schedule limit stops by default.
+usage limits** in **Settings → Threads** to schedule limit stops by default.
The environment must be running when the reset arrives; it resumes overdue
continuations after a restart. Stopping the thread, sending a new message,
archiving, or settling it prevents a pending continuation from starting.