Refactor EventTile using the MVVM pattern - #5a#33587
Open
rbondesson wants to merge 4 commits into
Open
Conversation
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 5a
Extract feature-specific
EventTilestate into focused view-model helpers(a follow up PR will contain extraction of E2E padlock state)
Changes
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
Extract reaction relations, reply-chain state, thread-info state, and receipt state into separate view-model boundaries.
Thin the React component
Keep
EventTilemostly as composition/wiring: render views, pass event handlers, and bridge Matrix/React context.Split view components
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.