Repository navigation
Closed
Closed
Copy link
Labels
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.4.9-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #93447
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Windows 11 / Chrome, iPhone 13 / iOS 26.5, Samsung A52 / Android 14
App Component: Other
Action Performed:
Preconditions:
- Logged in to any user that has several expenses
- Navigate to Concierge chat or #admin rooms of a workspace Send this messsage to Concierge “make a VictoryChart that has an "As of: date and time" based on my timezone as the subtitle under the chart title for all expenses. Make it for Monthly spend, top categories, and top employees by spend”
- Wait for Concierge to reply with VIctoryChart displayed (note that the subtitle time doesn't matches to my timezone)
Steps:
- Change the timezone on Profile settings to America/Los_Angeles
- Open the Concierge chat message with a VictoryChart that has an As of:subtitle under the chart title (note that the subtitle time doesn't change, it's expected)
- Change the timezone in settings (I changed to Asia/Tokyo) and reopen the chat
Expected Result:
- in preconditions, the subtitle time in VictoryChart doesn't matches to my timezone
- in step 3, subtitle time should change
Actual Result:
- In preconditions, the subtitle time in VictoryChart that the Concierge made doesn't matches to my timezone
- in step 3, subtitle time doesn't change
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome Safari
Screenshots/Videos
Bug7183299_1781691271843.809050d9a22f5c96ea4d42e82f312978.mp4
Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7183299
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022067193353006487755
- Upwork Job ID: 2067193353006487755
- Last Price Increase: 2026-06-17
Metadata
Metadata
Assignees
Labels
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
Type
Projects
- StatusShow more project fieldsDone
Activity
applause-bot commentedon Jun 17, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/ae2614a3db64597a1b3c620c8ef035d23ec23fb0e66f336dfc376122432835ae
MelvinBot commentedon Jun 17, 2026
Issue Analysis
The Expected Result and Actual Result in this report are identical. Both say:
As written, the actual behavior matches the expected behavior, so there is no demonstrated discrepancy to fix. The reporter also notes in step 2 that the subtitle not changing is "expected". Before this can be actioned, we need to know what the correct behavior should be (i.e., should the "As of:" subtitle reflect/track the viewer's timezone, or not?).
Most likely the underlying concern: PR #93447 ("Use user timezone") added client-side localization so the chart's
As of:subtitle renders in the viewer's timezone. QA found it isn't taking effect for this AI-generated chart. The localizer is intentionally narrow and silently no-ops on text it can't parse:^As of:\s*(.+)$whose datetime parses against the server's fixed formatMMM d, yyyy [at] h:mm aa(parse formats).In this test, the user explicitly prompted Concierge to "make … an 'As of: date and time' based on my timezone as the subtitle." That subtitle is free-form text generated by the AI, not the deterministic UTC
As of:label the localizer expects. If the AI emits a different shape (full month name like "June", a baked-in timezone/offset, or a non-UTC time), it falls through the localizer untouched — which exactly explains "doesn't match my timezone" and "doesn't change when I switch timezones."Investigation details
VictoryChartCartesian.tsx:29,60-63andVictoryChartPolar.tsx:27,39-42passtimezone={timezone}and key the label on the timezone, so a timezone change does re-render and re-localize — when the text is parseable.VictoryChartLabel.tsx:33. The wiring is correct; the gap is the parse step rejecting non-server-format text.Confidence: Medium on the technical mechanism (I can't see the exact AI-generated subtitle string in the attached video to confirm the parse failure). High that the report as written shows no Expected/Actual discrepancy.
What's needed to proceed:
As of:subtitle be localized to the viewer's timezone, or is the current behavior acceptable?MMM d, yyyy at h:mm aUTC format, this is a server/Concierge content-format question (the chart subtitle is generated server-side), not a frontend rendering fix.Next Steps: Reply with
@MelvinBot <your feedback>to refine this analysis, or provide the captured subtitle text so I can confirm the parse path.David-2002065 commentedon Jun 17, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The
As of: ...subtitle of a Concierge VictoryChart is still rendered in UTC and does not get localized to / updated with the viewer's selected timezone, even after the fix in #93447.What is the root cause of that problem?
#93447 localizes the subtitle in
getLocalizedVictoryChartLabelText, which matches the label text againstApp/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Line 6 in 484f55f
and runs it against the whole label text here
App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Lines 38 to 55 in 484f55f
But a
<victorylabel>node is multi-line — the chart title and theAs of: ...subtitle are two lines of one node, with per-line styles, which is exactly whyVictoryChartLabelsplits on\nand indexes color/fontSize per line:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/components/VictoryChartLabel.tsx
Lines 33 to 34 in 484f55f
App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/parsers/victoryLabelParser.ts
Line 16 in 484f55f
So the real text is e.g.
Monthly spend\nAs of: Jun 5, 2026 at 06:47 PM.AS_OF_LABEL_PATTERNhas nom(multiline) flag, so^As of:only anchors to the start of the string, never to the start of the second line. The match fails, the function returns the original text unchanged, and the subtitle stays in UTC. The unit tests added in #93447 only feed single-line strings, so they pass while the real (title + subtitle) label never localizes.What changes do you think we should make in order to solve the problem?
We should localize the label line by line instead of treating the whole multi-line text as a single candidate, so only the
As of:line is rewritten while the title (and its per-line index alignment with the style arrays) is preserved. IngetLocalizedVictoryChartLabelText:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Lines 38 to 55 in 484f55f
The line count is unchanged, so the per-line
color/fontSize/fontWeightindices used inVictoryChartLabelkeep lining up.Alternatively, we can keep operating on the whole string but make the regex multiline and replace in place — add the
mflag (/^As of:\s*(.+)$/im) and usetext.replace(AS_OF_LABEL_PATTERN, ...)so only the matched line is swapped and the rest of the text is retained. The per-line.mapabove is cleaner and keeps the existing single-match parsing intact, so I'd lead with that.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Add a multi-line case to
localizeVictoryChartLabelText.test.ts(the gap that let this regress), e.g.getLocalizedVictoryChartLabelText('Monthly spend\nAs of: Jun 5, 2026 at 06:47 PM', 'Asia/Tokyo')should return'Monthly spend\nAs of: Jun 6, 2026 at 3:47 AM', confirming the title line is preserved and only theAs of:line is localized.What alternative solutions did you explore? (Optional)
Splitting the title and subtitle into two separate
<victorylabel>nodes on the server so each is single-line — but that's a server-side change and the client should be robust to multi-line labels regardless, so the client-side per-line fix is preferable.melvin-bot commentedon Jun 17, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @daledah (
External)x-dev90 commentedon Jun 17, 2026
Proposal
What is the root cause of that problem?
The VictoryChart label localization code only parses
As of:subtitles in theMMM d, yyyy at h:mm AM/PMformat.The actual QA recording for this issue shows the generated Concierge chart subtitle as
As of: 2026-06-16 00:00. That value is passed toVictoryChartLabel, which callsgetLocalizedVictoryChartLabelText()before rendering the Skia text. However,parseDateAsUTC()only tries these two formats:MMM d, yyyy hh:mm aaMMM d, yyyy h:mm aaVictoryChartLabelrewrites the label text at render time:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/components/VictoryChartLabel.tsx
Lines 30 to 34 in 034fac9
parseDateAsUTC()normalizes and parses only the human-readable formats:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Lines 9 to 29 in 034fac9
When parsing fails, the original text is returned unchanged:
App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Lines 48 to 54 in 034fac9
Because
2026-06-16 00:00does not match the supported parse formats, the helper returns the original UTC string. So changing the user timezone correctly re-renders the chart label path, but there is no localized value to render.What changes do you think we should make in order to solve the problem?
Extend the existing VictoryChart
As of:parser to support the DB-style UTC timestamp format that Concierge actually emits in the failing chart.Required changes:
yyyy-MM-dd HH:mm,yyyy-MM-dd H:mm,yyyy-MM-dd HH:mm:ss, andyyyy-MM-dd H:mm:sstoSERVER_AS_OF_PARSE_FORMATS.Date.UTC(...), so both old human-readable labels and DB-style labels are interpreted as UTC wall-clock values.2026-06-16 00:00.America/Los_AngelesandAsia/Tokyo.Tests to add:
parseDateAsUTC('2026-06-16 00:00')returns2026-06-16T00:00:00.000Z.parseDateAsUTC('2026-06-16 00:00:30')preserves seconds.getLocalizedVictoryChartLabelText('As of: 2026-06-16 00:00', 'America/Los_Angeles')returnsAs of: Jun 15, 2026 at 5:00 PM.getLocalizedVictoryChartLabelText('As of: 2026-06-16 00:00', 'Asia/Tokyo')returnsAs of: Jun 16, 2026 at 9:00 AM.PR #93447 already introduced the right rendering-layer approach: subscribe to the current user timezone and localize
victorylabeltext at render time. This proposal is not a duplicate because that implementation missed the actual Concierge subtitle format shown in the regression recording. The minimal root-cause fix is to keep the existing architecture and expand the parser to handle the emitted DB-style UTC timestamp.What alternative solutions did you explore? (Optional)
[-]93447 - Concierge - Timezone in VictoryChart not updated to user’s timezone[/-][+][$250] 93447 - Concierge - Timezone in VictoryChart not updated to user’s timezone[/+]melvin-bot commentedon Jun 17, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022067193353006487755
godzillaxbox19982014-lgtm commentedon Jun 17, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
93447 - Concierge - Timezone in VictoryChart not updated to user’s timezone
What is the root cause of that problem?
I traced this to the path that handles
VictoryChart:parseStyles):const {nodeStyles: chartContentStyles, parentNodeStyles: chartContainerStyles} = parseStyles(tnode);VictoryChartContext):chartContentStyles: ReturnType<typeof parseStyles>['nodeStyles'];VictoryChartContext):chartContainerStyles: ReturnType<typeof parseStyles>['parentNodeStyles'];src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/context/VictoryChartContext.tsx:37andsrc/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/context/VictoryChartContext.tsx:20do not agree on the sameVictoryChartvalue, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.What changes do you think we should make in order to solve the problem?
src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/context/VictoryChartContext.tsx:37to deriveVictoryChartfrom the matched app state path that owns this flow before the value is consumed.src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/context/VictoryChartContext.tsx:20; that follows the safer family move to thread the chart point URL/query/tooltip payload into the rendered bar/segment, so the write/optimistic/read paths agree instead of only changing the visible component.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
tests/**/*Chart*.tsfor the exact issue flow: 93447 - Concierge - Timezone in VictoryChart not updated to user’s timezone.src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/context/VictoryChartContext.tsx:37so valid existingVictoryChartbehavior still works.What alternative solutions did you explore? (Optional)
VictoryChartconsistent at the first read/write boundary shown above.aswin-s commentedon Jun 17, 2026
Please re-state the problem that we are trying to solve in this issue.
When Concierge renders a VictoryChart with an "As of: [date and time]" subtitle, the displayed time does not match the user's profile timezone — both on initial render and after changing the timezone in Profile settings. The expected behavior is that the subtitle shows the datetime converted to the user's currently selected timezone.
What is the root cause of that problem?
In
src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts, the functionparseDateAsUTC(lines 15–32) is supposed to interpret the server-supplied datetime string as UTC before re-formatting it in the user's profile timezone. It does so in two steps:parse(normalizedText, formatStr, new Date())fromdate-fns, which has no timezone awareness — it treats the numeric fields (hour, minute, etc.) as belonging to the device's local timezone, producing aDatewhose internal epoch already reflects the device offset.Date.UTC(parsed.getFullYear(), parsed.getMonth(), parsed.getDate(), parsed.getHours(), parsed.getMinutes(), parsed.getSeconds()).Because
parsed.getHours()(and the other getters) return local values, not UTC values, step 2 re-interprets those local components as if they were UTC. This bakes the device's UTC offset into the epoch a second time — the UTC anchor fed intoDateUtils.formatInTimeZoneWithFallbackis therefore wrong by exactly the device's UTC offset, so the final display value is off by that amount regardless of which user timezone is selected.What changes do you think we should make in order to solve the problem?
localizeVictoryChartLabelText.ts—parseDateAsUTC: Replace the two-step parse-then-reconstruct approach withtoDatefromdate-fns-tz, passing{timeZone: 'UTC'}so the numeric fields in the server string are treated as UTC from the start. This avoids the device-local interpretation thatdate-fns/parseintroduces and produces a correct UTC epoch directly.date-fns-tzis already present in the Expensify codebase (used elsewhere for timezone-aware formatting), so no new dependency is required.localizeVictoryChartLabelText.ts—SERVER_AS_OF_PARSE_FORMATS: The display format constantCHART_DISPLAY_FORMATusesCONST.DATE.LOCAL_TIME_FORMATwhich is'h:mm a'(singlea). The parse formats use'aa'(double). Align the parse format suffix to'a'to match the server'sh:i APHP format and the display constant.VictoryChartCartesian.tsxandVictoryChartPolar.tsx: No change needed — both already passtimezonefromuseCurrentTimezone()down toVictoryChartLabel, and the key includestimezoneto force re-render on timezone change. The fix is entirely inlocalizeVictoryChartLabelText.ts.What alternative solutions did you explore? (Optional)
An alternative is to keep
date-fns/parsebut replace theDate.UTC(...)reconstruction withparsed.getTime(). This removes the double-encoding of the device offset, but it does not fully fix the problem:date-fns/parsestill interprets the server string in device-local time, soparsed.getTime()is itself device-offset-dependent. On a device set to UTC+0 the result happens to be correct, but on any other device the UTC anchor is still wrong. Usingdate-fns-tz/toDatewith{timeZone: 'UTC'}is the correct approach because it neutralizes the device timezone at parse time rather than at reconstruction time.10 remaining items
Abdulloh0109 commentedon Jun 17, 2026
What is the root cause of that problem?
PR #93447 localizes the
As of:subtitle at render time, but the localizer never actually rewrites this chart's subtitle. The video shows the subtitle rendering as raw server text —As of: 2026-06-16 00:00— i.e. an un-localized UTC value inyyyy-MM-dd HH:mm(24-hour) format. There are two independent defects ingetLocalizedVictoryChartLabelText, each of which alone is enough to make it a no-op:1. The parser doesn't recognize the format the server actually emits (the certain, observed cause).
parseDateAsUTConly attempts two formats, both 12-hour with a month name and AM/PM:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Line 10 in 484f55f
The server actually emits
2026-06-16 00:00(yyyy-MM-dd HH:mm).parse()againstMMM d, yyyy [h]h:mm aareturns an Invalid Date,isValidis false for both formats, soparseDateAsUTCreturnsnull:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Lines 21 to 31 in 484f55f
getLocalizedVictoryChartLabelTextthen bails and returns the original text unchanged:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Lines 48 to 51 in 484f55f
So the subtitle keeps the raw UTC string forever. That's both reported symptoms in one chain: it never matches the user's timezone on first render, and changing the timezone in settings changes nothing because the parse step always fails and the localization branch is never reached. (For reference, a successful localization would render
MMM d, yyyy 'at' h:mm a— e.g.Jun 16, 2026 at 12:00 AM— andLOCAL_TIME_FORMATis'h:mm a'. The on-screen2026-06-16 00:00matches neither the parse format nor the output format, confirming it's untouched server text.)2. The match is anchored to the whole string, but title + subtitle are one multi-line label.
In this chart "Monthly spend" and "As of: …" are a single multi-line
<victorylabel>node (line 0 = bold title, line 1 = muted subtitle — the per-linecolor/fontSize/fontWeightarrays onLabelItemexist exactly for this, and the component renders them afterdisplayText.split('\n')). But the localizer runs on the whole string before that split:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/components/VictoryChartLabel.tsx
Lines 33 to 34 in 484f55f
and the regex is anchored to the start of the entire string with no
mflag:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Line 6 in 484f55f
App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Lines 43 to 46 in 484f55f
For
"Monthly spend\nAs of: …",^resolves to"Monthly spend", so theAs of:line (line 1) never matches. Even if the format were fixed, this would still bail out. And the success branch returns`As of: ${localizedDate}`— discarding every other line — so a single-line rewrite would also drop the title:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Line 54 in 484f55f
Both defects must be fixed for localization to work for a real title/subtitle chart. Reactivity is fine —
useCurrentTimezone→useCurrentUserPersonalDetailsreadsPERSONAL_DETAILS_LISTviauseOnyxand the label is re-keyed ontimezone, so the component does re-render on a timezone change; there is just nothing to recompute.What changes do you think we should make in order to solve the problem?
Two changes, both in the util layer (
localizeVictoryChartLabelText.ts):Parse the format the server actually sends. Add the real server format(s) to
SERVER_AS_OF_PARSE_FORMATS—yyyy-MM-dd HH:mm(andyyyy-MM-dd HH:mm:ssif seconds appear). The existingDate.UTC(...)reconstruction andformatInTimeZoneWithFallbackoutput path are fine onceparseDateAsUTCreturns a valid date. Confirm against actual Concierge output whetherMMM d, yyyy at h:mm AMis ever emitted; if not, the 12-hour formats can be dropped, but keeping both is harmless.Localize per line, not per whole label. In
getLocalizedVictoryChartLabelText,text.split('\n'), run theAs of:match + reformat on each line, andjoin('\n'). Only the matching line is rewritten; the title line (and its line-indexed styles) is preserved. Anchoring with^…$is then correct per line, so them-flag ambiguity disappears. Keep the per-line guards (no timezone / unparseable → return the line unchanged).No change needed in
VictoryChartLabel/VictoryChartCartesian— they already pass and re-key ontimezone. Edge cases touched: standaloneAs of:labels still localize, the title line is preserved, and offline still works (purely client-side).What alternative solutions did you explore? (Optional)
<victorylabel>attribute and format it fully client-side. This is structurally the better fix — parsing a human-facing display string back into aDateand guessing its format is exactly what broke here. I'd lean toward this long-term, but it's a server change, so the client-side parse fix above is the immediate one.mflag toAS_OF_LABEL_PATTERN. Rejected: it fixes detection on multi-line labels but the success branch (#L54) still returns onlyAs of: …and drops the title, and it does nothing about the format mismatch — the parse would still fail on2026-06-16 00:00.useCurrentUserPersonalDetailssubscribes toPERSONAL_DETAILS_LISTthroughuseOnyxand the label is re-keyed ontimezone; if reactivity were the cause the first render would already be localized, which contradicts the observed raw2026-06-16 00:00.KJ21-ENG commentedon Jun 17, 2026
Updated my proposal — root cause is the As-of parser rejecting no-year/trailing-PT Concierge chart labels, not multiline label placement.
oqildev commentedon Jun 17, 2026
Proposal
What is the root cause of that problem?
PR #93447 ("Use user timezone") added render-time localization for the chart
As of:subtitle, but it parses against a datetime shape the server never sends, so parsing fails on every real label and the subtitle is rendered verbatim.The wiring is fine.
VictoryChartLabelruns the text through the localizer on every render at VictoryChartLabel.tsx#L30, and the timezone is keyed into the label so a profile-timezone change forces a re-render at VictoryChartCartesian.tsx#L44-L46. So this is not a stale/missing re-render — the localizer just keeps returning the input unchanged.The break is in the parser.
parseDateAsUTConly accepts a year-bearing, zone-less string via these two formats at localizeVictoryChartLabelText.ts#L9-L10:The author's own comment on that line says it targets
EXP_CHAT_COMMENT_DATETIME(M j, Y \a\t h:i A), i.e.May 6, 2026 at 12:49 PM. But that's the wrong server constant. The string the chart renderer actually emits is at monthly-spend.xml#L2-L3:No year, no
at, and a trailing timezone abbreviation (PT).AS_OF_LABEL_PATTERN(L6) matches and handsparseDateAsUTCthe valueMay 6, 12:49 PM PT. The format expects a 4-digit year right where the string has12:49, and there's a trailingPTno token consumes — sodate-fns/parsereturns Invalid Date for both formats,isValidis false, andparseDateAsUTCreturnsnull(L15-L32). Onnull, the localizer returns the original text untouched (L48-L51).That single no-op explains both reported symptoms: the precondition subtitle never matches the viewer's timezone (it's the server's pre-baked PT value), and switching profile timezones re-renders but re-runs the same failing parse, so nothing changes.
There's a second defect stacked behind the first, even once the format matches: the string is in Pacific (
PT), butparseDateAsUTCanchors the wall-clock as UTC viaDate.UTC(...)(L28). The PR body states the labels are "emitted by the server as UTC wall-clock text" — that premise is wrong; the server emits a zoned, labeled time. Anchoring12:49 PMas UTC instead of PT yields an instant off by the PT offset (~7–8h).The unit tests are green because they assert against the invented format, not the real one — e.g.
parseDateAsUTC('Jun 5, 2026 at 06:47 PM')at localizeVictoryChartLabelText.test.ts#L5-L8. Nothing in the suite feeds a year-less,PT-suffixed string, so the test pass and the production no-op coexist.What changes do you think we should make in order to solve the problem?
Fix layer is the parser util
localizeVictoryChartLabelText.ts— the render and timezone plumbing are already correct.MMM d, h:mm aaplus a trailing zone token), notMMM d, yyyy .... Capture the trailing zone abbreviation separately, and since the string carries no year, default it to the current year before constructing the instant.PT→ America/Los_Angeles) instead ofDate.UTC(...), then hand that instant toDateUtils.formatInTimeZoneWithFallbackin the viewer's timezone.PTis ambiguous between PDT/PST — resolving it via the zone (not a fixed offset) keeps DST correct.CHART_DISPLAY_FORMATdrops it and re-adds a year. Whoever picks this up should confirm with the issue owner whether the localized subtitle keeps a zone label. Minor, but it's a visible product decision baked into the format string.As of: May 6, 12:49 PM PT) and assert it localizes differently for, say,America/Los_AngelesvsAsia/Tokyo. That's the exact gap that let this ship green.No offline/optimistic concerns — this is pure client-side render formatting.
What alternative solutions did you explore? (Optional)
Make the server emit a machine-readable instant (recommended structural fix, deferred as it's a server change). Have the chart renderer add an unambiguous attribute to the
<victorylabel>node (e.g. a UTC ISO timestamp likeasof="2026-05-06T19:49:00Z") and have the client format that into the viewer's zone. This removes string parsing entirely and kills three fragilities at once:PTbeing ambiguous between PDT/PST, month names being locale-dependent, and the guessed-year problem. I'd prefer this long-term, but it's out of this repo and the bounty is an App fix, so I lead with the client parser.Multi-line regex fix (
/^As of:.../im+ per-line map), proposed by others. Rejected: it solves a node shape the server doesn't produce here. The title and theAs of:subtitle are separate single-line<victorylabel>nodes — monthly-spend.xml#L2 (title) vs #L3 (As of:).^As of:already matches the subtitle node fine; themflag changes nothing because the parse, not the regex, is what fails.Double-encoded device offset, proposed by others. Rejected:
parse()sets local wall-clock components andDate.UTC()reads those same local getters back, so the device offset cancels —parseDateAsUTC('Jun 5, 2026 at 06:47 PM')returns2026-06-05T18:47:00.000Zon any device, which is exactly what the PR's own passing test asserts. The fault isn't a wrong offset on a successful parse; it's that the parse never succeeds for the string the server actually sends.github-actions commentedon Jun 17, 2026
abbasifaizan70 commentedon Jun 17, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
Proposal
Please re-state the problem that we are trying to solve in this issue.
The "As of: …" subtitle on a Concierge
VictoryChartis not shown in the viewer's timezone, and it does not update when the viewer changes their profile timezone and reopens the chat. After PR #93447 it should re-localize on every timezone change.What is the root cause of that problem?
PR #93447 tries to re-localize the subtitle by reverse-parsing the already-rendered display string back into an instant, then reformatting it. That only works if the displayed string exactly matches one assumed format; otherwise the function returns the text untouched, so the subtitle never tracks the viewer timezone.
The accepted formats are a hard-coded two-item list, both year-bearing with a month name and AM/PM, so anything shaped differently can't match:
App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Lines 9 to 10 in 484f55f
parseDateAsUTCtries only those formats and, even on success, anchors the wall-clock fields as UTC — so a zone-qualified value (e.g.… PT) would resolve to the wrong instant even if it did parse:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Lines 15 to 32 in 484f55f
When the parse fails it silently falls back to the original text, which is why nothing changes on a timezone switch:
App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Lines 48 to 54 in 484f55f
But the chart renderer emits the subtitle as a human-readable string with no year and a trailing timezone abbreviation (its own separate node), which neither parse format can match:
App/server/victory-chart-renderer/tests/fixtures/monthly-spend.xml
Line 3 in 484f55f
The deeper, structural cause is that the absolute instant is never carried to the client in machine-readable form. The parser only reads the display string into
text:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/parsers/victoryLabelParser.ts
Line 16 in 484f55f
…and the component can only try to re-derive the instant by reverse-parsing that display string on every render:
App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/components/VictoryChartLabel.tsx
Line 33 in 484f55f
Because this subtitle is authored by Concierge from the user's free-form prompt, its shape and its source timezone are not guaranteed — it may be year-less with a
PTsuffix (the fixture above), or a DB-style2026-06-16 00:00, etc. No finite list ofparseformats can reliably recover the instant, and any format that does parse a zone-qualified value (e.g.… PT) and anchors it as UTC produces the wrong instant. So the problem is not a single missing format string; it is that re-deriving an absolute time from a localized display string is lossy and unreliable.What changes do you think we should make in order to solve the problem?
Carry the instant to the client in an unambiguous, machine-readable attribute and format that in the viewer's timezone, instead of reverse-parsing the human display string. Keep the existing string-parsing path only as a fallback for labels that don't carry the attribute.
<victorylabel>node (alongside the existing humantext), e.g.asof="2026-05-06T19:49:00Z". Current node, for reference:App/server/victory-chart-renderer/tests/fixtures/monthly-spend.xml
Line 3 in 484f55f
LabelItemtype — add the optional field next totext. Original:App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/types.ts
Lines 81 to 82 in 484f55f
App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/parsers/victoryLabelParser.ts
Lines 13 to 25 in 484f55f
App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts
Lines 38 to 55 in 484f55f
App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/components/VictoryChartLabel.tsx
Line 30 in 484f55f
App/src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/components/VictoryChartLabel.tsx
Line 33 in 484f55f
Why this fixes it: the instant no longer has to be guessed from a localized, AI-authored display string.
timezoneis already passed intoVictoryChartLabeland keyed so the label re-renders on a profile-timezone change; with a real instant in hand, that re-render now produces a correctly localized value every time. Labels without the attribute keep their current behavior, so nothing else regresses.Tests to add:
getLocalizedVictoryChartAsOfText('2026-05-06T19:49:00Z', 'As of: May 6, 12:49 PM PT', 'America/Los_Angeles')and'Asia/Tokyo'localize to different values; a missing/invalidasOfreturns the originaltext; and a<victorylabel asof="…">fixture flows throughparseVictoryLabelNode→VictoryChartLabel.What alternative solutions did you explore? (Optional)
Date.UTC. This avoids a renderer change but stays brittle — it must keep guessing formats and source zones for text an LLM writes freely, and a zone-qualified value parsed wrong silently mislocalizes. It treats the symptom (missing format) rather than the cause (the instant isn't carried).<victorylabel>nodes, so a multiline fix would not makeAs of: May 6, 12:49 PM PTparseable.asofattribute: equally unambiguous; ISO-8601 UTC is chosen for readability and becausenew Date(iso)needs no extra parsing.github-actions commentedon Jun 17, 2026
abbasifaizan70 commentedon Jun 17, 2026
@daledah This isn't a duplicate of the referenced proposal. That proposal's root cause is that the parser uses the wrong date format, and its fix stays entirely within localizeVictoryChartLabelText.ts (keep parsing the display string, but strip the timezone, default the year, and re-anchor). My root cause is different: the absolute instant is never sent to the client in machine-readable form, and because the subtitle is AI-authored free-form text, no finite set of parse formats can ever be reliable — the reverse-parse round-trip itself is the defect. My fix removes string parsing for these labels entirely by carrying a structured asof (UTC ISO-8601) attribute through victoryLabelParser.ts → LabelItem → VictoryChartLabel, files the other proposal never touches. The referenced proposal only names a machine-readable timestamp as a one-line alternative; it doesn't adopt it as the solution or wire it through the parsing pipeline.
sandipanghos commentedon Jun 17, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
github-actions commentedon Jun 17, 2026
sandipanghos commentedon Jun 17, 2026
Proposal
What is the root cause of that problem?
A Victory chart packs its title and the "As of: …" subtitle into one multi-line label, but NewDot's localizer only recognizes "As of:" when it's a single-line, standalone label. So on a real chart the "As of:" line sits on the second line of the title label, the localizer doesn't recognize it, and it returns the text untouched — the viewer's timezone is never applied, and never updates.
Primary Root Cause —
src/components/HTMLEngineProvider/HTMLRenderers/VictoryChartRenderer/utils/localizeVictoryChartLabelText.ts:6+:43-46(anchored, non-multiline match against the entire label):Why it bites:
VictoryChartLabel.tsx:30passes the full label to the localizer before splitting into lines (displayText.split('\n')), and the labeltextis one attribute (victoryLabelParser.ts:16). So a "title on line 1 /As of:on line 2" label — which is what "subtitle under the chart title" means — fails the^As of:anchor and is returned verbatim. The date never reachesparseDateAsUTC.Secondary Root Cause — same file,
:53-54. Even if the match did fire on a multi-line label, the function rebuilds the label from only the "As of" line:So a naive "just add the
mflag" fix would localize the time but erase the chart title. The function assumes the label is "As of"-only.Affected Files
…/utils/localizeVictoryChartLabelText.ts:6, 43-46, 53-54— whole-string anchored match + whole-string rebuild; both assume a single-line "As of"-only label.…/components/VictoryChartLabel.tsx:30(localize-then-split('\n'));…/parsers/victoryLabelParser.ts:16(label text is one attribute).Affected Component(s): VictoryChart HTML renderer — "As of" label localization.
Bug Category: wrong-assumption-about-input-shape (single-line vs multi-line) + regex-anchoring defect.
Mechanism: Concierge emits
<victorylabel text="Monthly spend\nAs of: Jun 5, 2026 at 06:47 PM">→victoryLabelParser.ts:16stores it as onetext→VictoryChartLabel.tsx:30callsgetLocalizedVictoryChartLabelText(text, timezone)on the full string →/^As of:/i(:6) doesn't match (title is on line 1) →:44-46returns text unchanged → user sees Concierge's un-localized time, frozen across timezone changes.What changes do you think we should make in order to solve the problem?
Fix Option 1 (Recommended) — localize per line, preserving the rest of the label.
localizeVictoryChartLabelText.ts:38-54.Why best: directly removes the cause (the subtitle is now recognized wherever it sits in the label) and fixes the title-erasure trap in one change. Contained to one util; no server change needed.
Fix Option 2 (Alternative) — have Concierge emit the "As of:" subtitle as its own standalone
<victorylabel>(separate from the title), so the existing single-line matcher works. Trade-off: needs a Concierge/server change and every old chart in history stays broken; doesn't fix the App's fragility.Revert Option: revert the ~2026‑06‑12 localizer. Removes the half-fix but restores the original always-wrong-zone behavior — not ideal.
Alternate fix (rejected): just add the
m(multiline) flag to the regex. Rejected — it would match the second line but:53-54still rebuilds the label from only the "As of" line, deleting the title. Half-fix that creates a worse bug.What alternative solutions did you explore? (Optional)
mflag — matches the line but still erases the title (rejected above).Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
github-actions commentedon Jun 17, 2026
sandipanghos commentedon Jun 17, 2026
Proposal
[Updated](link to proposal)
luacmartins commentedon Jun 19, 2026
This is working as expected. The date format in the OP is incorrect.