Skip to content
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

Clicking on an avatar shows a sliding pane with user details #78

Merged

Conversation

kevinaboos
Copy link
Member

@kevinaboos kevinaboos commented Jul 13, 2024

  • 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.

Note: there are still major problems with the UserProfileSlidingPane,
      it doesn't work and the actual view is split in half, weirdly.
Still need to:
* Make the window capture focus such that scrolling only scrolls the pane, not the background too.
* Paint a transparent gray overlay atop the background content
* Make the X close button show up properly
* Use a rounded view and/or shadows to make the pane appear to be floating above the background content.
* Fill in the data fields properly, i.e., User Name, Role in "ROOM NAME", Role info (levels)
* Actually implement the button actions
Redesigned how the Avatar works to be a bit more flexible, e.g.,
it can now accept any username string.

Avatars also store data about the user they're displaying,
which enables them to be self-sufficient when handling actions
like being clicked on.
@kevinaboos kevinaboos merged commit 98602b5 into project-robius:main Jul 13, 2024
1 check passed
@kevinaboos kevinaboos deleted the introduce_user_profile_sliding_pane branch July 13, 2024 00:51
kevinaboos added a commit to kevinaboos/robrix that referenced this pull request Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant