Skip to content

feat(ui): room_list_service::filters::unread becomes read_receipts - #6928

Merged
Hywan merged 4 commits into
matrix-org:mainfrom
Hywan:feat-ui-room-list-filter-read-receipts
Aug 27, 2026
Merged

feat(ui): room_list_service::filters::unread becomes read_receipts#6928
Hywan merged 4 commits into
matrix-org:mainfrom
Hywan:feat-ui-room-list-filter-read-receipts

Conversation

@Hywan

@Hywan Hywan commented Aug 27, 2026

Copy link
Copy Markdown
Member

This patch renames the room_list_service::filters::unread filter to read_receipts and adds a new parameter: ReadReceiptsCategory. Before it was looking at the ReadReceipts::num_notifications field only, now it can look at the following field: num_mentions, num_notifications or num_messages.

The condition where Room::is_marked_unread makes the room to be selected if there is no unread is kept because (i) it's a manual operation from the user, (ii) it signals the room is unread but for an unknown reason, it could be anything, so it's important and should be displayed regardless of the number of unread.

Before:

filters::unread()

After:

filters::read_receipts(filters::ReadReceiptsCategory::Notifications)

It is admittedly a bit longer but it unlocks more flexibility and more features.



  • I've documented the public API changes in the appropriate changelog files (see Writing changelog entries).
  • This PR was made with the help of AI.

Signed-off-by:

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.11%. Comparing base (1d4bc12) to head (fe800e4).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...-ui/src/room_list_service/filters/read_receipts.rs 92.72% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6928      +/-   ##
==========================================
- Coverage   90.12%   90.11%   -0.01%     
==========================================
  Files         407      407              
  Lines      115985   115968      -17     
  Branches   115985   115968      -17     
==========================================
- Hits       104532   104506      -26     
- Misses       7535     7536       +1     
- Partials     3918     3926       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@Hywan
Hywan force-pushed the feat-ui-room-list-filter-read-receipts branch from 6a78c42 to dedf9e7 Compare August 27, 2026 08:18
@codspeed-hq

codspeed-hq Bot commented Aug 27, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing Hywan:feat-ui-room-list-filter-read-receipts (fe800e4) with main (0f4d63b)

Open in CodSpeed

@Hywan
Hywan force-pushed the feat-ui-room-list-filter-read-receipts branch from dedf9e7 to eaf81db Compare August 27, 2026 08:31
@Hywan
Hywan marked this pull request as ready for review August 27, 2026 08:32
@Hywan
Hywan requested a review from a team as a code owner August 27, 2026 08:32
@Hywan
Hywan requested review from poljar and removed request for a team August 27, 2026 08:32
@Hywan
Hywan force-pushed the feat-ui-room-list-filter-read-receipts branch 4 times, most recently from be4cf2a to d1adc71 Compare August 27, 2026 08:56

@poljar poljar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple of nits, looks good otherwise.

Comment thread crates/matrix-sdk-ui/src/room_list_service/filters/read_receipts.rs
Comment thread crates/matrix-sdk-ui/src/room_list_service/room_list.rs Outdated
Comment thread bindings/matrix-sdk-ffi/changelog.d/6928.changed.md Outdated
Comment thread bindings/matrix-sdk-ffi/changelog.d/6928.changed.md Outdated
Comment thread crates/matrix-sdk-ui/changelog.d/6928.changed.md Outdated
Comment thread crates/matrix-sdk-ui/changelog.d/6928.changed.md Outdated
@Hywan
Hywan force-pushed the feat-ui-room-list-filter-read-receipts branch from d1adc71 to 75f9975 Compare August 27, 2026 12:20
Hywan added 3 commits August 27, 2026 14:23
This patch renames the `room_list_service::filters::unread` filter to
`read_receipts` and adds a new parameter: `ReadReceiptsCategory`. Before
it was looking at the `ReadReceipts::num_notifications` field only, now
it can look at the following field: `num_mentions`, `num_notifications`
or `num_messages`.

The condition where `Room::is_marked_unread` makes the room to be
selected if there is no unread is kept because (i) it's a manual
operation from the user, (ii) it signals the room is unread but for an
unknown reason, it could be anything, so it's important and should be
displayed regardless of the number of unreads.
This patch updates the `matches` function of
`room_list_service::filters` and `room_list_service::sorters` to take a
`fn` instead of a `Fn`. This has the same effect with our current code
except it's a bit faster to compile as there is no generic parameter. It
also reduces the risk of having monomorphisation which could duplicate
the code in the resulting binary.
@Hywan
Hywan force-pushed the feat-ui-room-list-filter-read-receipts branch from 75f9975 to 6d140d5 Compare August 27, 2026 12:23
@Hywan
Hywan enabled auto-merge (rebase) August 27, 2026 12:23
This patch removes the need to declare `RoomListFilterCategory` and
`RoomListFilterReadReceipts` in `matrix-sdk-ffi` by directly declaring
the bindings in `matrix-sdk-ui`.
@Hywan
Hywan force-pushed the feat-ui-room-list-filter-read-receipts branch from 6d140d5 to fe800e4 Compare August 27, 2026 12:34
@Hywan
Hywan merged commit 0b38cc3 into matrix-org:main Aug 27, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants