Skip to content
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
59890bd
test(RoomView): replace LoadMore snapshot with state assertions
diegolmello Sep 2, 2026
c6ccb38
fix(RoomView): cancel useThreadFollowing subscription on fast unmount
diegolmello Sep 2, 2026
730f2cd
perf(RoomView): stop observing last_message on the room record
diegolmello Sep 2, 2026
dcb5498
refactor(RoomView): drop redundant hideSystemMessages re-filter
diegolmello Sep 2, 2026
df647d1
refactor(RoomView): clone the observed messages only when appending t…
diegolmello Sep 2, 2026
734a304
refactor(RoomView): build the message query clauses once and drop Q.s…
diegolmello Sep 2, 2026
28e0fa2
refactor(RoomView): skip the readThread debounce timer outside threads
diegolmello Sep 2, 2026
5cc5121
refactor(RoomView): share the newer-loader lookup between the jump an…
diegolmello Sep 2, 2026
433d781
refactor(RoomView): drop the double casts to AnchorMessage
diegolmello Sep 2, 2026
2ac4ea8
perf(RoomView): update the scroll FAB state only on a threshold crossing
diegolmello Sep 2, 2026
98cea96
refactor(RoomView): type the animated message list instead of suppres…
diegolmello Sep 2, 2026
8232907
refactor(message): shrink the inert message-action store to the actio…
diegolmello Sep 2, 2026
2a73c3b
refactor(RoomView): flatten the jumpToMessage target checks
diegolmello Sep 2, 2026
d7104ad
refactor(RoomView): share one footer action button between TakeOrJoin…
diegolmello Sep 2, 2026
4877ce8
refactor(RoomView): type roomUpdate from the subscription model inste…
diegolmello Sep 2, 2026
ae1d144
test(RoomView): drop the tautological QUERY_SIZE assertion
diegolmello Sep 2, 2026
9f5f697
refactor(RoomView): drop the blank-label sentinel from LeftButtons
diegolmello Sep 2, 2026
0bd024f
test(RoomView): cover the visible system types clause
diegolmello Sep 2, 2026
279d150
perf(MessageComposer): read send-time values from the store instead o…
diegolmello Sep 2, 2026
de186c3
perf(RoomView): seed serverVersion into the room store at creation
diegolmello Sep 2, 2026
90f3569
perf(RoomView): skip the extra render when the acquired room store is…
diegolmello Sep 2, 2026
02bf2e6
refactor(RoomView): resolve thread names through fetchThreadName
diegolmello Sep 2, 2026
40ba0a2
refactor(RoomView): one thread-press wiring for the message tree
diegolmello Sep 2, 2026
a39a80f
refactor(RoomView): call useReactionActions once per room screen
diegolmello Sep 2, 2026
bf98ebe
refactor(RoomView): one sendRoomMessage wiring per room screen
diegolmello Sep 2, 2026
0fdc273
refactor(message): one MessageRoomProvider
diegolmello Sep 2, 2026
108ddbd
test(RoomView): cover pushThreadRoom and fetchThreadName
diegolmello Sep 2, 2026
8e4cc95
feat(RoomView): render a retryable screen when room init fails
diegolmello Sep 2, 2026
10824d6
fix(RoomView): cancel pending debounced calls on unmount
diegolmello Sep 2, 2026
eca7935
refactor(RoomView): share a RoomPlaceholder shell across blocking scr…
diegolmello Sep 2, 2026
1296233
refactor(RoomView): gate blocking screens before mounting the room tree
diegolmello Sep 2, 2026
485b44e
Merge remote-tracking branch 'origin/native-34-roomview-hooks' into n…
diegolmello Sep 2, 2026
c6e323c
docs(message): remove ARCHITECTURE.md
diegolmello Sep 2, 2026
c3d00b8
fix(RoomView): read the Workspace version when taking an inquiry
diegolmello Sep 2, 2026
8d0c9f0
fix(RoomView): harden Jump to Message navigation and cancellation
diegolmello Sep 2, 2026
4af9193
fix(message): call the latest MessageRoomProvider callbacks
diegolmello Sep 2, 2026
14896b0
fix(RoomView): drop stale init failure and unreachable invite transition
diegolmello Sep 2, 2026
6fcf34b
fix(RoomView): invalidate earlier jumps and keep store acquisition ou…
diegolmello Sep 3, 2026
008fc9f
Derive room store type from subscription
diegolmello Sep 3, 2026
e6fd8f1
fix(RoomView): cache routing config per server and derive on-hold fro…
diegolmello Sep 3, 2026
9c3422e
fix(RoomView): parse the route once into a valid screen identity or a…
diegolmello Sep 3, 2026
51e0780
refactor(RoomView): split RoomScreen into useRoomMessaging and focuse…
diegolmello Sep 3, 2026
e37943a
Merge branch 'native-34-roomview-hooks-3' of github.com:RocketChat/Ro…
diegolmello Sep 3, 2026
5c7a16c
fix(RoomView): cache routing config per server and derive on-hold fro…
diegolmello Sep 3, 2026
bda677f
Merge remote-tracking branch 'origin/native-34-roomview-hooks-3' into…
diegolmello Sep 3, 2026
bb8cd6e
fix(RoomView): stop the thread from opening after cancelling its load…
diegolmello Sep 3, 2026
76c8381
Merge remote-tracking branch 'origin/native-34-roomview-hooks-3' into…
diegolmello Sep 3, 2026
3cc695f
refactor(RoomView): pass RoomGate props explicitly and drop the route…
diegolmello Sep 3, 2026
6f41d1e
chore(RoomView): drop references to the removed ARCHITECTURE.md
diegolmello Sep 3, 2026
a0cf670
fix(RoomView): replace the store room when the subscription row is re…
diegolmello Sep 3, 2026
0be5ca0
fix(RoomView): clear livechat-only flags when the room type is not li…
diegolmello Sep 3, 2026
590cb88
fix(RoomView): reset the cached routing config on logout
diegolmello Sep 3, 2026
9b1c955
fix(RoomView): gate setParams thread jumps on loaded thread messages
diegolmello Sep 3, 2026
1b424b3
refactor(RoomView): reuse the livechat check and rename the non-livec…
diegolmello Sep 3, 2026
7472bb6
refactor(RoomView): name the recreated-row check in observeRoom
diegolmello Sep 3, 2026
f0703c3
fix(RoomView): key the thread jump gate to the loaded thread and tigh…
diegolmello Sep 3, 2026
8e4c088
fix(RoomView): reset the routing config cache on account deletion and…
diegolmello Sep 3, 2026
0b37bf9
test(RoomView): cover the thread jump gate across a thread switch
diegolmello Sep 3, 2026
90c0dac
refactor(logout): reset the routing config cache in removeServerData
diegolmello Sep 3, 2026
d58b291
test(logout): drop the duplicated routing config reset case
diegolmello Sep 3, 2026
40bf7a3
Merge remote-tracking branch 'origin/native-34-roomview-hooks-3' into…
diegolmello Sep 3, 2026
673c44d
Merge remote-tracking branch 'origin/native-34-roomview-hooks-3' into…
diegolmello Sep 3, 2026
c9a0d44
Merge remote-tracking branch 'origin/native-34-roomview-hooks-3' into…
diegolmello Sep 3, 2026
d0fe019
refactor(RoomView): pass useRoomMessaging results as explicit props
diegolmello Sep 3, 2026
48952b7
refactor(RoomView): useRoomMessaging has no JSX, use .ts
diegolmello Sep 3, 2026
8e29914
fix(RoomView): re-render the banner and message list on room updates
diegolmello Sep 3, 2026
d4e4a49
test(RoomView): replace adapter-dependent visible-row tests with pred…
diegolmello Sep 3, 2026
c2daedc
Merge remote-tracking branch 'origin/native-34-roomview-hooks-3' into…
diegolmello Sep 3, 2026
9aa6958
Merge remote-tracking branch 'origin/native-34-roomview-hooks-3' into…
diegolmello Sep 3, 2026
d8fb29c
Move routing config cache to omnichannel redux
diegolmello Sep 3, 2026
109cb3c
Merge remote-tracking branch 'origin/native-34-roomview-hooks-3' into…
diegolmello Sep 3, 2026
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
20 changes: 10 additions & 10 deletions app/containers/MessageComposer/MessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import Animated, { useAnimatedStyle, useSharedValue } from 'react-native-reanima
import {
useComposerRid,
useComposerSharing,
useComposerTmid,
useEditRequest,
useOnSendMessage,
useSetQuotesAndText
useComposerStoreApi,
useComposerTmid
} from '../../views/RoomView/stores/ComposerStore';
import { useEditingMessageId, useMessageActionKind, useQuotedMessageIds } from '../message/stores/MessageActionStore';
import { useMessageActionKind, useMessageActionStoreApi } from '../message/stores/MessageActionStore';
import { Autocomplete } from './components';
import { MIN_HEIGHT } from './constants';
import {
Expand Down Expand Up @@ -63,12 +61,9 @@ export const MessageComposer = ({
const rid = useComposerRid();
const tmid = useComposerTmid();
const sharing = useComposerSharing();
const editRequest = useEditRequest();
const onSendMessage = useOnSendMessage();
const setQuotesAndText = useSetQuotesAndText();
const composerStore = useComposerStoreApi();
const messageActionStore = useMessageActionStoreApi();
const actionKind = useMessageActionKind();
const editingMessageId = useEditingMessageId();
const quotedMessageIds = useQuotedMessageIds();
const alsoSendThreadToChannel = useAlsoSendThreadToChannel();
const { showEmojiKeyboard, showEmojiSearchbar, openEmojiSearchbar, resetKeyboard, keyboardHeight } = useEmojiKeyboard();
const { setAlsoSendThreadToChannel, setAutocompleteParams, clearAttachments } = useMessageComposerApi();
Expand Down Expand Up @@ -108,6 +103,11 @@ export const MessageComposer = ({
const handleSendMessage = async () => {
if (!rid) return;

const { editRequest, onSendMessage, setQuotesAndText } = composerStore.getState();
const { action } = messageActionStore.getState();
const editingMessageId = action?.kind === 'edit' ? action.messageId : undefined;
const quotedMessageIds = action?.kind === 'quote' ? action.messageIds : [];

if (alsoSendThreadToChannel) {
setAlsoSendThreadToChannel(false);
}
Expand Down
104 changes: 0 additions & 104 deletions app/containers/message/docs/ARCHITECTURE.md

This file was deleted.

32 changes: 12 additions & 20 deletions app/containers/message/stores/MessageActionStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,32 +53,21 @@ export type TMessageActionStore = ReturnType<typeof createMessageActionStore>;

export const MessageActionStoreContext = createContext<TMessageActionStore | null>(null);

const noOpAction = (): never => {
throw new Error('MessageActionStore: no provider — actions unavailable');
};

const NO_OP_ACTIONS: TMessageActionActions = {
startEditing: noOpAction,
startQuote: noOpAction,
addQuote: noOpAction,
removeQuote: noOpAction,
startReacting: noOpAction,
setQuoteMessageIds: noOpAction,
clear: noOpAction
};
// Rows rendered outside a RoomView (search, pinned) can never be in edit mode, and the only hook
// that falls back here reads `action`. Fixed at null (no `set` param).
const inertStore = createStore<Pick<MessageActionState, 'action'>>()(() => ({ action: null }));

// Rows rendered outside a RoomView (search, pinned) can never be in edit mode.
// `action` is fixed at null (no `set` param) and its actions always throw — a safe, inert fallback.
export const inertStore = createStore<MessageActionState>()(() => ({ action: null, actions: NO_OP_ACTIONS }));

const useMessageActionStore = <T,>(selector: (state: MessageActionState) => T): T => {
export const useMessageActionStoreApi = (): TMessageActionStore => {
const store = useContext(MessageActionStoreContext);
if (!store) {
throw new Error('Message action hooks must be used within a MessageActionProvider');
}
return useStore(store, selector);
return store;
};

const useMessageActionStore = <T,>(selector: (state: MessageActionState) => T): T =>
useStore(useMessageActionStoreApi(), selector);

// `action` is a single ref replaced wholesale on every `set` — no useShallow needed.
export const useMessageAction = (): TMessageActionState => useMessageActionStore(s => s.action);

Expand All @@ -91,7 +80,10 @@ export const useMessageActionKind = (): NonNullable<TMessageActionState>['kind']
*/
export const useIsBeingEdited = (messageId: string): boolean => {
const store = useContext(MessageActionStoreContext) ?? inertStore;
return useStore(store, s => s.action?.kind === 'edit' && s.action.messageId === messageId);
return useStore(
store,
(s: Pick<MessageActionState, 'action'>) => s.action?.kind === 'edit' && s.action.messageId === messageId
);
};

// Stable ref so the selector doesn't emit a fresh array when not quoting.
Expand Down
Loading
Loading