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
3 changes: 3 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 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-15 - React Native FlatList Optimization
**Learning:** Missing windowing props in React Native FlatList causes unnecessary memory consumption and degrades scrolling performance on long lists.
**Action:** Always include initialNumToRender, windowSize, maxToRenderPerBatch, and removeClippedSubviews when implementing FlatList for long lists.
7 changes: 6 additions & 1 deletion src/screens/CalendarScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,12 @@ export default function CalendarScreen() {
<Text style={[s.stepLabel, { color: colors.textSub }]}>
{t('calPickName')} ({parsedSchedule.employees.length} trovati)
</Text>
<FlatList
<FlatList
// Performance optimization: add windowing props to FlatList
initialNumToRender={10}
maxToRenderPerBatch={10}
windowSize={5}
removeClippedSubviews={Platform.OS === 'android'}
data={parsedSchedule.employees}
keyExtractor={(_, i) => String(i)}
style={{ maxHeight: 400 }}
Expand Down
5 changes: 5 additions & 0 deletions src/screens/FlightScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,11 @@ export default function FlightScreen({ openNotifSettingsSignal = 0 }: FlightScre
</View>
) : (
<FlatList
// Performance optimization: add windowing props to FlatList
initialNumToRender={10}
maxToRenderPerBatch={10}
windowSize={5}
removeClippedSubviews={Platform.OS === 'android'}
data={currentData}
keyExtractor={(item, i) => item.flight?.identification?.id || String(i)}
renderItem={renderFlight}
Expand Down
5 changes: 5 additions & 0 deletions src/screens/PasswordScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ export default function PasswordScreen() {

{/* List */}
<FlatList
// Performance optimization: add windowing props to FlatList
initialNumToRender={15}
maxToRenderPerBatch={15}
windowSize={5}
removeClippedSubviews={true}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid enabling clipped subviews on iOS password list

Setting removeClippedSubviews to true unconditionally here introduces a rendering regression risk on iOS, where FlatList can intermittently hide or drop row content when cells are recycled during scroll (especially with styled card rows like these). In this commit the other lists were guarded to Android only, but this one is forced on all platforms, so iOS users can experience disappearing password rows while scrolling.

Useful? React with πŸ‘Β / πŸ‘Ž.

data={entries}
keyExtractor={item => item.id}
renderItem={({ item }) => (
Expand Down
Loading