fix(charts): scale native Victory charts from measured bubble width - #95250
fix(charts): scale native Victory charts from measured bubble width#95250roryabraham wants to merge 2 commits into
Conversation
Re-export VictoryChartContainerResponsive on native so charts use onLayout instead of a window-width padding estimate. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Companion Web-Expensify PR for email chart aspect ratio: https://github.com/Expensify/Web-Expensify/pull/54217 |
|
@MelvinBot is this PR effectively a dupe of #93245? |
|
No — not a dupe. They fix different issues and different problems, even though both touch
Why they're distinct
One real overlap to be aware of: So |
Explanation of Change
Admins room VirtualCFO summary charts on native mobile were scaled using a window-width estimate (
windowWidth - 92px) instead of the actual chat bubble width. On iPhone this over-shrank charts (~44% scale), making them hard to read.Native
VictoryChartContainernow re-exportsVictoryChartContainerResponsive, matching web: an outeronLayoutwrapper measures available width and applies uniform scale viaVictoryChartContainerFixed.Companion Web-Expensify PR fixes chart aspect ratio in email notifications for the same issue.
Fixed Issues
For #95222
PROPOSAL:
Tests
npm run test -- tests/unit/computeChartScaleTest.ts tests/unit/VictoryChartContainerNativeTest.tsand confirm all tests pass.Offline tests
N/A — chart sizing is layout-only; offline messages render the same as online.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari