Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions apps/mobile/src/features/files/FileTreeBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium files/FileTreeBrowser.tsx:256

On Android, contentContainerStyle.paddingTop adds insets.top + IOS_NAV_BAR_HEIGHT + 8 before the first file row, creating an unnecessary large blank gap because AndroidScreenHeader and its search row already render outside the list. The same unconditional headerInset also 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:
In file @apps/mobile/src/features/files/FileTreeBrowser.tsx around line 256:

On Android, `contentContainerStyle.paddingTop` adds `insets.top + IOS_NAV_BAR_HEIGHT + 8` before the first file row, creating an unnecessary large blank gap because `AndroidScreenHeader` and its search row already render outside the list. The same unconditional `headerInset` also offsets the scroll indicator; gate both legacy-header insets to iOS rather than all non-Liquid-Glass platforms.

paddingBottom: 8,
}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Android gets unwanted top inset

Medium Severity

paddingTop falls back to headerInset + 8 whenever NATIVE_LIQUID_GLASS_SUPPORTED is false. That flag is false on Android, so the list gains safe-area plus a 44pt nav bar even though both Android call sites already render their own headers above FileTreeBrowser. Pre-change paddingTop was only 8 on Android; this opens a large empty gap at the top of the Files tree on Android.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2913955. Configure here.

refreshControl={<RefreshControl refreshing={props.isPending} onRefresh={props.onRefresh} />}
renderItem={renderItem}
ListEmptyComponent={
Expand Down
Loading