Force charts to fallback to currency code if symbol is not supported by font - #81550
Conversation
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.
|
a66bcff to
59e9ed4
Compare
|
Let's merge #81543 first |
|
Switching in @ShridharGoel to review as the C+ on this project. |
trjExpensify
left a comment
There was a problem hiding this comment.
Insights project PR 👍
ShridharGoel
left a comment
There was a problem hiding this comment.
Can we add tests covering these?
- unsupported symbol fallback to currency code
- supported symbol keeps symbol
- locale change updates unit/position in chart labels
|
@ShridharGoel I think you can re-review |
|
|
||
| mockNumberFormat = (n: number) => n.toLocaleString('de-DE'); | ||
| rerender({unit: {value: '€', fallback: 'EUR'}, position: 'right'}); | ||
| expect(result.current.formatYAxisLabel(1000)).toBe('1.000€'); |
There was a problem hiding this comment.
But in the chart, it displays as €1,000. Is that expected?
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: mWeb Safari |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #81112 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
🚧 @blimpich has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.3.21-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.21-4 🚀
|



Explanation of Change
YAxisUnittype that supports objects with{value, fallback}font.getGlyphIDs()), itfalls back to the 3-letter currency code (e.g., "₹" → "INR")
chart font in the future
Other changes:
getCurrencyDisplayInfoForChartsread locale directly fromIntlStore.getCurrentLocale(), which was not reactiveuseLocalize()hook, so charts will re-render when user changeslanguage settings
preferred locale
CurrencyUtils.tsdirectly intoSearchChartView.tsxgetCurrencyDisplayInfoForChartswas only used in one place, so extractingit to a shared utility was overkill
Fixed Issues
$ #81112
PROPOSAL:
Tests
- Create expenses with US Dollar (USD) currency
- Open search chart view
- Verify Y-axis labels display "$"
- Tap on a bar and verify tooltip also displays "$"
- For both INR and USD, verify the currency unit shown in tooltip matches the Y-axis
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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