From ea15f17afd94e7ce7133e52f5b5983910662c9ec Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Fri, 18 Sep 2026 16:09:00 -0700 Subject: [PATCH 01/25] fix(mobile): use native settings and snooze controls (#12512) --- .../sections/CodeAppearanceSection.tsx | 2 +- .../sections/TerminalAppearanceSection.tsx | 2 +- .../sections/TextAppearanceSection.tsx | 2 +- .../settings/components/SettingsSection.tsx | 6 +- .../threads/CustomSnoozeSheet.android.tsx | 12 +- .../threads/CustomSnoozeSheet.ios.tsx | 296 ++++++++++-------- .../threads/CustomSnoozeSheet.shared.tsx | 4 +- .../features/threads/ThreadSettingsSheet.tsx | 196 ++++++------ .../threads/provider-catalog-refresh.ts | 2 +- .../src/features/usage/UsageRouteScreen.tsx | 6 +- 10 files changed, 284 insertions(+), 244 deletions(-) diff --git a/apps/mobile/src/features/settings/appearance/sections/CodeAppearanceSection.tsx b/apps/mobile/src/features/settings/appearance/sections/CodeAppearanceSection.tsx index bb4bb4d0a8fe..6760504bfa28 100644 --- a/apps/mobile/src/features/settings/appearance/sections/CodeAppearanceSection.tsx +++ b/apps/mobile/src/features/settings/appearance/sections/CodeAppearanceSection.tsx @@ -26,7 +26,7 @@ export function CodeAppearanceSection() { ); return ( - + + + @@ -30,9 +28,7 @@ export function SettingsSection(props: { className={ Platform.OS === "android" ? "overflow-hidden rounded-[28px] bg-card" - : props.card - ? "overflow-hidden rounded-[24px] border-continuous bg-card" - : "overflow-hidden rounded-[24px] border-continuous bg-card android:bg-transparent" + : "overflow-hidden rounded-[24px] border-continuous bg-card" } > {props.children} diff --git a/apps/mobile/src/features/threads/CustomSnoozeSheet.android.tsx b/apps/mobile/src/features/threads/CustomSnoozeSheet.android.tsx index 85600838881f..e066c01b43cf 100644 --- a/apps/mobile/src/features/threads/CustomSnoozeSheet.android.tsx +++ b/apps/mobile/src/features/threads/CustomSnoozeSheet.android.tsx @@ -1,7 +1,6 @@ import { MaterialSegmentedButtons } from "../../components/MaterialSegmentedButtons.android"; import { BasicAlertDialog, - Button, Column, DateTimePicker, Host, @@ -240,19 +239,16 @@ export function CustomSnoozeSheet(props: Props) { Cancel - + diff --git a/apps/mobile/src/features/threads/CustomSnoozeSheet.ios.tsx b/apps/mobile/src/features/threads/CustomSnoozeSheet.ios.tsx index 20176064be52..c8d9abbc5fa8 100644 --- a/apps/mobile/src/features/threads/CustomSnoozeSheet.ios.tsx +++ b/apps/mobile/src/features/threads/CustomSnoozeSheet.ios.tsx @@ -1,27 +1,22 @@ import { - Button, DatePicker, Host, HStack, Picker, Popover, + RNHostView, Spacer, Text, VStack, } from "@expo/ui/swift-ui"; import { - accessibilityAddTraits, accessibilityHidden, - buttonBorderShape, - buttonStyle, clipped, - controlSize, font, datePickerStyle, foregroundStyle, frame, labelsHidden, - labelStyle, padding, pickerStyle, tag, @@ -32,12 +27,17 @@ import { resolveCustomSnooze, type CustomSnoozeInput, } from "@t3tools/client-runtime/state/thread-settled"; -import { useState } from "react"; -import { useWindowDimensions } from "react-native"; +import { useState, type ReactNode } from "react"; +import { NavigationContainer, NavigationIndependentTree } from "@react-navigation/native"; +import { createNativeStackNavigator } from "@react-navigation/native-stack"; +import { ScrollView, useWindowDimensions, View } from "react-native"; +import { useMobileNavigationTheme } from "../../lib/useMobileNavigationTheme"; +import { NativeHeaderToolbar } from "../../native/StackHeader"; import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass"; import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider"; const durationAmounts = Array.from({ length: 99 }, (_, index) => index + 1); +const SnoozeStack = createNativeStackNavigator<{ CustomSnooze: undefined }>(); const modes = [ { value: "date", label: "Date and time" }, { value: "duration", label: "Duration" }, @@ -52,13 +52,15 @@ export function CustomSnoozeSheet(props: { readonly onClose: () => void; readonly onSnooze: (snoozedUntil: string) => void; }) { - const { width } = useWindowDimensions(); + const { width, height } = useWindowDimensions(); const [mode, setMode] = useState("date"); const [date, setDate] = useState(() => new Date(Date.now() + 3_600_000)); const [amount, setAmount] = useState(2); const [unit, setUnit] = useState<"minutes" | "hours" | "days">("hours"); const [error, setError] = useState(null); const { themeVariables: colors, themeAppearance } = useAppearancePreferences(); + const popoverWidth = Math.min(360, width - 32); + const popoverHeight = Math.min(error ? 364 : 324, height - 96); const updateDate = (value: Date) => { setDate(value); setError(null); @@ -98,133 +100,179 @@ export function CustomSnoozeSheet(props: { /> - - -