refactor: Use groupType-based filtering for Workflow History Group Category filter#1197
Merged
adhityamamallan merged 6 commits intocadence-workflow:masterfrom Mar 6, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the filtering logic for workflow history v2 by replacing function-based category filtering with a direct constant mapping approach. The change simplifies the code, improves type safety, and eliminates the need for runtime function evaluations when filtering event groups.
Changes:
- Introduced
WORKFLOW_HISTORY_EVENT_GROUP_TYPE_TO_CATEGORY_MAPandWORKFLOW_HISTORY_EVENT_STATUS_TO_GROUP_STATUS_MAPconstants for direct type-safe mappings - Simplified
filter-groups-by-categoryandfilter-groups-by-statusfunctions to use direct map lookups - Removed deprecated
get-event-group-filtering-typehelper function andworkflow-history-event-group-category-filters.configfile - Updated all components to use the new mapping directly instead of calling helper functions
- Renamed
TimelineRow.groupTypetoTimelineRow.categoryfor consistency - Renamed
NavigationBarEventsMenuItem.typetoNavigationBarEventsMenuItem.categoryfor consistency
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| workflow-history-filters-menu.constants.ts | Added new type-safe constant mappings for event group types to categories and event statuses to group statuses |
| filter-groups-by-status.ts | Refactored to use direct map lookup instead of manual array reduction |
| filter-groups-by-category.ts | Refactored to use direct map lookup instead of config-based function evaluation |
| get-event-group-filtering-type.ts | Deleted deprecated helper function |
| workflow-history-event-group-category-filters.config.ts | Deleted deprecated config file |
| workflow-history-ungrouped-event.tsx | Updated to use direct map lookup instead of helper function |
| workflow-history-event-group.tsx | Updated to use direct map lookup instead of helper function |
| workflow-history-timeline.tsx | Updated to reference renamed category field |
| workflow-history-timeline.types.ts | Renamed groupType field to category, updated type imports |
| get-timeline-row-from-event-group.ts | Updated to use direct map lookup and return renamed category field |
| get-navigation-bar-events-menu-items.ts | Updated to use direct map lookup |
| workflow-history-navigation-bar-events-menu.types.ts | Renamed type field to category |
| workflow-history-navigation-bar-events-menu.tsx | Updated to reference renamed category field |
| workflow-history-filters-menu.types.ts | Removed deprecated EventGroupCategoryConfig type |
| workflow-history-event-groups.ts | Added mockLocalActivityEventGroup fixture |
| Various test files | Removed mocks for deleted functions, updated test expectations to use category field |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
e18554a to
d289fab
Compare
Assem-Uber
reviewed
Mar 4, 2026
...workflow-history-v2/workflow-history-filters-menu/workflow-history-filters-menu.constants.ts
Outdated
Show resolved
Hide resolved
...workflow-history-v2/workflow-history-filters-menu/workflow-history-filters-menu.constants.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Assem-Uber
approved these changes
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getEventGroupCategoryinstead of doing so the other way aroundTest plan
Added/updated unit tests + ran locally to sanity-check that filters still work as expected.