feat: Add filters to History Page V2#1088
feat: Add filters to History Page V2#1088adhityamamallan merged 6 commits intocadence-workflow:masterfrom
Conversation
c7d4683 to
70799a2
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds a filters menu to the History Page V2 using a popover UI pattern, replacing the previous toggle-based approach. The implementation includes color-coded filter options for event types and comprehensive test coverage.
Key Changes
- Replaced
PageFiltersTogglewith aStatefulPopovercontaining a newWorkflowHistoryFiltersMenucomponent - Added color configuration for workflow history event filtering types
- Created filter option configurations for both type and status filters using the
TagFiltercomponent
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/views/workflow-history-v2/workflow-history-v2.types.ts |
Added type definition for event filtering type colors |
src/views/workflow-history-v2/workflow-history-v2.tsx |
Updated import path to use v2-specific filter configuration |
src/views/workflow-history-v2/workflow-history-header/workflow-history-header.tsx |
Replaced filter toggle with popover-based filters button |
src/views/workflow-history-v2/workflow-history-header/workflow-history-header.styles.ts |
Added popover and button overrides for styling |
src/views/workflow-history-v2/workflow-history-header/__tests__/workflow-history-header.test.tsx |
Updated tests to reflect new popover-based UI |
src/views/workflow-history-v2/workflow-history-filters-menu/workflow-history-filters-menu.types.ts |
Added type definitions for filters menu props |
src/views/workflow-history-v2/workflow-history-filters-menu/workflow-history-filters-menu.tsx |
Implemented new filters menu component with reset functionality |
src/views/workflow-history-v2/workflow-history-filters-menu/workflow-history-filters-menu.styles.ts |
Added styled components for filters menu layout |
src/views/workflow-history-v2/workflow-history-filters-menu/__tests__/workflow-history-filters-menu.test.tsx |
Added comprehensive test suite for filters menu |
src/views/workflow-history-v2/config/workflow-history-filters.config.ts |
Created v2 filter configuration using TagFilter components |
src/views/workflow-history-v2/config/workflow-history-filters-type-options.config.ts |
Configured type filter options with color-coded icons |
src/views/workflow-history-v2/config/workflow-history-filters-status-options.config.ts |
Configured status filter options with themed icons |
src/views/workflow-history-v2/config/workflow-history-event-filtering-type-colors.config.ts |
Defined color palette for event filtering types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/views/workflow-history-v2/workflow-history-header/workflow-history-header.styles.ts
Show resolved
Hide resolved
| startEnhancer: () => | ||
| createElement(MdCircle, { | ||
| color: workflowHistoryEventFilteringTypeColorsConfig.ACTIVITY.content, | ||
| }), | ||
| }, | ||
| DECISION: { | ||
| label: 'Decision', | ||
| startEnhancer: () => | ||
| createElement(MdCircle, { | ||
| color: workflowHistoryEventFilteringTypeColorsConfig.DECISION.content, | ||
| }), | ||
| }, | ||
| SIGNAL: { | ||
| label: 'Signal', | ||
| startEnhancer: () => | ||
| createElement(MdCircle, { | ||
| color: workflowHistoryEventFilteringTypeColorsConfig.SIGNAL.content, | ||
| }), | ||
| }, | ||
| TIMER: { | ||
| label: 'Timer', | ||
| startEnhancer: () => | ||
| createElement(MdCircle, { | ||
| color: workflowHistoryEventFilteringTypeColorsConfig.TIMER.content, | ||
| }), | ||
| }, | ||
| CHILDWORKFLOW: { | ||
| label: 'Child Workflow', | ||
| startEnhancer: () => | ||
| createElement(MdCircle, { | ||
| color: | ||
| workflowHistoryEventFilteringTypeColorsConfig.CHILDWORKFLOW.content, | ||
| }), | ||
| }, | ||
| WORKFLOW: { | ||
| label: 'Other', | ||
| startEnhancer: () => | ||
| createElement(MdCircle, { | ||
| color: workflowHistoryEventFilteringTypeColorsConfig.WORKFLOW.content, | ||
| }), |
There was a problem hiding this comment.
The startEnhancer functions should accept a { theme } parameter to match the TagFilterOptionConfig type signature. Currently they're defined as () => createElement(...) but should be ({ theme }) => createElement(...). While the theme parameter isn't used here (colors are hardcoded), it's required by the type definition and should be accepted for consistency with the status options config.
| </styled.MenuHeader> | ||
| <styled.MenuFilters> | ||
| {workflowHistoryFiltersConfig.map( | ||
| (filter: WorkflowHistoryFilterConfig<any>) => ( |
There was a problem hiding this comment.
The explicit type annotation WorkflowHistoryFilterConfig<any> using any is unnecessary and reduces type safety. TypeScript can infer the type from workflowHistoryFiltersConfig automatically. Consider removing the explicit type annotation and let TypeScript infer: workflowHistoryFiltersConfig.map((filter) => ...)
| (filter: WorkflowHistoryFilterConfig<any>) => ( | |
| (filter) => ( |
There was a problem hiding this comment.
Unfortunately, this isn't the case. Typescript assumes that the type should satisfy all possible filter values at once
7400281 to
28aa289
Compare
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
037bfba to
e388660
Compare
Summary
Test plan
Unit tests + ran locally.
With sticky header
On narrow screens
With some values selected