-
Notifications
You must be signed in to change notification settings - Fork 5k
fix(mobile): keep the file tree clear of the translucent header #8129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,7 +124,7 @@ export function FileTreeBrowser(props: { | |
| const insets = useSafeAreaInsets(); | ||
| // Native transparent-header height ≈ safe-area top + nav bar (~44). Matches the | ||
| // observed adjustedContentInset bottom (~102) seen in the native trace. | ||
| const headerInset = NATIVE_LIQUID_GLASS_SUPPORTED ? insets.top + IOS_NAV_BAR_HEIGHT : 0; | ||
| const headerInset = insets.top + IOS_NAV_BAR_HEIGHT; | ||
| const iconColor = String(useThemeColor("--color-icon-muted")); | ||
| const { onPreviewFile, onSelectFile, selectedPath: controlledSelectedPath } = props; | ||
| const controlledSelectedPathRef = useRef(controlledSelectedPath); | ||
|
|
@@ -245,18 +245,17 @@ export function FileTreeBrowser(props: { | |
| data={visibleNodes} | ||
| keyExtractor={(item) => item.node.path} | ||
| contentInsetAdjustmentBehavior={NATIVE_LIQUID_GLASS_SUPPORTED ? "automatic" : "never"} | ||
| scrollIndicatorInsets={ | ||
| NATIVE_LIQUID_GLASS_SUPPORTED | ||
| ? { top: headerInset, left: 0, right: 0, bottom: 0 } | ||
| : undefined | ||
| } | ||
| scrollIndicatorInsets={{ top: headerInset, left: 0, right: 0, bottom: 0 }} | ||
| keyboardDismissMode="on-drag" | ||
| keyboardShouldPersistTaps="handled" | ||
| initialNumToRender={FILE_TREE_INITIAL_RENDER_COUNT} | ||
| maxToRenderPerBatch={FILE_TREE_RENDER_BATCH_SIZE} | ||
| updateCellsBatchingPeriod={16} | ||
| windowSize={5} | ||
| contentContainerStyle={{ paddingTop: 8, paddingBottom: 8 }} | ||
| contentContainerStyle={{ | ||
| paddingTop: NATIVE_LIQUID_GLASS_SUPPORTED ? 8 : headerInset + 8, | ||
| paddingBottom: 8, | ||
| }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Android gets unwanted top insetMedium Severity
Reviewed by Cursor Bugbot for commit 2913955. Configure here. |
||
| refreshControl={<RefreshControl refreshing={props.isPending} onRefresh={props.onRefresh} />} | ||
| renderItem={renderItem} | ||
| ListEmptyComponent={ | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium
files/FileTreeBrowser.tsx:256On Android,
contentContainerStyle.paddingTopaddsinsets.top + IOS_NAV_BAR_HEIGHT + 8before the first file row, creating an unnecessary large blank gap becauseAndroidScreenHeaderand its search row already render outside the list. The same unconditionalheaderInsetalso offsets the scroll indicator; gate both legacy-header insets to iOS rather than all non-Liquid-Glass platforms.🤖 Copy this AI Prompt to have your agent fix this: