Skip to content

Add room message search for unencrypted rooms#6432

Draft
kalix127 wants to merge 5 commits intoelement-hq:developfrom
kalix127:feat/room-message-search
Draft

Add room message search for unencrypted rooms#6432
kalix127 wants to merge 5 commits intoelement-hq:developfrom
kalix127:feat/room-message-search

Conversation

@kalix127
Copy link
Copy Markdown
Contributor

@kalix127 kalix127 commented Mar 22, 2026

Content

Add server-side room message search for unencrypted rooms using the Matrix /search API (/_matrix/client/v3/search).

The feature works for unencrypted rooms but it's not fully complete yet. Encrypted room search will require Rust SDK FFI work (exposing the matrix-sdk-search crate with local Tantivy indexing) and that's planned for later. Opening this now to get early feedback and visibility since this has been one of the most requested features.

What's included

  • New feature module (features/roommessagesearch/) with standard api/impl structure
  • Server-side search via direct HTTP calls to the Matrix /search endpoint, scoped to the current room
  • Search UI with debounced input (300ms), paginated results with "load more", highlighted search terms, sender avatars, formatted timestamps
  • Encrypted room handling: when the room is encrypted, the search UI is replaced by a banner explaining that search is not yet available (similar to how Element Web handled this in E2E rooms still have a search button but search doesn't work in E2E rooms. element-web#4982)
  • Clicking a search result navigates back to the timeline focused on that specific message
  • Static skeleton placeholder items while results load
  • Accessibility: content descriptions on search result items, semantic grouping
  • Pluralized result count strings
  • Feature flag feature.roomMessageSearch (default off, not finished)

What's NOT included yet / known limitations

  • Encrypted room search (requires Rust SDK changes)
  • Cross-room search
  • Search history / recent searches
  • Context messages around search results
  • Unit tests and screenshot tests need to be added/recorded
  • The feature flag is off by default

Motivation and context

This addresses one of the longest-standing and most requested features across the entire Element ecosystem:

Search is critical for daily use and its absence is a top reason users hesitate to migrate. Starting with unencrypted room search is the practical first step since it uses the existing Matrix server-side search API and doesn't require any SDK-level changes for local indexing.

Still waiting on

  • Feedback from the team on the overall approach and UX
  • Confirmation on whether the direct HTTP approach (bypassing the Rust SDK) is acceptable long-term or if this should eventually go through the SDK
  • Design review for the search UI
  • Guidance on encrypted room search timeline and Rust SDK plans

Screenshots / GIFs

1000065143

Tests

  • Manually tested search in unencrypted rooms on a real homeserver
  • Verified encrypted rooms show the "not available" banner
  • Tested pagination (load more results)
  • Tested clicking a result navigates to the correct message in timeline
  • Tested empty results state
  • Tested error/retry flow
  • Unit tests and screenshot tests still need to be added

Tested devices

  • Physical
  • Emulator
  • OS version(s): Android 15

Checklist

  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

@kalix127 kalix127 requested a review from a team as a code owner March 22, 2026 00:54
@kalix127 kalix127 requested review from ganfra and removed request for a team March 22, 2026 00:54
@kalix127 kalix127 marked this pull request as draft March 22, 2026 00:54
@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Mar 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:

  • Your branch should be based on origin/develop, at least when it was created.
  • The title of the PR will be used for release notes, so it needs to describe the change visible to the user.
  • The test pass locally running ./gradlew test.
  • The code quality check suite pass locally running ./gradlew runQualityChecks.
  • If you modified anything related to the UI, including previews, you'll have to run the Record screenshots GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, it will prevent the CI from running temporarily, until you upload a new commit after that one. To do so, just pull the latest changes and push an empty commit.

@aik2mlj
Copy link
Copy Markdown

aik2mlj commented Apr 14, 2026

This is probably the most essential long-awaited feature. Would be great if it gets merged.

@krbns
Copy link
Copy Markdown

krbns commented Apr 16, 2026

@kalix127 It might be nice to add a search UI for messages right within the chat screen, instead of navigating to a separate page. For example, you could check how Telegram does it, with options like arrow navigation or an overlay window—perhaps the overlay would be a simpler starting point if the arrows are tricky to implement

@kalix127
Copy link
Copy Markdown
Contributor Author

Whatever, I don't see much hope for this feature in the near future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants