Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2024-04-13 - Missing React.memo for FlatList Items
**Learning:** The React Native FlatList components in this codebase frequently render unmemoized inline items (like `ContactRow`, `PasswordRow`, etc.), causing unnecessary re-renders of the entire list when individual state changes.
**Action:** Always wrap long list item components in `React.memo()` to prevent cascading re-renders and improve FlatList scrolling performance.

## 2026-04-26 - Missing FlatList Windowing Props
**Learning:** FlatList components in React Native were rendering without windowing props, which can lead to poor performance on long lists due to excessive memory usage and rendering overhead.
**Action:** Always add windowing props (`initialNumToRender`, `windowSize`, `maxToRenderPerBatch`, etc.) to `FlatList` components to optimize memory and rendering performance.
14 changes: 9 additions & 5 deletions src/screens/CalendarScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -663,11 +663,15 @@ export default function CalendarScreen() {
<Text style={[s.stepLabel, { color: colors.textSub }]}>
{t('calPickName')} ({parsedSchedule.employees.length} trovati)
</Text>
<FlatList
data={parsedSchedule.employees}
keyExtractor={(_, i) => String(i)}
style={{ maxHeight: 400 }}
nestedScrollEnabled
<FlatList
data={parsedSchedule.employees}
keyExtractor={(_, i) => String(i)}
style={{ maxHeight: 400 }}
nestedScrollEnabled
initialNumToRender={15}
windowSize={5}
maxToRenderPerBatch={10}
removeClippedSubviews={true}
renderItem={({ item }) => (
<TouchableOpacity
style={[s.nameRow, { borderColor: colors.border }]}
Expand Down
4 changes: 4 additions & 0 deletions src/screens/FlightScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,10 @@ export default function FlightScreen() {
data={currentData}
keyExtractor={(item, i) => item.flight?.identification?.id || String(i)}
renderItem={renderFlight}
initialNumToRender={10}
windowSize={5}
maxToRenderPerBatch={10}
removeClippedSubviews={true}
contentContainerStyle={{ padding: 16, paddingBottom: 96 }}
refreshControl={<RefreshControl refreshing={refreshing} onRefresh={() => { setRefreshing(true); fetchAll(); }} tintColor={colors.primary} />}
ListEmptyComponent={<Text style={{ textAlign: 'center', marginTop: 40, color: '#9CA3AF', fontSize: 15 }}>{t('flightNoFlights')}</Text>}
Expand Down
4 changes: 4 additions & 0 deletions src/screens/PasswordScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ export default function PasswordScreen() {
<FlatList
data={entries}
keyExtractor={item => item.id}
initialNumToRender={15}
windowSize={5}
maxToRenderPerBatch={10}
removeClippedSubviews={true}
renderItem={({ item }) => (
<PasswordRow
item={item}
Expand Down
Loading