Add message support to the new search tab#5829
Merged
Merged
Conversation
Wrap the SDK's SearchService in a SearchServiceProxy that publishes typed message results and paginates on demand, expose it on the ClientProxy, and enable the search index store on the session. Also opens up the timeline item factory's message content builder so the proxy can reuse it.
Split global search into Rooms and Messages tabs. The Messages tab lists matching events with the room's name and avatar, a sender-prefixed preview, rich media (image/video/audio/file) previews, and a loading indicator, then paginates as you scroll. Queries are debounced and the previous one is superseded so late results can't clobber a newer search.
The SDK now surfaces polls, stickers, redactions and live location shares alongside plain messages. Map them to their preview content instead of dropping them as unsupported events.
pixlwave
approved these changes
Jul 2, 2026
pixlwave
left a comment
Member
There was a problem hiding this comment.
Very cool, nothing major just small thoughts 🔍
Comment on lines
+201
to
+208
| guard let selectedID else { return } | ||
| switch context.viewState.bindings.searchMode { | ||
| case .rooms: | ||
| context.send(viewAction: .selectRoom(roomID: selectedID)) | ||
| case .messages: | ||
| guard let message = context.viewState.messages.first(where: { $0.id == selectedID }) else { return } | ||
| context.send(viewAction: .selectMessage(roomID: message.roomID, eventID: message.id)) | ||
| } |
Member
There was a problem hiding this comment.
Not important for right now, part of me feels like there should be a single selectItem view action and then this logic could be in the view model and tested.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #5829 +/- ##
===========================================
- Coverage 74.21% 73.91% -0.31%
===========================================
Files 815 817 +2
Lines 56635 57554 +919
===========================================
+ Hits 42030 42539 +509
- Misses 14605 15015 +410
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
- Drop the redundant searchService coordinator/view model parameter; derive it from the client proxy. - Rename the globalSearch avatar size to search. - Lift the query observation streams out of their tasks. - Restore the appeared and updateVisibleRange comments. - Use CompoundIcon defaults and a scaledFrame for media previews. - Simplify the result mapping with compactMap(makeResult) and drop unsupported events by returning nil. - Move the preview helpers beneath the previews.
Move the protocol methods to the top under a Public mark and gather the helpers beneath a Private mark.
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.
Adds a Messages tab to global search, next to Rooms.
It's backed by a new
SearchServiceProxywrapping the SDK'sSearchService, exposed on theClientProxyand using the session's search index store.Message results show the room's name and avatar with a sender-prefixed preview. Image/video/audio/file matches get a thumbnail (or type icon) with filename and size.
Polls, stickers, redactions and live locations are supported too but depend on matrix-org/matrix-rust-sdk#6710