codeant-ai-for-open-source[bot] commented on code in PR #36936:
URL: https://github.com/apache/superset/pull/36936#discussion_r2666834866
##########
superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx:
##########
@@ -35,7 +35,9 @@ export function Timer({
status = 'success',
}: TimerProps) {
const theme = useTheme();
- const [clockStr, setClockStr] = useState('00:00:00.00');
+ const [clockStr, setClockStr] = useState(
+ startTime && endTime ? fDuration(startTime, endTime) : '00:00:00.00',
Review Comment:
**Suggestion:** The fallback string uses two decimal places ('00:00:00.00')
while the `fDuration` formatting uses milliseconds with three digits ('.SSS');
this produces inconsistent display and may confuse consumers. Change the
fallback to match the same millisecond precision. [possible bug]
**Severity Level:** Critical 🚨
```suggestion
startTime && endTime ? fDuration(startTime, endTime) : '00:00:00.000',
```
<details>
<summary><b>Why it matters? ⭐ </b></summary>
The fallback uses two decimal places while `fDuration` formats milliseconds
with three digits ('.SSS'). Making the fallback '00:00:00.000' keeps the UI
consistent and avoids surprising format changes when the value is derived from
`fDuration`.
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx
**Line:** 39:39
**Comment:**
*Possible Bug: The fallback string uses two decimal places
('00:00:00.00') while the `fDuration` formatting uses milliseconds with three
digits ('.SSS'); this produces inconsistent display and may confuse consumers.
Change the fallback to match the same millisecond precision.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]