Skip to content

DataViews: Hide "Add filter" link if there are no filters to add #64689

Closed

Description

@allilevine

The Add filter link should only show when there is another filter to add. Currently it shows when there's only one filter and it's already been added. It's not clickable.

Screen Shot 2024-08-21 at 12 00 24 PM

Activity

  1. oandregal commented on Aug 21, 2024

    @oandregal
    Member

    Hi @allilevine thanks for the report.

    The Add filter link should only show when there is another filter to add.

    I agree with this. If there's one filter, there's never an opportunity for the "add filter" to become enabled.

    When there are multiple filters and they've all been added, the Add filter link still shows

    This case is different, though.

    You cannot add more filters when you've added all of them, but the button becomes active as soon as you remove one. In this scenario the disabled/enabled states are more representative, IMO. It'll be a confusing experience to having buttons coming in/out on the screen.

    Additionally, we need to pay attention to the keyboard affordances: notice how the "add filter" button gains focus when the last filter is removed:

    Gravacao.do.ecra.2024-08-21.as.22.01.18.mov
  2. oandregal commented on Aug 21, 2024

    @oandregal
    Member

    sorry, clicked the wrong button when commenting :)

  3. allilevine commented on Aug 21, 2024

    @allilevine
    ContributorAuthor

    You cannot add more filters when you've added all of them, but the button becomes active as soon as you remove one. In this scenario the disabled/enabled states are more representative, IMO. It'll be a confusing experience to having buttons coming in/out on the screen.
    Additionally, we need to pay attention to the keyboard affordances: notice how the "add filter" button gains focus when the last filter is removed:

    @oandregal Thanks, this was really helpful to see! I agree and I'll update the issue.

  4. removed their assignment
    on Aug 22, 2024
  5. jameskoster commented on Aug 22, 2024

    @jameskoster
    Contributor

    I think the only time the button should be hidden entirely is when the data view only supplies primary filters. Primary filters are always visible in the UI (even if a value is not selected). In these cases it's not possible to add more filters, so there's no benefit to showing the button.

    An example of this is the Patterns page, which supplies a single "Sync status" filter which is primary. Consequently there's no visible "Add filter" button.

    Screenshot 2024-08-22 at 10 05 42

    Therefore we can probably close this issue?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond[Package] DataViews/packages/dataviews

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions