Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): land the first thread open above the composer on Android #5585

MergedPollyGlot(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/5585/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 3 changed files with 60 additions and 5 deletions.

x
0 of 3 viewed, 3 left
25 additions and 5 deletionsapps/mobile/src/features/threads/ThreadFeed.tsxModified
View file
@@ -73,7 +73,11 @@
} from "../review/nativeReviewDiffAdapter";
import { buildReviewParsedDiff } from "../review/reviewModel";
import { cn } from "../../lib/cn";
-import { deriveCenteredContentHorizontalPadding, type LayoutVariant } from "../../lib/layout";
+import {
+ deriveCenteredContentHorizontalPadding,
+ deriveThreadFeedInitialContentInset,
+ type LayoutVariant,
+} from "../../lib/layout";
import {
resolveMarkdownFontSizes,
resolveNativeMarkdownTypography,
@@ -1373,6 +1377,11 @@
const bottomContentInset = props.contentBottomInset ?? 18;
const usesNativeAutomaticInsets =
props.usesAutomaticContentInsets === true && Platform.OS === "ios";
+ const initialContentInset = deriveThreadFeedInitialContentInset({
+ platform: Platform.OS,
+ usesNativeAutomaticInsets,
+ bottomContentInset,
+ });
// With automatic insets the header inset lives in UIKit's adjustedContentInset,
// which LegendList's JS anchoring math cannot see — it measures the anchored
// end space from the scroll view's frame top. Fold the header height back into
@@ -1583,10 +1592,10 @@
// The empty↔filled key below remounts the list, which resets its imperative
// content-inset override — and useKeyboardChatComposerInset (mounted above