fix(ExampleApp): respect safe areas on HomeScreen and present image picker as a page sheet#263
Merged
Merged
Conversation
The HomeScreen rendered a bare FlatList instead of using the Screen component, and the navigator hides the native header, so the title and list content slid under the status bar/notch. Apply top/left/right safe area insets to the list so content stays clear of the safe areas.
Replace the manual safe-area inset hack with the shared Screen component used by every other screen. Uses the "fixed" preset so the FlatList keeps its own scrolling (a VirtualizedList must not be nested in a ScrollView), with the inner container flexed so the list fills the safe area.
The picker defaulted to the system's full-screen presentation, whose nav bar renders under the status bar / Dynamic Island. Set presentationStyle to PAGE_SHEET on the shared picker options so it presents as a card sheet that sits below the safe area. Applies to both the library and camera flows, which share these options.
🦋 Changeset detectedLatest commit: bb02352 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
… picker Split the shared picker options so launchImageLibraryAsync uses a page sheet (avoiding the full-screen nav bar under the status bar) while launchCameraAsync keeps the conventional full-screen camera.
Changes are confined to the private example-app workspace, so no package version bump is needed. The empty changeset satisfies the changeset check.
Document that PRs touching only non-published workspaces (e.g. example-app) should add an empty changeset (npx changeset --empty) to satisfy the changeset check without bumping any package version.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes safe-area issues in the example app reported from device screenshots.
1. HomeScreen safe areas
The navigator runs with
headerShown: false, andHomeScreenrendered a bareFlatListinstead of using the sharedScreencomponent that every other screen uses. As a result the "Infinite Red AI" title slid under the status bar / notch.HomeScreennow uses theScreencomponent withsafeAreaEdges={["top", "bottom"]}, matching the rest of the app. It uses the"fixed"preset (not"scroll") so theFlatListkeeps its own virtualized scrolling — aVirtualizedListmust not be nested inside theScrollViewthat the"scroll"preset provides — with the inner container flexed so the list fills the safe area.2. Image picker presentation
Selecting a photo opened the native iOS picker with its default full-screen presentation, whose nav bar renders under the status bar / Dynamic Island. The shared picker options (
useExampleImage.ts) now setpresentationStyle: UIImagePickerPresentationStyle.PAGE_SHEET, so the picker presents as a card sheet that sits below the safe area. This covers both the library (selectPhoto) and camera (takePhoto) flows, which share these options.Notes
PAGE_SHEETstyle also applies to the camera flow since both share one options object. Happy to split them if a full-screen camera is preferred.Test plan
https://claude.ai/code/session_017scjHRZz4xAYpGpqRTyNV8
Generated by Claude Code