Address remaining PR #768 review comments for locale safety and selector correctness - #770
Merged
adubovikov merged 4 commits intoJun 2, 2026
Merged
Conversation
|
|
Hardcoded en-GB / en-US locales rendered dates the same way for every
viewer, ignoring the browser preference. Users whose locale uses ISO 8601
(e.g. sv-SE) had no way to see `2026-06-01` instead of `01/06/2026`.
Adds a LocaleProvider (mirrors ThemeProvider) backed by localStorage and
exposed under Settings → Profile → "Date & time format". The "Auto"
default resolves to `navigator.language`, so users with a Swedish
browser get ISO output without any configuration. The picker lists ~60
BCP-47 tags labelled via Intl.DisplayNames in the active locale. The
"Auto · <tag>" label always shows the real browser default rather than
the currently selected locale, so its meaning stays consistent
regardless of selection.
11 display formatters (MessageModal, TransactionModal, OTLP*,
QosPanel, ClockPanel, ResultsPanel, TimeRangePicker display, flow-data)
now read the locale from context and pass it to Intl.DateTimeFormat
instead of hardcoding `en-GB`. The cosmetic `.replace(',', '')` and the
`hour12: false` / `2-digit` overrides are dropped so the locale's
natural conventions apply; `fractionalSecondDigits: 3` is preserved
where it was (SIP packet timing).
Left untouched: `resolveTimeRange.ts` and `TimeRangePicker`'s input
formatter path. Those use `formatToParts` to read deterministic ISO
components for `<input type="datetime-local">` and timezone math — not
for display — so they keep the existing locale literal.
Copilot
AI
changed the title
[WIP] Fix code for all comments in review thread
Address remaining PR #768 review comments for locale safety and selector correctness
Jun 2, 2026
adubovikov
marked this pull request as ready for review
June 2, 2026 15:52
adubovikov
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR applies the unresolved Copilot review feedback from thread
#pullrequestreview-4408060524in PR #768, with minimal scoped changes. It hardens locale/time formatting paths and fixes edge-case rendering in the profile locale selector.Locale provider type and context contract
type LocalePref = "auto" | stringwith a non-widening union so"auto"remains a real sentinel in type narrowing.LocaleProviderContexttoLocaleProviderState | undefineddefaulting toundefined, souseLocale()correctly throws outsideLocaleProviderinstead of silently returning defaults.Date/time option precedence
withTimeZoneto always stripopts.timeZonefirst, then apply the function parameter.timeZoneargument is authoritative (including explicit"local"semantics) regardless of caller-supplied options.Profile locale selector unknown-value handling
LOCALE_TAGS(e.g., historical/manual values), so theSelectkeeps a visible selected item.Focused coverage for new behavior
useLocale()throwing outside provider,withTimeZonestripping/overriding existingopts.timeZone,