Skip to content

New room list: filter list can be collapsed #29992

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

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

florianduros
Copy link
Member

@florianduros florianduros commented May 21, 2025

Task https://github.com/element-hq/wat-internal/issues/204
Figma

This PR improves the primary filters of the new room list

  • the filter list can be expanded/collapsed
  • when a filter is selected and not visible when the list is collapsed, the filter is moved at the first position of the list
  • the list is animated when collapsed/expanded
Screen.Recording.2025-05-27.at.09.25.18.mov

padding: unset;
list-style-type: none;
/**
* The InteractionObserver needs the height to be set for to work properly.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* The InteractionObserver needs the height to be set for to work properly.
* The InteractionObserver needs the height to be set to work properly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* @param isExpanded - the filter is expanded or not (fully visible).
* @param isVisible - `null` if there is not selected filter. `true` or `false` if the filter is visible or not.
*/
function useFilters(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this in the view and not the vm?

Copy link
Member Author

@florianduros florianduros May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put it in the view because it depends of two view attributes: isExpanded and isVisible where isVisible is the result of computation on the view

setFilterState({
filters: filters
.slice()
.sort((filterA, filterB) => (filterA.active === filterB.active ? 0 : filterA.active ? -1 : 1)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we replace this chained ternary with an if-else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expand/collapse interaction seems rather moot for keyboard accessibility given tabbing accesses the hidden elements too, using tab you can also end up with the active filter off-screen and the room list looking somewhat confusing.

Screen.Recording.2025-05-29.at.09.52.08.mov

Maybe when accessing the list via keyboard the filters should expand automatically and the expand/collapse should not be part of the keyboard UX.

image

When tabbed to the last filter item the expand/collapse seems to disappear entirely. In this state, if I click off the element I am left in a broken state and cannot access the expand interaction.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants