refactor: migrate RoomView to a function component - #7482
Merged
Merged
Conversation
Resolve conflicts in MessagesView/SearchMessagesView: keep MessageRoomProvider wrapping while adopting develop's insets/paddingBottom on the FlatList.
The Timestamp story renders a fixed unix time with the relative (`R`) format, so its snapshot drifts with wall-clock time (`2 years ago` -> `a year ago`).
…tion verbs (NATIVE-22)
…e (NATIVE-22) Replace the writable module-level fallbackStore with a frozen inertStore whose actions throw on call, closing the latent cross-room write vector for no-provider consumers (search/pinned rows). Document useIsBeingEdited's graceful-degradation contract via JSDoc, and expand the test suite: no-provider isolation, useIsBeingEdited across all kinds, addQuote dedup guard, clear() from each kind. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lands the message-action-store map into native-22-message-hooks. Pure refactor of the interaction store — no intended behavior change. - Rename InteractionStore -> MessageActionStore, normalize action verbs - Collapse useMessageAction + useSelectedMessages into one useMessageAction() - Harden the no-provider fallback with an inert MessageActionStore Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…IVE-22) Relocates MessageActionStore from views/RoomView into containers/message/stores so reusable layers no longer import upward from a view, and moves the TMessageActionState discriminated union into app/definitions (where the derived TMessageAction already lives), inverting the definitions -> views arrow. RoomView/ShareView keep creating and providing the store.
…s (NATIVE-22) JitsiBranch rendered a bare <Content /> after the refactor, and useIsInfoMessage() explicitly excludes jitsi_call_started (it isn't a compact/non-touchable info row), so InfoContent never rendered the localized "started a call" line — only the join button remained. Give Content a local isInfo override so JitsiBranch alone can force InfoContent, matching the pre-refactor output (User + Started_call text + join button) without touching useIsInfoMessage or any other branch. Add a jitsi_call_started story to cover it going forward.
Ticket 004: confirmed the stuck-false transition bug at the unit level, but the only caller (useMediaAutoDownload) keys its message list by the same id, so a real messageId change always remounts the hook with a fresh seed. Ruled the behavior fix out of scope; kept the test as a documented contract.
…ranches (NATIVE-22)
blocks now types to @rocket.chat/ui-kit's LayoutBlock union (the type already rendered by UiKitMessage), and e2eMentions matches getE2EEMentions's real return shape. Closes the any hole at the useBlocks() hook boundary.
… hole (NATIVE-22)
…(type) (NATIVE-22)
Touch.tsx was the only PR-touched message-render-path leaf missing the directive under compilationMode 'annotation'. No react-hooks lint rule (use-memo, preserve-manual-memoization) actually detects a missing directive — they validate useMemo() usage and compiler-preservation of existing manual memoization, both already enforced via the extended plugin:react-hooks/recommended config at their default severities (0 violations). Enabling them explicitly would only duplicate or, if downgraded to 'warn' per convention, weaken already-clean 'error' defaults, so .eslintrc.js is left unchanged.
…ntity (#7670) * refactor: render the empty room background when RoomView mounts without a route identity * refactor: name the RoomBackground export and type its return * test(RoomView): drop assertions on a testID the suite can never render * refactor: keep rid and t required on the room screen props * refactor: declare tmid on the room screen props
10 tasks
This was referenced Sep 11, 2026
* test: prove RoomMessageActions sheet handle attachment * refactor: pass RoomMessageActions refs directly * test: reuse typed store factories in RoomMessageActions test
* test(RoomView): assert an exact-null render in RightButtons routing guards * test(RoomView): drop composed RightButtons cases duplicated by routing and leaf suites
|
Android Build Available Rocket.Chat 4.77.0.109608 Internal App Sharing: https://play.google.com/apps/test/RQQ8k09hlnQ/ahAO29uNTnr2G67t5Hzb1qq6U-nwuC98cduPQK2LkPP1GV3TzvREV6VjhaHI_5SGlKPuV976AvpwCGm3eJIZfVGFkA |
|
iOS Build Available Rocket.Chat 4.77.0.109609 |
diegolmello
commented
Sep 11, 2026
#7678) * chore: drop unused reassure devDependency * test(MessageComposer): rename media transfer ownership suite after its component * test(RoomView): move observableDatabase helper out of __tests__
… openThread/openRoom services (#7679) Rename the hook to useJumpToMessage to match the CONTEXT.md Positional State row. Move Thread and Room opening into plain async services with explicit deps. Isolate route-param consumption in a non-exported helper hook so the generation counter has a single owner. Behavior and public surface unchanged; the three existing suites pass with only import renames. NATIVE-1550
… compiler contract test (#7680) * refactor(MessageActions): read the room at action time instead of during render * test(RoomView): remove the React Compiler contract test
…itial jump params (#7682) * refactor(RoomView): split useRoomNavigation into useJumpToMessage and openThread/openRoom services Rename the hook to useJumpToMessage to match the CONTEXT.md Positional State row. Move Thread and Room opening into plain async services with explicit deps. Isolate route-param consumption in a non-exported helper hook so the generation counter has a single owner. Behavior and public surface unchanged; the three existing suites pass with only import renames. NATIVE-1550 * refactor(RoomView): consume initial jump route params in a mount effect instead of InteractionManager
Preserve the RoomView function-component migration while applying develop's application import aliases, including branch-added files and moved components.
|
Android Build Available Rocket.Chat 4.77.0.109614 Internal App Sharing: https://play.google.com/apps/test/RQQ8k09hlnQ/ahAO29uNTIX3RknPBb6ezKZVW1lGelcdXoVQkqLMoFiTA4u_eZ5T_Pqf3jfCDkAct-YQFOCA2_X5eLPMSB_ICDCQct |
|
iOS Build Available Rocket.Chat 4.77.0.109615 |
OtavioStasiak
approved these changes
Sep 14, 2026
OtavioStasiak
left a comment
Contributor
There was a problem hiding this comment.
Just add new i18n label and you can merge!
| "room_changed_topic_to": "changed room topic to: {{topic}}", | ||
| "room_changed_type": "changed room to {{type}}", | ||
| "room_disallowed_reactions": "disallowed reactions", | ||
| "Room_failed_to_load": "This room could not be loaded. Check your connection and try again.", |
Contributor
There was a problem hiding this comment.
Missing other languages.
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
Converted RoomView from a large class component to a function component, splitting its logic into smaller hooks, stores, and components. Added tests around room state, navigation, and message actions to help preserve existing behavior.
Issue(s)
https://rocketchat.atlassian.net/browse/NATIVE-34
How to test or reproduce
Use a room end to end (send/edit/quote/react, drafts, autocomplete, threads, jump-to-message, join a not-subscribed room, header actions) on phone and tablet, plus an omnichannel/livechat room. Behavior should match the base branch.
Screenshots
No visual changes intended.
Types of changes
Checklist
Further comments
None.