Skip to content

feat: Tag Filter component#1087

Merged
adhityamamallan merged 4 commits intocadence-workflow:masterfrom
adhityamamallan:tag-filter
Nov 21, 2025
Merged

feat: Tag Filter component#1087
adhityamamallan merged 4 commits intocadence-workflow:masterfrom
adhityamamallan:tag-filter

Conversation

@adhityamamallan
Copy link
Member

@adhityamamallan adhityamamallan commented Nov 19, 2025

Summary

Add TagFilter component, which uses a set of selectable tags as a multi select filter.

Test plan

Unit tests + tested in a follow-up PR to add the filter in the History V2 page (colours not final).

Screenshot 2025-11-19 at 14 26 16

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
@Assem-Uber
Copy link
Contributor

Show all should be the only selected tag if all is selected

startEnhancer?: React.ComponentType<{ theme: Theme }>;
};

export type Props<T extends string> = {
Copy link
Member

Choose a reason for hiding this comment

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

What's the purpose of T extends string?

Is it not sufficient to use string instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to allow usage to specify as strict a type as necessary. In theory, a user could just create a tag filter with T as string, but they could also use something like "WorkflowStatus".

Copy link
Member

Choose a reason for hiding this comment

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

Nice, thx!

expect(mockOnChangeValues).toHaveBeenCalledWith(['opt2']);
});

it('calls onChangeValues with all tag keys when clicking "Show all" and no values are selected', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add an overview of user interactions in the Test Plan?

I'm wondering why "all tag keys" are provided when "no values are selected"? I wonder if there's a typo in the latter?

Copy link
Member Author

Choose a reason for hiding this comment

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

Essentially, if there are no values selected before the user clicks "Show all", we select all values. I can make the test name clearer.

Copy link
Contributor

@Assem-Uber Assem-Uber Nov 20, 2025

Choose a reason for hiding this comment

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

I don't think this is the intended behaviour (attaching the design).

Image

Copy link
Member Author

@adhityamamallan adhityamamallan Nov 20, 2025

Choose a reason for hiding this comment

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

Agreed; I tried out both cases:

  • "Show all" visibly selects all the other tags
  • "Show all" clears the other tags but sets the query params to select all of them

The first one felt more intuitive to me when I tried it out. We can discuss and reevaluate this if you'd like

Copy link
Contributor

Choose a reason for hiding this comment

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

Setting query params with all is something we can work around, i think having ALL value would be better specially for persistence as it keeps working even when we change filter values.

But from UX perspective, we can have a quick discussion on what seems to be better. Asking couple of users may help too.

Choose a reason for hiding this comment

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

The intended behavior is as follows:

  • "Show all" is selected by default in both categories, hence showing all event types and statuses
  • If the user clicks "Workflow" or any other type, it deselects "Show all" and selects "Workflow". Now it only shows "Workflows" in the list. If the user clicks any other type, it adds it to the filtered list.
  • If the user clicks "Show all" again, then it deselects all other options and selects "Show all". This will reset type and show everything.
  • The above pattern is the same for "Status": either individual statutes are selected and shown, or "Show all" to reset/show everything.
  • For each individual filter that is activated, it will update the count to reflect how many are selected (eg., selecting "Activity" and "Failed" will show "2" active filters)

Copy link
Member

@macrotim macrotim left a comment

Choose a reason for hiding this comment

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

Selecting "Request Changes" because I mistakenly approved.

Wish I could unapprove instead but this may be the best option.

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
@adhityamamallan adhityamamallan merged commit 58356cd into cadence-workflow:master Nov 21, 2025
5 checks passed
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.

4 participants