Repository navigation
Show only the absolute time in dashboard relative-time tooltips - #22263
Sébastien Ros (sebastienros) merged 7 commits into
Conversation
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.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22263Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22263" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 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
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".
There was a problem hiding this comment.
🟡 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
This comment has been minimized.
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.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 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.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
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
This changes the public method signature ofBrowserTimeProvider.SetBrowserTimeZone(from a single… · New This changes the public method signature ofBrowserTimeProvider.SetBrowserTimeZone(from a single… · New The PR checklist indicates no public API was added, but this introduces a new top-level `public… · New
1 resolved since last review
Review effort: Lite
|
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.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 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
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.
Tests selector15 / 101 PR test projects · 5 PR jobs, from 11 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 |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
✅ No documentation update needed. Skipped: the |
|
Decision is not to backport this to release/17.0 |



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:
Started 1m ago (Nov 13, 2026, 11:03 AM), so it still contains the label (WCAG 2.5.3).Healthy (16s ago)), which previously repeated the status.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.FormatTooltipDateTimeuses 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:41in fr-FR,2026年11月11日 20:41in 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
Stressplayground. The "before" and "after" runs are from different times of the day, so ages and times differ.Validation
FormatHelpersTestscover 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.Clibuilds (it sharesFormatHelpers.cs).Checklist
<remarks />and<code />elements on your triple slash comments?