Skip to content

Use standard timestamp formatting in dashboard tooltips - #22720

Merged
James Newton-King (JamesNK) merged 1 commit into
mainfrom
jamesnk/dashboard-tooltip-timestamp
Nov 26, 2026
Merged

James Newton-King (JamesNK) merged 1 commit into
mainfrom
jamesnk/dashboard-tooltip-timestamp

Conversation

@JamesNK

@JamesNK James Newton-King (JamesNK) commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

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 shows 1/2/2025 1:30:00 PM in 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.

Before: full date, no seconds After: time with seconds, no date
Before: the capture pause tooltip shows the date and time to the minute After: the capture pause tooltip shows the time to the second without the date

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

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22720

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22720"

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

15 / 101 PR test projects · 5 PR jobs, from 8 changed files.

Selected PR test projects (15 / 101)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests

Selected PR jobs (5)

cli-starter-validation, extension-e2e, native-dashboard-validation, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

⚠️ 10 of the 15 selected test projects come from a single change — src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.cs.

🔧 src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.cs (changed source)
→ 10 via the project graph: Aspire.Hosting.Azure.Kubernetes.Tests (3 hops), Aspire.Hosting.Azure.Tests (2 hops), Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

📦 affected project Aspire.Cli
→ 1 test: Aspire.Cli.EndToEnd.Tests

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

🔧 src/Shared/DateFormatStringsHelpers.cs (changed source)
→ 1 via the project graph: Aspire.Cli.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Controls/PauseWarningTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Dialogs/DashboardRunsDialogTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Layout/ResourcesLayoutTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Tests/FormatHelpersTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.cs, src/Aspire.Dashboard/Model/HealthReportFormatter.cs
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 008e614.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@JamesNK
James Newton-King (JamesNK) merged commit cb0e389 into main Nov 26, 2026
572 of 575 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.1 milestone Nov 26, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #2262

Generated by PR Documentation Check · copilot · auto (Claude Sonnet 5.5) · ~19 AIC · ⌖ ~10 AIC · ⊞ 7.6K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#2262 targeting release/17.1.

Updated dashboard/explore.mdx to note that hovering a resource's start/stop age shows the exact local time with seconds in the standard timestamp format. Triggered signal: pr_body_has_cli_flag_mention (evidence: dotnet test flags in the PR body's validation section — a weak/false-positive signal; the change is a minor user-visible dashboard behavior change).

Note

This draft PR needs human review before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants