-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Open
juliusmarminge
wants to merge
1
commit into
main
Choose a base branch
from
t3code/fix-ios18-non-glass-overlaps
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, | ||
| ); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: