@devries-cameron20 / t3code Mirror · read-only / commits / 7247851d35
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 00:30 UTC

refactor(mobile): simplify commit sheet and share thread actions (#21943)

Julius Marminge committed Oct 19, 2026 at 15:04 UTC 7247851d35ac79a5534ee5bbe59279be1e309c2e
16 files changed +259 -348
apps/mobile/src/Stack.tsx
+1 -1
@@ -889,7 +889,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
889 linking: `${THREAD_LINKING_PREFIX}/git/commit`,
890 options: {
891 ...FORM_SHEET_PRESENTATION_OPTIONS,
892 - sheetAllowedDetents: [0.55, 0.92],
892 + sheetAllowedDetents: [0.8, 0.92],
893 sheetGrabberVisible: true,
894 },
895 }),
apps/mobile/src/features/archive/ArchivedThreadsScreen.tsx
+5 -4
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import type {
3 EnvironmentProject,
4 EnvironmentThreadShell,
@@ -14,7 +15,7 @@ import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
15 import { AppBar } from "../../components/ui/AppBar";
16 import { SymbolView } from "../../components/ui/AppSymbol";
17 import { useCallback, useMemo, useRef, type ComponentProps } from "react";
17 -import { Platform, Pressable, RefreshControl, useWindowDimensions, View } from "react-native";
18 +import { Platform, RefreshControl, useWindowDimensions, View } from "react-native";
19 import { GestureDetector, useNativeGesture } from "react-native-gesture-handler";
20 import type { SwipeableMethods } from "react-native-gesture-handler/ReanimatedSwipeable";
21
@@ -279,9 +280,9 @@ function ArchiveError(props: { readonly message: string; readonly onRetry: () =>
280 Could not load every archive
281 </Text>
282 <Text className="mt-1 text-sm text-foreground-muted">{props.message}</Text>
282 - <Pressable className="mt-3 self-start active:opacity-60" onPress={props.onRetry}>
283 - <Text className="text-sm font-t3-bold text-danger-foreground">Try again</Text>
284 - </Pressable>
283 + <View className="mt-3">
284 + <Button label="Try again" tone="secondary" onPress={props.onRetry} />
285 + </View>
286 </View>
287 );
288 }
apps/mobile/src/features/threads/ComposerFeedback.tsx
+5 -6
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import {
3 codexFeedbackNotice,
4 type CodexFeedbackSubmission,
@@ -47,15 +48,13 @@ export function ComposerFeedback({
48 </Text>
49 ) : null}
50 {submission.status === "sent" ? (
50 - <Pressable
51 - accessibilityRole="button"
51 + <Button
52 + label="Copy ID"
53 + tone="text"
54 onPress={() =>
55 copyTextWithHaptic(submission.feedbackId, { target: "Codex feedback thread ID" })
56 }
55 - className="self-start py-1 active:opacity-60"
56 - >
57 - <Text className="text-sm text-foreground">Copy ID</Text>
58 - </Pressable>
57 + />
58 ) : null}
59 </View>
60 </View>
apps/mobile/src/features/threads/ComposerQueuedEdit.tsx
+5 -7
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import type { ChatAttachment, EnvironmentId } from "@t3tools/contracts";
3 import { Image } from "expo-image";
4 import { Pressable, ScrollView, View } from "react-native";
@@ -17,16 +18,13 @@ export function ComposerQueuedEditBanner(props: {
18 <Text className="min-w-0 flex-1 text-xs text-foreground-muted" numberOfLines={1}>
19 Editing queued message
20 </Text>
20 - <Pressable
21 - accessibilityRole="button"
21 + <Button
22 + label="Cancel"
23 + tone="text"
24 accessibilityLabel="Cancel editing queued message"
25 disabled={props.saving}
26 onPress={props.onCancel}
25 - hitSlop={8}
26 - className="min-h-8 justify-center px-1 active:opacity-70 disabled:opacity-40"
27 - >
28 - <Text className="font-t3-medium text-xs text-primary">Cancel</Text>
29 - </Pressable>
27 + />
28 </View>
29 );
30 }
apps/mobile/src/features/threads/CustomSnoozeSheet.shared.tsx
+6 -13
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import { DateTimePicker } from "@expo/ui/community/datetime-picker";
3 import {
4 localSnoozeDate,
@@ -143,16 +144,10 @@ export function CustomSnoozeSheet(props: {
144 </AppText>
145 )}
146 <View className="flex-row justify-end gap-3">
146 - <Pressable
147 - accessibilityRole="button"
148 - className="min-h-12 justify-center px-3"
149 - onPress={props.onClose}
150 - >
151 - <AppText>Cancel</AppText>
152 - </Pressable>
153 - <Pressable
154 - accessibilityRole="button"
155 - className="min-h-12 justify-center rounded-xl bg-subtle px-3"
147 + <Button label="Cancel" tone="text" onPress={props.onClose} />
148 + <Button
149 + label="Snooze"
150 + tone="secondary"
151 onPress={() => {
152 const input: CustomSnoozeInput =
153 mode === "date"
@@ -170,9 +165,7 @@ export function CustomSnoozeSheet(props: {
165 props.onSnooze(snoozedUntil);
166 props.onClose();
167 }}
173 - >
174 - <AppText className="text-foreground">Snooze</AppText>
175 - </Pressable>
168 + />
169 </View>
170 </ScrollView>
171 </KeyboardAvoidingView>
apps/mobile/src/features/threads/NewTaskContextPickerScreens.tsx
+4 -7
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import { Toolbar } from "../../components/ui/Toolbar";
3 import * as Dialog from "../../components/ui/Dialog";
4 import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
@@ -470,13 +471,9 @@ export function BranchPickerScreen(props: {
471 : "No branches available"}
472 </Text>
473 {!props.loading && props.error ? (
473 - <Pressable
474 - accessibilityRole="button"
475 - className="rounded-full bg-card px-4 py-2 active:opacity-70"
476 - onPress={props.onRefresh}
477 - >
478 - <Text className="text-sm font-t3-medium text-foreground">Try again</Text>
479 - </Pressable>
474 + <View className="self-center">
475 + <Button label="Try again" tone="secondary" onPress={props.onRefresh} />
476 + </View>
477 ) : null}
478 </View>
479 </ScrollView>
apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
+5 -6
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import { Toolbar } from "../../components/ui/Toolbar";
3 import * as Dialog from "../../components/ui/Dialog";
4 import { useAtomValue } from "@effect/atom-react";
@@ -1612,14 +1613,12 @@ export function NewTaskDraftScreen(props: {
1613 ) : null}
1614
1615 {modelUnavailable ? (
1615 - <Pressable
1616 - accessibilityRole="button"
1617 - className="px-3 py-2"
1616 + <Button
1617 + label="Model unavailable. Open model settings."
1618 + tone="text"
1619 disabled={isComposerInteractionLocked}
1620 onPress={settingsSheetPresentation.open}
1620 - >
1621 - <Text className="text-xs text-foreground">Model unavailable. Open model settings.</Text>
1622 - </Pressable>
1621 + />
1622 ) : null}
1623
1624 <ComposerSurface
apps/mobile/src/features/threads/PendingUserInputCard.tsx
+4 -8
@@ -312,16 +312,12 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) {
312 onPress={() => void props.onSubmit()}
313 />
314 {props.pendingUserInput.dismissible ? (
315 - <Pressable
316 - accessibilityRole="button"
317 - className="items-center justify-center rounded-2xl px-4 py-2.5 active:opacity-70"
315 + <Button
316 + label="Dismiss without answering"
317 + tone="text"
318 disabled={isResponding}
319 onPress={() => void props.onDismiss()}
320 - >
321 - <Text className="font-t3-bold text-sm text-foreground-muted">
322 - Dismiss without answering
323 - </Text>
324 - </Pressable>
320 + />
321 ) : null}
322 {!props.canOperateThread ? (
323 <Text className="font-sans text-xs text-foreground-tertiary">
apps/mobile/src/features/threads/ProjectCloneBanner.tsx
+6 -7
@@ -1,9 +1,10 @@
1 +import { Button } from "../../components/ui/Button";
2 import {
3 projectCloneDisplayName,
4 projectCloneProgressSummary,
5 type ProjectCloneSnapshot,
6 } from "@t3tools/contracts";
6 -import { Pressable, View } from "react-native";
7 +import { View } from "react-native";
8
9 import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
10 import { cn } from "../../lib/cn";
@@ -65,13 +66,11 @@ export function ProjectCloneBanner(props: {
66
67 function BannerAction(props: { readonly label: string; readonly onPress: () => void }) {
68 return (
68 - <Pressable
69 - accessibilityRole="button"
69 + <Button
70 + label={props.label}
71 + tone="secondary"
72 accessibilityLabel={props.label}
71 - className="rounded-full border border-border bg-card px-3 py-1.5"
73 onPress={props.onPress}
73 - >
74 - <Text className="font-t3-medium text-xs">{props.label}</Text>
75 - </Pressable>
74 + />
75 );
76 }
apps/mobile/src/features/threads/SecretRequestCard.tsx
+5 -9
@@ -12,7 +12,7 @@ import {
12 } from "@t3tools/client-runtime/state/runtime";
13 import type { EnvironmentId, OrchestrationV2ProjectedTurnItem } from "@t3tools/contracts";
14 import { useRef, useState } from "react";
15 -import { Pressable, View, type ColorValue } from "react-native";
15 +import { View, type ColorValue } from "react-native";
16
17 import { SymbolView, type AppSymbolName } from "../../components/ui/AppSymbol";
18 import { AppText as Text, AppTextInput as TextInput } from "../../components/ui/AppText";
@@ -147,16 +147,12 @@ function PendingSecretRequestForm(props: {
147 {SECRET_REQUEST_PRIVACY_NOTE}
148 </Text>
149 </View>
150 - <Pressable
151 - accessibilityRole="button"
152 - accessibilityState={{ disabled: submitting }}
150 + <Button
151 + label="Decline"
152 + tone="text"
153 disabled={submitting}
154 - hitSlop={8}
155 - className="px-1 py-1 active:opacity-60 disabled:opacity-50"
154 onPress={() => void send({ type: "decline" })}
157 - >
158 - <Text className="font-sans text-xs text-foreground-muted">Decline</Text>
159 - </Pressable>
155 + />
156 </View>
157 </View>
158 );
apps/mobile/src/features/threads/ThreadComposer.tsx
+7 -4
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import * as Dialog from "../../components/ui/Dialog";
3 import type { ComposerTextPaste } from "../../native/T3ComposerEditor.types";
4 import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
@@ -27,7 +28,7 @@ import {
28 import { StackActions, useFocusEffect, useNavigation } from "@react-navigation/native";
29 import type { ReactNode } from "react";
30 import { useEffect, useLayoutEffect, useRef, useState, type RefObject } from "react";
30 -import { Keyboard, Platform, Pressable, View, type ViewStyle } from "react-native";
31 +import { Keyboard, Platform, View, type ViewStyle } from "react-native";
32 import { composerImageGallery } from "../../lib/composerImageGallery";
33 import { filePreviewGallery } from "../../lib/filePreviewGallery";
34 import { FilePreviewModal, type FilePreviewSource } from "../../components/FilePreviewModal";
@@ -720,9 +721,11 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
721 </Text>
722 ) : null}
723 {modelUnavailable ? (
723 - <Pressable accessibilityRole="button" className="px-3 py-2" onPress={openSettings}>
724 - <Text className="text-xs text-foreground">Model unavailable. Open model settings.</Text>
725 - </Pressable>
724 + <Button
725 + label="Model unavailable. Open model settings."
726 + tone="text"
727 + onPress={openSettings}
728 + />
729 ) : null}
730
731 <ComposerSurface
apps/mobile/src/features/threads/ThreadFeed.tsx
+16 -23
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import * as Dialog from "../../components/ui/Dialog";
3 import { useOpenPullRequest } from "../../native/useOpenPullRequest";
4 import { ThreadMarkdownVideo, ThreadMediaVisibleContext } from "./ThreadMarkdownVideo";
@@ -784,14 +785,12 @@ function ArtifactTemplateCard(props: {
785 </Text>
786 </View>
787 {props.onUse ? (
787 - <Pressable
788 - accessibilityRole="button"
788 + <Button
789 + label="Use template"
790 + tone="secondary"
791 accessibilityLabel={`Use ${props.template.displayName} template`}
790 - className="min-h-9 justify-center rounded-lg border border-border bg-subtle px-3 active:opacity-65"
792 onPress={() => props.onUse?.(props.template)}
792 - >
793 - <Text className="font-t3-bold text-xs text-foreground">Use template</Text>
794 - </Pressable>
793 + />
794 ) : null}
795 </View>
796 );
@@ -2586,29 +2585,23 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
2585 function ThreadFeedLoadEarlierControl(props: ThreadFeedHistoryControls) {
2586 const theme = useUniwindTheme();
2587 const mutedColor = theme["--color-icon-subtle"];
2589 - const accentColor = theme["--color-primary"];
2588 if (!props.hasMoreHistory && props.error === null) {
2589 return null;
2590 }
2591 return (
2592 <View className="mb-3 items-center gap-1.5 px-2">
2593 {props.hasMoreHistory ? (
2596 - <Pressable
2597 - accessibilityRole="button"
2598 - accessibilityLabel="Load earlier activity"
2599 - disabled={props.loading}
2600 - onPress={props.onLoadEarlier}
2601 - className="min-h-9 flex-row items-center justify-center gap-2 rounded-full border border-border/60 bg-card/80 px-4 py-2 disabled:opacity-50"
2602 - >
2603 - {props.loading ? (
2604 - <AppActivityIndicator size="small" color={accentColor} />
2605 - ) : (
2606 - <SymbolView name="chevron.up" size={12} tintColor={accentColor} type="monochrome" />
2607 - )}
2608 - <Text className="text-sm font-medium text-foreground">
2609 - {props.loading ? "Loading earlier activity…" : "Load earlier activity"}
2610 - </Text>
2611 - </Pressable>
2594 + <View className="self-center">
2595 + <Button
2596 + label={props.loading ? "Loading earlier activity…" : "Load earlier activity"}
2597 + tone="secondary"
2598 + accessibilityLabel="Load earlier activity"
2599 + disabled={props.loading}
2600 + onPress={props.onLoadEarlier}
2601 + icon="chevron.up"
2602 + loading={props.loading}
2603 + />
2604 + </View>
2605 ) : null}
2606 {props.error !== null ? (
2607 <Text className="text-center text-xs" style={{ color: mutedColor }}>
apps/mobile/src/features/threads/UsageLimitRecoveryCard.tsx
+10 -17
@@ -1,10 +1,11 @@
1 +import { Button } from "../../components/ui/Button";
2 import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
3 import { AsyncResult } from "effect/reactivity";
4 import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell";
5 import type { EnvironmentId } from "@t3tools/contracts";
6 import * as DateTime from "effect/DateTime";
7 import { useEffect, useState } from "react";
7 -import { Pressable, View } from "react-native";
8 +import { View } from "react-native";
9 import { AppText as Text } from "../../components/ui/AppText";
10 import { threadEnvironment } from "../../state/threads";
11 import { useAtomCommand } from "../../state/use-atom-command";
@@ -93,26 +94,18 @@ export function UsageLimitRecoveryCard({
94 </Text>
95 {canSchedule ? (
96 <View className="flex-row flex-wrap gap-2">
96 - <Pressable
97 - accessibilityRole="button"
97 + <Button
98 + label={scheduled ? "Cancel auto-resume" : "Resume at reset"}
99 + tone="secondary"
100 disabled={pending}
101 onPress={() => void toggle("resume")}
100 - className="self-start rounded-lg bg-subtle px-3 py-2 active:opacity-70"
101 - >
102 - <Text className="text-sm text-foreground">
103 - {scheduled ? "Cancel auto-resume" : "Resume at reset"}
104 - </Text>
105 - </Pressable>
106 - <Pressable
107 - accessibilityRole="button"
102 + />
103 + <Button
104 + label={snoozed ? "Wake now" : "Snooze until reset"}
105 + tone="secondary"
106 disabled={pending || (!snoozed && resetPassed)}
107 onPress={() => void toggle("snooze")}
110 - className="self-start rounded-lg bg-subtle px-3 py-2 active:opacity-70"
111 - >
112 - <Text className="text-sm text-foreground">
113 - {snoozed ? "Wake now" : "Snooze until reset"}
114 - </Text>
115 - </Pressable>
108 + />
109 </View>
110 ) : null}
111 {error ? (
apps/mobile/src/features/threads/git/GitCommitSheet.tsx
+153 -206
@@ -1,12 +1,12 @@
1 +import { Button } from "../../../components/ui/Button";
2 import { useNavigation, type StaticScreenProps } from "@react-navigation/native";
3 import { useState } from "react";
4 import { Platform, Pressable, ScrollView, useWindowDimensions, View } from "react-native";
5 import { formatDiffCount } from "@t3tools/client-runtime/diff-count";
6 import { useSafeAreaInsets } from "react-native-safe-area-context";
7
7 -import { AndroidSheetHeader } from "../../../components/ui/AndroidScreenHeader";
8 +import { IconButton } from "../../../components/ui/IconButton";
9 import { SymbolView } from "../../../components/ui/AppSymbol";
9 -import { ScreenContent } from "../../../components/ui/ScreenContent";
10 import { NativeStackScreenOptions } from "../../../native/StackHeader";
11 import { AppText as Text, AppTextInput as TextInput } from "../../../components/ui/AppText";
12 import { cn } from "../../../lib/cn";
@@ -16,7 +16,6 @@ import { useSelectedThreadGitActions } from "../../../state/use-selected-thread-
16 import { useSelectedThreadGitState } from "../../../state/use-selected-thread-git-state";
17 import { useSelectedThreadWorktree } from "../../../state/use-selected-thread-worktree";
18 import { vcsEnvironment } from "../../../state/vcs";
19 -import { SheetActionButton } from "./gitSheetComponents";
19
20 type GitCommitSheetProps = StaticScreenProps<{
21 readonly environmentId: string;
@@ -48,14 +47,12 @@ export function GitCommitSheet(_props: GitCommitSheetProps) {
47
48 const [dialogCommitMessage, setDialogCommitMessage] = useState("");
49 const [excludedFiles, setExcludedFiles] = useState<ReadonlySet<string>>(new Set());
51 - const [isEditingFiles, setIsEditingFiles] = useState(false);
50
51 const selectedFiles = allFiles.filter((file) => !excludedFiles.has(file.path));
52 const allSelected = excludedFiles.size === 0;
53 const noneSelected = selectedFiles.length === 0;
54 const selectedInsertions = selectedFiles.reduce((sum, file) => sum + file.insertions, 0);
55 const selectedDeletions = selectedFiles.reduce((sum, file) => sum + file.deletions, 0);
58 - const selectedFilePreview = selectedFiles.slice(0, 3);
56
57 const runCommitAction = async (featureBranch: boolean) => {
58 if (!canWriteSourceControl || (featureBranch && !canChangeThreadBranch)) return;
@@ -77,221 +74,171 @@ export function GitCommitSheet(_props: GitCommitSheetProps) {
74 >
75 {Platform.OS === "android" ? (
76 <NativeStackScreenOptions
80 - options={{
81 - sheetCornerRadius: 28,
82 - sheetAllowedDetents: "fitToContents",
83 - }}
77 + options={{ sheetCornerRadius: 28, sheetAllowedDetents: "fitToContents" }}
78 />
79 ) : null}
86 - {Platform.OS === "android" ? (
87 - <AndroidSheetHeader
88 - title="Commit changes"
89 - onBack={() => navigation.goBack()}
90 - hideBottomBorder
80 + <View className="flex-row items-center justify-between gap-3 px-5 pt-3 pb-2">
81 + <View className="flex-1 gap-1">
82 + <Text className="text-xl font-t3-bold text-foreground">Commit changes</Text>
83 + <View className="flex-row items-center gap-1.5">
84 + <SymbolView
85 + name="arrow.branch"
86 + size={14}
87 + tintColorClassName="accent-foreground-muted"
88 + />
89 + <Text
90 + numberOfLines={1}
91 + ellipsizeMode="middle"
92 + className="flex-1 text-sm text-foreground-muted"
93 + >
94 + {gitStatus.data?.refName ?? "(detached HEAD)"}
95 + </Text>
96 + </View>
97 + </View>
98 + <IconButton
99 + icon="xmark"
100 + accessibilityLabel="Close commit sheet"
101 + onPress={() => navigation.goBack()}
102 />
92 - ) : null}
93 - <ScreenContent fitToContents>
94 - <ScrollView
95 - nestedScrollEnabled
96 - className="android:shrink android:grow-0 ios:flex-1"
97 - keyboardShouldPersistTaps="handled"
98 - showsVerticalScrollIndicator={false}
99 - contentInset={{ bottom: Math.max(insets.bottom, 18) + 18 }}
100 - contentContainerClassName="android:gap-2 android:p-2 ios:gap-4 ios:px-5 ios:pt-2"
101 - contentContainerStyle={
102 - Platform.OS === "android"
103 - ? { paddingBottom: Math.max(insets.bottom, 18) + 18 }
104 - : undefined
105 - }
106 - >
107 - <View className="gap-3 bg-card p-4 android:rounded-[20px] ios:rounded-[22px] ios:border ios:border-border">
108 - <View className="android:gap-1 ios:flex-row ios:items-center ios:justify-between ios:gap-3">
109 - <Text className="text-foreground-muted text-sm font-medium">Branch</Text>
110 - <Text className="text-foreground text-base android:font-t3-medium ios:font-t3-bold">
111 - {gitStatus.data?.refName ?? "(detached HEAD)"}
103 + </View>
104 + <ScrollView
105 + nestedScrollEnabled
106 + className="android:shrink android:grow-0 ios:flex-1"
107 + keyboardShouldPersistTaps="handled"
108 + keyboardDismissMode="on-drag"
109 + automaticallyAdjustKeyboardInsets
110 + contentContainerClassName="px-5 pt-4 pb-6 gap-5"
111 + contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 18) + 18 }}
112 + >
113 + {isDefaultRef ? (
114 + <Text className="text-sm text-warning-foreground">
115 + You’re on the default branch. You can create a new branch when committing.
116 + </Text>
117 + ) : null}
118 + <View className="gap-2">
119 + <Text className="text-sm font-t3-medium text-foreground">Commit message</Text>
120 + <TextInput
121 + multiline
122 + accessibilityLabel="Commit message"
123 + value={dialogCommitMessage}
124 + onChangeText={setDialogCommitMessage}
125 + placeholder="Describe your changes…"
126 + textAlignVertical="top"
127 + className="min-h-24 rounded-xl bg-subtle px-4 py-3 text-base"
128 + />
129 + <Text className="text-xs text-foreground-muted">
130 + Leave empty to generate a message automatically.
131 + </Text>
132 + </View>
133 + <View>
134 + <View className="flex-row items-center justify-between gap-2 pb-2">
135 + <View className="flex-1 gap-1">
136 + <Text className="text-base font-t3-bold text-foreground">Changed files</Text>
137 + <Text className="text-xs text-foreground-muted">
138 + {selectedFiles.length} of {allFiles.length} selected · +
139 + {formatDiffCount(selectedInsertions)} −{formatDiffCount(selectedDeletions)}
140 </Text>
141 </View>
114 - {isDefaultRef ? (
115 - <Text className="text-xs leading-normal text-warning-foreground">
116 - Warning: this is the default branch.
117 - </Text>
142 + {allFiles.length > 0 ? (
143 + <Button
144 + label={allSelected ? "Deselect all" : "Select all"}
145 + tone="text"
146 + onPress={() =>
147 + setExcludedFiles(
148 + allSelected ? new Set(allFiles.map((file) => file.path)) : new Set(),
149 + )
150 + }
151 + />
152 ) : null}
153 </View>
120 -
121 - <View className="gap-3 bg-card p-4 android:rounded-[20px] ios:rounded-[22px] ios:border ios:border-border">
122 - <View className="flex-row items-center justify-between gap-3">
123 - <View className="gap-1">
124 - <Text className="text-foreground text-base android:font-t3-medium ios:font-t3-bold">
125 - Files
126 - </Text>
127 - <Text className="text-foreground-muted text-xs leading-normal">
128 - {selectedFiles.length} selected · +{formatDiffCount(selectedInsertions)} / -
129 - {formatDiffCount(selectedDeletions)}
130 - </Text>
131 - </View>
132 - <View className="flex-row items-center gap-2">
133 - {!allSelected && isEditingFiles ? (
134 - <Pressable
135 - className="rounded-full px-3 android:min-h-12 android:justify-center android:active:bg-subtle ios:bg-subtle ios:py-2"
136 - onPress={() => setExcludedFiles(new Set())}
137 - >
138 - <Text className="android:text-primary-text android:text-sm android:font-t3-medium ios:text-foreground ios:text-2xs ios:font-t3-bold ios:uppercase">
139 - Reset
140 - </Text>
141 - </Pressable>
142 - ) : null}
154 + {allFiles.length === 0 ? (
155 + <Text className="py-4 text-sm text-foreground-muted">No changed files to commit.</Text>
156 + ) : (
157 + allFiles.map((file) => {
158 + const included = !excludedFiles.has(file.path);
159 + const slash = file.path.lastIndexOf("/");
160 + const name = file.path.slice(slash + 1);
161 + const directory = slash >= 0 ? file.path.slice(0, slash) : null;
162 + return (
163 <Pressable
144 - className="rounded-full px-3 android:min-h-12 android:justify-center android:active:bg-subtle ios:bg-subtle ios:py-2"
145 - onPress={() => setIsEditingFiles((current) => !current)}
164 + key={file.path}
165 + className="min-h-16 flex-row items-center gap-3 border-t border-border-subtle py-3"
166 + accessibilityRole="checkbox"
167 + accessibilityLabel={file.path}
168 + accessibilityState={{ checked: included }}
169 + onPress={() =>
170 + setExcludedFiles((current) => {
171 + const next = new Set(current);
172 + if (next.has(file.path)) next.delete(file.path);
173 + else next.add(file.path);
174 + return next;
175 + })
176 + }
177 >
147 - <Text className="android:text-primary-text android:text-sm android:font-t3-medium ios:text-foreground ios:text-2xs ios:font-t3-bold ios:uppercase">
148 - {isEditingFiles ? "Done" : "Edit"}
149 - </Text>
150 - </Pressable>
151 - </View>
152 - </View>
153 -
154 - {allFiles.length === 0 ? (
155 - <Text className="text-foreground-secondary text-sm leading-normal">
156 - No changed files are available to commit.
157 - </Text>
158 - ) : !isEditingFiles ? (
159 - <View className="gap-2">
160 - {selectedFilePreview.map((file) => (
161 - <View key={file.path} className="flex-row items-center justify-between gap-3">
162 - <Text className="text-foreground flex-1 text-sm font-medium" numberOfLines={1}>
163 - {file.path}
178 + <View
179 + className={cn(
180 + "size-5 items-center justify-center rounded-full",
181 + included ? "bg-primary" : "border border-input-border",
182 + )}
183 + >
184 + {included ? (
185 + <SymbolView
186 + name="checkmark"
187 + size={13}
188 + tintColorClassName="accent-primary-foreground"
189 + />
190 + ) : null}
191 + </View>
192 + <View className="flex-1 gap-1">
193 + <Text
194 + numberOfLines={1}
195 + ellipsizeMode="middle"
196 + className="text-sm font-t3-medium text-foreground"
197 + >
198 + {name}
199 </Text>
165 - <Text className="text-xs font-t3-bold text-adaptive-emerald-700-300">
200 + {directory ? (
201 + <Text
202 + numberOfLines={1}
203 + ellipsizeMode="middle"
204 + className="text-xs text-foreground-muted"
205 + >
206 + {directory}
207 + </Text>
208 + ) : null}
209 + </View>
210 + <View className="flex-row gap-2">
211 + <Text className="text-xs text-adaptive-emerald-700-300">
212 +{formatDiffCount(file.insertions)}
213 </Text>
168 - <Text className="text-xs font-t3-bold text-adaptive-rose-700-300">
169 - -{formatDiffCount(file.deletions)}
214 + <Text className="text-xs text-adaptive-rose-700-300">
215 + −{formatDiffCount(file.deletions)}
216 </Text>
217 </View>
172 - ))}
173 - {selectedFiles.length > selectedFilePreview.length ? (
174 - <Text className="text-foreground-muted text-xs leading-snug">
175 - +{selectedFiles.length - selectedFilePreview.length} more files
176 - </Text>
177 - ) : null}
178 - </View>
179 - ) : (
180 - <View className="gap-2">
181 - {allFiles.map((file) => {
182 - const included = !excludedFiles.has(file.path);
183 - return (
184 - <Pressable
185 - key={file.path}
186 - className={cn(
187 - "px-4 py-3 android:rounded-xl ios:rounded-[18px] ios:border",
188 - included
189 - ? "android:bg-subtle ios:border-border"
190 - : "ios:border-border-subtle",
191 - )}
192 - accessibilityRole="checkbox"
193 - accessibilityLabel={file.path}
194 - accessibilityState={{ checked: included }}
195 - onPress={() => {
196 - setExcludedFiles((current) => {
197 - const next = new Set(current);
198 - if (next.has(file.path)) {
199 - next.delete(file.path);
200 - } else {
201 - next.add(file.path);
202 - }
203 - return next;
204 - });
205 - }}
206 - >
207 - {Platform.OS !== "android" ? (
208 - <View
209 - className={`absolute inset-0 rounded-[18px] ${included ? "bg-card" : "bg-subtle"}`}
210 - />
211 - ) : null}
212 - <View className="flex-row items-start justify-between gap-3">
213 - {Platform.OS === "android" ? (
214 - <View
215 - className={cn(
216 - "mt-0.5 size-5 items-center justify-center rounded-sm",
217 - included ? "bg-primary" : "border border-input-border",
218 - )}
219 - >
220 - {included ? (
221 - <SymbolView
222 - name="checkmark"
223 - size={16}
224 - tintColorClassName="accent-primary-foreground"
225 - type="monochrome"
226 - />
227 - ) : null}
228 - </View>
229 - ) : null}
230 - <View className="flex-1 gap-1">
231 - <Text
232 - selectable
233 - className={`text-sm font-t3-bold ${included ? "text-foreground" : "text-foreground-muted"}`}
234 - >
235 - {file.path}
236 - </Text>
237 - {!included ? (
238 - <Text className="text-foreground-muted text-2xs leading-normal">
239 - Excluded from this commit
240 - </Text>
241 - ) : null}
242 - </View>
243 - <View className="items-end gap-1">
244 - <Text className="text-xs font-t3-bold text-adaptive-emerald-700-300">
245 - +{formatDiffCount(file.insertions)}
246 - </Text>
247 - <Text className="text-xs font-t3-bold text-adaptive-rose-700-300">
248 - -{formatDiffCount(file.deletions)}
249 - </Text>
250 - </View>
251 - </View>
252 - </Pressable>
253 - );
254 - })}
255 - </View>
256 - )}
257 - </View>
258 -
259 - <View className="android:gap-3 android:rounded-[20px] android:bg-card android:p-4 ios:gap-2">
260 - <Text className="text-foreground android:text-base android:font-t3-medium ios:text-sm ios:font-t3-bold">
261 - Commit message
262 - </Text>
263 - <TextInput
264 - multiline
265 - accessibilityLabel="Commit message"
266 - value={dialogCommitMessage}
267 - onChangeText={setDialogCommitMessage}
268 - placeholder="Leave empty to auto-generate"
269 - textAlignVertical="top"
270 - className="min-h-[128px] px-4 py-3.5 android:rounded-xl android:bg-sheet-solid ios:rounded-[20px]"
271 - />
272 - </View>
273 -
274 - <View className="android:gap-2 ios:flex-row ios:gap-3">
275 - <View className="ios:flex-1">
276 - <SheetActionButton
277 - icon="arrow.branch"
278 - label="Commit on new branch"
279 - disabled={!canChangeThreadBranch || noneSelected || busy}
280 - onPress={() => void runCommitAction(true)}
281 - />
282 - </View>
283 - <View className="ios:flex-1">
284 - <SheetActionButton
285 - icon="checkmark.circle"
286 - label="Commit"
287 - tone="primary"
288 - disabled={!canWriteSourceControl || noneSelected || busy}
289 - onPress={() => void runCommitAction(false)}
290 - />
291 - </View>
292 - </View>
293 - </ScrollView>
294 - </ScreenContent>
218 + </Pressable>
219 + );
220 + })
221 + )}
222 + </View>
223 + <View className="gap-2">
224 + <Button
225 + label="Commit changes"
226 + icon="checkmark"
227 + tone="primary"
228 + fullWidth
229 + disabled={!canWriteSourceControl || noneSelected || busy}
230 + onPress={() => void runCommitAction(false)}
231 + />
232 + <Button
233 + label="Commit on a new branch"
234 + icon="arrow.branch"
235 + tone="text"
236 + fullWidth
237 + disabled={!canWriteSourceControl || !canChangeThreadBranch || noneSelected || busy}
238 + onPress={() => void runCommitAction(true)}
239 + />
240 + </View>
241 + </ScrollView>
242 </View>
243 );
244 }
apps/mobile/src/features/threads/thread-work-log.tsx
+18 -18
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import { SubagentStatusDot } from "./SubagentStatusDot";
3 import { ThreadSubagentGroup } from "./thread-subagent-group";
4 import {
@@ -796,24 +797,23 @@ function WorkspacePreparationRetryButton(props: {
797 const [busy, setBusy] = useState(false);
798 if (!retryable) return null;
799 return (
799 - <Pressable
800 - accessibilityRole="button"
801 - accessibilityLabel="Retry workspace preparation"
802 - disabled={busy}
803 - onPress={() => {
804 - setBusy(true);
805 - void Haptics.selectionAsync();
806 - void retry({
807 - environmentId: props.environmentId,
808 - input: { threadId: props.threadId, runId: props.runId },
809 - }).finally(() => setBusy(false));
810 - }}
811 - className="ml-7 mt-2 min-h-11 flex-row items-center gap-1.5 self-start rounded-full border border-border px-4"
812 - style={{ opacity: busy ? 0.5 : 1 }}
813 - >
814 - <SymbolView name="arrow.clockwise" size={13} tintColorClassName="accent-icon" />
815 - <Text className="font-t3-medium text-sm text-foreground">Retry</Text>
816 - </Pressable>
800 + <View className="ml-7 mt-2">
801 + <Button
802 + label="Retry"
803 + tone="secondary"
804 + accessibilityLabel="Retry workspace preparation"
805 + disabled={busy}
806 + onPress={() => {
807 + setBusy(true);
808 + void Haptics.selectionAsync();
809 + void retry({
810 + environmentId: props.environmentId,
811 + input: { threadId: props.threadId, runId: props.runId },
812 + }).finally(() => setBusy(false));
813 + }}
814 + icon="arrow.clockwise"
815 + />
816 + </View>
817 );
818 }
819
apps/mobile/src/features/threads/worktree-setup-card.tsx
+9 -12
@@ -1,3 +1,4 @@
1 +import { Button } from "../../components/ui/Button";
2 import {
3 worktreeSetupStageLabel,
4 type WorktreeSetupSnapshot,
@@ -229,28 +230,24 @@ function SetupDetailsSheet({
230 ) : null}
231 {canCancel ? (
232 <View className="mt-3 flex-row items-center justify-end gap-4 border-t border-border pt-1">
232 - <Pressable
233 - accessibilityRole="button"
233 + <Button
234 + label="Cancel setup"
235 + tone="danger"
236 accessibilityLabel="Cancel worktree setup"
237 onPress={() => {
238 onClose();
239 onCancel();
240 }}
239 - className="min-h-11 justify-center px-2"
240 - >
241 - <Text className="text-sm text-danger-foreground">Cancel setup</Text>
242 - </Pressable>
241 + />
242 {onWorkLocally ? (
244 - <Pressable
245 - accessibilityRole="button"
243 + <Button
244 + label="Work locally"
245 + tone="secondary"
246 onPress={() => {
247 onClose();
248 onWorkLocally();
249 }}
250 - className="min-h-11 justify-center px-2"
251 - >
252 - <Text className="text-sm text-foreground">Work locally</Text>
253 - </Pressable>
250 + />
251 ) : null}
252 </View>
253 ) : null}