Skip to content

fix: iOS contentInsetAdjustmentBehavior for all LargeTitleHeader screens#2357

Merged
mikib0 merged 3 commits into
mainfrom
fix/ios-inset-adjustments
Apr 28, 2026
Merged

fix: iOS contentInsetAdjustmentBehavior for all LargeTitleHeader screens#2357
mikib0 merged 3 commits into
mainfrom
fix/ios-inset-adjustments

Conversation

@andrew-bierman
Copy link
Copy Markdown
Collaborator

@andrew-bierman andrew-bierman commented Apr 27, 2026

Summary

  • contentInsetAdjustmentBehavior="automatic" added to all 20 screens using LargeTitleHeader so scroll content starts below the transparent native nav bar on iOS (was rendering behind it)
  • Redundant manual insets removedcurrent-pack, weight-analysis, and trail-conditions had existing SafeAreaView paddingTop: insets.top + inner paddingTop: insets.top + 22 that conflicted with the automatic behavior; those are stripped
  • PackItemDetailScreenSafeAreaView restricted to edges={['bottom']} since the regular opaque stack header already offsets content correctly

Test plan

  • Navigate to each LargeTitleHeader screen — scroll content starts below nav bar, no overlap
  • Current Pack screen: no excessive top padding on pack header row
  • Weight Analysis screen: no excessive top padding on weight cards
  • Trail Conditions screen: filter bar and list start in correct position
  • Item Detail screen (/item/[id]): no extra gap at top below nav bar

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved safe area handling on multiple screens to better accommodate device notches and system UI overlays, ensuring content displays correctly on all device configurations.
  • Refactor

    • Standardized safe area management patterns across screens for more consistent layout behavior and improved scrolling inset adjustment on iOS and Android devices.

…leHeader screens

All 19 screens using LargeTitleHeader were missing this prop on their main
scroll component, causing content to render behind the transparent native
header on iOS. Fixes the overlap bug found on SeasonSuggestions.
…tInsetAdjustmentBehavior

- PackItemDetailScreen: edges={['bottom']} — regular stack header already offsets content
- current-pack, weight-analysis, trail-conditions: strip manual paddingTop/insets since
  contentInsetAdjustmentBehavior=automatic handles nav bar offset
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

Caution

Review failed

The pull request is closed.

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: String must contain at most 250 character(s) at "tone_instructions"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6e54bf48-c7ec-4b97-8170-4b1c76a45036

📥 Commits

Reviewing files that changed from the base of the PR and between 94b8b36 and 568962b.

📒 Files selected for processing (21)
  • apps/expo/app/(app)/current-pack/[id].tsx
  • apps/expo/app/(app)/gear-inventory.tsx
  • apps/expo/app/(app)/pack-stats/[id].tsx
  • apps/expo/app/(app)/recent-packs.tsx
  • apps/expo/app/(app)/shared-packs.tsx
  • apps/expo/app/(app)/shopping-list.tsx
  • apps/expo/app/(app)/trail-conditions.tsx
  • apps/expo/app/(app)/weather-alerts.tsx
  • apps/expo/app/(app)/weight-analysis/[id].tsx
  • apps/expo/components/LargeTitleHeaderOverlapFixIOS.tsx
  • apps/expo/features/ai/screens/ReportedContentScreen.tsx
  • apps/expo/features/catalog/screens/CatalogItemsScreen.tsx
  • apps/expo/features/feed/screens/FeedScreen.tsx
  • apps/expo/features/guides/screens/GuidesListScreen.tsx
  • apps/expo/features/pack-templates/screens/PackTemplateListScreen.tsx
  • apps/expo/features/packs/screens/PackDetailScreen.tsx
  • apps/expo/features/packs/screens/PackItemDetailScreen.tsx
  • apps/expo/features/packs/screens/PackListScreen.tsx
  • apps/expo/features/trips/screens/TripListScreen.tsx
  • apps/expo/features/weather/screens/LocationsScreen.tsx
  • apps/expo/features/wildlife/screens/WildlifeScreen.tsx

📝 Walkthrough

Walkthrough

This PR standardizes safe-area handling across the Expo app by removing manual inset calculations and adopting a declarative approach. Changes include restricting SafeAreaView to bottom edge handling only via edges={['bottom']}, adding automatic content inset adjustment to scrollable views, and refactoring related imports.

Changes

