Skip to content

Commit f722b70

Browse files
authored
Merge branch 'main' into fix/preview-timeout-diagnostic
2 parents 76d14e2 + 27e0c68 commit f722b70

9 files changed

Lines changed: 444 additions & 88 deletions

File tree

‎apps/mobile/src/features/settings/SettingsRouteScreen.tsx‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { Platform, View } from "react-native";
1919
import { useWorkspaceSurface } from "../workspace/useWorkspaceSurface";
2020
import { useDeviceType } from "../../native/native-layout-metrics";
2121
import { useCompactWorkspaceTabs } from "../workspace/useSystemWorkspaceTabBar";
22-
import { NativeStackScreenOptions } from "../../native/StackHeader";
2322
import { deriveProjectGroupLabel } from "@t3tools/client-runtime/state/project-grouping";
2423
import { useSafeAreaInsets } from "react-native-safe-area-context";
2524

@@ -47,15 +46,6 @@ export function SettingsRouteScreen() {
4746

4847
return (
4948
<View className={`flex-1 ${surface.className}`}>
50-
{Platform.OS === "ios" ? (
51-
<NativeStackScreenOptions
52-
options={{
53-
headerTransparent: false,
54-
headerStyle: { backgroundColor: surface.backgroundColor },
55-
contentStyle: { backgroundColor: surface.backgroundColor },
56-
}}
57-
/>
58-
) : null}
5949
<SettingsEnvironmentFilterHeader />
6050
<ScreenScrollViewBottomInset value={deviceType === "pad" || compactTabs ? 80 : 0}>
6151
{Platform.OS === "android" ? (

‎apps/mobile/src/features/settings/components/SettingsScreen.tsx‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { ScreenContent as SettingsScreenContent } from "../../../components/ui/S
88
import { useWorkspaceTabs } from "../../workspace/WorkspaceTabsContext";
99
import { useWorkspaceSurface } from "../../workspace/useWorkspaceSurface";
1010
import { useDeviceType } from "../../../native/native-layout-metrics";
11-
import { NativeStackScreenOptions } from "../../../native/StackHeader";
1211
import { useCompactWorkspaceTabs } from "../../workspace/useSystemWorkspaceTabBar";
1312
import { ScreenScrollViewBottomInset } from "../../../components/ui/ScreenScrollView";
1413

@@ -47,15 +46,6 @@ export function SettingsScreen(
4746
onBack={workspaceRoot ? undefined : () => navigation.goBack()}
4847
hideBottomBorder={!props.formSheet}
4948
/>
50-
{Platform.OS === "ios" && (workspaceRoot || cover) ? (
51-
<NativeStackScreenOptions
52-
options={{
53-
headerTransparent: false,
54-
headerStyle: { backgroundColor: surface.backgroundColor },
55-
contentStyle: { backgroundColor: surface.backgroundColor },
56-
}}
57-
/>
58-
) : null}
5949
<ScreenScrollViewBottomInset value={deviceType === "pad" || compactTabs ? 80 : 0}>
6050
{props.formSheet ? (
6151
props.children

‎apps/mobile/src/features/usage/UsageRouteScreen.tsx‎

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import { UsageLimitsSection } from "./UsageLimitsPooled";
5656
import { Menu } from "../../components/ui/Menu";
5757
import { SymbolView } from "../../components/ui/AppSymbol";
5858
import { NativeStackScreenOptions } from "../../native/StackHeader";
59+
import { withNativeGlassHeaderItem } from "../layout/native-glass-header-items";
5960
import type { UsageChartMetric } from "./usageChartData";
6061
import { PROVIDER_LABEL, useProviderColors, useUsageMixColors } from "./usageProviders";
6162

@@ -245,8 +246,31 @@ function UsageScreen(props: {
245246
<SettingsScreen title="Usage" trailing={environmentFilter} workspaceRoot={props.workspace}>
246247
{Platform.OS === "ios" ? (
247248
<NativeStackScreenOptions
248-
optionsVersion={environmentFilter}
249-
options={{ headerRight: () => environmentFilter }}
249+
optionsVersion={JSON.stringify({ showEnvironmentFilter, filterIcon, environmentActions })}
250+
options={{
251+
// A native menu item, unlike a custom view, moves into the Duo's vertical bar.
252+
unstable_headerRightItems: () =>
253+
showEnvironmentFilter
254+
? [
255+
withNativeGlassHeaderItem({
256+
accessibilityLabel: "Filter usage environments",
257+
icon: { name: filterIcon, type: "sfSymbol" },
258+
label: "",
259+
type: "menu",
260+
menu: {
261+
title: "Environments",
262+
items: environmentActions.map((action) => ({
263+
type: "action" as const,
264+
label: action.title,
265+
description: action.subtitle,
266+
state: action.state === "on" ? ("on" as const) : undefined,
267+
onPress: () => selectEnvironment(action.id),
268+
})),
269+
},
270+
}),
271+
]
272+
: [],
273+
}}
250274
/>
251275
) : null}
252276
<ScrollView

‎apps/mobile/src/features/workspace/WorkspaceExtraTab.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ export function WorkspaceExtraTab(_props: {
77
}) {
88
return (
99
<>
10-
<NativeStackScreenOptions
11-
options={{ headerSearchBarOptions: undefined, unstable_headerRightItems: undefined }}
12-
/>
10+
<NativeStackScreenOptions options={{ headerSearchBarOptions: undefined }} />
1311
<UsageRouteScreen workspace />
1412
</>
1513
);

‎apps/mobile/src/features/workspace/WorkspaceRootScreen.tsx‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ function WorkspaceRootContent() {
9393
const keyboardHeight = useKeyboardState((keyboard) => keyboard.height);
9494
const workspace = useWorkspaceTabs()!;
9595
const { state } = workspace;
96-
const solidHeader = deviceType === "duo-folded" || state.selectedTab === "usage";
9796
const renderHeaderTitle = useCallback(
9897
() => (
9998
<WorkspaceRootTitle
@@ -150,16 +149,11 @@ function WorkspaceRootContent() {
150149
options={{
151150
title: enabled.length ? TAB_TITLES[state.selectedTab] : "Navigation",
152151
headerShown: true,
153-
headerTransparent: solidHeader ? false : NATIVE_LIQUID_GLASS_SUPPORTED,
154-
headerStyle: solidHeader
155-
? { backgroundColor: surface.backgroundColor }
156-
: NATIVE_LIQUID_GLASS_SUPPORTED
157-
? { backgroundColor: "transparent" }
158-
: undefined,
159-
contentStyle: solidHeader ? { backgroundColor: surface.backgroundColor } : undefined,
160-
...(state.selectedTab !== "usage" || enabled.length === 0
161-
? { headerRight: undefined }
162-
: {}),
152+
headerTransparent: NATIVE_LIQUID_GLASS_SUPPORTED,
153+
headerStyle: NATIVE_LIQUID_GLASS_SUPPORTED
154+
? { backgroundColor: "transparent" }
155+
: undefined,
156+
contentStyle: undefined,
163157
...(enabled.length === 0
164158
? { headerSearchBarOptions: undefined, unstable_headerRightItems: () => [] }
165159
: {}),

0 commit comments

Comments
 (0)