Move EventTile to shared components - #4a (#34469)

* Add EventTile root properties to view model

* Move render-related event reads into the vm

* Remove duplicate root derivation in UnwrappedEventTile

* Move data-has-reply derivation into EventTileViewModel

* Move getEventDisplayInfo() and dependencies into EventTileViewModel

* Add tests for improved coverage

* Cleanup and comments

* Fix: Replacement events have a fallback tile but must not show their own reply chain

* Combine dependency and prop updates into one atomic VM update

* Remove property which was never read and fix oxfmt issue
This commit is contained in:
rbondesson
2026-07-30 13:35:09 +00:00
committed by GitHub
parent 242d2c5209
commit d4d4794f7e
4 changed files with 445 additions and 136 deletions
@@ -292,6 +292,15 @@ describe("EventTile", () => {
expect(getTile(container)).toContainElement(getLine(container));
});
it("preserves the existing root and line markup", () => {
const { container } = getComponent();
const tile = getTile(container);
expect(tile.tagName).toBe("LI");
expect(tile).toContainElement(getLine(container));
expect(getLine(container)).toHaveClass("mx_EventTile_line");
});
it("does not expose a scroll token for local echo events", () => {
const localEcho = makeOwnMessage();
localEcho.setStatus(EventStatus.SENDING);