Cohort / File(s) Summary
App screens with SafeAreaView refactoring
apps/expo/app/(app)/current-pack/[id].tsx, apps/expo/app/(app)/weight-analysis/[id].tsx
Removed useSafeAreaInsets usage and conditional iOS padding; replaced with SafeAreaView edges={['bottom']} and contentInsetAdjustmentBehavior="automatic" on scrollable views.
App screens adding SafeAreaView with bottom edge
apps/expo/app/(app)/gear-inventory.tsx, apps/expo/app/(app)/pack-stats/[id].tsx, apps/expo/app/(app)/recent-packs.tsx, apps/expo/app/(app)/shared-packs.tsx, apps/expo/app/(app)/shopping-list.tsx, apps/expo/app/(app)/weather-alerts.tsx
Wrapped root container in SafeAreaView with edges={['bottom']} and added contentInsetAdjustmentBehavior="automatic" to scrollable views.
App screens with FlatList inset adjustment
apps/expo/app/(app)/trail-conditions.tsx
Removed useSafeAreaInsets; configured SafeAreaView edges={['bottom']} and FlatList contentInsetAdjustmentBehavior="automatic".
Component dependency cleanup
apps/expo/components/LargeTitleHeaderOverlapFixIOS.tsx
Removed react-native-safe-area-context dependency by eliminating useSafeAreaInsets usage and conditional paddingTop logic.
Feature screens adding contentInsetAdjustmentBehavior
apps/expo/features/catalog/screens/CatalogItemsScreen.tsx, apps/expo/features/feed/screens/FeedScreen.tsx, apps/expo/features/pack-templates/screens/PackTemplateListScreen.tsx, apps/expo/features/wildlife/screens/WildlifeScreen.tsx
Added contentInsetAdjustmentBehavior="automatic" to FlatList for automatic content inset management.
Feature screens with broader SafeAreaView changes
apps/expo/features/guides/screens/GuidesListScreen.tsx
Added contentInsetAdjustmentBehavior="automatic" to FlatList managing safe-area inset adjustments for list header, refresh control, and footer.
Pack feature screens with edges configuration
apps/expo/features/packs/screens/PackDetailScreen.tsx, apps/expo/features/packs/screens/PackItemDetailScreen.tsx
Updated SafeAreaView to restrict safe-area handling to bottom edge via edges={['bottom']}.
PackListScreen wrapping refactor
apps/expo/features/packs/screens/PackListScreen.tsx
Wrapped root layout in SafeAreaView edges={['bottom']} to constrain safe-area handling while preserving LargeTitleHeaderOverlapFixIOS and FlatList rendering logic.
TripListScreen safe-area refactor
apps/expo/features/trips/screens/TripListScreen.tsx
Replaced fragment wrapper with SafeAreaView edges={['bottom']} and added contentInsetAdjustmentBehavior="automatic" to FlatList.
LocationsScreen comprehensive refactor
apps/expo/features/weather/screens/LocationsScreen.tsx
Removed platform-dependent iOS top padding and wrapped header content in LargeTitleHeaderOverlapFixIOS; configured SafeAreaView edges={['bottom']} and adjusted styling.
ReportedContentScreen rendering refactor
apps/expo/features/ai/screens/ReportedContentScreen.tsx
Restructured control flow from outer conditional to single FlatList using ListHeaderComponent for filters and ListEmptyComponent for loading/error/empty states.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

  • Development -> main #2190: Both PRs modify apps/expo/features/packs/screens/PackListScreen.tsx, with this PR updating the root SafeAreaView wrapping and the related PR adjusting spacing details.
  • Release v2.0.15 #1979: Both PRs modify safe-area handling and related imports across overlapping Expo app screens including current-pack, gear-inventory, and weight-analysis.

Suggested reviewers

  • Isthisanmol

Poem

🐰 Safe areas now bottom-aligned with cheer,
Insets adjust automatic, crystal clear,
Fragments become containers, layouts refined,
Platform checks removed, new patterns designed,
A hop toward consistency across the app! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ios-inset-adjustments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mikib0
Copy link
Copy Markdown
Collaborator

mikib0 commented Apr 27, 2026

Reviewing...

@mikib0
Copy link
Copy Markdown
Collaborator

mikib0 commented Apr 28, 2026

We already have a fix for iOS LargeTitleHeader overlap using SafeAreaView.

Though I can see that this PR addressed some new screens with LargeTitleHeader that were missed.

I’m looking at the result of the changes and also comparing with the previous SafeAreaView only fix in screens that had it for correctness.

Copy link
Copy Markdown
Collaborator

@mikib0 mikib0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a commit with some corrections. Ltgm now.

@mikib0 mikib0 marked this pull request as ready for review April 28, 2026 11:04
@mikib0 mikib0 merged commit 9cbd0c6 into main Apr 28, 2026
5 of 9 checks passed
@mikib0 mikib0 deleted the fix/ios-inset-adjustments branch April 28, 2026 11:05
andrew-bierman pushed a commit that referenced this pull request May 14, 2026
fix: iOS contentInsetAdjustmentBehavior for all LargeTitleHeader screens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants