-
Notifications
You must be signed in to change notification settings - Fork 37
Handle matrix.to room alias and room ID links. #531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Handle matrix.to room alias and room ID links. #531
Conversation
4675675 to
24d8652
Compare
kevinaboos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
I'm a bit confused about the title of this PR. When you "handle" room aliases and links, what do you mean by "handle"? I would expect the UI to open a new tab (in Desktop mode) and show that room's content if it's joined, or if it hasn't been joined yet, then show a new view with a preview of that room and a prompt asking the user to join it.
And then in Mobile mode, the same thing would happen, but you'd just show the new room in a view that replaces the existing RoomScreen, instead of opening a new tab (since there are no tabs). I was under the impression that we'd need Julian's new stack navigation PR in order to handle this properly, in which we're able to "push" the new room view onto the stack of existing views (such that you can navigate backwards to the rooms you viewed previously). Without that functionality, we can't really offer a good user experience of navigating between multiple rooms.
This PR doesn't really seem to do any of that, so I'm a bit confused about what you intended the scope of this to be.
|
Blocked on Makepad PR see: makepad/makepad#766 |
|
@kevinaboos Need to update latest Makepad version, because Julian's PR about StackNavigation has been merged makepad/makepad#766, need to use something about that PR. Thanks. now i use my local latest makepad repo. |
Indeed, thanks for mentioning that. We have a PR already in progress that updates to the latest version of Makepad, which is #521. Once that is merged, you can proceed here. |
|
Blocked on #521 |
…edRoom in Dock - Add src/room/can_not_preview_screen.rs: a UI for rooms that cannot be previewed or joined, with a Join button / messaging. - Introduce PreviewedRoom variant in SelectedRoom and propagate through persistence and UI: - src/app.rs: import reordering and PreviewedRoom handling for room_id/room_name getters. - src/persistence/app_state.rs: include PreviewedRoom when saving dock state. - Desktop & mobile UI updates for room previews: - src/home/main_desktop_ui.rs: register CanNotPreviewScreen, implement focus_or_crate_preview_screen_tab to create/select preview tabs, and handle room preview fetch results (show preview or can't-preview screen). - src/home/main_mobile_ui.rs: small logic fix (handle None | _ case). - Improved matrix link handling in room UI: - src/home/room_screen.rs: enhanced handling of Matrix links (user, room id/alias, event links) — jump to known rooms (handling different RoomState cases) or request room preview for unknown rooms. - Serialization / utils: - src/utils.rs: add OwnedServerNameRon wrapper to support RON (de)serialization of OwnedServerName and adjust imports. - Misc: - Register new can_not_preview_screen module in src/room/mod.rs. - Tidy imports and adapt code to new flow. Rationale: Improve UX when clicking room links by showing a room preview or a clear message when the room cannot be previewed or joined. Treat previewed rooms as first-class tabs in the Dock and persist them in app state for consistent restore behaviour.
4017881 to
bd14ffa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for displaying room previews when users click on Matrix room links. The implementation handles both world-readable rooms and non-world-readable rooms with different UI screens.
Key changes:
- Added a new
PreviewedRoomvariant to theSelectedRoomenum to track previewed rooms in the application state - Implemented a new
CanNotPreviewScreenUI component for rooms that cannot be previewed - Enhanced Matrix link handling to fetch and display room previews instead of just logging TODO messages
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils.rs | Added OwnedServerNameRon wrapper for RON serialization of server names |
| src/room/mod.rs | Registered the new can_not_preview_screen module |
| src/room/can_not_preview_screen.rs | New UI component for displaying non-previewable rooms with join options |
| src/persistence/app_state.rs | Extended pattern matching to include PreviewedRoom variant |
| src/home/room_screen.rs | Enhanced Matrix link handling to fetch room previews and navigate to rooms based on their state |
| src/home/main_mobile_ui.rs | Added catch-all pattern for unhandled room types |
| src/home/main_desktop_ui.rs | Added focus_or_crate_preview_screen_tab method to create tabs for room previews |
| src/app.rs | Added PreviewedRoom variant to SelectedRoom enum with supporting methods |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR content
Related PR
matrix.tolinks for Rooms #87