Skip to content

Full-bleed mode: document/support safe-area handling for fixed-position overlays (status-bar collisions) #77

Description

@kieranklaassen

Summary

With full-bleed content (the behavior requested in #4), position: fixed top-anchored overlays — banners, toasts, modal headers — render under the iOS status bar unless the app hand-rolls env(safe-area-inset-top) math. The gem's .native-inset-top helpers cover in-flow layout (they inject an ::before spacer) but nothing covers fixed overlays, and the pattern isn't documented. We've now shipped the same one-line fix three separate times, each one first reported as a device-only bug by a tester.

Setup

  • Cora (cora.computer) — Rails 8 + Inertia/React, ruby_native 0.10.11, Normal Mode iOS shell, full-bleed webview

What we hit (three independent device-reported bugs, same root cause)

  1. Full-screen preview modal: header rendered beneath the notch — the Close button was visible but untappable. Fix: pt-[max(0.75rem,env(safe-area-inset-top))] on the modal container.
  2. Account-reconnect banner (fixed top-3): the clock/battery painted straight over the banner copy (tester screenshot). Fix: top: max(0.75rem, calc(env(safe-area-inset-top, 0px) + 0.5rem)).
  3. Welcome overlay: same story, same fix.

None of these reproduce in desktop Safari/Chrome or simulators without a notch, so each burned a report → triage → device-verify loop before the obvious fix.

Asks

  1. Document the fixed-overlay pattern alongside the full-bleed / .native-inset docs: "any position: fixed element anchored with top: needs max(<your-offset>, env(safe-area-inset-top) + <gap>)" — one paragraph would have saved us three bug cycles.
  2. Bless --ruby-native-safe-area-inset-top as public API. ruby_native.css already defines the helpers via var(--ruby-native-safe-area-inset-top, env(safe-area-inset-top)) — with the comment that Android's WebView doesn't populate env(safe-area-inset-*). That means our pure-env() fixes above are iOS-only and will silently collapse to 0 on the Android shell. If apps are supposed to write var(--ruby-native-safe-area-inset-top, env(safe-area-inset-top)) instead of raw env(), please document it; a tiny utility class for fixed overlays (e.g. .native-fixed-top) would be even better.

If this is already covered on rubynative.com and we just missed it, feel free to close with a pointer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions