fix(mobile): land the first thread open above the composer on Android #5585
MergedPollyGlot(GitHub profile, opens in a new tab)merged 4 commits into
main fromrefs/pull/5585/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
- apps/mobile/src/features/threads/ThreadFeed.tsx line 1893OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1898,4 +1884,10 @@18981884 // under-reports the composer inset by this amount (see18991885 // ThreadDetailScreen); this tells LegendList's scroll math about the19001886 // extra so programmatic end scrolls land at the true resting offset.1901- contentInsetEndStaticAdjustment={usesNativeAutomaticInsets ? insets.bottom : 0}1887+ // Without automatic insets (Android, pre-glass iOS) the composer1888+ // overlay only exists as the keyboard integration's animated bottom1889+ // padding, which the scroll math cannot see either — declare the1890+ // estimated overlay height here so the initial scroll-at-end lands1891+ // above the composer on the very first (uncached) thread open,1892+ // instead of racing an imperative reportContentInset after mount.1893+ contentInsetEndStaticAdjustment={
- apps/mobile/src/features/threads/ThreadFeed.tsx line 1895OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1898,4 +1884,12 @@18981884 // under-reports the composer inset by this amount (see18991885 // ThreadDetailScreen); this tells LegendList's scroll math about the19001886 // extra so programmatic end scrolls land at the true resting offset.1901- contentInsetEndStaticAdjustment={usesNativeAutomaticInsets ? insets.bottom : 0}1887+ // Without automatic insets (Android, pre-glass iOS) the composer1888+ // overlay only exists as the keyboard integration's animated bottom1889+ // padding, which the scroll math cannot see either — declare the1890+ // estimated overlay height here so the initial scroll-at-end lands1891+ // above the composer on the very first (uncached) thread open,1892+ // instead of racing an imperative reportContentInset after mount.1893+ contentInsetEndStaticAdjustment={1894+ usesNativeAutomaticInsets ? insets.bottom : bottomContentInset1895+ }
- apps/mobile/src/features/threads/ThreadFeed.tsx line 1914OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1899,3 +1899,16 @@18991899 // ThreadDetailScreen); this tells LegendList's scroll math about the19001900 // extra so programmatic end scrolls land at the true resting offset.19011901 contentInsetEndStaticAdjustment={usesNativeAutomaticInsets ? insets.bottom : 0}1902+ // Android: the composer overlay only exists as the keyboard1903+ // integration's animated bottom padding, which the list's scroll1904+ // math cannot see until the inset reports above land — and those1905+ // arrive via runOnJS, racing the remounted list's one-shot initial1906+ // scroll-at-end. Seed the estimated overlay height as a declarative1907+ // contentInset floor: LegendList consumes it in JS math only1908+ // (Android's ScrollView has no native contentInset prop) and the1909+ // first reported override REPLACES it instead of adding to it.1910+ // Not on iOS: there the prop would reach UIKit and inset natively1911+ // on top of the animated padding.1912+ {...(Platform.OS === "android" && !usesNativeAutomaticInsets1913+ ? { contentInset: { bottom: bottomContentInset } }1914+ : {})}
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.




Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
10d7bcef-f0d5-4d07-b7eb-02c966710f19You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
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