Skip to content

perf: virtualize bookmark & syllabus lists (#219)#558

Open
eleven-smg wants to merge 1 commit into
rinafcode:mainfrom
eleven-smg:feat/flatlist-virtualization
Open

perf: virtualize bookmark & syllabus lists (#219)#558
eleven-smg wants to merge 1 commit into
rinafcode:mainfrom
eleven-smg:feat/flatlist-virtualization

Conversation

@eleven-smg

Copy link
Copy Markdown

What this does

Closes #219.

Converts the remaining long lists from ScrollView to virtualized lists so they stay smooth with 1000+ items:

  • BookmarkList now uses the shared VirtualList (the tuned FlatList wrapper) instead of mapping every bookmark inside a ScrollView. Bookmark rows are a fixed height, so I pass itemHeight to enable getItemLayout for O(1) scroll-to-index.
  • MobileSyllabus now renders a SectionList instead of nested .map()s inside a ScrollView. Collapsed sections pass an empty data array so their lesson rows unmount while the section header stays visible. Lesson rows have variable height (wrapping titles + Resume/Bookmarked badges), so getItemLayout is intentionally left off here.
  • MobileSearch already used a FlatList, so it didn't need changes.

The windowing settings (windowSize, maxToRenderPerBatch in the 10-15 range, updateCellsBatchingPeriod, removeClippedSubviews) are documented in code comments in both files.

Tests

Added src/components/mobile/__tests__/list-virtualization.perf.test.tsx, following the same style as the existing carousel.test.tsx: under Jest the RN list components are host stubs, so the tests assert each list is virtualized and configured correctly rather than counting rendered rows.

Notes

  • A clean npm install was failing because jest-expo was pinned to ~54.0.19, which was never published (latest 54.x is 54.0.16). I bumped it to ~54.0.16 so the project installs again.
  • Separately, the existing test suite doesn't run on a fresh install due to a Jest version mismatch (root jest@30 vs the environment jest-expo@54 pulls in) - carousel.test.tsx fails the same way before my changes. Looks like a pre-existing toolchain issue; happy to open a separate issue or help fix it if useful.

Convert BookmarkList to the shared VirtualList and MobileSyllabus to a SectionList so course/quiz lists stay smooth with 1000+ items. Add virtualization tests and document the tuning in code comments. Also bump jest-expo to a version that actually exists (54.0.16) so installs work.
@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@eleven-smg Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Kindly resolve conflict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement FlatList virtualization for course/quiz lists (1000+ items)

2 participants