carbon-design-system / carbon-platform

The "next" version of the Carbon Design System website, as a platform.
https://next.carbondesignsystem.com
Apache License 2.0
21 stars 5 forks source link

Asset filter by status mismatch #866

Closed francinelucca closed 2 years ago

francinelucca commented 2 years ago

Description

There is something broken in our asset filtering logic when filtering by status:

NOTE: I think this is due to us not taking into consideration assets that are of status type object, this can be solved by using the statusKey property to compare against when filtering by status

Steps to reproduce

How do we reproduce the error? Please be as specific as you can.

  1. https://next.carbondesignsystem.com/assets/components?items=240&status[]=draft, note 4 results
  2. https://next.carbondesignsystem.com/assets/components?items=240, do a ctrl + f for draft, note 5 results

  3. https://next.carbondesignsystem.com/assets/components?items=240&status[]=experimental, note 6 results
  4. https://next.carbondesignsystem.com/assets/components?items=240, do a ctrl + f for experimental, note 7 results
mattrosno commented 2 years ago

Hey team! Please add your planning poker estimate with ZenHub @andreancardona @francinelucca @jdharvey-ibm

mattrosno commented 2 years ago

Verified: https://github.com/carbon-design-system/carbon-for-ibm-dotcom/blob/main/packages/styles/carbon.yml#L685

mattrosno commented 2 years ago

My understanding:

  1. Framework collapsing happens when there's a "group" of assets (matching asset ids whose libraries are in a defined group) and no framework filter has been set
  2. If multiple filter items are selected within the same category, it's an OR (show all that is React OR is Angular) (show all that is Draft OR Stable)
  3. If multiple filter categories are used, it's an AND (show all that is Experimental AND IBM Products)

Your example from Slack is search "Link List Section" AND Draft.

https://next.carbondesignsystem.com/assets/components?q=link%20list%20section&sort=status&status[]=draft

Because no framework is selected, Web Components asset is in the data set, and that is Stable, so nothing is returned.

Option 1

Do nothing, knowing we'll spend more time on this later.

Option 2

Update:

Framework collapsing happens when there's a "group" of assets (matching asset ids whose libraries are in a defined group) and no framework filter has been set

to

Framework collapsing happens when there's a "group" of assets (matching asset ids whose libraries are in a defined group) and no framework filter has been set and there's no search query

Before, searching "Alluvial" just returns one collapsed asset.

https://next.carbondesignsystem.com/assets/components?q=alluvial

But there's really 5 different Alluvial assets that somebody could use. With this new logic, all 5 would show here.

The intent of framework collapsing is to prevent asset "duplication" by default. Once you're interacting with searching and filtering, I think it's okay to not framework collapse and show more, because after all, you're looking for something specific.

With this new logic, searching for Link List Section you'd see the Web Components and React components, and further filtering by Draft would only show the React asset.

francinelucca commented 2 years ago

Your example from Slack is search "Link List Section" AND Draft.

[https://next.carbondesignsystem.com/assets/components?q=link%20list%20section&sort=status&status[]=draft]>(https://next.carbondesignsystem.com/assets/components?q=link%20list%20section&sort=status&status%5B%5D=draft)

Because no framework is selected, Web Components asset is in the data set, and that is Stable, so nothing is returned.

Clarification: "Link List Section" will show up when filtering by draft , it's just not showing up on prod because the statusKey bug is not in yet. (see second :18 of attached video) My question was more regarding it showing up as stable in the catalog when not filters

https://user-images.githubusercontent.com/40550942/186253780-6b853e3f-3a76-4bca-b86b-446f084e4145.mov

francinelucca commented 2 years ago

Picture with query and draft filter:

image
mattrosno commented 2 years ago

@francinelucca what if we don't collapse frameworks if there's a search query? In that above screenshot, it'd show just that one result and there'd be no "+1".

Here, it'd show both results, not just the canonical.

image
francinelucca commented 2 years ago

@mattrosno I'll grab a slot on the next huddle and we can discuss as team