Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/mobile/src/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
linking: `${THREAD_LINKING_PREFIX}/git/commit`,
options: {
...FORM_SHEET_PRESENTATION_OPTIONS,
sheetAllowedDetents: [0.55, 0.92],
sheetAllowedDetents: [0.8, 0.92],
sheetGrabberVisible: true,
},
}),
Expand Down
9 changes: 5 additions & 4 deletions apps/mobile/src/features/archive/ArchivedThreadsScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "../../components/ui/Button";
import type {
EnvironmentProject,
EnvironmentThreadShell,
Expand All @@ -14,7 +15,7 @@ import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
import { AppBar } from "../../components/ui/AppBar";
import { SymbolView } from "../../components/ui/AppSymbol";
import { useCallback, useMemo, useRef, type ComponentProps } from "react";
import { Platform, Pressable, RefreshControl, useWindowDimensions, View } from "react-native";
import { Platform, RefreshControl, useWindowDimensions, View } from "react-native";
import { GestureDetector, useNativeGesture } from "react-native-gesture-handler";
import type { SwipeableMethods } from "react-native-gesture-handler/ReanimatedSwipeable";

Expand Down Expand Up @@ -279,9 +280,9 @@ function ArchiveError(props: { readonly message: string; readonly onRetry: () =>
Could not load every archive
</Text>
<Text className="mt-1 text-sm text-foreground-muted">{props.message}</Text>
<Pressable className="mt-3 self-start active:opacity-60" onPress={props.onRetry}>
<Text className="text-sm font-t3-bold text-danger-foreground">Try again</Text>
</Pressable>
<View className="mt-3">
<Button label="Try again" tone="secondary" onPress={props.onRetry} />
</View>
</View>
);
}
Expand Down
11 changes: 5 additions & 6 deletions apps/mobile/src/features/threads/ComposerFeedback.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "../../components/ui/Button";
import {
codexFeedbackNotice,
type CodexFeedbackSubmission,
Expand Down Expand Up @@ -47,15 +48,13 @@ export function ComposerFeedback({
</Text>
) : null}
{submission.status === "sent" ? (
<Pressable
accessibilityRole="button"
<Button
label="Copy ID"
tone="text"
onPress={() =>
copyTextWithHaptic(submission.feedbackId, { target: "Codex feedback thread ID" })
}
className="self-start py-1 active:opacity-60"
>
<Text className="text-sm text-foreground">Copy ID</Text>
</Pressable>
/>
) : null}
</View>
</View>
Expand Down
12 changes: 5 additions & 7 deletions apps/mobile/src/features/threads/ComposerQueuedEdit.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "../../components/ui/Button";
import type { ChatAttachment, EnvironmentId } from "@t3tools/contracts";
import { Image } from "expo-image";
import { Pressable, ScrollView, View } from "react-native";
Expand All @@ -17,16 +18,13 @@ export function ComposerQueuedEditBanner(props: {
<Text className="min-w-0 flex-1 text-xs text-foreground-muted" numberOfLines={1}>
Editing queued message
</Text>
<Pressable
accessibilityRole="button"
<Button
label="Cancel"
tone="text"
accessibilityLabel="Cancel editing queued message"
disabled={props.saving}
onPress={props.onCancel}
hitSlop={8}
className="min-h-8 justify-center px-1 active:opacity-70 disabled:opacity-40"
>
<Text className="font-t3-medium text-xs text-primary">Cancel</Text>
</Pressable>
/>
</View>
);
}
Expand Down
19 changes: 6 additions & 13 deletions apps/mobile/src/features/threads/CustomSnoozeSheet.shared.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "../../components/ui/Button";
import { DateTimePicker } from "@expo/ui/community/datetime-picker";
import {
localSnoozeDate,
Expand Down Expand Up @@ -143,16 +144,10 @@ export function CustomSnoozeSheet(props: {
</AppText>
)}
<View className="flex-row justify-end gap-3">
<Pressable
accessibilityRole="button"
className="min-h-12 justify-center px-3"
onPress={props.onClose}
>
<AppText>Cancel</AppText>
</Pressable>
<Pressable
accessibilityRole="button"
className="min-h-12 justify-center rounded-xl bg-subtle px-3"
<Button label="Cancel" tone="text" onPress={props.onClose} />
<Button
label="Snooze"
tone="secondary"
onPress={() => {
const input: CustomSnoozeInput =
mode === "date"
Expand All @@ -170,9 +165,7 @@ export function CustomSnoozeSheet(props: {
props.onSnooze(snoozedUntil);
props.onClose();
}}
>
<AppText className="text-foreground">Snooze</AppText>
</Pressable>
/>
</View>
</ScrollView>
</KeyboardAvoidingView>
Expand Down
11 changes: 4 additions & 7 deletions apps/mobile/src/features/threads/NewTaskContextPickerScreens.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "../../components/ui/Button";
import { Toolbar } from "../../components/ui/Toolbar";
import * as Dialog from "../../components/ui/Dialog";
import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
Expand Down Expand Up @@ -470,13 +471,9 @@ export function BranchPickerScreen(props: {
: "No branches available"}
</Text>
{!props.loading && props.error ? (
<Pressable
accessibilityRole="button"
className="rounded-full bg-card px-4 py-2 active:opacity-70"
onPress={props.onRefresh}
>
<Text className="text-sm font-t3-medium text-foreground">Try again</Text>
</Pressable>
<View className="self-center">
<Button label="Try again" tone="secondary" onPress={props.onRefresh} />
</View>
) : null}
</View>
</ScrollView>
Expand Down
11 changes: 5 additions & 6 deletions apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "../../components/ui/Button";
import { Toolbar } from "../../components/ui/Toolbar";
import * as Dialog from "../../components/ui/Dialog";
import { useAtomValue } from "@effect/atom-react";
Expand Down Expand Up @@ -1612,14 +1613,12 @@ export function NewTaskDraftScreen(props: {
) : null}

{modelUnavailable ? (
<Pressable
accessibilityRole="button"
className="px-3 py-2"
<Button
label="Model unavailable. Open model settings."
tone="text"
disabled={isComposerInteractionLocked}
onPress={settingsSheetPresentation.open}
>
<Text className="text-xs text-foreground">Model unavailable. Open model settings.</Text>
</Pressable>
/>
) : null}

<ComposerSurface
Expand Down
12 changes: 4 additions & 8 deletions apps/mobile/src/features/threads/PendingUserInputCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,16 +312,12 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) {
onPress={() => void props.onSubmit()}
/>
{props.pendingUserInput.dismissible ? (
<Pressable
accessibilityRole="button"
className="items-center justify-center rounded-2xl px-4 py-2.5 active:opacity-70"
<Button
label="Dismiss without answering"
tone="text"
disabled={isResponding}
onPress={() => void props.onDismiss()}
>
<Text className="font-t3-bold text-sm text-foreground-muted">
Dismiss without answering
</Text>
</Pressable>
/>
) : null}
{!props.canOperateThread ? (
<Text className="font-sans text-xs text-foreground-tertiary">
Expand Down
13 changes: 6 additions & 7 deletions apps/mobile/src/features/threads/ProjectCloneBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Button } from "../../components/ui/Button";
import {
projectCloneDisplayName,
projectCloneProgressSummary,
type ProjectCloneSnapshot,
} from "@t3tools/contracts";
import { Pressable, View } from "react-native";
import { View } from "react-native";

import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
import { cn } from "../../lib/cn";
Expand Down Expand Up @@ -65,13 +66,11 @@ export function ProjectCloneBanner(props: {

function BannerAction(props: { readonly label: string; readonly onPress: () => void }) {
return (
<Pressable
accessibilityRole="button"
<Button
label={props.label}
tone="secondary"
accessibilityLabel={props.label}
className="rounded-full border border-border bg-card px-3 py-1.5"
onPress={props.onPress}
>
<Text className="font-t3-medium text-xs">{props.label}</Text>
</Pressable>
/>
);
}
14 changes: 5 additions & 9 deletions apps/mobile/src/features/threads/SecretRequestCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "@t3tools/client-runtime/state/runtime";
import type { EnvironmentId, OrchestrationV2ProjectedTurnItem } from "@t3tools/contracts";
import { useRef, useState } from "react";
import { Pressable, View, type ColorValue } from "react-native";
import { View, type ColorValue } from "react-native";

import { SymbolView, type AppSymbolName } from "../../components/ui/AppSymbol";
import { AppText as Text, AppTextInput as TextInput } from "../../components/ui/AppText";
Expand Down Expand Up @@ -147,16 +147,12 @@ function PendingSecretRequestForm(props: {
{SECRET_REQUEST_PRIVACY_NOTE}
</Text>
</View>
<Pressable
accessibilityRole="button"
accessibilityState={{ disabled: submitting }}
<Button
label="Decline"
tone="text"
disabled={submitting}
hitSlop={8}
className="px-1 py-1 active:opacity-60 disabled:opacity-50"
onPress={() => void send({ type: "decline" })}
>
<Text className="font-sans text-xs text-foreground-muted">Decline</Text>
</Pressable>
/>
</View>
</View>
);
Expand Down
11 changes: 7 additions & 4 deletions apps/mobile/src/features/threads/ThreadComposer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "../../components/ui/Button";
import * as Dialog from "../../components/ui/Dialog";
import type { ComposerTextPaste } from "../../native/T3ComposerEditor.types";
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
Expand Down Expand Up @@ -27,7 +28,7 @@ import {
import { StackActions, useFocusEffect, useNavigation } from "@react-navigation/native";
import type { ReactNode } from "react";
import { useEffect, useLayoutEffect, useRef, useState, type RefObject } from "react";
import { Keyboard, Platform, Pressable, View, type ViewStyle } from "react-native";
import { Keyboard, Platform, View, type ViewStyle } from "react-native";
import { composerImageGallery } from "../../lib/composerImageGallery";
import { filePreviewGallery } from "../../lib/filePreviewGallery";
import { FilePreviewModal, type FilePreviewSource } from "../../components/FilePreviewModal";
Expand Down Expand Up @@ -720,9 +721,11 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
</Text>
) : null}
{modelUnavailable ? (
<Pressable accessibilityRole="button" className="px-3 py-2" onPress={openSettings}>
<Text className="text-xs text-foreground">Model unavailable. Open model settings.</Text>
</Pressable>
<Button
label="Model unavailable. Open model settings."
tone="text"
onPress={openSettings}
/>
) : null}

<ComposerSurface
Expand Down
39 changes: 16 additions & 23 deletions apps/mobile/src/features/threads/ThreadFeed.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "../../components/ui/Button";
import * as Dialog from "../../components/ui/Dialog";
import { useOpenPullRequest } from "../../native/useOpenPullRequest";
import { ThreadMarkdownVideo, ThreadMediaVisibleContext } from "./ThreadMarkdownVideo";
Expand Down Expand Up @@ -784,14 +785,12 @@ function ArtifactTemplateCard(props: {
</Text>
</View>
{props.onUse ? (
<Pressable
accessibilityRole="button"
<Button
label="Use template"
tone="secondary"
accessibilityLabel={`Use ${props.template.displayName} template`}
className="min-h-9 justify-center rounded-lg border border-border bg-subtle px-3 active:opacity-65"
onPress={() => props.onUse?.(props.template)}
>
<Text className="font-t3-bold text-xs text-foreground">Use template</Text>
</Pressable>
/>
) : null}
</View>
);
Expand Down Expand Up @@ -2586,29 +2585,23 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
function ThreadFeedLoadEarlierControl(props: ThreadFeedHistoryControls) {
const theme = useUniwindTheme();
const mutedColor = theme["--color-icon-subtle"];
const accentColor = theme["--color-primary"];
if (!props.hasMoreHistory && props.error === null) {
return null;
}
return (
<View className="mb-3 items-center gap-1.5 px-2">
{props.hasMoreHistory ? (
<Pressable
accessibilityRole="button"
accessibilityLabel="Load earlier activity"
disabled={props.loading}
onPress={props.onLoadEarlier}
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"
>
{props.loading ? (
<AppActivityIndicator size="small" color={accentColor} />
) : (
<SymbolView name="chevron.up" size={12} tintColor={accentColor} type="monochrome" />
)}
<Text className="text-sm font-medium text-foreground">
{props.loading ? "Loading earlier activity…" : "Load earlier activity"}
</Text>
</Pressable>
<View className="self-center">
<Button
label={props.loading ? "Loading earlier activity…" : "Load earlier activity"}
tone="secondary"
accessibilityLabel="Load earlier activity"
disabled={props.loading}
onPress={props.onLoadEarlier}
icon="chevron.up"
loading={props.loading}
/>
</View>
) : null}
{props.error !== null ? (
<Text className="text-center text-xs" style={{ color: mutedColor }}>
Expand Down
27 changes: 10 additions & 17 deletions apps/mobile/src/features/threads/UsageLimitRecoveryCard.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Button } from "../../components/ui/Button";
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
import { AsyncResult } from "effect/reactivity";
import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell";
import type { EnvironmentId } from "@t3tools/contracts";
import * as DateTime from "effect/DateTime";
import { useEffect, useState } from "react";
import { Pressable, View } from "react-native";
import { View } from "react-native";
import { AppText as Text } from "../../components/ui/AppText";
import { threadEnvironment } from "../../state/threads";
import { useAtomCommand } from "../../state/use-atom-command";
Expand Down Expand Up @@ -93,26 +94,18 @@ export function UsageLimitRecoveryCard({
</Text>
{canSchedule ? (
<View className="flex-row flex-wrap gap-2">
<Pressable
accessibilityRole="button"
<Button
label={scheduled ? "Cancel auto-resume" : "Resume at reset"}
tone="secondary"
disabled={pending}
onPress={() => void toggle("resume")}
className="self-start rounded-lg bg-subtle px-3 py-2 active:opacity-70"
>
<Text className="text-sm text-foreground">
{scheduled ? "Cancel auto-resume" : "Resume at reset"}
</Text>
</Pressable>
<Pressable
accessibilityRole="button"
/>
<Button
label={snoozed ? "Wake now" : "Snooze until reset"}
tone="secondary"
disabled={pending || (!snoozed && resetPassed)}
onPress={() => void toggle("snooze")}
className="self-start rounded-lg bg-subtle px-3 py-2 active:opacity-70"
>
<Text className="text-sm text-foreground">
{snoozed ? "Wake now" : "Snooze until reset"}
</Text>
</Pressable>
/>
</View>
) : null}
{error ? (
Expand Down
Loading
Loading