diff --git a/mobile/src/app/(app)/(tabs)/(balances)/balances.tsx b/mobile/src/app/(app)/(tabs)/(balances)/balances.tsx
index e690b50..50ccd70 100644
--- a/mobile/src/app/(app)/(tabs)/(balances)/balances.tsx
+++ b/mobile/src/app/(app)/(tabs)/(balances)/balances.tsx
@@ -1,11 +1,12 @@
-import { router } from 'expo-router';
+import { Stack, router } from 'expo-router';
import React, { useCallback, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { FlatList, RefreshControl, Share, StyleSheet } from 'react-native';
+import { FlatList, Platform, RefreshControl, Share, StyleSheet } from 'react-native';
import { AddExpenseAction } from '@/components/expense';
import { BalanceTotals } from '@/components/friend/BalanceTotals';
import { FriendBalanceRow } from '@/components/friend/FriendBalanceRow';
+import { NativeBalances } from '@/components/friend/NativeBalances';
import { EmptyState, FullScreenSpinner, Separator, icons, rowInset } from '@/components/ui';
import { api } from '@/lib/api';
import { API_URL } from '@/lib/config';
@@ -16,6 +17,7 @@ const Balances = () => {
const { t } = useTranslation();
const balanceQuery = api.user.getBalances.useQuery();
const [refreshing, setRefreshing] = useState(false);
+ const [search, setSearch] = useState('');
const onRefresh = useCallback(() => {
setRefreshing(true);
@@ -98,10 +100,41 @@ const Balances = () => {
return (
// No wrapping view: the list must be the screen's first view for the large title to collapse.
<>
- {body}
-
+ {'ios' === Platform.OS ? (
+ {
+ await balanceQuery.refetch();
+ }}
+ />
+ ) : (
+ body
+ )}
+ {'ios' === Platform.OS ? (
+ <>
+ setSearch(event.nativeEvent.text)}
+ onCancelButtonPress={() => setSearch('')}
+ hideWhenScrolling={false}
+ />
+
+
+ {t('balances.share_app')}
+
+ router.push('/add')}>
+ {t('balances.add_expense')}
+
+
+ >
+ ) : (
+
+ )}
>
);
};
diff --git a/mobile/src/components/friend/NativeBalances.ios.tsx b/mobile/src/components/friend/NativeBalances.ios.tsx
new file mode 100644
index 0000000..ddd4f03
--- /dev/null
+++ b/mobile/src/components/friend/NativeBalances.ios.tsx
@@ -0,0 +1,312 @@
+import {
+ Button,
+ ContentUnavailableView,
+ ContextMenu,
+ HStack,
+ Host,
+ Image,
+ List,
+ ProgressView,
+ RNHostView,
+ Section,
+ Spacer,
+ Text,
+ VStack,
+} from '@expo/ui/swift-ui';
+import {
+ accessibilityElement,
+ accessibilityHint,
+ accessibilityLabel,
+ buttonStyle,
+ contentShape,
+ font,
+ foregroundStyle,
+ frame,
+ listRowBackground,
+ listRowSeparator,
+ listStyle,
+ padding,
+ refreshable,
+ shapes,
+} from '@expo/ui/swift-ui/modifiers';
+import { router } from 'expo-router';
+import React, { useCallback, useMemo } from 'react';
+import { useTranslation } from 'react-i18next';
+import { Platform, useWindowDimensions } from 'react-native';
+
+import { Avatar } from '@/components/ui';
+import { type RouterOutputs } from '@/lib/api';
+import { haptics } from '@/lib/haptics';
+import { formatMoney } from '@/lib/money';
+import { colors } from '@/theme/tokens';
+
+import { filterBalances } from './balanceSearch';
+
+type Balances = RouterOutputs['user']['getBalances'];
+type Balance = Balances['balances'][number];
+
+const balanceKey = (row: Balance) => String(row.friendId);
+
+// The app still supports iOS 16.4; Expo's ContentUnavailableView is empty before iOS 17.
+const Unavailable = (props: React.ComponentProps) =>
+ 17 <= Number.parseInt(String(Platform.Version), 10) ? (
+
+ ) : (
+
+
+ {props.title}
+
+ {props.description}
+
+
+ );
+
+const BalanceRow = React.memo(({ row, fontScale }: { row: Balance; fontScale: number }) => {
+ const { t } = useTranslation();
+ const params = { friendId: String(row.friendId) };
+ const add = () => {
+ haptics.light();
+ router.push({ pathname: '/add', params });
+ };
+ const settle = () => {
+ haptics.light();
+ router.push({ pathname: '/settle-up', params });
+ };
+ const open = () => router.push({ pathname: '/balances/[friendId]', params });
+ const name = row.friend.name ?? row.friend.email ?? '';
+ const direction = t(
+ 0 === row.amount
+ ? 'balances.settled_up'
+ : 0 < row.amount
+ ? 'balances.you_get_short'
+ : 'balances.you_owe_short',
+ );
+ const amount = formatMoney(row.amount, row.currency);
+ const tone =
+ 0 === row.amount ? colors.secondaryLabel : 0 < row.amount ? colors.positive : colors.negative;
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ {name}
+
+ {direction}
+
+
+ {amount}
+
+ {row.hasMore ? {t('balances.more_currencies')} : null}
+
+
+
+ );
+});
+
+BalanceRow.displayName = 'BalanceRow';
+
+/** Genuine SwiftUI rows: system insets, separators, highlighting and long-press menus. */
+export const NativeBalances = ({
+ data,
+ search,
+ loading,
+ error,
+ onRefresh,
+}: {
+ data?: Balances;
+ search: string;
+ loading: boolean;
+ error?: string;
+ onRefresh: () => Promise;
+}) => {
+ const { t } = useTranslation();
+ const { fontScale } = useWindowDimensions();
+ const query = search.trim().toLocaleLowerCase();
+ const rows = useMemo(() => filterBalances(data?.balances ?? [], query), [data?.balances, query]);
+ const renderRow = useCallback(
+ ({ item }: { item: Balance }) => ,
+ [fontScale],
+ );
+
+ return (
+
+
+ {data && !query && (data.youOwe.length || data.youGet.length) ? (
+
+
+ {[
+ { title: t('balances.you_owe'), totals: data.youOwe, color: colors.negative },
+ { title: t('balances.you_get'), totals: data.youGet, color: colors.positive },
+ ]
+ .filter(({ totals }) => totals.length)
+ .map(({ title, totals, color }) => (
+
+
+ {title}
+
+ {[...totals]
+ .sort((a, b) => a.currency.localeCompare(b.currency))
+ .map((total) => (
+
+ {formatMoney(total.amount, total.currency)}
+
+ ))}
+
+ ))}
+
+
+ ) : null}
+
+
+ {renderRow}
+
+ {!rows.length ? (
+
+ {loading ? (
+
+ ) : (
+ <>
+
+ {error ? (
+
+ ) : null}
+
+
+
+ );
+};
diff --git a/mobile/src/components/friend/NativeBalances.tsx b/mobile/src/components/friend/NativeBalances.tsx
new file mode 100644
index 0000000..bb20971
--- /dev/null
+++ b/mobile/src/components/friend/NativeBalances.tsx
@@ -0,0 +1,8 @@
+/** iOS uses the platform-specific SwiftUI implementation; other platforms keep FlatList. */
+export const NativeBalances = (_props: {
+ data?: import('@/lib/api').RouterOutputs['user']['getBalances'];
+ search: string;
+ loading: boolean;
+ error?: string;
+ onRefresh: () => Promise;
+}) => null;
diff --git a/mobile/src/components/friend/balanceSearch.test.ts b/mobile/src/components/friend/balanceSearch.test.ts
new file mode 100644
index 0000000..ed031d4
--- /dev/null
+++ b/mobile/src/components/friend/balanceSearch.test.ts
@@ -0,0 +1,30 @@
+import assert from 'node:assert/strict';
+import { describe, it } from 'node:test';
+
+import { filterBalances } from './balanceSearch';
+
+// Only the name and email are read; keep the fixture independent of server profile fields.
+const balances = [
+ { friend: { name: 'Alice', email: 'alice@example.com' } },
+ { friend: { name: null, email: 'bob@example.com' } },
+ { friend: { name: null, email: null } },
+] as Parameters[0];
+
+describe('filterBalances', () => {
+ it('should match names without case or surrounding whitespace', () => {
+ assert.deepEqual(filterBalances(balances, ' ALICE '), [balances[0]]);
+ });
+
+ it('should search email when the name is missing', () => {
+ assert.deepEqual(filterBalances(balances, 'BOB@'), [balances[1]]);
+ });
+
+ it('should preserve all balances and their order when search is cleared', () => {
+ assert.deepEqual(filterBalances(balances, ' '), balances);
+ });
+
+ it('should return no results safely with missing profile fields', () => {
+ assert.deepEqual(filterBalances(balances, 'nobody'), []);
+ assert.deepEqual(filterBalances([], 'alice'), []);
+ });
+});
diff --git a/mobile/src/components/friend/balanceSearch.ts b/mobile/src/components/friend/balanceSearch.ts
new file mode 100644
index 0000000..a950123
--- /dev/null
+++ b/mobile/src/components/friend/balanceSearch.ts
@@ -0,0 +1,10 @@
+import { type RouterOutputs } from '@/lib/api';
+
+type Balance = RouterOutputs['user']['getBalances']['balances'][number];
+
+export const filterBalances = (balances: Balance[], search: string) => {
+ const query = search.trim().toLocaleLowerCase();
+ return balances.filter((row) =>
+ `${row.friend.name ?? ''} ${row.friend.email ?? ''}`.toLocaleLowerCase().includes(query),
+ );
+};
diff --git a/mobile/src/i18n/locales/en.json b/mobile/src/i18n/locales/en.json
index 6d7008e..39f2fdf 100644
--- a/mobile/src/i18n/locales/en.json
+++ b/mobile/src/i18n/locales/en.json
@@ -120,6 +120,10 @@
"delete_done": "Your account was deleted"
},
"balances": {
+ "search_friends": "Search friends",
+ "no_results": "No friends found",
+ "view_balance": "View balance",
+ "open_friend_hint": "Opens balances and expenses with this friend",
"you_owe": "You owe",
"you_get": "You get",
"you_lent": "You lent",