Skip to content

Latest commit

 

History

History
50 lines (40 loc) · 2.98 KB

12_mobile-navigation.md

File metadata and controls

50 lines (40 loc) · 2.98 KB

Mobile navigation

Home and thread routes share the root native stack so UIKit animates headers within one navigation controller; the iPad sidebar has its own stack. See Mobile layout for how the stack maps to columns, sheets, and panes.

Selecting versus drilling in

Opening a page has two intents:

  • Select replaces the workspace's active detail page via selectWorkspaceDetail, preserving route keys when updating in place across phones and splits.
  • Drill in pushes a page onto the stack with StackActions.push so Back returns.

Lint rejects navigate to Thread or PullRequest because its behavior depends on what happens to be on top. Never infer navigation intent from transition events (UIKit emits them for sidebar appearances too). Settings pages beside the list share one native screen whose content swaps so navigating between settings does not pop/push the column or unmount its header.

UIKit and react-native-screens fork constraints

The react-native-screens fork preserves native header behavior that is easy to break:

  • Keep the brand in headerTitle (UIKit on iOS 26.5 morphs a background-free leading toolbar item into the next screen's back button).
  • Keep the empty native label supplying custom title geometry so UIKit's scroll-edge fade recognizes Fabric text views.
  • Keep independent caches for leading, trailing, and center item groups (and header config) so rebuilding an unchanged group does not pull buttons out of an active UIKit animation.
  • Horizontal ScrollViews at their leading edge must yield to the full-screen back gesture.
  • Register header scroll views only through NativeScrollViewMarker or NativeScrollView (lint enforces this): shifting via bounds origin rather than content offset avoids React Native layout passes resetting scroll position under the side bar.

Native media presentations

  • iOS uses AVKit for full-screen video, Quick Look for documents, and our own image viewer for images (Quick Look drags images during swipe/dismiss). Do not layer a custom UIKit zoom transition over AVKit or Quick Look—it breaks AVKit's Close action and Quick Look's interactive dismiss.
  • Thumbnail registrations hold weak references and resolve promises only after dismissal so callers keep local file leases alive. Treat dismissal as pending until UIKit finishes its transition; video cleanup must restore the prior audio configuration without deactivating the shared audio session.
  • Pin the initial signed asset URL for a video preview's lifetime (reacting to token refreshes restarts playback), and copy Quick Look inputs into a temporary directory so preview/sharing cannot mutate workspace files.