fix(vcr): render email charts with light theme and solid background - #94881
Conversation
Email PNGs were transparent with gray headers because the CLI used the dark fallback theme and the headless View stub ignored backgroundColor. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Add eslint exceptions for headless light theme imports, remove unused headless prop, and adjust PNG assertion matchers for bun:test typing. Co-authored-by: Cursor <cursoragent@cursor.com>
Override no-restricted-imports for the headless CLI directory instead of using inline eslint-disable comments. Co-authored-by: Cursor <cursoragent@cursor.com>
Override no-restricted-imports for the headless CLI directory instead of using inline eslint-disable comments. Co-authored-by: Cursor <cursoragent@cursor.com>
Apply prettier to CLI files committed with wrong quote style, and use Math.ceil for the 0.1% pixelmatch allowance to avoid Linux CI flakes. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@nyomanjyotisa 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] |
|
@eVoloshchak 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] |
|
Not sure C+ review will be all that helpful on this one since the golden PNGs provide visual confirmation of the fix |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
…endering fix(vcr): render email charts with light theme and solid background (cherry picked from commit cb42d9e) (cherry-picked to staging by roryabraham)
|
🚧 luacmartins 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! 🧪🧪
|
|
🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.4.22-3 🚀
|
…endering fix(vcr): render email charts with light theme and solid background (cherry picked from commit cb42d9e) (cherry-picked to production by roryabraham)
…-28393716468-1 🍒 Cherry pick PR #94881 to production 🍒
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.4.23-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.4.24-0 🚀
|
|
@roryabraham @luacmartins This seems like internal QA. Do we need to run anything specific on our end? |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.4.24-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.4.25-0 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.4.24-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.4.25-2 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Email chart PNGs rendered by the
victory-chart-rendererCLI were transparent with gray headers because the headless runtime used the dark fallback theme and the RNViewstub ignoredbackgroundColor. This PR forces the light theme in the CLI, restoresThemeContext.Providerfor headless label overlays, clears the offscreen canvas with the resolved card background before drawing, and strengthens golden tests with structural pixel assertions.Fixed Issues
$ #94619
PROPOSAL:
Tests
npm run server:vcr:testfrom the repo root and confirm all 16 tests pass.npm run server:vcr:dev -- --chart-xml "$(cat server/victory-chart-renderer/tests/fixtures/monthly-spend.xml)" --out /tmp/monthly-spend-fixed.png./tmp/monthly-spend-fixed.pngand confirm corners are opaque cream (#F8F4F0) and the title text is dark green (#002E22).Offline tests
N/A — server-side CLI rendering only.
QA Steps
victory-chart-rendererbinary to a staging www host (or wait for the next App release + www build).<victorychart>block (e.g. monthly spend summary report comment).PR Author Checklist
Reviewer Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).Avatar, I verified the components usingAvatarhave been tested & I retested again)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)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
See golden png