project-robius / robrix

A Matrix chat client written in pure Rust using the Makepad UI toolkit and the Robius app dev framework
MIT License
67 stars 11 forks source link

Implement search bar at the top of the rooms list #123

Open kevinaboos opened 3 weeks ago

kevinaboos commented 3 weeks ago

This feature simply acts as a local filter for the list of rooms currently being displayed. It does not perform any remote search for rooms or any other form of server requests for data. It only looks at the list of currently-known rooms, including both joined and invited rooms.

There are many ways one could implement this:

Optionally, you can also include left rooms (rooms the user had joined in the past but has since left) in the search.

Supported search terms

The keywords entered in the rooms list search bar should match on all of the following strings:

  1. Each room's display name
    • example: "Matrix Rust SDK Development"
  2. Each room's published addresses/aliases
    • example: "#matrix-rust-sdk-dev:flipdot.org"
  3. Each room's internal room ID
    • example: "!qSsPTKDfMGYqhgiLPJ:flipdot.org"

Upon typing one or more characters in the search bar, the list should automatically be refreshed (without the user having to click a button or press Enter/Return), and only the Rooms that (partially) match the terms should be shown.

Then, also after typing at least one character, a small X (❌) icon button should be shown on the right-hand side of the TextInput search bar, which allows the user to clear the entered search terms. Upon clicking that, or when the search bar text is deleted/cleared, all filters should be automatically removed and all known rooms should be displayed.

When the search bar is empty, it should display the text "Filter rooms..." or "Room name, alias, or ID...", or something similar.