Skip to content

Show only the absolute time in dashboard relative-time tooltips - #22263

Merged
Sébastien Ros (sebastienros) merged 7 commits into
mainfrom
sebros/dashboard-datetime-tooltips-448638
Nov 13, 2026
Merged

Sébastien Ros (sebastienros) merged 7 commits into
mainfrom
sebros/dashboard-datetime-tooltips-448638

Conversation

@sebastienros

@sebastienros Sébastien Ros (sebastienros) commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

Tooltips on relative times in the new dashboard repeated the text they were attached to, for example Started 1m ago (11/13/2026 8:30:43 AM) on a row that already reads "Started 1m ago". They now show only the exact time, in a browser-like medium format: Nov 13, 2026, 11:03 AM.

Affected tooltips:

  • Resource rows, in the sidebar and in the full resource list. The accessible name keeps the visible age, Started 1m ago (Nov 13, 2026, 11:03 AM), so it still contains the label (WCAG 2.5.3).
  • Health check last-run times on the resource overview (Healthy (16s ago)), which previously repeated the status.
  • Recording rows in the recordings panel (8 minutes ago). These didn't repeat the label, but now use the same format.

The legacy dashboard's health check grid is unchanged.

How the format is built

FormatHelpers.FormatTooltipDateTime uses only the culture and time zone the dashboard already has. It mirrors the browser's medium date and short time styles, which .NET doesn't have: the date comes from the culture's long date pattern without the day of the week and with an abbreviated month (11 nov. 2026, 20:41 in fr-FR, 2026年11月11日 20:41 in ja-JP). The dashboard's 12h/24h setting still applies, and the time is in the browser's time zone like the dashboard's other times.

No public types change: the additions are in internal helpers.

Screenshots

Taken with the Stress playground. The "before" and "after" runs are from different times of the day, so ages and times differ.

Before After
Resource list Before: resource list tooltip After: resource list tooltip
Resource sidebar Before: sidebar tooltip After: sidebar tooltip
Health check Before: health check tooltip After: health check tooltip
Recordings Before: recordings tooltip After: recordings tooltip

Validation

  • New FormatHelpersTests cover the browser's time zone in standard and daylight saving time, the 12h/24h overrides, and en-US/fr-FR/ja-JP.
  • Aspire.Dashboard.Tests (FormatHelpersTests, 116), Aspire.Dashboard.Components.Tests (1443) and the dashboard JavaScript tests (295) pass locally on macOS.
  • Aspire.Cli builds (it shares FormatHelpers.cs).

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

Tooltips on relative times in the new dashboard repeated the visible text,
for example "Started 1m ago (11/13/2026 8:30:43 AM)". They now show only the
exact time in a browser-like medium format with the time zone, for example
"Nov 13, 2026, 8:36 AM PST":

- Resource rows in the sidebar and the full resource list. The accessible
  name keeps the visible age so it still includes the label (WCAG 2.5.3).
- Health check last-run times on the resource overview.
- Recording rows in the recordings panel.

.NET has no short time zone names, so the browser now sends the short names
of its zone in standard and daylight saving time with the time zone id. When
they aren't known, the tooltip falls back to the UTC offset, such as UTC+5:30.
@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 -- 22263

Or

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

@github-actions

This comment has been minimized.

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.

🟡 Changes recommended

Time-zone labels can be incorrect because repeated-hour conversion loses the original instant and January/July sampling misses offset changes such as Casablanca’s Ramadan transition.

2 open issues
What changed in this PR

This PR makes relative-time tooltips in the dashboard show only the absolute timestamp, while preserving the visible age in resource rows’ accessible names. The legacy health-check grid remains unchanged.

Changes:

  • Adds culture-aware tooltip formatting with abbreviated dates, configurable 12/24-hour time, and time-zone labels.
  • Captures browser time-zone short names and provides a UTC-offset fallback.
  • Updates resource, health-check, and recording tooltips, with formatter and component test coverage.
File Description
tests/​Aspire.Dashboard.Tests/​FormatHelpersTests.cs Tests cultures, time formats, zone names, and fallbacks.
tests/​Aspire.Dashboard.Components.Tests/​Layout/​ResourcesLayoutTests.cs Verifies tooltips and accessible names separately.
tests/​Aspire.Dashboard.Components.Tests/​Dialogs/​DashboardRunsDialogTests.cs Updates recording tooltip expectations.
src/​Shared/​FormatHelpers.cs Adds absolute-time tooltip formatting and zone labels.
src/​Shared/​DateFormatStringsHelpers.cs Builds medium-date, short-time patterns.
src/​Aspire.Dashboard/​wwwroot/​js/​app.js Collects browser time-zone short names.
src/​Aspire.Dashboard/​Model/​HealthReportFormatter.cs Adds a timestamp-only health-check tooltip.
src/​Aspire.Dashboard/​Model/​BrowserTimeProvider.cs Stores and selects browser zone names.
src/​Aspire.Dashboard/​Model/​BrowserInfo.cs Carries zone names from JavaScript.
src/​Aspire.Dashboard/​Components/​Pages/​ResourceOverview.razor Uses timestamp-only health-check tooltips.
src/​Aspire.Dashboard/​Components/​Legacy/​Layout/​LegacyMainLayout.razor.cs Passes browser zone names to the time provider.
src/​Aspire.Dashboard/​Components/​Layout/​ResourcesLayout.razor.cs Separates tooltip text from accessible descriptions.
src/​Aspire.Dashboard/​Components/​Layout/​ResourcesLayout.razor Applies separate tooltips and accessible names.
src/​Aspire.Dashboard/​Components/​Layout/​MainLayout.razor.cs Initializes browser zone names.
src/​Aspire.Dashboard/​Components/​Dialogs/​DashboardRunsDialog.razor.cs Formats recording timestamps with the shared helper.
src/​Aspire.Dashboard/​Components/​Dialogs/​DashboardRunsDialog.razor Uses the updated recording tooltip helper.

