Repository navigation
Use standard timestamp formatting in dashboard tooltips - #22720
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22720Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22720" |
Tests selector15 / 101 PR test projects · 5 PR jobs, from 8 changed files. Selected PR test projects (15 / 101)
Selected PR jobs (5)
How these were chosen — grouped by what changed
🔧 📦 affected project 📦 affected project 🔧 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the timestamp-tooltip formatting changes.
No open issues 🎉
What changed in this PR
This PR aligns relative-timestamp tooltips with the dashboard’s standard formatting, showing seconds and including the date when the timestamp is not today. Locale, browser time zone, and 12-/24-hour preferences remain supported; chart tooltips are unchanged.
Changes:
- Reuses the standard timestamp formatter and removes the obsolete tooltip-specific formatting logic.
- Updates tests for exact seconds, local-date boundaries, cultures, and time-format preferences.
- Refreshes documentation examples to match the new tooltip format.
| File | Description |
|---|---|
| tests/Aspire.Dashboard.Tests/FormatHelpersTests.cs | Tests seconds, local dates, cultures, and time preferences. |
| tests/Aspire.Dashboard.Components.Tests/Layout/ResourcesLayoutTests.cs | Verifies resource tooltips and accessible labels. |
| tests/Aspire.Dashboard.Components.Tests/Dialogs/DashboardRunsDialogTests.cs | Verifies recording tooltip formatting. |
| tests/Aspire.Dashboard.Components.Tests/Controls/PauseWarningTests.cs | Covers pause tooltips for today and the previous day. |
| src/Shared/FormatHelpers.cs | Delegates tooltip formatting to the standard formatter. |
| src/Shared/DateFormatStringsHelpers.cs | Removes obsolete tooltip patterns, caching, and regular expressions. |
| src/Aspire.Dashboard/Model/HealthReportFormatter.cs | Updates the documentation example only. |
| src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.cs | Updates tooltip and accessible-label comments only. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Pull request created: #2262
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#2262 targeting Updated Note This draft PR needs human review before merging. |
Description
Dashboard tooltips for relative timestamps used a different date format from the rest of the dashboard and omitted seconds. They now use the dashboard's standard timestamp format so users can see the exact time at a glance.
Examples
Hover over a resource's start or stop age, a health check's last-run age, a recording's age, or a capture pause notice to see the local time. For example, a resource that stopped today shows
2:00:37 PM; a recording from another day shows1/2/2025 1:30:00 PMin en-US. The tooltip follows the dashboard's locale and 12- or 24-hour preference. Chart tooltips are unchanged.Screenshots
The Traces capture-pause tooltip for a timestamp from today.
Validation
dotnet test --project tests\Aspire.Dashboard.Tests\Aspire.Dashboard.Tests.csproj --no-restore --no-launch-profile -- --filter-class '*.FormatHelpersTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— 118 passed.dotnet test --project tests\Aspire.Dashboard.Components.Tests\Aspire.Dashboard.Components.Tests.csproj --no-restore --no-launch-profile -- --filter-class '*.PauseWarningTests' --filter-class '*.ResourcesLayoutTests' --filter-class '*.DashboardRunsDialogTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— 213 passed.dotnet build src\Aspire.Cli\Aspire.Cli.csproj --no-restore -p:SkipNativeBuild=true— passed.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?