From 447a8344d9903e703e14fc3eaad0b693add63a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20=C5=A0=C4=87eki=C4=87?= Date: Tue, 8 Sep 2026 12:51:02 +0200 Subject: [PATCH 1/2] chore: bring-mobile-gitlab-and-bitb-3792 pre-verify snapshot --- .../src/app/(app)/agent-chat/repo-picker.tsx | 53 +++++--- .../agents/new-session-configure-form.tsx | 1 + .../agents/repository-branch-selector.tsx | 18 ++- .../agents/session-detail-content.tsx | 3 +- apps/mobile/src/components/picker-sheet.tsx | 9 +- .../pr-review/pr-form-sheet-chrome.tsx | 4 +- .../pr-review/pr-review-connect-gate.tsx | 21 ++- .../components/pr-review/pr-review-screen.tsx | 10 ++ .../pr-review/pr-review-tab-selector.tsx | 13 +- .../active-agents-widget.tsx | 4 +- apps/mobile/src/i18n/locales/en.json | 2 +- .../lib/pr-review/use-provider-inbox.test.ts | 28 ++++ .../src/lib/pr-review/use-provider-inbox.ts | 3 +- .../provider-review/bitbucket-read.test.ts | 121 +++++++++++++----- .../src/lib/provider-review/bitbucket-read.ts | 117 +++++++++++++++-- patches/expo-router@57.0.15.patch | 32 +++++ pnpm-lock.yaml | 16 +-- 17 files changed, 369 insertions(+), 86 deletions(-) diff --git a/apps/mobile/src/app/(app)/agent-chat/repo-picker.tsx b/apps/mobile/src/app/(app)/agent-chat/repo-picker.tsx index 3caa8c6961..ff57253491 100644 --- a/apps/mobile/src/app/(app)/agent-chat/repo-picker.tsx +++ b/apps/mobile/src/app/(app)/agent-chat/repo-picker.tsx @@ -2,9 +2,8 @@ import { useFocusEffect, useRouter } from 'expo-router'; import * as Haptics from 'expo-haptics'; import { Check, Info, Lock, Search, SearchX, Unlock } from '@/components/ui/icons'; import { useCallback, useMemo, useRef, useState } from 'react'; -import { FlatList, Pressable, TextInput, View } from 'react-native'; +import { Pressable, TextInput, View } from 'react-native'; import { useTranslation } from 'react-i18next'; -import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { EmptyState } from '@/components/empty-state'; import { PickerSheet } from '@/components/picker-sheet'; @@ -21,7 +20,6 @@ type PickerListItem = export default function RepoPickerScreen() { const router = useRouter(); const colors = useThemeColors(); - const { bottom } = useSafeAreaInsets(); const { t } = useTranslation(); const [search, setSearch] = useState(''); const [bridge, setBridge] = useState(() => repoPickerSlot.get(UNFENCED_ROUTE_KEY)); @@ -102,7 +100,6 @@ export default function RepoPickerScreen() { @@ -136,17 +133,18 @@ export default function RepoPickerScreen() { } /> ) : ( - item.key} - keyboardShouldPersistTaps="handled" - keyboardDismissMode="on-drag" - contentContainerStyle={{ paddingBottom: bottom }} - renderItem={({ item }) => { + // Mapped rows inside the shell ScrollView instead of a FlatList: the + // FlatList stretches into the space the formSheet offers and its rows + // painted over the pinned search header while scrolling. The shell + // scroll view starts below the header, so a row can never overlap it. + + {listItems.map(item => { if (item.kind === 'header') { return ( - + {t(item.titleKey)} ); @@ -156,6 +154,7 @@ export default function RepoPickerScreen() { const rowLabel = `${platformName} ${repo.fullName}`; return ( { handleSelect(`${repo.platform}:${repo.fullName}`); @@ -182,9 +181,33 @@ export default function RepoPickerScreen() { ) : null} ); - }} - /> + })} + {renderBitbucketNote()} + )} ); + + /** + * Personal Bitbucket never lists repositories (organization-only), so the + * grouped list would end at GitLab with nothing explaining the gap. The + * note renders once, after the provider sections, whenever the picker has + * rows but no Bitbucket section; a connected org's rows suppress it. + */ + function renderBitbucketNote() { + if (search.trim() || bridge === null) { + return null; + } + if (bridge.sections.some(section => section.key === 'bitbucket')) { + return null; + } + return ( + + + {t('agentChat.repoPicker.platformBitbucket')} + + {t('agentChat.newSession.bitbucketOrganizationsOnly')} + + ); + } } diff --git a/apps/mobile/src/components/agents/new-session-configure-form.tsx b/apps/mobile/src/components/agents/new-session-configure-form.tsx index 6ebae1b378..33d9762546 100644 --- a/apps/mobile/src/components/agents/new-session-configure-form.tsx +++ b/apps/mobile/src/components/agents/new-session-configure-form.tsx @@ -217,6 +217,7 @@ export function NewSessionConfigureForm({ contentContainerClassName="flex-grow px-4 pb-8 pt-4" keyboardShouldPersistTaps="handled" automaticallyAdjustKeyboardInsets + keyboardDismissMode="on-drag" > {t('agentChat.newSession.branchPickerTitle')} - branch} - renderItem={({ item }) => renderBranchRow(item, close)} - showsVerticalScrollIndicator={false} - /> + {/* ScrollView, not FlatList: a FlatList stretches to the space + its container offers, so two branch rows rendered as a mostly + empty sheet. A ScrollView hugs its rows and only scrolls once + the card's max height is reached. */} + + {branches.branches.map(branch => renderBranchRow(branch, close))} +