-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Gate iOS glass layout on native support #4032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ import { | |
| } from "../../components/AndroidScreenHeader"; | ||
| import { LoadingScreen } from "../../components/LoadingScreen"; | ||
| import { scopedThreadKey } from "../../lib/scopedEntities"; | ||
| import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass"; | ||
| import { connectionTone } from "../connection/connectionTone"; | ||
|
|
||
| import { | ||
|
|
@@ -278,7 +279,7 @@ function ThreadRouteContent( | |
| ); | ||
|
|
||
| /* ─── Native header theming ──────────────────────────────────────── */ | ||
| const usesNativeHeaderGlass = Platform.OS === "ios"; | ||
| const usesNativeHeaderGlass = NATIVE_LIQUID_GLASS_SUPPORTED; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate thread header controlsHigh Severity On pre-glass iOS, changing Reviewed by Cursor Bugbot for commit 5ddde32. Configure here. |
||
| const headerSubtitle = [ | ||
| selectedThreadProject?.title ?? null, | ||
| selectedEnvironmentConnection?.environmentLabel ?? null, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ import { | |
| import type { ReactNode } from "react"; | ||
| import { Platform, useColorScheme } from "react-native"; | ||
|
|
||
| import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass"; | ||
| import { nativeHeaderScrollEdgeEffects } from "../../native/StackHeader"; | ||
|
|
||
| const SCROLL_EDGE_EFFECTS = nativeHeaderScrollEdgeEffects(Platform.OS, Platform.Version); | ||
|
|
@@ -33,12 +34,12 @@ const SIDEBAR_SCREEN_OPTIONS: SidebarScreenOptions = { | |
| headerLargeTitle: false, | ||
| headerShadowVisible: false, | ||
| headerShown: true, | ||
| headerStyle: { backgroundColor: "transparent" }, | ||
| headerStyle: NATIVE_LIQUID_GLASS_SUPPORTED ? { backgroundColor: "transparent" } : undefined, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sidebar solid header fallback gapMedium Severity When native liquid glass is unavailable, Additional Locations (1)Reviewed by Cursor Bugbot for commit 5ddde32. Configure here. |
||
| headerTitleStyle: { fontSize: 18, fontWeight: "800" }, | ||
| headerTransparent: true, | ||
| scrollEdgeEffects: SCROLL_EDGE_EFFECTS, | ||
| headerTransparent: NATIVE_LIQUID_GLASS_SUPPORTED, | ||
| scrollEdgeEffects: NATIVE_LIQUID_GLASS_SUPPORTED ? SCROLL_EDGE_EFFECTS : undefined, | ||
| title: "Threads", | ||
| unstable_navigationItemStyle: "editor", | ||
| unstable_navigationItemStyle: NATIVE_LIQUID_GLASS_SUPPORTED ? "editor" : undefined, | ||
| }; | ||
|
|
||
| const SidebarStack = createNativeStackNavigator(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { describe, expect, it } from "vite-plus/test"; | ||
|
|
||
| import { supportsNativeLiquidGlass } from "./native-glass-capability"; | ||
|
|
||
| describe("supportsNativeLiquidGlass", () => { | ||
| it("uses native liquid glass when iOS reports the capability", () => { | ||
| expect(supportsNativeLiquidGlass("ios", true)).toBe(true); | ||
| }); | ||
|
|
||
| it("keeps pre-glass iOS on the solid fallback", () => { | ||
| expect(supportsNativeLiquidGlass("ios", false)).toBe(false); | ||
| }); | ||
|
|
||
| it("does not enable iOS liquid-glass layout behavior on other platforms", () => { | ||
| expect(supportsNativeLiquidGlass("android", true)).toBe(false); | ||
| expect(supportsNativeLiquidGlass("web", true)).toBe(false); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export function supportsNativeLiquidGlass( | ||
| platform: string, | ||
| nativeCapabilityAvailable: boolean, | ||
| ): boolean { | ||
| return platform === "ios" && nativeCapabilityAvailable; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { isLiquidGlassSupported } from "@callstack/liquid-glass"; | ||
| import { Platform } from "react-native"; | ||
|
|
||
| import { supportsNativeLiquidGlass } from "../lib/native-glass-capability"; | ||
|
|
||
| export const NATIVE_LIQUID_GLASS_SUPPORTED = supportsNativeLiquidGlass( | ||
| Platform.OS, | ||
| isLiquidGlassSupported, | ||
| ); |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 High
files/FileTreeBrowser.tsx:246On iOS devices that don't support liquid glass,
contentInsetAdjustmentBehavioris now set to"never", so the FlatList receives no automatic top inset and the first file rows render beneath the native header. This regresses from the previousPlatform.OS === "ios" ? "automatic" : "never"behavior, which applied the inset on all iOS versions. The gating now usesNATIVE_LIQUID_GLASS_SUPPORTEDinstead ofPlatform.OS === "ios", so pre-glass iOS loses the inset even though the header is still translucent. Consider gating onPlatform.OS === "ios"(or header translucency) rather than liquid-glass capability.🚀 Reply "fix it for me" or copy this AI Prompt for your agent: