refactor: tidy RoomView components - #7641
Merged
diegolmello merged 2 commits intoSep 3, 2026
Merged
Conversation
Pass provider props explicitly instead of spreading, flatten MessageRow into early returns, route goSearchView through navigateToScreen so the ts-ignore can go, and read settings through useSetting. Hoist RoomPlaceholder's stylesheet to module scope, drop Banner's memo comparator that ignored title and closeBanner, and remove InvitedRoom's unused loading prop.
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (11)
WalkthroughRoomView updates settings access, navigation, provider prop forwarding, component rendering, placeholder styling, and definition comments. Invitation button loading props are removed. ChangesRoomView cleanup
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: 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. Comment |
…ative-34-components-simplify # Conflicts: # app/views/RoomView/components/RoomMessageProvider.tsx
diegolmello
requested a deployment
to
approve_e2e_testing
September 3, 2026 19:31 — with
GitHub Actions
Waiting
diegolmello
requested a deployment
to
ios_build
September 3, 2026 19:33 — with
GitHub Actions
Waiting
diegolmello
requested a deployment
to
android_build
September 3, 2026 19:33 — with
GitHub Actions
Waiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Cleanup pass over the RoomView components, on top of the RoomView hooks migration.
RoomProvidersandRoomMessageProviderspread{...props}into their providers. Every field is now passed explicitly, so what each provider actually supplies is readable at the call site.MessageRowbuilt its output into alet contentthrough an if/else chain and wrapped a render-time decision in a nestedrunOnRenderfunction. Now early returns and a plain boolean.RightButtonshad a@ts-ignoreongoSearchViewbecause it navigated directly instead of through the file's ownnavigateToScreenhelper. Routing it through the helper drops the suppression; the two branches keep their distinct params, and the modal branch now also passes thetit was required to.Threads_enabledandLivechat_request_comment_when_closing_conversationinRightButtons, plus the federation settings inuseRoomFooterStateanduseFooterMessage, read throughuseSettinginstead of a rawuseAppSelectorwith a cast. The federation settings are read unconditionally: a short-circuit between twouseSettingcalls makes the hook order depend on the first value, which breaks the rules of hooks and failsreactCompilerContract.test.ts.RoomPlaceholderranStyleSheet.createon every render. Hoisted to a module-level stylesheet with the four color values applied inline, matchingRoomFooter/styles.ts.Banner's hand-writtenmemocomparator ignoredtitleandcloseBanner, so it could hold a stale banner on screen. Replaced with a plainmemo.InvitedRoom'sloadingprop had no caller passing it.Issue(s)
https://rocketchat.atlassian.net/browse/NATIVE-34
How to test or reproduce
Open a room and exercise the header buttons (search, threads, kebab), the footer states (preview, on hold, take/join, airgapped), an invited room, and the room placeholder during load. Behavior should be unchanged.
Screenshots
Types of changes
Checklist
Further comments
Targets
native-34-roomview-hooks(#7482), not develop.Three
resolveJumpAnchorfromServertests fail on this branch. They also fail onnative-34-roomview-hooksunchanged, so they are pre-existing there and not caused by these changes.Considered and not done, since each needs edits outside these components:
placeOnHoldLivechatandcloseLivechatare duplicated statement for statement withRoomActionsView; extracting toapp/lib/methods/helperswould need that view changed too.JoinCodecallsjoinRoomfromrestApidirectly rather than the store service. Routing it through the service would skiplogEvent(ROOM_JOIN)andlog(e), which is a behavior change, not a cleanup.AirgappedWscould render throughPreview, but the title colors differ, so it would be a visual change.useRoomMessaginghandlers through context instead of prop threading, moving the join-code trigger intoRoomStorestate, extractinguseRightButtons, and convertingUploadProgressoff its class component.hooks/andstores/. The sharpest:last_messagesits inOBSERVED_COLUMNS, so the room observer wakes on every message in every room to compute a livechat-only value.Summary by CodeRabbit
Bug Fixes
Changes
Refactor