Skip to content

Commit 633c291

Browse files
Merge remote-tracking branch 'origin/main' into fix/issue-30495
2 parents d1af662 + dd69b31 commit 633c291

129 files changed

Lines changed: 3013 additions & 2301 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.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- Tabler Icons filter, filled (MIT), matching AppSymbol's line.3.horizontal.decrease.circle.fill. -->
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:width="24dp" android:height="24dp"
4+
android:viewportWidth="24" android:viewportHeight="24">
5+
<path android:fillColor="#000000"
6+
android:pathData="M20,3 h-16 a1,1 0 0,0 -1,1 v2.227 l0.008,0.223 a3,3 0 0,0 0.772,1.795 l4.22,4.641 v8.114 a1,1 0 0,0 1.316,0.949 l6,-2 l0.108,-0.043 a1,1 0 0,0 0.576,-0.906 v-6.586 l4.121,-4.12 a3,3 0 0,0 0.879,-2.123 v-2.171 a1,1 0 0,0 -1,-1 z" />
7+
</vector>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- Tabler Icons filter (MIT), matching AppSymbol's line.3.horizontal.decrease.circle.
2+
Strokes expanded to fills: Expo UI's vector parser does not support strokes. -->
3+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:width="24dp" android:height="24dp"
5+
android:viewportWidth="24" android:viewportHeight="24">
6+
<path android:fillColor="#000000"
7+
android:pathData="M3,4 A1,1 0 0,1 4,3 L20,3 A1,1 0 0,1 21,4 L21,6.172 A1,1 0 0,1 20.9969,6.2505 L20.9723,6.5633 A1,1 0 0,1 20.9477,6.7183 L20.8745,7.0235 A1,1 0 0,1 20.826,7.1727 L20.7059,7.4627 A1,1 0 0,1 20.6347,7.6025 L20.4707,7.8701 A1,1 0 0,1 20.3778,7.9977 L20.1738,8.2362 A1,1 0 0,1 20.1211,8.2931 L16,12.4142 L16,19 A1,1 0 0,1 15.3162,19.9487 L9.3162,21.9487 A1,1 0 0,1 8,21 L8,12.8866 L3.7801,8.2447 A1,1 0 0,1 3.7328,8.1888 L3.5517,7.9575 A1,1 0 0,1 3.4694,7.8348 L3.3236,7.5783 A1,1 0 0,1 3.2604,7.4451 L3.1539,7.1699 A1,1 0 0,1 3.111,7.0287 L3.0462,6.7409 A1,1 0 0,1 3.0245,6.595 L3.0027,6.3008 A1,1 0 0,1 3,6.227 Z M5,6.1901 L5.0136,6.3737 L5.0459,6.5172 L5.099,6.6544 L5.1716,6.7823 L5.2846,6.9264 L9.7399,11.8273 A1,1 0 0,1 10,12.5 L10,19.6126 L14,18.2792 L14,12 A1,1 0 0,1 14.2929,11.2929 L18.6795,6.9063 L18.8068,6.7576 L18.8883,6.6246 L18.9481,6.4801 L18.9846,6.328 L19,6.1327 L19,5 L5,5 Z" />
8+
</vector>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- Tabler Icons search (MIT), matching AppSymbol's magnifyingglass.
2+
Strokes expanded to fills: Expo UI's vector parser does not support strokes. -->
3+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:width="24dp" android:height="24dp"
5+
android:viewportWidth="24" android:viewportHeight="24">
6+
<path android:fillColor="#000000"
7+
android:pathData="M2,10 A8,8 0 1,1 18,10 A8,8 0 1,1 2,10 Z M4,10 A6,6 0 1,0 16,10 A6,6 0 1,0 4,10 Z" />
8+
<path android:fillColor="#000000"
9+
android:pathData="M14.2929,15.7071 A1,1 0 0,1 15.7071,14.2929 L21.7071,20.2929 A1,1 0 0,1 20.2929,21.7071 Z" />
10+
</vector>

‎apps/mobile/modules/t3-native-controls/ios/T3ScrollEdgeBleedView.swift‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ final class T3ScrollEdgeBleedView: ExpoView {
9595
// The vertical-bar API ships in the iOS 27.1 SDK (UIKit 9127.0.85); see T3LayoutMetricsView.
9696
#if canImport(UIKit, _version: 9127.0.85)
9797
if #available(iOS 27.1, *) {
98+
// UIKit leaves the trait unset in a split view's inspector column, though the bar overlaps
99+
// it; the flush check above still decides whether this view sits at the bar.
100+
let traits = window?.rootViewController?.traitCollection ?? traitCollection
98101
let rtl = effectiveUserInterfaceLayoutDirection == .rightToLeft
99-
switch traitCollection.verticalBarEdge {
102+
switch traits.verticalBarEdge {
100103
case .leading: return rtl ? .right : .left
101104
case .trailing: return rtl ? .left : .right
102105
default: return nil

‎apps/mobile/src/Stack.tsx‎

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import {
1111
StackActions,
1212
useNavigation,
1313
} from "@react-navigation/native";
14-
import {
15-
createNativeStackScreen,
16-
type NativeStackNavigationOptions,
17-
} from "@react-navigation/native-stack";
14+
import { createNativeStackScreen } from "@react-navigation/native-stack";
1815
import type { ReactNode } from "react";
1916
import { Platform, Pressable, ScrollView, StyleSheet, useWindowDimensions } from "react-native";
2017
import { useResolveClassNames } from "uniwind";
@@ -50,7 +47,6 @@ import { ConnectOnboardingRouteScreen } from "./features/cloud/ConnectOnboarding
5047
import { AttachmentFileScreen } from "./features/files/AttachmentFileScreen";
5148
import { ThreadFilesTreeScreen, ThreadFileScreen } from "./features/files/ThreadFilesRouteScreen";
5249
import { AdaptiveWorkspaceLayout } from "./features/layout/AdaptiveWorkspaceLayout";
53-
import { selectedPullRequestKey } from "./features/pull-requests/pullRequestSelection";
5450
import {
5551
HardwareKeyboardCommandOverlay,
5652
HardwareKeyboardCommandProvider,
@@ -142,33 +138,12 @@ import {
142138
SettingsLegalDocumentCloseHeaderButton,
143139
SettingsLegalDocumentExternalHeaderButton,
144140
} from "./features/settings/components/SettingsLegalDocumentRouteScreen";
145-
import { NATIVE_LIQUID_GLASS_SUPPORTED } from "./native/native-glass";
141+
import { GLASS_HEADER_OPTIONS, type AppScreenOptions } from "./native/glass-header-options";
146142
import { deriveLayout } from "./lib/layout";
147143
import { useNativeLayoutMetrics } from "./native/native-layout-metrics";
148-
import { nativeHeaderScrollEdgeEffects } from "./native/StackHeader";
149144
import { HORIZONTAL_FORM_SHEET_OPTIONS, formSheetDetents } from "./native/sheet-surface";
150145
import { workspaceDetailRouter } from "./features/workspace/workspace-detail-selection";
151146

152-
const HEADER_SCROLL_EDGE_EFFECTS = nativeHeaderScrollEdgeEffects(Platform.OS, Platform.Version);
153-
154-
type AppScreenOptions = NativeStackNavigationOptions & {
155-
readonly unstable_navigationItemStyle?: "editor";
156-
readonly unstable_headerMinimizationBehavior?: "onScrollUp" | "never";
157-
};
158-
159-
const GLASS_HEADER_OPTIONS: AppScreenOptions = {
160-
headerBackButtonDisplayMode: "minimal",
161-
headerBackTitle: "",
162-
headerLargeTitle: false,
163-
headerShadowVisible: false,
164-
headerShown: true,
165-
headerStyle: NATIVE_LIQUID_GLASS_SUPPORTED ? { backgroundColor: "transparent" } : undefined,
166-
headerTitleStyle: { fontSize: 18, fontWeight: "800" },
167-
headerTransparent: NATIVE_LIQUID_GLASS_SUPPORTED,
168-
scrollEdgeEffects: NATIVE_LIQUID_GLASS_SUPPORTED ? HEADER_SCROLL_EDGE_EFFECTS : undefined,
169-
unstable_navigationItemStyle: NATIVE_LIQUID_GLASS_SUPPORTED ? "editor" : undefined,
170-
};
171-
172147
// Hiding Android's native header after mount can leave detail panes measured short.
173148
// These screens render their own Material toolbar, so hide it from the first layout.
174149
const DETAIL_HEADER_OPTIONS: AppScreenOptions = {
@@ -488,7 +463,6 @@ export function workspaceLocationFromState(state: NavigationState) {
488463
pathname: path.startsWith("/") ? path : `/${path}`,
489464
routeKey: route?.key,
490465
routeName: route?.name,
491-
routeKeys: effectiveState.routes.map((stackRoute) => stackRoute.key),
492466
};
493467
}
494468

@@ -536,8 +510,6 @@ function RootStackLayout(props: {
536510
pathname={workspaceLocation.pathname}
537511
workspaceRouteKey={workspaceLocation.routeKey}
538512
workspaceRouteName={workspaceLocation.routeName}
539-
workspaceRouteKeys={workspaceLocation.routeKeys}
540-
selectedPullRequestKey={selectedPullRequestKey(props.state)}
541513
>
542514
{props.children}
543515
<HardwareKeyboardCommandOverlay />
@@ -621,6 +593,9 @@ const RootStackConfig = createWorkspaceStackNavigator({
621593
contentStyle: { backgroundColor: "transparent" },
622594
headerBackVisible: false,
623595
...getCompactBrandHeaderOptions(),
596+
// Android draws Home's bars itself. Set here, not by the screen: Home also renders in the
597+
// sidebar column, and that copy clears the route's set options when it unmounts.
598+
headerShown: Platform.OS !== "android",
624599
},
625600
}),
626601
PullRequest: createNativeStackScreen({
@@ -973,7 +948,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
973948
screen: ConnectOnboardingRouteScreen,
974949
linking: "connect-onboarding",
975950
options: {
976-
// Android root formSheets lack a native stack bar; the route provides AndroidSheetHeader.
951+
// Android root formSheets lack a native stack bar; the route provides its own sheet AppBar.
977952
...(Platform.OS === "android" ? { headerShown: false } : SHEET_SOLID_HEADER_OPTIONS),
978953
title: "Set up T3 Connect",
979954
gestureEnabled: true,

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,3 @@ export function AndroidScreenHeader(props: {
208208
</View>
209209
);
210210
}
211-
212-
export function AndroidSheetHeader(
213-
props: Omit<Parameters<typeof AndroidScreenHeader>[0], "embedded">,
214-
) {
215-
return <AndroidScreenHeader {...props} embedded />;
216-
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { act, type ReactNode } from "react";
2+
import { createRoot, type Root } from "react-dom/client";
3+
import { afterEach, expect, it, vi } from "vite-plus/test";
4+
5+
vi.mock("react-native", () => ({
6+
View: (props: { readonly children?: ReactNode }) => <div>{props.children}</div>,
7+
Keyboard: { dismiss: () => {} },
8+
BackHandler: { addEventListener: () => ({ remove: () => {} }) },
9+
}));
10+
// React Navigation throws this outside a navigator, as for the Arrange threads sheet.
11+
vi.mock("@react-navigation/native", () => ({
12+
useIsFocused: () => {
13+
throw new Error("Couldn't find a navigation object.");
14+
},
15+
}));
16+
vi.mock("./AndroidScreenHeader", () => ({
17+
AndroidScreenHeader: (props: { readonly title: string }) => <h1>{props.title}</h1>,
18+
}));
19+
vi.mock("./WorkspaceAppBar.android", () => ({
20+
useHasWorkspaceAppBar: () => false,
21+
WorkspaceAppBar: () => null,
22+
}));
23+
vi.mock("./Menu", () => ({ Menu: (props: { readonly children?: ReactNode }) => props.children }));
24+
vi.mock("./ScreenHeaderButton.android", () => ({ ScreenHeaderButton: () => null }));
25+
vi.mock("./SearchField", () => ({ SearchField: () => null }));
26+
vi.mock("./useToolbarLayout", () => ({
27+
useToolbarLayout: () => ({ height: 48, paddingTop: 0, paddingBottom: 0 }),
28+
}));
29+
vi.mock("../../native/StackHeader", () => ({ NativeStackScreenOptions: () => null }));
30+
vi.mock("../../features/layout/useSidebarToggle", () => ({ useSidebarToggle: () => null }));
31+
vi.mock("../../features/settings/appearance/AppearancePreferencesProvider", () => ({
32+
useAppearancePreferences: () => ({ themeVariables: {} }),
33+
}));
34+
35+
import { AppBar } from "./AppBar.android";
36+
37+
const roots: Root[] = [];
38+
39+
afterEach(() => {
40+
for (const root of roots.splice(0)) act(() => root.unmount());
41+
document.body.innerHTML = "";
42+
});
43+
44+
it("renders a sheet bar without search outside a navigation container", () => {
45+
vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);
46+
const container = document.createElement("div");
47+
document.body.append(container);
48+
const root = createRoot(container);
49+
roots.push(root);
50+
51+
act(() => root.render(<AppBar sheet title="Arrange threads" />));
52+
53+
expect(container.textContent).toBe("Arrange threads");
54+
});

0 commit comments

Comments
 (0)