Refactor EventTile using the MVVM pattern - #7b#33668
Open
rbondesson wants to merge 11 commits into
Open
Conversation
dbkr
reviewed
May 29, 2026
Member
dbkr
left a comment
There was a problem hiding this comment.
other than doc on the adapters, looking good!
| getRelationsForEvent?: GetRelationsForEvent; | ||
| } | ||
|
|
||
| export function ActionBarAdapter({ |
| customReactionImagesEnabled?: boolean; | ||
| } | ||
|
|
||
| function ReactionsRowButtonAdapter(props: Readonly<ReactionsRowButtonAdapterProps>): JSX.Element { |
Member
There was a problem hiding this comment.
quick bit of doc on here would be appreciated too
| reactions?: Relations | null; | ||
| } | ||
|
|
||
| export function ReactionsRowAdapter({ |
| isTwelveHour?: boolean; | ||
| } | ||
|
|
||
| export function ReceiptAdapter({ |
| senderSnapshot: EventTileSenderSnapshot; | ||
| } | ||
|
|
||
| export function EventTileAvatarAdapter({ |
| showDisplayName?: boolean; | ||
| } | ||
|
|
||
| export function ThreadMessagePreviewAdapter({ |
| thread: Thread; | ||
| } | ||
|
|
||
| export function ThreadSummaryAdapter({ |
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.
Checklist
public/exportedsymbols have accurate TSDoc documentation.Refactor EventTile using the MVVM pattern
Partially implements: https://github.com/element-hq/wat-internal/issues/414
Summary - Step 7b
This PR continues thinning
EventTileby moving stable leaf UI and stateful UI surfaces into focused adapters.EventTilekeeps layout/composition ownership, while adapters handle local React/context wiring and VM-backed view rendering where needed.Changes
EventTileleaf adapters:MessageTimestampAdapter,ThreadMessagePreviewAdapter,ThreadSummaryAdapter,ThreadListActionBarAdapter,E2eMessageSharedIconAdapter,ActionBarAdapter,ReactionsRowAdapter,ReceiptAdapter,SenderIdentityAdapterEventTileViewModel forEventTile-scoped VMs: thread preview, thread summary, E2E message-shared icon, action bar, reactions rowEventTile.EventTile.EventTile, including sent/sending receipt vs read receipt selection.EventTilewhile keeping layout placement inEventTile.Implementation plan
Cover existing behavior with tests - Refactor EventTile using the MVVM pattern - #1 #33463
Add/maintain focused tests around current
EventTilebehavior before moving logic.Extract pure decision helpers - Refactor EventTile using the MVVM pattern - #2 #33489
Move low-risk derived state calculations out of
EventTile, without changing rendering ownership yet.Introduce small view models - Refactor EventTile using the MVVM pattern - #3 #33516
Start with isolated surfaces such as timestamp visibility, root attributes/classes, message type classes, and sender/avatar decisions.
Move interaction state - Refactor EventTile using the MVVM pattern - #4 #33539
Extract hover/focus/action-bar/context-menu state once the pure rendering decisions are stable.
Move feature-specific state - Refactor EventTile using the MVVM pattern - #5a #33587, Refactor EventTile using the MVVM pattern - #5b #33600
a. Extract reaction relations, reply-chain state, thread-info state, and receipt state into separate view-model boundaries.
b. Extract E2E padlock into separate view-model boundaries
Thin the React component - Refactor EventTile using the MVVM pattern - #6 #33621
Keep
EventTilemostly as composition/wiring: render views, pass event handlers, and bridge Matrix/React context.Split view components - Refactor EventTile using the MVVM pattern - #7a #33640
Move stable UI fragments into smaller view components where it reduces
EventTilecomplexity.Remove legacy duplication
After behavior is covered by view models and views, clean up old inline helpers and dead conditional branches.