Skip to content

Commit ad7c3db

Browse files
authored
Merge branch 'main' into feat/new-project-readme-credit
2 parents b6b2896 + e3e89f4 commit ad7c3db

67 files changed

Lines changed: 834 additions & 1024 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/mobile/src/Stack.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
889889
linking: `${THREAD_LINKING_PREFIX}/git/commit`,
890890
options: {
891891
...FORM_SHEET_PRESENTATION_OPTIONS,
892-
sheetAllowedDetents: [0.55, 0.92],
892+
sheetAllowedDetents: [0.8, 0.92],
893893
sheetGrabberVisible: true,
894894
},
895895
}),

‎apps/mobile/src/components/ComposerContextAttachment.tsx‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Button } from "./ui/Button";
12
import { settlePromise, squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
23
import { AsyncResult } from "effect/reactivity";
34
import * as Dialog from "./ui/Dialog";
@@ -118,16 +119,14 @@ export function ComposerContextAttachment(props: {
118119
</Text>
119120
) : null}
120121
<PresentationSource identifier={shareSourceIdentifier}>
121-
<Pressable
122-
accessibilityRole="button"
122+
<Button
123+
label={sharing ? "Opening attachment…" : "Open or share attachment"}
124+
tone="secondary"
123125
disabled={sharing}
124126
onPress={() => void share()}
125-
className="rounded-xl bg-subtle p-4"
126-
>
127-
<Text className="text-foreground">
128-
{sharing ? "Opening attachment…" : "Open or share attachment"}
129-
</Text>
130-
</Pressable>
127+
fullWidth
128+
loading={sharing}
129+
/>
131130
</PresentationSource>
132131
{previewOpen && record.kind === "image" && uri ? (
133132
<FilePreviewModal

‎apps/mobile/src/components/ComposerContextSheet.tsx‎

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Button } from "./ui/Button";
12
import * as Dialog from "./ui/Dialog";
23
import { useOpenPullRequest } from "../native/useOpenPullRequest";
34
import { SourceFileSurface } from "../features/files/SourceFileSurface";
@@ -299,18 +300,17 @@ export function ComposerContextSheet(props: {
299300
<View className="gap-3">
300301
<ContextField label="Thread" value={record.title} />
301302
{props.onOpenThread ? (
302-
<Pressable
303-
accessibilityRole="button"
303+
<Button
304+
label="Open thread"
305+
tone="secondary"
304306
onPress={() =>
305307
props.onOpenThread?.({
306308
environmentId: record.environmentId,
307309
threadId: record.threadId,
308310
})
309311
}
310-
className="rounded-xl bg-subtle p-4"
311-
>
312-
<Text className="text-foreground">Open thread</Text>
313-
</Pressable>
312+
fullWidth
313+
/>
314314
) : null}
315315
</View>
316316
) : null}
@@ -322,13 +322,12 @@ export function ComposerContextSheet(props: {
322322
value={props.skillDescription ?? "No description is available for this skill."}
323323
/>
324324
{props.onOpenSkill ? (
325-
<Pressable
326-
accessibilityRole="button"
325+
<Button
326+
label="View instructions"
327+
tone="secondary"
327328
onPress={props.onOpenSkill}
328-
className="rounded-xl bg-subtle p-4"
329-
>
330-
<Text className="text-foreground">View instructions</Text>
331-
</Pressable>
329+
fullWidth
330+
/>
332331
) : null}
333332
</View>
334333
) : null}
@@ -364,31 +363,23 @@ export function ComposerContextSheet(props: {
364363
</Pressable>
365364
) : null}
366365
{props.onOpenAttachment ? (
367-
<Pressable
368-
accessibilityRole="button"
366+
<Button
367+
label="Open attachment"
368+
tone="secondary"
369369
onPress={props.onOpenAttachment}
370-
className="rounded-xl bg-subtle p-4"
371-
>
372-
<Text className="text-foreground">Open attachment</Text>
373-
</Pressable>
370+
fullWidth
371+
/>
374372
) : null}
375373
{props.onOpenPullRequest && !pullRequestUrl ? (
376-
<Pressable
377-
accessibilityRole="button"
374+
<Button
375+
label="Open pull request"
376+
tone="secondary"
378377
onPress={props.onOpenPullRequest}
379-
className="rounded-xl bg-subtle p-4"
380-
>
381-
<Text className="text-foreground">Open pull request</Text>
382-
</Pressable>
378+
fullWidth
379+
/>
383380
) : null}
384381
{props.onRemove ? (
385-
<Pressable
386-
accessibilityRole="button"
387-
onPress={props.onRemove}
388-
className="rounded-xl bg-subtle p-4"
389-
>
390-
<Text className="text-foreground">Remove from draft</Text>
391-
</Pressable>
382+
<Button label="Remove from draft" tone="secondary" onPress={props.onRemove} fullWidth />
392383
) : null}
393384
</ScrollView>
394385
</Sheet>

‎apps/mobile/src/components/FilePreview.tsx‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { Button } from "./ui/Button";
12
import * as Dialog from "./ui/Dialog";
23
import { useEffect, useEffectEvent } from "react";
3-
import { Modal, Pressable, View } from "react-native";
4+
import { Modal, View } from "react-native";
45
import ImageViewing from "react-native-image-viewing";
56
import { useSafeAreaInsets } from "react-native-safe-area-context";
67

@@ -84,13 +85,9 @@ function DocumentPreview(props: {
8485
<Text className="text-foreground-muted" numberOfLines={2}>
8586
{name ?? "Document"}
8687
</Text>
87-
<Pressable
88-
accessibilityRole="button"
89-
onPress={props.onRequestClose}
90-
className="self-end p-3"
91-
>
92-
<Text className="text-foreground">Cancel</Text>
93-
</Pressable>
88+
<View className="items-end">
89+
<Button label="Cancel" tone="text" onPress={props.onRequestClose} />
90+
</View>
9491
</View>
9592
</View>
9693
</Modal>

‎apps/mobile/src/components/ui/Button.android.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function Button(props: ButtonProps) {
4949
<View
5050
accessible
5151
accessibilityRole="button"
52-
accessibilityLabel={props.label}
52+
accessibilityLabel={props.accessibilityLabel ?? props.label}
5353
accessibilityHint={props.accessibilityHint}
5454
accessibilityState={{
5555
disabled: Boolean(props.disabled || props.loading),

‎apps/mobile/src/components/ui/Button.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { cn } from "../../lib/cn";
66

77
export interface ButtonProps {
88
readonly label: string;
9+
readonly accessibilityLabel?: string;
910
readonly icon?: AppSymbolName;
1011
readonly onPress: () => void;
1112
readonly disabled?: boolean;
@@ -29,7 +30,7 @@ export function Button(props: ButtonProps) {
2930
return (
3031
<Pressable
3132
accessibilityRole="button"
32-
accessibilityLabel={props.label}
33+
accessibilityLabel={props.accessibilityLabel ?? props.label}
3334
accessibilityHint={props.accessibilityHint}
3435
accessibilityState={{ disabled, busy: Boolean(props.loading) }}
3536
disabled={disabled}

‎apps/mobile/src/features/archive/ArchivedThreadsScreen.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Button } from "../../components/ui/Button";
12
import type {
23
EnvironmentProject,
34
EnvironmentThreadShell,
@@ -14,7 +15,7 @@ import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
1415
import { AppBar } from "../../components/ui/AppBar";
1516
import { SymbolView } from "../../components/ui/AppSymbol";
1617
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";
1819
import { GestureDetector, useNativeGesture } from "react-native-gesture-handler";
1920
import type { SwipeableMethods } from "react-native-gesture-handler/ReanimatedSwipeable";
2021

@@ -279,9 +280,9 @@ function ArchiveError(props: { readonly message: string; readonly onRetry: () =>
279280
Could not load every archive
280281
</Text>
281282
<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>
285286
</View>
286287
);
287288
}

‎apps/mobile/src/features/browser/PreviewStreamWebView.tsx‎

Lines changed: 28 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Button } from "../../components/ui/Button";
12
import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
23
import * as Dialog from "../../components/ui/Dialog";
34
import previewStreamScript from "@t3tools/mobile-preview-stream";
@@ -142,13 +143,9 @@ export function PreviewStreamWebView(
142143
{error || "Connecting to browser..."}
143144
</AppText>
144145
{error && (
145-
<Pressable
146-
accessibilityRole="button"
147-
className="rounded-full border border-secondary-border bg-secondary px-6 py-3"
148-
onPress={refresh}
149-
>
150-
<AppText className="text-secondary-foreground">Retry</AppText>
151-
</Pressable>
146+
<View className="items-center">
147+
<Button label="Retry" tone="secondary" onPress={refresh} />
148+
</View>
152149
)}
153150
</>
154151
)}
@@ -335,19 +332,14 @@ function PreviewStreamDocumentView({
335332
{previewStreamControlLabel(control)}
336333
</AppText>
337334
{control?.canOperate ? (
338-
<Pressable
339-
accessibilityRole="button"
335+
<Button
336+
label={control.controller === "you" ? "Release control" : "Take control"}
337+
tone="secondary"
340338
disabled={control.controller === "another-viewer"}
341-
accessibilityState={{ disabled: control.controller === "another-viewer" }}
342-
className="rounded-full border border-secondary-border bg-secondary px-3 py-2"
343339
onPress={() =>
344340
command({ type: control.controller === "you" ? "releaseControl" : "takeControl" })
345341
}
346-
>
347-
<AppText className="text-xs text-secondary-foreground">
348-
{control.controller === "you" ? "Release control" : "Take control"}
349-
</AppText>
350-
</Pressable>
342+
/>
351343
) : null}
352344
</View>
353345
) : null}
@@ -445,22 +437,12 @@ function PreviewStreamDocumentView({
445437
The page asks for {fileChooser.multiple ? "files" : "a file"}.
446438
</AppText>
447439
<View className="flex-row justify-end gap-3">
448-
<Pressable
449-
accessibilityRole="button"
450-
className="px-3 py-2"
451-
onPress={() => answerFileChooser(false)}
452-
>
453-
<AppText className="text-secondary-foreground">Cancel</AppText>
454-
</Pressable>
455-
<Pressable
456-
accessibilityRole="button"
457-
className="px-3 py-2"
440+
<Button label="Cancel" tone="text" onPress={() => answerFileChooser(false)} />
441+
<Button
442+
label={`Choose ${fileChooser.multiple ? "files" : "file"}`}
443+
tone="secondary"
458444
onPress={() => answerFileChooser(true)}
459-
>
460-
<AppText className="text-secondary-foreground">
461-
Choose {fileChooser.multiple ? "files" : "file"}
462-
</AppText>
463-
</Pressable>
445+
/>
464446
</View>
465447
</View>
466448
) : null}
@@ -480,26 +462,22 @@ function PreviewStreamDocumentView({
480462
/>
481463
) : null}
482464
<View className="flex-row justify-end gap-3">
483-
<Pressable
484-
accessibilityRole="button"
485-
className="px-3 py-2"
465+
<Button
466+
label="Dismiss"
467+
tone="text"
486468
onPress={() => command({ type: "dialog", accept: false })}
487-
>
488-
<AppText className="text-secondary-foreground">Dismiss</AppText>
489-
</Pressable>
490-
<Pressable
491-
accessibilityRole="button"
492-
className="px-3 py-2"
469+
/>
470+
<Button
471+
label="Accept"
472+
tone="secondary"
493473
onPress={() =>
494474
command({
495475
type: "dialog",
496476
accept: true,
497477
...(control.dialog?.type === "prompt" ? { promptText } : {}),
498478
})
499479
}
500-
>
501-
<AppText className="text-secondary-foreground">Accept</AppText>
502-
</Pressable>
480+
/>
503481
</View>
504482
</>
505483
) : (
@@ -537,15 +515,13 @@ function PreviewStreamDocumentView({
537515
</Pressable>
538516
) : null}
539517
{status === "error" && !gone && !compact ? (
540-
<Pressable
541-
accessibilityRole="button"
542-
className="rounded-full border border-secondary-border bg-secondary px-6 py-3"
543-
onPress={onRetry}
544-
>
545-
<AppText className="text-secondary-foreground">
546-
{hostSetup ? "Try again" : "Reconnect"}
547-
</AppText>
548-
</Pressable>
518+
<View className="items-center">
519+
<Button
520+
label={hostSetup ? "Try again" : "Reconnect"}
521+
tone="secondary"
522+
onPress={onRetry}
523+
/>
524+
</View>
549525
) : null}
550526
</View>
551527
) : null}

‎apps/mobile/src/features/cloud/ConnectOnboardingRouteScreen.tsx‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { Button } from "../../components/ui/Button";
12
import { Toolbar } from "../../components/ui/Toolbar";
23
import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollView";
34

45
import { useAuth } from "@clerk/expo";
56
import { StackActions, useNavigation } from "@react-navigation/native";
67
import { useEffect, useState } from "react";
7-
import { Platform, Pressable, RefreshControl, View } from "react-native";
8+
import { Platform, RefreshControl, View } from "react-native";
89
import { useSafeAreaInsets } from "react-native-safe-area-context";
910

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

127128
{userId ? (
128-
<Pressable
129-
accessibilityRole="button"
130-
hitSlop={8}
131-
onPress={handleDontShowAgain}
132-
className="items-center py-1 active:opacity-70"
133-
>
134-
<Text className="text-xs text-foreground-muted">{"Don't show this again"}</Text>
135-
</Pressable>
129+
<Button label={"Don't show this again"} tone="text" onPress={handleDontShowAgain} />
136130
) : null}
137131
</ScrollView>
138132
</View>

0 commit comments

Comments
 (0)