-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(formatting): consolidate duration formatting into shared utility #3118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR successfully consolidates duplicate Key Changes
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as UI Components
participant Terminal as Terminal
participant Logs as Logs UI
participant Copilot as Copilot/Tool Call
participant Notification as Notification Service
participant Formatter as formatDuration Utility
Note over UI,Formatter: Duration Formatting Flow
Terminal->>Formatter: formatDuration(durationMs, {precision: 2})
Formatter-->>Terminal: "0.44ms" or "1.23s"
Logs->>Formatter: formatDuration(duration, {precision: 2})
Formatter-->>Logs: "500ms" or "2.50s"
Copilot->>Copilot: Round to min 1s: Math.max(1000, Math.round(ms/1000)*1000)
Copilot->>Formatter: formatDuration(roundedMs)
Formatter-->>Copilot: "1s", "2s", etc.
Notification->>Formatter: formatDuration(totalDurationMs, {precision: 1})
Formatter-->>Notification: "500ms", "1.2s", or "2.5m"
Note over Formatter: Logic:<br/>- Sub-millisecond: 2 decimal places<br/>- < 1000ms: round to integer<br/>- < 60s: format with precision<br/>- >= 60s: minutes/hours
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, no comments
...l/components/copilot/components/copilot-message/components/thinking-block/thinking-block.tsx
Outdated
Show resolved
Hide resolved
.../sim/app/workspace/[workspaceId]/w/[workflowId]/components/training-modal/training-modal.tsx
Show resolved
Hide resolved
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/utils.ts
Show resolved
Hide resolved
|
@greptile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, no comments
apps/sim/app/workspace/[workspaceId]/logs/components/logs-list/logs-list.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Summary
0.44229199923574924ms→0.44ms)formatDurationimplementations into single shared utilityType of Change
Testing
Tested manually, all 46 unit tests pass
Checklist