fix(ui): correct Last checked timestamp in workspace close dialog (#2179)

## Problem

In the ExecutionWorkspaceCloseDialog, the "Last checked" timestamp was
using \`new Date()\` which show the current render time, not when the
readiness check API call actually completed.

\`\`\`tsx
Last checked {formatDateTime(new Date())} // always NOW
\`\`\`

This mean every time React re-render the component (which happen
frequently), the timestamp update to the current moment. User see "Last
checked 2:45:30 PM" and think the check just ran, but actually it might
have ran 30 seconds ago. The timestamp is lying.

## What I changed

Changed from \`new Date()\` to \`new
Date(readinessQuery.dataUpdatedAt)\` which is the actual timestamp from
React Query tracking when the API response was last received.

\`\`\`tsx
Last checked {formatDateTime(new Date(readinessQuery.dataUpdatedAt))} //
actual check time
\`\`\`

Now the timestamp accurately show when the close readiness check was
performed. It stay stable between re-renders until the query actually
refetch.

## How to test

1. Open an execution workspace > click Close button to open the dialog
2. The "Last checked" timestamp should show when the API call completed
3. Wait a few seconds - timestamp should NOT update (it's the query
time, not render time)
4. Click "Recheck" or trigger refetch - timestamp should update to new
fetch time

1 file, 1 line changed.
This commit is contained in:
Evyatar Bluzer 2026-08-01 03:54:23 +07:00 committed by GitHub
parent ce40343b9c
commit 2137f85e1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -287,7 +287,7 @@ export function ExecutionWorkspaceCloseDialog({
) : null}
<div className="text-xs text-muted-foreground">
Last checked {formatDateTime(new Date())}
Last checked {formatDateTime(new Date(readinessQuery.dataUpdatedAt))}
</div>
</div>
) : null}