TypeScript
refactor(mobile): unify sheet header actions (#21978)
Julius Marminge60d377380ce6
diff --git a/apps/mobile/src/components/ui/SheetHeader.android.tsx b/apps/mobile/src/components/ui/SheetHeader.android.tsxnew file mode 100644index 00000000000..e56c835365e--- /dev/null+++ b/apps/mobile/src/components/ui/SheetHeader.android.tsx@@ -0,0 +1,54 @@+import { View } from "react-native";++import { AndroidScreenHeader } from "./AndroidScreenHeader";+import { Button } from "./Button";+import { IconButton } from "./IconButton";+import type { SheetCloseButtonProps, SheetHeaderProps } from "./SheetHeader.types";++export function SheetCloseButton(props: SheetCloseButtonProps) {+ return (+ <IconButton+ icon="xmark"+ accessibilityLabel={props.accessibilityLabel ?? (props.onCancel ? "Cancel" : "Close")}+ disabled={props.disabled}+ tintColorClassName="accent-header-foreground"+ onPress={props.onCancel ?? props.onClose}+ />+ );+}++export function SheetHeader(props: SheetHeaderProps) {+ const confirmation = props.confirm;+ const trailing =+ props.trailing || confirmation ? (+ <View className="flex-row items-center gap-2">+ {props.trailing}+ {confirmation ? (+ <Button+ label={confirmation.label}+ tone="text"+ loading={confirmation.loading}+ disabled={confirmation.disabled}+ onPress={confirmation.onPress}+ />+ ) : null}+ </View>+ ) : undefined;++ return (+ <AndroidScreenHeader+ embedded={props.presentation === "inline"}+ title={props.title}+ subtitle={props.subtitle}+ leading={+ <SheetCloseButton+ {...(props.onCancel ? { onCancel: props.onCancel } : { onClose: props.onClose })}+ accessibilityLabel={props.accessibilityLabel}+ disabled={props.dismissDisabled}+ />+ }+ trailing={trailing}+ hideBottomBorder+ />+ );+}diff --git a/apps/mobile/src/components/ui/SheetHeader.tsx b/apps/mobile/src/components/ui/SheetHeader.tsxnew file mode 100644index 00000000000..311020d9fd3--- /dev/null+++ b/apps/mobile/src/components/ui/SheetHeader.tsx@@ -0,0 +1,164 @@+import { Pressable, View } from "react-native";++import { NativeStackScreenOptions } from "../../native/StackHeader";+import { AppActivityIndicator } from "./AppActivityIndicator";+import { AppText } from "./AppText";+import { SymbolView } from "./AppSymbol";+import { IconButton } from "./IconButton";+import { Toolbar } from "./Toolbar";+import { useControlTheme } from "./useControlTheme";+import type { SheetCloseButtonProps, SheetHeaderProps } from "./SheetHeader.types";++export function SheetCloseButton(props: SheetCloseButtonProps) {+ return (+ <IconButton+ icon="xmark"+ accessibilityLabel={props.accessibilityLabel ?? (props.onCancel ? "Cancel" : "Close")}+ disabled={props.disabled}+ onPress={props.onCancel ?? props.onClose}+ />+ );+}++export function SheetHeader(props: SheetHeaderProps) {+ return props.presentation !== "inline" ? (+ <NativeSheetHeader {...props} />+ ) : (+ <InlineSheetHeader {...props} />+ );+}++function NativeSheetHeader(props: SheetHeaderProps) {+ const { colors } = useControlTheme();+ const onDismiss = props.onCancel ?? props.onClose;+ const dismissLabel = props.accessibilityLabel ?? (props.onCancel ? "Cancel" : "Close");+ const confirmation = props.confirm;++ // Toolbar children are parsed as native items, so keep the actual Button+ // elements here instead of hiding them behind another component.+ return (+ <>+ <NativeStackScreenOptions+ options={{+ title: props.title,+ headerBackVisible: false,+ unstable_headerSubtitle: props.subtitle,+ }}+ />+ <Toolbar placement="left">+ <Toolbar.Button+ icon="xmark"+ accessibilityLabel={dismissLabel}+ onPress={onDismiss}+ disabled={props.dismissDisabled}+ />+ </Toolbar>+ {confirmation || props.trailing ? (+ <Toolbar placement="right">+ {props.trailing ? (+ <Toolbar.Custom>+ <View>{props.trailing}</View>+ </Toolbar.Custom>+ ) : null}+ {confirmation?.loading ? (+ <Toolbar.Custom>+ <View+ className="size-11 items-center justify-center"+ accessible+ accessibilityLabel={confirmation.label}+ accessibilityState={{ busy: true }}+ >+ <AppActivityIndicator colorClassName="accent-prominent-action" />+ </View>+ </Toolbar.Custom>+ ) : confirmation ? (+ <Toolbar.Button+ icon="checkmark"+ variant="prominent"+ tintColor={colors["--color-prominent-action"]}+ accessibilityLabel={confirmation.label}+ disabled={confirmation.disabled}+ onPress={confirmation.onPress}+ />+ ) : null}+ </Toolbar>+ ) : null}+ </>+ );+}++function InlineConfirmation({+ confirmation,+}: {+ readonly confirmation: NonNullable<SheetHeaderProps["confirm"]>;+}) {+ const confirmDisabled = confirmation.disabled || confirmation.loading;+ return (+ <Pressable+ accessibilityRole="button"+ accessibilityLabel={confirmation.label}+ accessibilityState={{+ disabled: Boolean(confirmDisabled),+ busy: Boolean(confirmation.loading),+ }}+ disabled={confirmDisabled}+ onPress={confirmation.onPress}+ className={+ confirmDisabled+ ? "size-11 items-center justify-center rounded-full bg-subtle-strong"+ : "size-11 items-center justify-center rounded-full bg-prominent-action"+ }+ >+ {confirmation.loading ? (+ <AppActivityIndicator colorClassName="accent-icon-subtle" />+ ) : (+ <SymbolView+ name="checkmark"+ size={20}+ tintColorClassName={+ confirmDisabled ? "accent-icon-subtle" : "accent-prominent-action-foreground"+ }+ />+ )}+ </Pressable>+ );+}++function InlineSheetHeader(props: SheetHeaderProps) {+ const close = (+ <SheetCloseButton+ {...(props.onCancel ? { onCancel: props.onCancel } : { onClose: props.onClose })}+ accessibilityLabel={props.accessibilityLabel}+ disabled={props.dismissDisabled}+ />+ );+ const confirm = props.confirm ? <InlineConfirmation confirmation={props.confirm} /> : null;+ const trailing =+ props.trailing || confirm ? (+ <View className="flex-row items-center gap-2">+ {props.trailing}+ {confirm}+ </View>+ ) : undefined;++ return (+ <View className="flex-row items-center gap-3 px-4 pt-3 pb-3">+ {close}+ <View className="min-w-0 flex-1 gap-1">+ <AppText numberOfLines={1} className="text-base font-t3-bold text-foreground">+ {props.title}+ </AppText>+ {props.subtitle ? (+ <AppText+ numberOfLines={1}+ ellipsizeMode="middle"+ className="text-xs text-foreground-muted"+ >+ {props.subtitle}+ </AppText>+ ) : null}+ </View>+ {trailing}+ </View>+ );+}diff --git a/apps/mobile/src/components/ui/SheetHeader.types.ts b/apps/mobile/src/components/ui/SheetHeader.types.tsnew file mode 100644index 00000000000..a5b38949fa5--- /dev/null+++ b/apps/mobile/src/components/ui/SheetHeader.types.ts@@ -0,0 +1,27 @@+import type { ReactNode } from "react";++type SheetDismissAction =+ | { readonly onCancel: () => void; readonly onClose?: never }+ | { readonly onClose: () => void; readonly onCancel?: never };++type SheetConfirmation = {+ readonly label: string;+ readonly onPress: () => void;+ readonly disabled?: boolean;+ readonly loading?: boolean;+};++export type SheetHeaderProps = SheetDismissAction & {+ readonly title: string;+ readonly subtitle?: string;+ readonly accessibilityLabel?: string;+ readonly dismissDisabled?: boolean;+ readonly confirm?: SheetConfirmation;+ readonly presentation?: "native" | "inline";+ readonly trailing?: ReactNode;+};++export type SheetCloseButtonProps = SheetDismissAction & {+ readonly accessibilityLabel?: string;+ readonly disabled?: boolean;+};diff --git a/apps/mobile/src/features/browser/BrowserPreviewRouteScreen.tsx b/apps/mobile/src/features/browser/BrowserPreviewRouteScreen.tsxindex e0660e11ed4..cb7a7615fd3 100644--- a/apps/mobile/src/features/browser/BrowserPreviewRouteScreen.tsx+++ b/apps/mobile/src/features/browser/BrowserPreviewRouteScreen.tsx@@ -1,4 +1,4 @@-import { Toolbar } from "../../components/ui/Toolbar";+import { SheetHeader } from "../../components/ui/SheetHeader";import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";import * as Dialog from "../../components/ui/Dialog";import { useIsFocused, useNavigation, type StaticScreenProps } from "@react-navigation/native";@@ -159,14 +159,11 @@ function BrowserPreviewScreen({}/>{Platform.OS === "ios" ? (- <Toolbar placement="left">- <Toolbar.Button- icon="xmark"- accessibilityLabel="Close browser"- onPress={onClose}- separateBackground- />- </Toolbar>+ <SheetHeader+ title={tab ? browserTabTitle(tab) : "Browser"}+ onClose={onClose}+ accessibilityLabel="Close browser"+ />) : null}{tab ? (<>diff --git a/apps/mobile/src/features/cloud/ConnectOnboardingRouteScreen.tsx b/apps/mobile/src/features/cloud/ConnectOnboardingRouteScreen.tsxindex e11933e271b..cb5c697db11 100644--- a/apps/mobile/src/features/cloud/ConnectOnboardingRouteScreen.tsx+++ b/apps/mobile/src/features/cloud/ConnectOnboardingRouteScreen.tsx@@ -1,5 +1,7 @@+import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";+import { SheetHeader } from "../../components/ui/SheetHeader";+import { IconButton } from "../../components/ui/IconButton";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";@@ -9,7 +11,6 @@ import { Platform, RefreshControl, View } from "react-native";import { useSafeAreaInsets } from "react-native-safe-area-context";import { reportAtomCommandResult, settlePromise } from "@t3tools/client-runtime/state/runtime";-import { AndroidSheetHeader } from "../../components/ui/AndroidScreenHeader";import { AppText as Text } from "../../components/ui/AppText";import { useRemoteConnections } from "../../state/use-remote-environment-registry";import { CloudEnvironmentRows } from "../connection/CloudEnvironmentRows";@@ -73,25 +74,31 @@ function ConfiguredConnectOnboardingRouteScreen() {return (<View collapsable={false} className="flex-1 bg-sheet">- {Platform.OS === "android" ? (- <AndroidSheetHeader- title="Set up T3 Connect"- actions={[- {- accessibilityLabel: "Refresh environments",- disabled: isRefreshing,- icon: "arrow.clockwise",- loading: isRefreshing,- onPress: handleRefresh,- },- { accessibilityLabel: "Close", icon: "xmark", onPress: handleClose },- ]}- />- ) : (- <Toolbar placement="right">- <Toolbar.Button icon="xmark" onPress={handleClose} separateBackground />- </Toolbar>- )}+ <SheetHeader+ presentation={Platform.OS === "android" ? "inline" : "native"}+ title="Set up T3 Connect"+ onClose={handleClose}+ trailing={+ Platform.OS === "android" ? (+ isRefreshing ? (+ <View+ className="size-12 items-center justify-center"+ accessible+ accessibilityLabel="Refreshing environments"+ accessibilityState={{ busy: true }}+ >+ <AppActivityIndicator />+ </View>+ ) : (+ <IconButton+ accessibilityLabel="Refresh environments"+ icon="arrow.clockwise"+ onPress={handleRefresh}+ />+ )+ ) : undefined+ }+ /><ScrollViewnestedScrollEnabledalwaysBounceVerticaldiff --git a/apps/mobile/src/features/devices/DevicePreviewRouteScreen.tsx b/apps/mobile/src/features/devices/DevicePreviewRouteScreen.tsxindex 58a9e134d5f..368c3286e35 100644--- a/apps/mobile/src/features/devices/DevicePreviewRouteScreen.tsx+++ b/apps/mobile/src/features/devices/DevicePreviewRouteScreen.tsx@@ -1,3 +1,4 @@+import { SheetCloseButton } from "../../components/ui/SheetHeader";import { Button } from "../../components/ui/Button";import * as Dialog from "../../components/ui/Dialog";import {@@ -296,11 +297,7 @@ function DevicePreviewScreen({) : null}<View className="px-3" style={{ paddingTop: Math.max(insets.top, 12) }}><GlassSurface className="flex-row items-center gap-1 p-1">- <ControlPill- accessibilityLabel="Close device preview"- icon="xmark"- onPress={onClose}- />+ <SheetCloseButton accessibilityLabel="Close device preview" onClose={onClose} /><AppText numberOfLines={1} className="flex-1 text-center font-t3-medium text-base">{preview?.name ?? "Devices"}</AppText>diff --git a/apps/mobile/src/features/pull-requests/PullRequestReviewersScreen.tsx b/apps/mobile/src/features/pull-requests/PullRequestReviewersScreen.tsxindex 3caa8957dfe..4f9b9316d43 100644--- a/apps/mobile/src/features/pull-requests/PullRequestReviewersScreen.tsx+++ b/apps/mobile/src/features/pull-requests/PullRequestReviewersScreen.tsx@@ -1,5 +1,5 @@+import { SheetHeader } from "../../components/ui/SheetHeader";import { AsyncResult } from "effect/reactivity";-import { Toolbar } from "../../components/ui/Toolbar";import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";import { usePullRequestConnected } from "./usePullRequestConnected";import { useAtomValue } from "@effect/atom-react";@@ -18,7 +18,6 @@ import {import { useSafeAreaInsets } from "react-native-safe-area-context";import { ScrollViewMarker } from "react-native-screens";import { AppText as Text, AppTextInput as TextInput } from "../../components/ui/AppText";-import { AndroidScreenHeader } from "../../components/ui/AndroidScreenHeader";import { EmptyState } from "../../components/ui/EmptyState";import { Button } from "../../components/ui/Button";import { SymbolView } from "../../components/ui/AppSymbol";@@ -140,17 +139,14 @@ export function PullRequestReviewersScreen({ route }: StaticScreenProps<PullRequ};return (<View className="flex-1 bg-sheet">- <Toolbar placement="left">- <Toolbar.Button- icon="xmark"- accessibilityLabel="Close request review"- onPress={() => navigation.goBack()}- />- </Toolbar>+ <SheetHeader+ title="Request review"+ subtitle={`#${route.params.number} · ${route.params.repository}`}+ onClose={() => navigation.goBack()}+ accessibilityLabel="Close request review"+ /><NativeStackScreenOptionsoptions={{- title: "Request review",- unstable_headerSubtitle: `#${route.params.number} · ${route.params.repository}`,headerSearchBarOptions: listCandidates ? searchOptions : undefined,unstable_headerToolbarItems: () =>listCandidates && integratedSearch@@ -165,9 +161,6 @@ export function PullRequestReviewersScreen({ route }: StaticScreenProps<PullRequ: [],}}/>- {Platform.OS === "android" ? (- <AndroidScreenHeader title="Request review" onBack={() => navigation.goBack()} />- ) : null}{listCandidates ? (<FlatListref={listRef}diff --git a/apps/mobile/src/features/pull-requests/PullRequestSheetContent.tsx b/apps/mobile/src/features/pull-requests/PullRequestSheetContent.tsxindex 24cadccd30b..cf566e99dc1 100644--- a/apps/mobile/src/features/pull-requests/PullRequestSheetContent.tsx+++ b/apps/mobile/src/features/pull-requests/PullRequestSheetContent.tsx@@ -1,13 +1,10 @@+import { SheetHeader } from "../../components/ui/SheetHeader";import { useNavigation } from "@react-navigation/native";import type { ReactNode } from "react";import { Platform, ScrollView, useWindowDimensions, View } from "react-native";import { KeyboardAvoidingView } from "react-native-keyboard-controller";import { useSafeAreaInsets } from "react-native-safe-area-context";-import { AppText as Text } from "../../components/ui/AppText";-import { AndroidSheetHeader } from "../../components/ui/AndroidScreenHeader";-import { IconButton } from "../../components/ui/IconButton";import { ScreenContent } from "../../components/ui/ScreenContent";-import { ControlPill } from "../../components/ui/ControlPill";import { NativeStackScreenOptions } from "../../native/StackHeader";export function PullRequestSheetContent(props: {@@ -35,38 +32,13 @@ export function PullRequestSheetContent(props: {) : null;const content = (<>- {android ? (- <AndroidSheetHeader- title={props.title}- subtitle={props.subtitle}- hideBottomBorder- leading={- <IconButton- icon="arrow.left"- accessibilityLabel="Close"- disabled={props.busy}- tintColorClassName="accent-header-foreground"- onPress={() => navigation.goBack()}- />- }- />- ) : (- <View className="flex-row items-center gap-2 px-4 pt-5 pb-5">- <ControlPill- icon="xmark"- accessibilityLabel="Close"- disabled={props.busy}- onPress={() => navigation.goBack()}- />- <View className="min-w-0 flex-1 items-center gap-1">- <Text className="text-center text-base font-t3-bold">{props.title}</Text>- <Text numberOfLines={1} className="text-center text-xs text-foreground-muted">- {props.subtitle}- </Text>- </View>- <View className="w-11" />- </View>- )}+ <SheetHeader+ presentation="inline"+ title={props.title}+ subtitle={props.subtitle}+ onCancel={() => navigation.goBack()}+ dismissDisabled={props.busy}+ /><ScreenContent fitToContents={fitToContents}>{props.scrollable === false ? (<View className="flex-1" pointerEvents={props.busy ? "none" : "auto"}>diff --git a/apps/mobile/src/features/settings/components/SettingsLegalDocumentRouteScreen.tsx b/apps/mobile/src/features/settings/components/SettingsLegalDocumentRouteScreen.tsxindex e9372fc75eb..58def043185 100644--- a/apps/mobile/src/features/settings/components/SettingsLegalDocumentRouteScreen.tsx+++ b/apps/mobile/src/features/settings/components/SettingsLegalDocumentRouteScreen.tsx@@ -1,3 +1,4 @@+import { SheetCloseButton } from "../../../components/ui/SheetHeader";import { type NavigationProp, type ParamListBase, useNavigation } from "@react-navigation/native";import { useCallback, useLayoutEffect, useState } from "react";import { Linking, Pressable, View } from "react-native";@@ -15,10 +16,9 @@ export function SettingsLegalDocumentCloseHeaderButton() {const navigation = useNavigation();return (- <IconButton+ <SheetCloseButtonaccessibilityLabel="Close legal document"- icon="xmark"- onPress={() => navigation.goBack()}+ onClose={() => navigation.goBack()}/>);}diff --git a/apps/mobile/src/features/threads/CustomSnoozeSheet.ios.tsx b/apps/mobile/src/features/threads/CustomSnoozeSheet.ios.tsxindex aa01ab3aa12..850251fb5aa 100644--- a/apps/mobile/src/features/threads/CustomSnoozeSheet.ios.tsx+++ b/apps/mobile/src/features/threads/CustomSnoozeSheet.ios.tsx@@ -1,4 +1,4 @@-import { Toolbar } from "../../components/ui/Toolbar";+import { SheetHeader } from "../../components/ui/SheetHeader";import {DatePicker,Host,@@ -249,22 +249,12 @@ function SnoozePopoverNavigation(props: {<SnoozeStack.Screen name="CustomSnooze">{() => (<>- <Toolbar placement="left">- <Toolbar.Button- accessibilityLabel="Cancel custom snooze"- icon="xmark"- onPress={props.onClose}- />- </Toolbar>- <Toolbar placement="right">- <Toolbar.Button- accessibilityLabel="Snooze"- icon="checkmark"- variant="prominent"- tintColor={colors["--color-prominent-action"]}- onPress={props.onSubmit}- />- </Toolbar>+ <SheetHeader+ title="Custom snooze"+ onCancel={props.onClose}+ accessibilityLabel="Cancel custom snooze"+ confirm={{ label: "Snooze", onPress: props.onSubmit }}+ /><ScrollViewcontentInsetAdjustmentBehavior="automatic"showsVerticalScrollIndicator={false}diff --git a/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx b/apps/mobile/src/features/threads/NewTaskDraftScreen.tsxindex 4a7c366caf0..ff02b9db8a5 100644--- a/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx+++ b/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx@@ -1,5 +1,6 @@+import { AndroidScreenHeader } from "../../components/ui/AndroidScreenHeader";+import { SheetHeader } from "../../components/ui/SheetHeader";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";import * as Cause from "effect/Cause";@@ -54,7 +55,6 @@ import {ComposerInlineControl,ComposerToolbarRow,} from "../../components/ComposerToolbar";-import { AndroidScreenHeader } from "../../components/ui/AndroidScreenHeader";import { ScreenContent } from "../../components/ui/ScreenContent";import { ComposerAttachmentButton } from "./ComposerAttachmentButton";import { ComposerAttachmentStrip } from "../../components/ComposerAttachmentStrip";@@ -1784,7 +1784,11 @@ export function NewTaskDraftScreen(props: {return (<View className="flex-1 bg-sheet" collapsable={false}><NativeStackScreenOptions options={{ headerShown: false }} />- <AndroidScreenHeader title="New thread" hideBottomBorder onBack={closeNewTask} />+ <SheetHeader+ title="New thread"+ onCancel={closeNewTask}+ accessibilityLabel="Cancel new task"+ /><ScreenContent>{heroViewport}@@ -1808,9 +1812,11 @@ export function NewTaskDraftScreen(props: {title: "New thread",}}/>- <Toolbar placement="left">- <Toolbar.Button accessibilityLabel="Cancel new task" icon="xmark" onPress={closeNewTask} />- </Toolbar>+ <SheetHeader+ title="New thread"+ onCancel={closeNewTask}+ accessibilityLabel="Cancel new task"+ />{heroViewport}<KeyboardStickyViewdiff --git a/apps/mobile/src/features/threads/ThreadArrangementSheet.tsx b/apps/mobile/src/features/threads/ThreadArrangementSheet.tsxindex 335749e7fa6..77ecc530b90 100644--- a/apps/mobile/src/features/threads/ThreadArrangementSheet.tsx+++ b/apps/mobile/src/features/threads/ThreadArrangementSheet.tsx@@ -1,3 +1,4 @@+import { SheetHeader } from "../../components/ui/SheetHeader";import { appAtomRegistry } from "../../state/atom-registry";import { useAtomValue } from "@effect/atom-react";import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell";@@ -12,7 +13,6 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";import { AppText as Text } from "../../components/ui/AppText";import { SymbolView } from "../../components/ui/AppSymbol";-import { IconButton } from "../../components/ui/IconButton";import { scopedThreadKey } from "../../lib/scopedEntities";import { environmentServerConfigsAtom } from "../../state/server";import { environmentThreadShells } from "../../state/threads";@@ -377,14 +377,12 @@ export function ThreadArrangementSheet(props: { onClose: () => void }) {className="flex-1 bg-screen"style={{ paddingTop: insets.top, paddingBottom: insets.bottom }}>- <View className="flex-row items-center justify-between gap-3 px-5 py-3">- <Text className="flex-1 text-xl font-t3-semibold">Arrange threads</Text>- <IconButton- accessibilityLabel="Close arrange threads"- icon="xmark"- onPress={props.onClose}- />- </View>+ <SheetHeader+ presentation="inline"+ title="Arrange threads"+ onClose={props.onClose}+ accessibilityLabel="Close arrange threads"+ /><Text className="px-5 pb-3 text-sm text-foreground-muted">Drag to reorder, pin, or settle. Changes save when you drop.</Text>diff --git a/apps/mobile/src/features/threads/ThreadSettingsSheet.tsx b/apps/mobile/src/features/threads/ThreadSettingsSheet.tsxindex c8e10580e93..5854ca236d1 100644--- a/apps/mobile/src/features/threads/ThreadSettingsSheet.tsx+++ b/apps/mobile/src/features/threads/ThreadSettingsSheet.tsx@@ -1,3 +1,4 @@+import { SheetHeader } from "../../components/ui/SheetHeader";import { Toolbar } from "../../components/ui/Toolbar";import * as Dialog from "../../components/ui/Dialog";import { createV5StackNavigator as createNativeStackNavigator } from "../../native/createV5StackNavigator";@@ -45,7 +46,6 @@ import { SymbolView } from "../../components/ui/AppSymbol";import { AppText as Text } from "../../components/ui/AppText";import { AndroidScreenHeader } from "../../components/ui/AndroidScreenHeader";import { AndroidAnchoredMenu } from "../../components/ui/AndroidAnchoredMenu";-import { Button } from "../../components/ui/Button";import { IconButton } from "../../components/ui/IconButton";import { ProviderIcon } from "../../components/ProviderIcon";import { ThemedSwitch } from "../../components/ui/ThemedSwitch";@@ -1157,7 +1157,6 @@ function ThreadSettingsModelsScreen() {const presentation = useThreadSettingsPickerPresentation();const navigation = useNavigation<NativeStackNavigationProp<ThreadSettingsPickerStackParams>>();const usesNativeMailSearchToolbar = useNativeMailSearchToolbar();- const theme = useUniwindTheme();const hasCustomCatalogFilter = session.providerFilter !== null || session.showLegacy;const commitAndClose = useEffectEvent(() => {if (!session.commitPendingModel()) return;@@ -1201,7 +1200,7 @@ function ThreadSettingsModelsScreen() {return (<>{Platform.OS === "android" ? (- <AndroidScreenHeader+ <SheetHeadertrailing={<View className="flex-row items-center"><AndroidAnchoredMenu@@ -1244,14 +1243,11 @@ function ThreadSettingsModelsScreen() {/>)}</AndroidAnchoredMenu>- {session.pendingModel ? (- <Button label="Save" tone="text" onPress={commitAndClose} />- ) : null}</View>}- onBack={presentation.onClose}+ onCancel={presentation.onClose}title="Thread settings"- hideBottomBorder+ confirm={session.pendingModel ? { label: "Save", onPress: commitAndClose } : undefined}/>) : null}<NativeStackScreenOptions@@ -1303,22 +1299,17 @@ function ThreadSettingsModelsScreen() {}}/></ScreenContent>- <Toolbar placement="left">- <Toolbar.Button+ {Platform.OS === "ios" ? (+ <SheetHeader+ title="Thread settings"+ onCancel={presentation.onClose}accessibilityLabel="Cancel thread settings"- icon="xmark"- onPress={presentation.onClose}- />- </Toolbar>- <Toolbar placement="right">- <Toolbar.Button- accessibilityLabel={session.pendingModel ? "Save thread settings" : "Done"}- icon="checkmark"- variant="prominent"- tintColor={theme["--color-prominent-action"]}- onPress={commitAndClose}+ confirm={{+ label: session.pendingModel ? "Save thread settings" : "Done",+ onPress: commitAndClose,+ }}/>- </Toolbar>+ ) : null}{Platform.OS === "ios" && !usesNativeMailSearchToolbar ? (<Toolbar placement="bottom"><Toolbar.Menudiff --git a/apps/mobile/src/features/threads/git/GitCommitSheet.tsx b/apps/mobile/src/features/threads/git/GitCommitSheet.tsxindex 5dd363c9b79..7bc5105805b 100644--- a/apps/mobile/src/features/threads/git/GitCommitSheet.tsx+++ b/apps/mobile/src/features/threads/git/GitCommitSheet.tsx@@ -1,3 +1,4 @@+import { SheetHeader } from "../../../components/ui/SheetHeader";import { Button } from "../../../components/ui/Button";import { useNavigation, type StaticScreenProps } from "@react-navigation/native";import { useState } from "react";@@ -5,7 +6,6 @@ import { Platform, Pressable, ScrollView, useWindowDimensions, View } from "reacimport { formatDiffCount } from "@t3tools/client-runtime/diff-count";import { useSafeAreaInsets } from "react-native-safe-area-context";-import { IconButton } from "../../../components/ui/IconButton";import { SymbolView } from "../../../components/ui/AppSymbol";import { NativeStackScreenOptions } from "../../../native/StackHeader";import { AppText as Text, AppTextInput as TextInput } from "../../../components/ui/AppText";@@ -77,30 +77,13 @@ export function GitCommitSheet(_props: GitCommitSheetProps) {options={{ sheetCornerRadius: 28, sheetAllowedDetents: "fitToContents" }}/>) : null}- <View className="flex-row items-center justify-between gap-3 px-5 pt-3 pb-2">- <View className="flex-1 gap-1">- <Text className="text-xl font-t3-bold text-foreground">Commit changes</Text>- <View className="flex-row items-center gap-1.5">- <SymbolView- name="arrow.branch"- size={14}- tintColorClassName="accent-foreground-muted"- />- <Text- numberOfLines={1}- ellipsizeMode="middle"- className="flex-1 text-sm text-foreground-muted"- >- {gitStatus.data?.refName ?? "(detached HEAD)"}- </Text>- </View>- </View>- <IconButton- icon="xmark"- accessibilityLabel="Close commit sheet"- onPress={() => navigation.goBack()}- />- </View>+ <SheetHeader+ presentation="inline"+ title="Commit changes"+ subtitle={gitStatus.data?.refName ?? "(detached HEAD)"}+ onCancel={() => navigation.goBack()}+ accessibilityLabel="Cancel commit"+ /><ScrollViewnestedScrollEnabledclassName="android:shrink android:grow-0 ios:flex-1"