Review effort: Balanced

Comment thread src/Aspire.Dashboard/wwwroot/js/app.js Resolved
Comment thread src/Shared/FormatHelpers.cs Resolved
The tooltip's time zone name was chosen from the local wall-clock time,
which is ambiguous in the hour repeated when daylight saving time ends:
1:30 AM PDT and 1:30 AM PST both read as PST. The browser also only samples
January and July, so a zone at a third offset, such as Africa/Casablanca at
UTC+0 during Ramadan, got the UTC+1 name.

The offset now comes from the UTC instant, and the browser sends each short
name with the offset it applies to. A name is used only for a time at that
offset; otherwise the tooltip shows the offset, such as "UTC".

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.

🟡 Changes recommended

The browser-side getBrowserInfo extraction lacks regression coverage for seasonal offsets, abbreviation deduplication, and locale-constructor fallback behavior.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment thread src/Aspire.Dashboard/wwwroot/js/app.js Resolved
@github-actions

This comment has been minimized.

Covers standard and daylight saving time in both hemispheres, a zone with
one offset, the dashboard language with its fallback when the browser
rejects it, and an offset the browser doesn't name.
@github-actions

This comment has been minimized.

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.

🟡 Changes recommended

The six BrowserInfo regression tests are not wired into PR CI, leaving offset-sign, deduplication, and locale-fallback behavior unprotected until an Infrastructure.Tests wrapper invokes them.

1 open issue
1 resolved since last review

Review effort: Balanced

… Windows

The tooltip test for an offset the browser didn't name used the system
Africa/Casablanca zone, whose data differs between operating systems:
Windows reads January 2026 as UTC+0 where IANA data has UTC+1. It now uses
a custom zone with the same Ramadan shape.

The dashboard JavaScript suites run in CI through Infrastructure.Tests
wrappers, so BrowserInfo.test.mjs gets one, and the test-selection tests
check that app.js and the new script select Infrastructure.Tests.
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 13, 2026 17:43
@github-actions

This comment has been minimized.

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open issues
1 resolved since last review

Review effort: Lite

Comment thread src/Shared/FormatHelpers.cs Resolved
@sebastienros
Sébastien Ros (sebastienros) marked this pull request as draft November 13, 2026 18:12
@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.

Rendering a tooltip shouldn't need new plumbing between the browser and the
server. Remove the time zone short names the browser sent (BrowserInfo,
BrowserTimeProvider.SetBrowserTimeZone, ITimeZoneNameProvider, the app.js
sampling and its tests) and format the tooltip only from the culture and time
zone the dashboard already has.

.NET has no time zone abbreviations, so the zone is named by its UTC offset:
"Nov 13, 2026, 8:36 AM UTC-8". The offset still comes from the UTC instant,
so the hour repeated when daylight saving time ends is labeled correctly.
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 13, 2026 18:58
@github-actions

This comment has been minimized.

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.

🟡 Changes recommended

Removing a trailing weekday leaves its preceding comma, causing doubled commas in formatted tooltips; the removal logic needs correction and a regression test.

1 open issue
3 resolved since last review

Review effort: Balanced

Comment thread src/Shared/DateFormatStringsHelpers.cs Resolved
The tooltip now shows only the date and time, "Nov 13, 2026, 8:36 AM", in
the browser's time zone like the dashboard's other times.
Removing a trailing day of the week left its comma behind, so a long date
pattern such as "yyyy. MMMM d., dddd" (hu-HU) gave "2026. nov. 11.,, 20:41".
The same rule missed the Arabic comma, a space before the comma and the
abbreviated day of the week. It now removes the separator before or after
the day of the week, in either form.
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

15 / 101 PR test projects · 5 PR jobs, from 11 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/Dialogs/DashboardRunsDialog.razor.

🔧 src/Aspire.Dashboard/Components/Dialogs/DashboardRunsDialog.razor (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/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/Dialogs/DashboardRunsDialog.razor, src/Aspire.Dashboard/Components/Dialogs/DashboardRunsDialog.razor.cs, src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor, src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.cs, src/Aspire.Dashboard/Components/Pages/ResourceOverview.razor, 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 ec26a17.

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 were identified for the timestamp-tooltip changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@sebastienros
Sébastien Ros (sebastienros) marked this pull request as ready for review November 13, 2026 19:15
@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.

@sebastienros
Sébastien Ros (sebastienros) merged commit 619426b into main Nov 13, 2026
562 of 565 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.1 milestone Nov 13, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

Skipped: the dashboard_user_facing_page_changed signal (evidence: src/Aspire.Dashboard/Components/Pages/ResourceOverview.razor) is a false positive for docs purposes. The PR changes only the text of hover tooltips on relative times, which now show the absolute time (Nov 13, 2026, 11:03 AM) instead of repeating the visible label. No flags, options, APIs, configuration or workflows change. A search of the microsoft/aspire.dev dashboard docs found no page that describes these tooltips or their format, so there is nothing to correct or add.

@sebastienros

Copy link
Copy Markdown
Contributor Author

Decision is not to backport this to release/17.0

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