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
12 changes: 3 additions & 9 deletions apps/mobile/src/features/cloud/ConnectOnboardingRouteScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Button } from "../../components/ui/Button";
import { Toolbar } from "../../components/ui/Toolbar";
import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollView";

import { useAuth } from "@clerk/expo";
import { StackActions, useNavigation } from "@react-navigation/native";
import { useEffect, useState } from "react";
import { Platform, Pressable, RefreshControl, View } from "react-native";
import { Platform, RefreshControl, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";

import { reportAtomCommandResult, settlePromise } from "@t3tools/client-runtime/state/runtime";
Expand Down Expand Up @@ -125,14 +126,7 @@ function ConfiguredConnectOnboardingRouteScreen() {
)}

{userId ? (
<Pressable
accessibilityRole="button"
hitSlop={8}
onPress={handleDontShowAgain}
className="items-center py-1 active:opacity-70"
>
<Text className="text-xs text-foreground-muted">{"Don't show this again"}</Text>
</Pressable>
<Button label={"Don't show this again"} tone="text" onPress={handleDontShowAgain} />
) : null}
</ScrollView>
</View>
Expand Down
28 changes: 10 additions & 18 deletions apps/mobile/src/features/connection/CloudEnvironmentRows.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "../../components/ui/Button";
import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
import { ConnectionTraceId } from "./ConnectionTraceId";
import { useAuth } from "@clerk/expo";
Expand Down Expand Up @@ -161,15 +162,13 @@ function CloudEnvironmentRowsContent(
{controller.relayDiscovery.errorTraceId ? (
<CopyTraceIdButton traceId={controller.relayDiscovery.errorTraceId} />
) : null}
<Pressable
accessibilityRole="button"
<Button
label="Try again"
tone="secondary"
onPress={() => {
void controller.refreshRelayEnvironments();
}}
className="self-start rounded-full bg-subtle px-3.5 py-2 active:opacity-70"
>
<Text className="text-xs font-t3-bold text-foreground">Try again</Text>
</Pressable>
/>
</View>
) : null}
</View>
Expand Down Expand Up @@ -432,20 +431,13 @@ function CloudEnvironmentRowShell(props: {

function CopyTraceIdButton(props: { readonly traceId: string }) {
return (
<Pressable
accessibilityRole="button"
<Button
label="Copy trace ID"
tone="secondary"
onPress={() => {
copyTextWithHaptic(props.traceId, { target: "connection-trace-id" });
}}
className="self-start flex-row items-center gap-1.5 rounded-full bg-subtle px-3 py-2 active:opacity-70"
>
<SymbolView
name="doc.on.doc"
size={12}
tintColorClassName={"accent-icon"}
type="monochrome"
/>
<Text className="text-xs font-t3-bold text-foreground">Copy trace ID</Text>
</Pressable>
icon="doc.on.doc"
/>
);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Button } from "../../components/ui/Button";
import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
import { ConnectionTraceId } from "./ConnectionTraceId";
import {
type EnvironmentConnectionPhase,
type EnvironmentConnectionPresentation,
} from "@t3tools/client-runtime/connection";
import { SymbolView } from "../../components/ui/AppSymbol";
import { Pressable, View } from "react-native";
import { View } from "react-native";

import { AppText as Text } from "../../components/ui/AppText";

Expand Down Expand Up @@ -87,13 +88,9 @@ export function EnvironmentConnectionNotice(props: {
</Text>

{props.connection.phase !== "offline" && props.connection.phase !== "unsupported" ? (
<Pressable
accessibilityRole="button"
className="mt-1 rounded-full bg-subtle px-4 py-2.5 active:opacity-70"
onPress={props.onRetry}
>
<Text className="text-sm font-t3-bold text-foreground">Retry now</Text>
</Pressable>
<View className="mt-1">
<Button label="Retry now" tone="secondary" onPress={props.onRetry} />
</View>
) : null}
</View>
</View>
Expand Down
13 changes: 7 additions & 6 deletions apps/mobile/src/features/projects/AddProjectScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,13 @@ function EmptyEnvironmentState() {
<Text className="text-center text-sm leading-normal text-foreground-muted">
Start or reconnect an environment before adding a project.
</Text>
<Pressable
onPress={() => navigation.dispatch(StackActions.replace("ConnectionsNew"))}
className="mt-1 rounded-full bg-primary px-4 py-2.5 active:opacity-70"
>
<Text className="text-sm font-t3-bold text-primary-foreground">Add environment</Text>
</Pressable>
<View className="mt-1">
<Button
label="Add environment"
tone="primary"
onPress={() => navigation.dispatch(StackActions.replace("ConnectionsNew"))}
/>
</View>
</View>
);
}
Expand Down
13 changes: 5 additions & 8 deletions apps/mobile/src/features/settings/EnvironmentRoutesSection.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 { useAtomValue } from "@effect/atom-react";
import {
Expand Down Expand Up @@ -132,15 +133,11 @@ export function EnvironmentRoutesSection({
title="Routes"
trailing={
routes.length > 1 ? (
<Pressable
accessibilityRole="button"
<Button
label={editing ? "Done" : "Edit"}
tone="text"
onPress={() => setEditing((value) => !value)}
className="px-2 py-1 active:opacity-70"
>
<Text className="text-sm font-t3-medium text-foreground android:text-primary-text">
{editing ? "Done" : "Edit"}
</Text>
</Pressable>
/>
) : undefined
}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "../../components/ui/Button";
import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollView";
import { useAtomSet, useAtomValue } from "@effect/atom-react";
import { AsyncResult } from "effect/reactivity";
Expand Down Expand Up @@ -166,15 +167,11 @@ export function SettingsMicrophoneRouteScreen() {
title="Preferred order"
trailing={
hasDevices ? (
<Pressable
accessibilityRole="button"
<Button
label={editing ? "Done" : "Edit"}
tone="text"
onPress={() => setEditing((value) => !value)}
className="px-2 py-1 active:opacity-70"
>
<Text className="text-sm font-t3-medium text-foreground">
{editing ? "Done" : "Edit"}
</Text>
</Pressable>
/>
) : undefined
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1067,9 +1067,9 @@ function WebhookScheduleDetails({
{resolved.note !== null ? (
<Text className="text-sm text-foreground-muted">{resolved.note}</Text>
) : null}
<Pressable
accessibilityRole="button"
accessibilityState={{ disabled: disabled || rotating }}
<Button
label={rotating ? "Rotating…" : "Rotate URL"}
tone="danger"
disabled={disabled || rotating}
onPress={() =>
Dialog.alert("Rotate URL?", "The current URL stops working immediately.", [
Expand All @@ -1092,12 +1092,8 @@ function WebhookScheduleDetails({
},
])
}
className="min-h-11 justify-center active:opacity-70 disabled:opacity-50"
>
<Text className="text-base text-danger-foreground">
{rotating ? "Rotating…" : "Rotate URL"}
</Text>
</Pressable>
loading={rotating}
/>
</>
)}
{signatureConfigured ? (
Expand Down
15 changes: 6 additions & 9 deletions apps/mobile/src/features/settings/SettingsThreadsRouteScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Button } from "../../components/ui/Button";
import { AuthSettingsWriteScope } from "@t3tools/contracts";
import { readEnvironmentScope, 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 { Pressable, View } from "react-native";
import { View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";

import { DEFAULT_SERVER_SETTINGS } from "@t3tools/contracts";
Expand Down Expand Up @@ -228,16 +229,12 @@ function AutoSettleSettingsRows() {
<Text className="text-sm text-foreground-muted">
{mismatches.map((mismatch) => mismatch.label).join(", ")}
</Text>
<Pressable
accessibilityRole="button"
<Button
label="Apply auto-settle defaults"
tone="secondary"
disabled={disabled}
onPress={() => writeToAll(autoSettlePatch)}
className="self-start rounded-full bg-subtle px-4 py-2 active:opacity-70"
>
<Text className="text-sm font-t3-medium text-foreground">
Apply auto-settle defaults
</Text>
</Pressable>
/>
</View>
</SettingsSection>
) : null}
Expand Down
41 changes: 18 additions & 23 deletions apps/mobile/src/features/threads/NewTaskRouteScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,33 +400,28 @@ export function NewTaskRouteScreen({ route }: StaticScreenProps<NewTaskRoutePara
) : null}
</>
) : !catalogState.hasReadyEnvironment ? (
<Pressable
className="mt-1 rounded-full bg-primary px-4 py-2.5 active:opacity-70"
onPress={() => navigation.navigate("ConnectionsNew")}
>
<Text className="text-sm font-t3-bold text-primary-foreground">
Add environment
</Text>
</Pressable>
<View className="mt-1">
<Button
label="Add environment"
tone="primary"
onPress={() => navigation.navigate("ConnectionsNew")}
/>
</View>
) : (
<>
<Pressable
className="mt-1 rounded-full bg-primary px-4 py-2.5 active:opacity-70"
onPress={() => navigation.dispatch(StackActions.push("AddProject"))}
>
<Text className="text-sm font-t3-bold text-primary-foreground">
Add new project
</Text>
</Pressable>
<View className="mt-1">
<Button
label="Add new project"
tone="primary"
onPress={() => navigation.dispatch(StackActions.push("AddProject"))}
/>
</View>
{canStartScratch ? (
<Pressable
className="rounded-full bg-subtle px-4 py-2.5 active:opacity-70"
<Button
label="Start without a project"
tone="secondary"
onPress={() => void startScratch()}
>
<Text className="text-sm font-t3-bold text-foreground">
Start without a project
</Text>
</Pressable>
/>
) : null}
</>
)}
Expand Down
Loading