Skip to content

New room list: avoid extra render for room list item#29752

Merged
florianduros merged 16 commits into
developfrom
florianduros/new-room-list/avoid-extra-render
Apr 16, 2025
Merged

New room list: avoid extra render for room list item#29752
florianduros merged 16 commits into
developfrom
florianduros/new-room-list/avoid-extra-render

Conversation

@florianduros
Copy link
Copy Markdown
Member

@florianduros florianduros commented Apr 15, 2025

Task https://github.com/element-hq/wat-internal/issues/204
In order to avoid to rerender all the room list item when a room item is selected or if there is a notification, we can add a memo.

We need to listen to the room name and the notification changes to render the correct value.

Comment thread src/components/viewmodels/roomlist/RoomListItemViewModel.tsx Outdated
@florianduros
Copy link
Copy Markdown
Member Author

I followed your suggestion and indeed it's cleaner!
I also took the opportunity to add some extra tests.

Comment thread src/components/viewmodels/roomlist/RoomListItemViewModel.tsx Outdated
@florianduros florianduros enabled auto-merge April 16, 2025 17:40
@florianduros florianduros added this pull request to the merge queue Apr 16, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 16, 2025
@florianduros florianduros added this pull request to the merge queue Apr 16, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 16, 2025
@florianduros florianduros added this pull request to the merge queue Apr 16, 2025
Merged via the queue into develop with commit fd45517 Apr 16, 2025
32 checks passed
@florianduros florianduros deleted the florianduros/new-room-list/avoid-extra-render branch April 16, 2025 21:54
acheong08 pushed a commit to acheong08/element-web that referenced this pull request Apr 30, 2025
* fix: avoid extra render in the new room list

* fix: listen to room name changes

* fix: trigger render when notification state change

* test: fix room list item tests

* chore: fix typo `RoomNotificationState.isUnsentMessage`

* refactor: move `isNotificationDecorationVisible` into `useRoomListItemViewModel`

* refactor: recalculate notification values on notification state changes

* refactor: rename `isNotificationDecorationVisible` to `showNotificationDecoration`

* test: add test for room list item view

* test: add notification tests in room list item vm

* fix: listen to notification updates in `NotificationDecoration`

* test: update notification decoration tests

* refactor: display notification decoration according to vm

* test: update room list item view tests

* fix: a11y label computation after room name change

* refactor: improve notification handling
snowping pushed a commit to Novaloop-AG/element-web that referenced this pull request Jun 22, 2025
* fix: avoid extra render in the new room list

* fix: listen to room name changes

* fix: trigger render when notification state change

* test: fix room list item tests

* chore: fix typo `RoomNotificationState.isUnsentMessage`

* refactor: move `isNotificationDecorationVisible` into `useRoomListItemViewModel`

* refactor: recalculate notification values on notification state changes

* refactor: rename `isNotificationDecorationVisible` to `showNotificationDecoration`

* test: add test for room list item view

* test: add notification tests in room list item vm

* fix: listen to notification updates in `NotificationDecoration`

* test: update notification decoration tests

* refactor: display notification decoration according to vm

* test: update room list item view tests

* fix: a11y label computation after room name change

* refactor: improve notification handling
Dileep9999 pushed a commit to hemanth-nag/element-web that referenced this pull request Oct 8, 2025
* fix: avoid extra render in the new room list

* fix: listen to room name changes

* fix: trigger render when notification state change

* test: fix room list item tests

* chore: fix typo `RoomNotificationState.isUnsentMessage`

* refactor: move `isNotificationDecorationVisible` into `useRoomListItemViewModel`

* refactor: recalculate notification values on notification state changes

* refactor: rename `isNotificationDecorationVisible` to `showNotificationDecoration`

* test: add test for room list item view

* test: add notification tests in room list item vm

* fix: listen to notification updates in `NotificationDecoration`

* test: update notification decoration tests

* refactor: display notification decoration according to vm

* test: update room list item view tests

* fix: a11y label computation after room name change

* refactor: improve notification handling
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.

2 participants