Skip to content

feat(rooms-list): render rooms list with Legend List - #7739

Open
diegolmello wants to merge 2 commits into
developfrom
diegolmello/rooms-list-legend-list
Open

diegolmello wants to merge 2 commits into
developfrom
diegolmello/rooms-list-legend-list

Conversation

@diegolmello

@diegolmello diegolmello commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Proposed changes

Renders the rooms list with Legend List (@legendapp/list 3.4.0) instead of FlatList.

  • Row heights come from getFixedItemSize (regular or condensed height, depending on the display mode). Section separators are measured.
  • getItemType tells separators and rooms apart.
  • Removed the tuning props Legend List doesn't need: initialNumToRender, windowSize, onEndReachedThreshold, getItemLayout.
  • Recycling stays off so a row's swipe state can't carry over to another room.

Profiled on an iOS simulator (dev build) with the same scroll each run: 3 flings down, 2 up.

Run Commits ≥16ms Time in those commits
FlatList run 1 25 653ms
FlatList run 2 22 560ms
Legend List run 1 12 286ms
Legend List run 2 8 197ms

Average and slowest commit durations didn't change.

Issue(s)

No ticket.

How to test or reproduce

  1. Open the rooms list with enough rooms to scroll.
  2. Fling down and back up several times.
  3. Pull to refresh.
  4. Swipe a room row to show its actions, then swipe another row.
  5. Open a room, then go back.
  6. Search for a room.
  7. Switch the display mode to condensed and scroll again.

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Checked on an iOS simulator: scrolling, the header row, pull to refresh, swipe actions, opening a room and going back, and search. Not tested on Android yet.

Summary by CodeRabbit

  • Improvements
    • Room rows use responsive sizing based on the selected display mode.
    • Separators are handled separately from room rows, and the loading indicator appears at the end of the list.
    • The room list has updated rendering behavior while preserving its visible content, refresh controls, and loading feedback as you browse.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: e17415cd-9fe1-4cad-8727-fc8e8c19523d

📥 Commits

Reviewing files that changed from the base of the PR and between a0d6c8c and 04846fa.

📒 Files selected for processing (1)
  • app/views/RoomsListView/index.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: ESLint and Test / run-eslint-and-test
  • GitHub Check: E2E Shard Preflight
🔇 Additional comments (1)
app/views/RoomsListView/index.tsx (1)

127-128: LGTM!

Also applies to: 131-142


Walkthrough

The rooms list replaces React Native’s FlatList with LegendList. A new hook provides fixed sizing for room items and returns no size for separators. The change adds @legendapp/list and removes several FlatList settings.

Changes

Rooms list migration

Layer / File(s) Summary
LegendList integration and item sizing
package.json, app/views/RoomsListView/hooks/useGetFixedItemSize.ts, app/views/RoomsListView/index.tsx
Adds @legendapp/list and replaces FlatList with LegendList. The sizing hook returns the responsive row height for room items and undefined for separators. The list passes its loading footer as an element and removes the previous layout, initial-render, windowing, and end-reached settings.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested labels: type: chore

Suggested reviewers: otaviostasiak

Merge Risk: ⚪ Minimal · up to 04846

The rooms list now uses LegendList with sizing that matches its rendered rows, while preference changes still refresh items. No material user-facing regression was established; the change is ready for normal merge checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 04846

The migration preserves existing room selection, navigation, and access-related checks. No introduced security flaw is demonstrated, but isolation of each room’s interaction state depends on library recycling behavior that has not been verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The new rendering dependency consumes room records and display or identity state inside the mobile application. Row interactions continue to reach existing navigation, favorite, read-state, and hide-room operations. This establishes the integration’s exposure, not the library’s complete internal capabilities.

Trust Boundaries and Controls

  • inferred — The inspected migration does not demonstrate a new room-data producer, navigation authority, or action-control bypass. Existing RoomItem action gating and the unchanged press callback are the strongest counterevidence to expanded attacker-controlled reachability.

Resilience and Maintainability Implications

  • inferred — Room identity isolation depends on the replacement list’s instance lifecycle. Swipe values belong to each Touchable instance, and RoomItem observes its initial item with cleanup on unmount. Stable keys and action resets support isolation, but without verified recycling semantics they do not prove that a mounted instance cannot be reassigned to another room. No actual state transfer or wrong-room action was demonstrated.

Hardening Proposals

  • proposed — After confirming the pinned library API, express the required non-recycling behavior explicitly at the integration boundary so room-state isolation does not depend on an implicit default.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: replacing the rooms list implementation with Legend List.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

iOS Build Available

Rocket.Chat 4.77.0.109801

@github-actions

Copy link
Copy Markdown

@diegolmello
diegolmello force-pushed the diegolmello/rooms-list-legend-list branch from 3c59091 to a0d6c8c Compare September 30, 2026 18:52
@diegolmello
diegolmello changed the base branch from diegolmello/native-1561-rn-upgrade-13 to develop September 30, 2026 18:52
@diegolmello
diegolmello deployed to approve_e2e_testing September 30, 2026 18:54 — with GitHub Actions Active
@diegolmello
diegolmello deployed to android_build September 30, 2026 18:57 — with GitHub Actions Active
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

iOS Build Available

Rocket.Chat 4.78.0.109846

@diegolmello
diegolmello deployed to approve_e2e_testing October 1, 2026 09:31 — with GitHub Actions Active
@diegolmello
diegolmello deployed to android_build October 1, 2026 09:34 — with GitHub Actions Active
@diegolmello

Copy link
Copy Markdown
Member Author

Verified 04846fa on an iOS 27 simulator (iPhone 18 Pro), logged in to a test workspace.

  1. Rooms list in Expanded with avatars: each row shows its avatar and last message (0:00).
  2. Display preferences → Condensed, back to the list: last-message previews are gone and rows are shorter right away (0:35).
  3. Display preferences → Avatars off, back to the list: avatars are gone right away (1:02).
  4. Display preferences → Expanded, Avatars on, back to the list: avatars and last messages are back (1:22).
  5. Tap legend-list-roomview: legend-list-roomview opens (1:28).
  6. Back, tap rn-header-perf: rn-header-perf opens (1:39), back returns to the list (1:47).

Outcome: pass. Rows re-render on every display preference change, and room taps open the tapped room.

04846fa-small.mp4

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

iOS Build Available

Rocket.Chat 4.78.0.109853

This branch is waiting to be deployed

3 active and 1 waiting deployments
upload_android — 04846faa Waiting Oct 1, 2026 by diegolmello via Build Android / Upload Hold #6912
ios_build — 04846faa Deployed Oct 1, 2026 by diegolmello via Build iOS / Hold #6912
android_build — 04846faa Deployed Oct 1, 2026 by diegolmello via Build Android / Hold #6912
approve_e2e_testing — 04846faa Deployed Oct 1, 2026 by diegolmello via E2E Hold #6912
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant