Skip to content

Shrink VirtualCFO horizontal chart's left-axis padding to fit label width#95995

Merged
luacmartins merged 12 commits into
mainfrom
cmartins-updatePadding
Jul 16, 2026
Merged

Shrink VirtualCFO horizontal chart's left-axis padding to fit label width#95995
luacmartins merged 12 commits into
mainfrom
cmartins-updatePadding

Conversation

@luacmartins

@luacmartins luacmartins commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Horizontal bar charts (e.g. "Top employees by spend") hardcode padding.left to 150px for the category-axis labels.

This PR measures the widest rendered label via Skia glyph widths and adjusts the label area accoridngly.

Fixed Issues

$ #95434

Tests

Pre-condition: an admin account with expenses on the previous month

VirtualCFO report

  1. Navigate to https://www.expensify.com.dev/_support/agentZeroSandbox
  2. Get a VIrtualCFO report
  3. Verify that the vertical bar chart labels are properly positioned.

Headless rendering

  1. Run cd server/victory-chart-renderer && bun test tests/render.test.ts and confirm all golden-PNG fixtures pass, including the two updated (top-employees-by-spend, top-employees-by-spend-truncated-labels) and the unrelated vertical-chart fixture (monthly-spend), which is byte-identical to its unchanged golden.
  2. Build the renderer (bun run scripts/build.ts --target --outfile /tmp/vcr) and render tests/fixtures/top-employees-by-spend.xml with short 2-3 character placeholder names.
  3. Confirm the bars start further left than the original 150px-padding render, with no label clipped.
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

Same as tests

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected) — verified the vertical-chart (dependent-axis) path is unaffected via its unchanged golden render.
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow. — covered via the updated golden-image fixtures in server/victory-chart-renderer/tests/__golden__/.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Screenshot 2026-07-13 at 3 36 33 PM

Android: Native
N/A

Android: mWeb Chrome
N/A

iOS: Native
N/A

iOS: mWeb Safari
N/A

MacOS: Chrome / Safari
N/A

…idth

Employee-name labels on the left axis of Concierge-generated horizontal
bar charts reserve a fixed 150px regardless of content, wasting bar
space for short names. The configured padding.left now acts as a max
that shrinks to the actual measured label width when smaller.
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
...er/HTMLRenderers/VictoryChartRenderer/constants.ts 100.00% <100.00%> (ø)
...erers/VictoryChartRenderer/utils/resolvePadding.ts 75.00% <75.00%> (ø)
...ryChartRenderer/parsers/processVictoryChartTree.ts 73.21% <66.66%> (-1.79%) ⬇️
...rs/VictoryChartRenderer/utils/getFontGlyphWidth.ts 0.00% <0.00%> (ø)
.../VictoryChartRenderer/parsers/victoryAxisParser.ts 71.42% <33.33%> (-14.29%) ⬇️
... and 47 files with indirect coverage changes

The XML's tickLabels.padding can set an arbitrarily large gap between
the label and the chart; clamp it so labels never sit further than
16px from the bars they label.
@luacmartins luacmartins requested a review from a team July 14, 2026 18:30
@luacmartins luacmartins marked this pull request as ready for review July 14, 2026 18:30
@luacmartins luacmartins requested review from a team as code owners July 14, 2026 18:30
@melvin-bot melvin-bot Bot requested review from lakchote and trjExpensify and removed request for a team July 14, 2026 18:30
@melvin-bot

melvin-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

@lakchote Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot Bot removed the request for review from a team July 14, 2026 18:31

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 386bbed577

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

When tickValues is longer than tickFormat, the unformatted ticks
render via String(label) fallback but were excluded from the width
measurement, letting padding.left shrink below what a wide fallback
label needs.
@luacmartins luacmartins requested a review from situchan July 14, 2026 20:16
domain: CartesianChartProps['domain'];
domainPadding: CartesianChartProps['domainPadding'];
padding: CartesianChartProps['padding'];
/** Pixel width the left y-axis actually needs for its widest label, used to shrink `padding.left` when it's larger than the content requires. */

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.

NAB: I don't think a block style comment is needed here

Suggested change
/** Pixel width the left y-axis actually needs for its widest label, used to shrink `padding.left` when it's larger than the content requires. */
// Pixel width the left y-axis actually needs for its widest label, used to shrink `padding.left` when it's larger than the content requires.

@shawnborton

Copy link
Copy Markdown
Contributor

Screenshot above seems good to me 👍

@shawnborton

Copy link
Copy Markdown
Contributor

Though I bet you could still reduce this gap between the label and the chart just slightly, by like 4-8px:
CleanShot 2026-07-15 at 09 36 32@2x

@luacmartins

Copy link
Copy Markdown
Contributor Author

@shawnborton reduced the gap
Screenshot 2026-07-15 at 10 41 06 AM

@situchan

Copy link
Copy Markdown
Contributor

Bun tests failing

@luacmartins

Copy link
Copy Markdown
Contributor Author

@situchan fixed

@shawnborton

Copy link
Copy Markdown
Contributor

Thanks!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2f0c471ce

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +107 to +109
if (childResult.leftAxisLabelPadding !== undefined) {
leftAxisLabelPadding = childResult.leftAxisLabelPadding;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the widest left-axis label measurement

When a horizontal chart supplies multiple left-side y-axis configurations, this assignment overwrites the earlier measurement with the last axis encountered. yAxis is intentionally accumulated as an array in the same traversal, so a later axis with shorter labels can make resolvePadding() shrink padding.left below the width required by an earlier axis, clipping that axis's labels. Retain the maximum measured width instead of the last value.

Useful? React with 👍 / 👎.

@MelvinBot

Copy link
Copy Markdown
Contributor

Review

Overall this looks clean and well-scoped — the measure-and-shrink approach is a solid replacement for the hardcoded 150px, the code is nicely factored into small pure helpers, and the doc comments explain the why. No blocking issues. A few notes below, mostly non-blocking.

Suggestions

1. Add a unit test for resolvePadding (non-blocking, but easy win).
The new clamp/min logic is only exercised through the golden PNGs. There's already a fast parser unit-test suite (VictoryChartParsers.test.ts), and resolvePadding is pure and font-free — trivial to cover the three branches (undefined label padding, non-object padding, and the Math.min shrink). A cheap regression guard for the core arithmetic that golden images don't localize well.

2. Constant naming collision (readability).
LEFT_AXIS_LABEL_PADDING (the constant 32px edge buffer) reads almost identically to the computed leftAxisLabelPadding field (the measured label content width). They mean very different things. Consider renaming the constant to something like LEFT_AXIS_LABEL_EDGE_BUFFER to avoid confusion for the next reader.

3. Numeric padding is silently skipped.
resolvePadding only shrinks when padding is an object with a numeric .left — a uniform numeric padding falls through unchanged (resolvePadding.ts:12). That's fine for the VirtualCFO charts (they use the object form with left: 150), just flagging that the shrink is a no-op for the numeric-padding shape in case a future chart hits it.

Things I checked that look correct

Details
  • undefined doesn't clobber a set value. Both merge sites guard with if (result.leftAxisLabelPadding !== undefined) (processVictoryChartTree.ts:54, :107), so a right-oriented y-axis returning undefined won't overwrite a left axis's measured width.
  • Measurement matches what's rendered. computeLeftAxisLabelPadding is fed resolvedLabelOffset (the same clamped offset applied to the axis via labelOffset:), and labelsForMeasurement = tickValues?.map(formatLabel) ?? tickFormat mirrors the labels victory-native actually draws (victoryAxisParser.ts:87-102).
  • resolvePadding runs at every recursion return but is idempotent. Math.min means re-application is harmless; it only does meaningful work at the root where both padding (from the chart node) and leftAxisLabelPadding (from an axis child) coexist.
  • Only shrinks, never grows (Math.min). If a label is wider than the configured left, padding stays put and clipping behavior is unchanged from before — consistent with the goal and with the top-employees-by-spend-truncated-labels fixture.
  • Vertical (dependent-axis) path is untouched, matching the PR's claim that monthly-spend golden is byte-identical.

Not a substitute for a human review — please still get eyes from a reviewer before merging.

@MelvinBot

Copy link
Copy Markdown
Contributor

Regression scan

No confirmed regressions. The change is correctly scoped to horizontal bar charts with a left y-axis, and the unchanged golden images prove nothing else moved. Two edge cases are worth a look before merge (both low-likelihood).

What I checked (and why it's safe)
  • Blast radius is bounded. Only the two horizontal goldens changed (top-employees-by-spend.png, top-employees-by-spend-truncated-labels.png). The vertical monthly-spend and all top-categories goldens are byte-identical, and those fixtures are not horizontal — so vertical/column charts and dependent-axis rendering are provably untouched.
  • No raw-vs-resolved padding mismatch. padding.left is shrunk once in processVictoryChartTree.ts:128, and every downstream consumer reads that same resolved value — the context destructures it from the final result (VictoryChartContext.tsx:40) and it's passed straight to CartesianChart (VictoryChartCartesian.tsx:58). No parser reads the pre-resolved rootProcessedResult.padding, so overlay/value labels can't drift out of alignment.
  • Height is unaffected. computeDynamicChartHeight only reads padding.top/padding.bottom, never left.
  • Math.min never grows padding, so the worst case is the prior (pre-PR) padding — it can't push labels off-canvas.
  • Type change is complete. leftAxisLabelPadding was added as a required field and both ProcessNodeResult construction sites were updated; the undefined-guarded merges prevent a right-axis's undefined from clobbering a left-axis value.

Edge cases to sanity-check

1. Offset clamp is unconditional, but the padding shrink is not — they can disagree.
The label-offset clamp to LEFT_AXIS_LABEL_OFFSET_MAX (2px) is applied to every left horizontal axis (victoryAxisParser.ts:87), but the compensating padding.left shrink only fires when padding is an object with a numeric left (resolvePadding.ts:12). So a horizontal-left chart with a uniform numeric padding (or none) would get its labels yanked tight to the axis (offset 2) while padding.left stays large — a big empty gap between labels and bars, arguably worse than today. The VirtualCFO fixtures use object padding so this isn't hit in tests, but the two mechanisms should probably share the same guard.

2. No golden coverage for other horizontal charts. Only top-employees-* exercise the horizontal-left path. Any other horizontal bar chart the report emitter can produce (e.g. a "top vendors"-style chart) gets the same offset-clamp + shrink with no regression guard. Worth a quick manual check against a real VirtualCFO report that renders more than just top-employees, since the golden set won't catch a surprise there.

Neither is a blocker — flagging for a look, not a fix demand.

This is an automated scan, not a substitute for human review.

@situchan

situchan commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
android.mov
Android: mWeb Chrome
iOS: HybridApp
ios.mov
iOS: mWeb Safari
MacOS: Chrome / Safari web

@situchan

Copy link
Copy Markdown
Contributor

It would be good to have some space at the left edge. Not blocker as happening on production.

web

production:
web-production

@shawnborton

Copy link
Copy Markdown
Contributor

Totally agree

@melvin-bot melvin-bot Bot requested a review from blimpich July 16, 2026 16:13
@melvin-bot

melvin-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

@blimpich Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@luacmartins

Copy link
Copy Markdown
Contributor Author

@situchan I don't get that issue anymore (don't mind the messed up bars, I'm fixing that in a separate PR)
Screenshot 2026-07-16 at 11 58 29 AM

@luacmartins luacmartins merged commit d769fd5 into main Jul 16, 2026
43 of 44 checks passed
@luacmartins luacmartins deleted the cmartins-updatePadding branch July 16, 2026 17:59
@github-actions

Copy link
Copy Markdown
Contributor

🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here.

@situchan

Copy link
Copy Markdown
Contributor

@luacmartins please test with this data. Still reproducible on main (after this PR merged)

const longName = 'sdf jskljf slkdjfklsjkflsjdklfjsk jlfjsd kljfskj fksljdfjskldfjsjd klsjjlfksdkj fskljkfjkljs';
const html8 = `<victorychart horizontal domain="{y: [0, 18000]}" domainpadding="{x: 44, y: 16}" height="464" width="680" padding="{top: 92, bottom: 84, left: 150, right: 32}" style="{ parent: { backgroundColor: '#F8F4F0', borderRadius: 16, width: '100%', maxWidth: 680, }, }" categories="{x: ['Ethan Brooks', 'Sofia Ramirez', '${longName}']}"><victorylabel x="32" y="40" text='Top employees by spend' style="{ fill: '#002E22', fontSize: 17, fontWeight: 700, fontFamily: 'Expensify Neue', }"/><victorylabel x="32" y="62" text='As of: May 6, 2026 12:49 PM' style="{ fill: '#76847E', fontSize: 11, fontWeight: 400, fontFamily: 'Expensify Neue', }"/><victoryaxis tickValues="[0,1,2]" tickformat="['Ethan Brooks', 'Sofia Ramirez', '${longName}']" style="{ axis: {stroke: 'transparent'}, ticks: {stroke: 'transparent'}, grid: {stroke: 'transparent'}, tickLabels: { fill: '#76847E', fontSize: 11, fontWeight: 500, fontFamily: 'Expensify Neue', padding: 24, }, }"/><victoryaxis dependentaxis tickvalues="[0, 3000, 6000, 9000, 12000, 15000, 18000]" tickformat="['$0', '$3,000', '$6,000', '$9,000', '$12,000', '$15,000', '$18,000']" style="{ axis: {stroke: 'transparent'}, ticks: {stroke: 'transparent'}, grid: {stroke: '#E6E1DA', strokeWidth: 1}, tickLabels: { fill: '#76847E', fontSize: 11, fontWeight: 500, fontFamily: 'Expensify Neue', padding: 8, }, }"/><victorygroup horizontal offset="18"><victorybar barwidth="16" cornerradius="{top: 8, bottom: 0}" style="{data: {fill: '#13C96B'}}" data="[ {x: 'Ethan Brooks', y: 9450}, {x: 'Sofia Ramirez', y: 10500}, {x: '${longName}', y: 11900}]"/><victorybar barwidth="16" cornerradius="{top: 8, bottom: 0}" style="{data: {fill: '#1E90F2'}}" data="[ {x: 'Ethan Brooks', y: 8800}, {x: 'Sofia Ramirez', y: 10250}, {x: '${longName}', y: 11250}]"/></victorygroup><victorylegend x="250" y="416" orientation='horizontal' gutter="42" symbolspacer="10" style="{ labels: { fill: '#002E22', fontSize: 13, fontWeight: 500, fontFamily: 'Expensify Neue', }, }" data="[ {name: 'This month', symbol: {type: 'circle', fill: '#13C96B', size: 6}}, {name: 'Last month', symbol: {type: 'circle', fill: '#1E90F2', size: 6}}, ]"/></victorychart>`;
Onyx.merge(`reportActions_${reportID}`, {
    '89012345': {
                    message: [{html: html8, text: 'chart test 8', type: 'COMMENT'}],
                    actionName: 'ADDCOMMENT',
                    actorAccountID,
                    automatic: false,
                    avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_5.png',
                    created: '2026-05-28 19:59:07.664',
                    lastModified: '2026-05-28 19:59:07.664',
                    reportActionID: '89012345',
                    reportID,
                    shouldShow: true,
    },
});

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@luacmartins

Copy link
Copy Markdown
Contributor Author

@situchan this is the chart I get from the BE using the same long name. I think there might be something wrong with the data above. This is the data I get:

Screenshot 2026-07-16 at 12 45 37 PM
<victorychart horizontal domain="{y: [0, 6000]}" domainpadding="{x: 44, y: 16}" height="464" width="680" padding="{top: 92, bottom: 84, left: 150, right: 32}" style="{parent: {backgroundColor: '#F8F4F0', borderRadius: 16, width: '100%', maxWidth: 680}}" categories="{x: ['sdf jskljf slk…', 'asdfuaidsfiaejw…', 'Carlos Martins']}"> <victorylabel x="32" y="40" text="Top employees by spend" style="{fill: '#002E22', fontSize: 17, fontWeight: 700, fontFamily: 'Expensify Neue'}" /> <victorylabel x="32" y="62" text="As of: Jul 16, 2026 at 06:40 PM" style="{fill: '#76847E', fontSize: 11, fontWeight: 400, fontFamily: 'Expensify Neue'}" /> <victoryaxis tickvalues="[0, 1, 2]" tickformat="['sdf jskljf slk…', 'asdfuaidsfiaejw…', 'Carlos Martins']" style="{axis: {stroke: 'transparent'}, ticks: {stroke: 'transparent'}, grid: {stroke: 'transparent'}, tickLabels: {fill: '#76847E', fontSize: 11, fontWeight: 500, fontFamily: 'Expensify Neue', padding: 8}}" /> <victoryaxis dependentaxis tickvalues="[0, 1500, 3000, 4500, 6000]" tickformat="['$0', '$1,500', '$3,000', '$4,500', '$6,000']" style="{axis: {stroke: 'transparent'}, ticks: {stroke: 'transparent'}, grid: {stroke: '#E6E1DA', strokeWidth: 1}, tickLabels: {fill: '#76847E', fontSize: 11, fontWeight: 500, fontFamily: 'Expensify Neue', padding: 8}}" /> <victorygroup horizontal offset="18"> <victorybar barwidth="16" cornerradius="{top: 8, bottom: 0}" style="{data: {fill: '#03D47C'}}" data="[{x: 'sdf jskljf slkdjfklsjkflsjdklfjsk jlfjsd kljfskj fksljdfjskldfjsjd klsjjlfksdkj fskljkfjkljs', y: 361}, {x: 'asdfuaidsfiaejwkprkpaoandsofhaosij@cha.com', y: 361}, {x: 'Carlos Martins', y: 5410}]" /> <victorybar barwidth="16" cornerradius="{top: 8, bottom: 0}" style="{data: {fill: '#0185FF'}}" data="[{x: 'sdf jskljf slkdjfklsjkflsjdklfjsk jlfjsd kljfskj fksljdfjskldfjsjd klsjjlfksdkj fskljkfjkljs', y: 0}, {x: 'asdfuaidsfiaejwkprkpaoandsofhaosij@cha.com', y: 231}, {x: 'Carlos Martins', y: 690}]" /> </victorygroup> <victorylegend x="250" y="416" orientation="horizontal" gutter="42" symbolspacer="10" style="{labels: {fill: '#002E22', fontSize: 13, fontWeight: 500, fontFamily: 'Expensify Neue'}}" data="[{name: 'This month', symbol: {type: 'circle', fill: '#03D47C', size: 6}}, {name: 'Last month', symbol: {type: 'circle', fill: '#0185FF', size: 6}}]" /> </victorychart>

@situchan

Copy link
Copy Markdown
Contributor

@situchan this is the chart I get from the BE using the same long name. I think there might be something wrong with the data above. This is the data I get:

Screenshot 2026-07-16 at 12 45 37 PM ``` ```

Because backend is sending already ellipsed name asdfuaidsfiaejw…

@luacmartins

Copy link
Copy Markdown
Contributor Author

Ah yea, the BE truncates the names to 16 characters

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants