feat(ui): improve duration display in workflow and execution tables#223
Merged
feat(ui): improve duration display in workflow and execution tables#223
Conversation
- Add formatDurationHumanReadable() utility for human-readable durations (e.g., '1h 2m' instead of '3748.3s') - Add LiveElapsedDuration component that ticks every second for running items instead of showing static '-' dash - Update WorkflowsTable, CompactWorkflowsTable, CompactExecutionsTable, and EnhancedExecutionsTable to use new duration formatting - Fix 'as any' type assertion in CompactExecutionsTable status prop Closes #222
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
Closes #222
3748.3s) with natural format (1h 2m,17m 32s,230ms)-dashformatDurationHumanReadable()andLiveElapsedDurationcomponent indata-formatters.tsxChanges
New shared utilities (
data-formatters.tsx)formatDurationHumanReadable(ms)— Formats milliseconds to human-readable:230ms,42s,3m 28s,1h 2m,1d 2hLiveElapsedDuration— React component withuseEffect/setIntervalthat computes elapsed time fromstartedAtand ticks every secondUpdated table components
Bonus fix
as anytype assertion inCompactExecutionsTablestatus prop, replaced with propernormalizeExecutionStatus()callDuration Format Examples
3748.3s1h 2m1208.5s20m 8s426.0s7m 6s0.1s123ms-(running)2m 34s(live, ticking)Screenshots (Playwright)
Workflows Table (After)
Executions Table (After)
Verification
npx tsc --noEmit— passesnpm run build— passes