Skip to content

feat(ios): expose four-edge native tab scene insets - #589

Open
thiagobrez wants to merge 1 commit into
mainfrom
codex/duo-scene-insets
Open

thiagobrez wants to merge 1 commit into
mainfrom
codex/duo-scene-insets

Conversation

@thiagobrez

@thiagobrez thiagobrez commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

PR Description

Foreground content can overlap vertical native tab bars on iPhone Duo. Add useTabSceneInsets() to expose the native scene's physical top/right/bottom/left safe-area insets, updating through layout and safe-area changes. Keep scene bounds and backgrounds edge-to-edge; apps opt in by applying the insets to foreground content.

Insets are stored by route and exposed within each scene. The hook returns undefined before measurement, outside scenes, for custom tab bars, and on unsupported platforms. It leaves the existing bottom-height API unchanged. The Four Tabs Article example and docs demonstrate explicit padding, including physical-to-logical edge mapping for React Native RTL layouts and disabling duplicate automatic scroll adjustment.

How to test?

Open Four Tabs and inspect/scroll Article. Its text should clear the vertical bar while the white background extends behind it. Rotate between both closed landscape orientations, unfold to horizontal tabs, and switch away from Article and back.

Verified with agent-device 0.20.10, using Device Hub for Duo hardware rotation/folding:

  • iPhone Duo / iOS 27.1: left and right 84-point scene insets; unfolded bottom inset 83 points. A temporary hidden-bar prop reduced the bottom inset to 34 points, and restoring/folding restored the side inset.
  • React Native RTL: foreground padding stays on the measured physical edge.
  • iPhone 17 Pro / iOS 26.5: horizontal LTR layout and Article/Albums switching.
  • Xcode native build, lint, typecheck, and existing workspace tests pass. Diagnostic labels and temporary hidden-bar props were removed.

Uses public UIView safe-area callbacks; no private view inspection. Android/macOS behavior and keyboard avoidance are outside this iOS inset API. Split View, sidebar transitions, and older iOS runtimes were not runtime-tested in this change.

Screenshots

Both recordings show Four Tabs / Article in the same closed landscape orientation. Before is upstream main with diagnostic logging only; after applies the new hook in the example. App interactions use agent-device; videos use explicit simulator display 1 because automatic landscape capture produced black recordings during the audit.

Before — text overlaps the vertical bar After — foreground applies scene insets
04-insets-before-overlap.mp4
04-insets-after-padding.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant