-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Background
Spaces support within Robrix was recently added (see PRs #623, #624, #636, #644), and it is mostly complete. The last remaining component is the Spaces "lobby"/"homepage", which allows the user to explore the full list of subspaces and rooms within a given space.
Here is how Element displays a space's homepage:
Implementation: Viewing the space
Key components that we need to implement are:
- Space avatar and name (already known in the SpacesBar)
- Whether it is public/private
- How many members there are
- A search box
- Keywords should match on the room/space ID, name, alias, and topic
- The list of rooms and subspaces
- Each subspace can be expanded/collapsed to show its children
- Each room displays its name & avatar, the number of members, whether you've joined it, whether it is "Suggested"
- Each subspace displays the name & avatar of that subspace, the number of child rooms/space, the number of members, whether it is joined
- Buttons to join/leave each room or subspace
There is already an existing SpaceLobbyScreen, but it is just a placeholder for now:
robrix/src/home/space_lobby.rs
Lines 174 to 195 in d7117c3
| // The main view that shows the lobby (homepage) for a space. | |
| pub SpaceLobbyScreen = {{SpaceLobbyScreen}} { | |
| width: Fill, height: Fill, | |
| padding: {top: 100} | |
| align: {x: 0.5} | |
| show_bg: true | |
| draw_bg: { | |
| color: (COLOR_PRIMARY) | |
| } | |
| title = <Label> { | |
| flow: RightWrap, | |
| align: {x: 0.5} | |
| draw_text: { | |
| text_style: <TITLE_TEXT>{font_size: 13}, | |
| color: #000 | |
| wrap: Word | |
| } | |
| text: "Space Lobby Screen is not yet implemented" | |
| } | |
| } |
The RoomsList is the main "driver" of the background space sync service, and uses this space_request_sender to send requests to it:
Lines 380 to 381 in d7117c3
| /// The sender used to send Space-related requests to the background service. | |
| #[rust] space_request_sender: Option<UnboundedSender<SpaceRequest>>, |
The RoomsList has a full map of all spaces, including each space's parents, list of direct rooms, and list of nested subspaces:
Lines 383 to 389 in d7117c3
| /// A flattened map of all spaces known to the client. | |
| /// | |
| /// The key is a Space ID, and the value contains a list of all regular rooms | |
| /// and nested subspaces *directly* within that space. | |
| /// | |
| /// This can include both joined and non-joined spaces. | |
| #[rust] space_map: HashMap<OwnedRoomId, SpaceMapValue>, |
So, the SpaceLobbyScreen can query the RoomsList for the basic structure of a given space, but the RoomsList doesn't hold all details about each space. Thus, we will need to add some additional requests to get the full details of a space. Perhaps something like a more detailed version of the existing SpaceRequest::GetChildren, which will return the full SpaceRoom object for each space instead of just a list of child room/subspace IDs.
Implementation: editing the space
If the current logged-in user can edit the space, then we also need to allow them to:
- Add rooms or subspaces to the space.
- Remove rooms or subspaces from the space.
- Mark rooms or subspaces as "suggested" (or not).
Here are some screenshots from Element showing how they display it.

Metadata
Metadata
Assignees
Labels
Type
Projects
Status