Allow truncating long activity names#918
Merged
Assem-Uber merged 8 commits intocadence-workflow:masterfrom May 26, 2025
Merged
Conversation
97f8075 to
8bf4d7b
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds optional truncation of long activity names in the Workflow History view behind a config flag, with full names available via tooltip, and tightens up the Export JSON button styling.
- Introduce a new
fullNamefield and wrap labels in a tooltip component when shortening is enabled - Update the activity-group helper to cut names after the last
.or/based onWORKFLOW_HISTORY_SHOULD_SHORTEN_GROUP_LABELS_CONFIG - Refactor
WorkflowHistoryExportJsonButtonto avoid passing a boolean toendEnhancer
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/views/workflow-history/helpers/get-history-group-from-events/get-activity-group-from-events.ts | Add fullName, conditional short/long label logic, import config |
| src/views/workflow-history/config/workflow-history-should-shorten-group-labels.config.ts | New config flag definition |
| src/views/workflow-history/workflow-history-group-label/* | New component and types to render label with optional tooltip |
| src/views/workflow-history/workflow-history-timeline-group/* and compact-event-card/* | Propagate and render fullName via new WorkflowHistoryGroupLabel |
| src/views/workflow-history/workflow-history-export-json-button/workflow-history-export-json-button.tsx | Refactor conditional endEnhancer prop |
+ tests in corresponding __tests__ folders |
Updated mocks and new tests for grouping logic |
Comments suppressed due to low confidence (2)
src/views/workflow-history/helpers/get-history-group-from-events/tests/get-activity-group-from-events.test.ts:20
- The mock path uses the
@/views/...alias but the code imports the config via a relative path (../../config/...). This mismatch prevents Jest from mocking the module. Update the mock to use the same relative import specifier (e.g.jest.mock('../../config/workflow-history-should-shorten-group-labels.config', ...)) so the mock takes effect.
jest.mock('@/views/workflow-history/config/workflow-history-should-shorten-group-labels.config',
src/views/workflow-history/helpers/get-history-group-from-events/get-activity-group-from-events.ts:51
- [nitpick] There are tests for shortened vs. full
label, but none checking thatfullNameis correctly set or omitted. Consider adding a unit test to verifyfullNameis populated when shortening is enabled and remainsundefinedwhen disabled.
if (WORKFLOW_HISTORY_SHOULD_SHORTEN_GROUP_LABELS_CONFIG) {
...workflow-history/workflow-history-export-json-button/workflow-history-export-json-button.tsx
Outdated
Show resolved
Hide resolved
Assem-Uber
reviewed
May 23, 2025
...ews/workflow-history/helpers/get-history-group-from-events/get-activity-group-from-events.ts
Outdated
Show resolved
Hide resolved
Assem-Uber
reviewed
May 23, 2025
...ews/workflow-history/helpers/get-history-group-from-events/get-activity-group-from-events.ts
Outdated
Show resolved
Hide resolved
Assem-Uber
approved these changes
May 26, 2025
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
Since we currently show the full activity names in the Workflow History view (unlike previous versions of cadence-web), this PR adds changes to allow shortening names for display.
The shortened name is derived by cutting everything off before the last period/slash, which may not always be accurate or complete. Therefore, we have made this behaviour opt-in using the
WORKFLOW_HISTORY_SHOULD_SHORTEN_GROUP_LABELS_CONFIGflag.Misc
Test plan
Updated unit tests + ran locally.
With the flag disabled:

With the flag enabled:


Export JSON button (before/after):

