Skip to content
Source
Sign inSign up
pingdotgg/t3code

Gate iOS glass layout on native support #4032

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/4032/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Summary

  • Add a shared native liquid-glass capability check for iOS-only glass behavior.
  • Fall back to solid headers and non-overlapping scroll inset behavior when native glass is unavailable.
  • Adjust affected mobile home, files, thread, and sidebar screens to avoid pre-glass iOS header/content overlaps.

Testing

  • Added unit coverage for supportsNativeLiquidGlass platform and capability gating.
  • Not run: validation commands not provided in prompt.

Note

Low Risk UI/layout-only gating on an existing native capability check; no auth, data, or API changes. Main risk is visual/regression on pre-glass iOS devices, which this PR is intended to fix.

Overview iOS liquid-glass UI is now gated on a shared runtime flag (NATIVE_LIQUID_GLASS_SUPPORTED) instead of treating every iOS device as glass-capable.

The flag combines Platform.OS === "ios" with @callstack/liquid-glass’s isLiquidGlassSupported, via a small supportsNativeLiquidGlass helper and unit tests.

When glass is off (older iOS or non-iOS), navigation and lists use solid sheet-colored headers, non-transparent bars, and no automatic scroll/content inset adjustment—so lists and empty states sit below the header instead of underlapping it. Glass-specific options (transparent headers, scroll-edge effects, editor nav item style, automatic contentInsetAdjustmentBehavior) apply only when the flag is true.

Touched surfaces include root GLASS_HEADER_OPTIONS, iPad sidebar stack chrome, Home, file tree, thread route/detail (including working-duration pill styling on legacy iOS), and thread navigation sidebar lists.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5ddde32385c34ab5d398bed08e6916de7ade619e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Gate iOS glass layout behavior on native liquid glass capability

  • Introduces a NATIVE_LIQUID_GLASS_SUPPORTED runtime flag in native-glass.ts, derived from a new supportsNativeLiquidGlass helper that checks both Platform.OS === 'ios' and a native capability flag.
  • Replaces all Platform.OS === 'ios' checks for glass-related UI (transparent headers, scroll edge effects, content inset adjustments) with NATIVE_LIQUID_GLASS_SUPPORTED across screens and navigation components.
  • On iOS versions without native liquid glass support, headers render with a solid background, content insets are not auto-adjusted, and translucent pill/sidebar styles fall back to solid card styling.
  • Behavioral Change: Pre-liquid-glass iOS devices now receive the same non-glass layout as non-iOS platforms for all affected screens.
📊 Macroscope summarized 5ddde32. 9 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 0271e970-1b36-48f5-ade1-5ccb694d8d1b

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `t3code/fix-ios18-non-glass-overlaps`

      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. @@ -249,4 +243,4 @@
      249243 className="flex-1"
      250244 data={visibleNodes}
      251245 keyExtractor={(item) => item.node.path}
      252- contentInsetAdjustmentBehavior={Platform.OS === "ios" ? "automatic" : "never"}
      246+ contentInsetAdjustmentBehavior={NATIVE_LIQUID_GLASS_SUPPORTED ? "automatic" : "never"}
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟠 High files/FileTreeBrowser.tsx:246

      On iOS devices that don't support liquid glass, contentInsetAdjustmentBehavior is 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 previous Platform.OS === "ios" ? "automatic" : "never" behavior, which applied the inset on all iOS versions. The gating now uses NATIVE_LIQUID_GLASS_SUPPORTED instead of Platform.OS === "ios", so pre-glass iOS loses the inset even though the header is still translucent. Consider gating on Platform.OS === "ios" (or header translucency) rather than liquid-glass capability.

      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/src/features/files/FileTreeBrowser.tsx around line 246:
      
      On iOS devices that don't support liquid glass, `contentInsetAdjustmentBehavior` is 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 previous `Platform.OS === "ios" ? "automatic" : "never"` behavior, which applied the inset on all iOS versions. The gating now uses `NATIVE_LIQUID_GLASS_SUPPORTED` instead of `Platform.OS === "ios"`, so pre-glass iOS loses the inset even though the header is still translucent. Consider gating on `Platform.OS === "ios"` (or header translucency) rather than liquid-glass capability.
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      1 blocking correctness issue found. An unresolved high-severity comment identifies a potential regression on older iOS devices where content may render beneath the header due to changed inset behavior. This bug concern warrants human review before merging.

      No code changes detected at 5ddde32. Prior analysis still applies.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. juliusmarminge merged thisb6d9ce3

    6. juliusmarminge closed this

    7. Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

      Fix All in Cursor Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start. Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5ddde32385c34ab5d398bed08e6916de7ade619e. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -278,4 +279,4 @@
      278279 );
      279280
      280281 /* ─── Native header theming ──────────────────────────────────────── */
      281- const usesNativeHeaderGlass = Platform.OS === "ios";
      282+ const usesNativeHeaderGlass = NATIVE_LIQUID_GLASS_SUPPORTED;
      cursor[bot](GitHub profile, opens in a new tab)commented

      Duplicate thread header controls

      High Severity

      On pre-glass iOS, changing usesNativeHeaderGlass to NATIVE_LIQUID_GLASS_SUPPORTED incorrectly activates ThreadGitControls' native header toolbar. This conflicts with the screen's existing compactRightHeaderItems logic, causing header actions to duplicate, disappear, or thrash.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5ddde32385c34ab5d398bed08e6916de7ade619e. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -33,4 +34,4 @@
      3334 headerLargeTitle: false,
      3435 headerShadowVisible: false,
      3536 headerShown: true,
      36- headerStyle: { backgroundColor: "transparent" },
      37+ headerStyle: NATIVE_LIQUID_GLASS_SUPPORTED ? { backgroundColor: "transparent" } : undefined,

      Sidebar solid header fallback gap

      Medium Severity

      When native liquid glass is unavailable, SIDEBAR_SCREEN_OPTIONS clears transparency but leaves headerStyle undefined. The main stack’s glass preset falls back to SHEET_BACKGROUND_COLOR, so the iPad sidebar nav bar can keep a default system material instead of the intended solid sheet chrome.

      Additional Locations (1)
      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5ddde32385c34ab5d398bed08e6916de7ade619e. Configure [here](https://www.cursor.com/dashboard/bugbot).

Sign in to join this conversation.