Skip to content

Refactor EventTile using the MVVM pattern - #5a#33587

Open
rbondesson wants to merge 4 commits into
element-hq:developfrom
ZacksBot:refactor/event-tile-replay
Open

Refactor EventTile using the MVVM pattern - #5a#33587
rbondesson wants to merge 4 commits into
element-hq:developfrom
ZacksBot:refactor/event-tile-replay

Conversation

@rbondesson
Copy link
Copy Markdown
Contributor

@rbondesson rbondesson commented May 22, 2026

Checklist

Refactor EventTile using the MVVM pattern

Partially implements: https://github.com/element-hq/wat-internal/issues/414

Summary - Step 5a

Extract feature-specific EventTile state into focused view-model helpers
(a follow up PR will contain extraction of E2E padlock state)

Changes

  • Extract receipt state
  • Extract thread state
  • Extract reaction relation state
  • Extract reply-chain state
  • Added focused view-model tests for each extracted state helper

Implementation plan

  1. Cover existing behavior with tests - Refactor EventTile using the MVVM pattern - #1 #33463
    Add/maintain focused tests around current EventTile behavior before moving logic.

  2. 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.

  3. 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.

  4. 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.

  5. Move feature-specific state
    Extract reaction relations, reply-chain state, thread-info state, and receipt state into separate view-model boundaries.

  6. Thin the React component
    Keep EventTile mostly as composition/wiring: render views, pass event handlers, and bridge Matrix/React context.

  7. Split view components
    Move stable UI fragments into smaller view components where it reduces EventTile complexity.

  8. Remove legacy duplication
    After behavior is covered by view models and views, clean up old inline helpers and dead conditional branches.

@rbondesson rbondesson self-assigned this May 22, 2026
@rbondesson rbondesson added the T-Task Tasks for the team like planning label May 22, 2026
@rbondesson rbondesson marked this pull request as ready for review May 22, 2026 07:17
@rbondesson rbondesson requested a review from a team as a code owner May 22, 2026 07:17
@rbondesson rbondesson requested review from dbkr and florianduros May 22, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Task Tasks for the team like planning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant