Skip to content

Commit

Permalink
Clicking on an avatar shows a sliding pane with user details (#78)
Browse files Browse the repository at this point in the history
* Introduce a new UserProfileSlidingPane, which fades in from the right side
  of the screen when the user clicks on an Avatar (big or small).
  * Room avatars do not enable this action, as clicking on a room avatar
    should open the room itself instead.
  * This borrows some button designs from Moxin, which show nice SVG icons
     next to the button text.
  * These buttons are not yet functional; that will be added shortly.

* The flow of events now works like this:
  1. User clicks on an Avatar
  2. The `Avatar` widget handles that click and emits a `ShowUserProfileAction`
  3. The `RoomScreen` widget handles that action, sets the info for the `UserProfileSlidingPane`, and then shows that sliding pane.
  4. The user views the pane, and clicks the close button (or pressed back/Esc, etc), returning them to the RoomScreen.
 
* Redesigned how the Avatar works to be a bit more flexible, e.g., it now accepts
  any username or User ID string and still display the first non-'@' grapheme.
* Avatars also store data about the user they're displaying,
  which enables them to be self-sufficient when handling actions like being clicked.

* Reorganize imports and `live_design()` invocations in each module group.

* Still need to fix a few things:
  * Setting the width of the sliding pane to be a percentage of the parent window's width
  * Making sure that events are not forwarded to the hidden RoomScreen beneath the UserProfileSlidingPane
  * Hide the sliding pane if the user clicks/taps outside of its bounds (e.g., like a Modal)
  * Implement the button actions
  * Properly query and display the user's role (power level) in the current room.
  • Loading branch information
kevinaboos authored Jul 13, 2024
1 parent 0335e8e commit 98602b5
Show file tree
Hide file tree
Showing 23 changed files with 1,236 additions and 229 deletions.
62 changes: 31 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,7 @@ These are generally sorted in order of priority. If you're interested in helping
- [ ] User profile settings screen
- [ ] Persistence of app state to disk


## Known problems/issues
- URLs do not wrap properly; that is a Makepad-side problem.
- Matrix-specific links are not yet fully handled (https://matrix.to/...)
3 changes: 3 additions & 0 deletions resources/icons/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions resources/icons/copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions resources/icons/double_chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions resources/icons/external_link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions resources/icons/forbidden.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/go_back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 98602b5

Please sign in to comment.