Skip to content

[Payment due @ikevin127] Render the currency conversion fee payer changelog entry - #97897

Merged
madmax330 merged 14 commits into
Expensify:mainfrom
ishpaul777:ishpaul/655935-fx-preference-changelog
Aug 19, 2026
Merged

[Payment due @ikevin127] Render the currency conversion fee payer changelog entry#97897
madmax330 merged 14 commits into
Expensify:mainfrom
ishpaul777:ishpaul/655935-fx-preference-changelog

Conversation

@ishpaul777

@ishpaul777 ishpaul777 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Auth now writes a changelog entry into the #admins room when a workspace admin changes who pays the currency conversion fees on cross-border reimbursements (Auth PR). The action is POLICYCHANGELOG_UPDATE_GLOBAL_REIMBURSEMENTS_FX_PREFERENCE, carrying {"preference": "company"} or {"preference": "employee"}.

This renders it in NewDot:

updated the currency conversion fee setting to "Company pays"

Beyond the room message, the same text is wired into the LHN preview, the search options list, the thread name when the message is grouped into a thread, and copy-to-clipboard, matching how UPDATE_REQUIRE_COMPANY_CARDS_ENABLED is handled. Without those, the LHN would fall back to the English text Auth stores rather than the reader's locale.

The Auth PR should merge first, since nothing produces this action until it deploys. OldDot renders the same wording in https://github.com/Expensify/Web-Expensify/pull/55150.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/655935
PROPOSAL: N/A

Tests

Requires the globalReimbursement and globalReimbursementFX beta .

  1. As an admin of a Collect or Control workspace with global reimbursement enabled, go to Workspace > Workflows > Make or track payments and set the currency conversion fees to be paid by the company.
  2. Open the workspace's #admins room.
  3. Verify a system message reads updated the currency conversion fee setting to "Company pays".
  4. Verify the LHN row for #admins shows the same text as its preview.
  5. Change the setting back to the employee and verify a second message reads "Employee pays".
  6. Save the same setting twice and verify no duplicate message appears.
  7. Right click the message, choose Copy to clipboard, and verify the pasted text matches the message.
  • Verify that no errors appear in the JS console

Offline tests

The message comes from a report action pushed by the backend, so there is no optimistic path. Offline, the room shows whatever actions were already synced and the setting cannot be changed.

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)
  • 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.
  • 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

Android: Native
Android: mWeb Chrome
iOS: Native Screenshot 2026-08-12 at 9 24 17 PM
iOS: mWeb Safari Screenshot 2026-08-12 at 9 20 35 PM
MacOS: Chrome / Safari Screenshot 2026-08-06 at 7 25 20 PM

@melvin-bot

melvin-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONST/index.ts 94.85% <ø> (ø)
src/libs/OptionsListUtils/index.ts 87.33% <100.00%> (+0.01%) ⬆️
src/libs/ReportActionsUtils.ts 80.00% <100.00%> (+0.04%) ⬆️
src/libs/ReportNameUtils.ts 81.95% <100.00%> (+0.08%) ⬆️
src/libs/SidebarUtils.ts 80.38% <100.00%> (+0.05%) ⬆️
...x/report/actionContents/PolicyChangeLogContent.tsx 100.00% <100.00%> (ø)
...es/inbox/report/ContextMenu/ContextMenuActions.tsx 40.63% <50.00%> (+0.02%) ⬆️
... and 7 files with indirect coverage changes

@ishpaul777

Copy link
Copy Markdown
Contributor Author

@MelvinBot review

@ishpaul777

Copy link
Copy Markdown
Contributor Author

@codex review

@MelvinBot

Copy link
Copy Markdown
Contributor

Review

Looks good — clean, minimal, and it faithfully mirrors the existing UPDATE_REQUIRE_COMPANY_CARDS_ENABLED pattern. I verified every render surface that the sibling action touches is covered here, so there are no gaps in where the new message will show up. A couple of non-blocking notes below.

Completeness ✅ — the new action is wired into all five render surfaces plus the CONST entry, the shared type, and unit tests:

A repo-wide grep for the reference action returned exactly these five call sites, and all five are handled.

Notes (non-blocking)

1. Locale typography — nl and it use straight ASCII quotes. The new strings in nl.ts ("Bedrijf betaalt") and it.ts ("Azienda paga") wrap the quoted term in straight "…", whereas those locales use typographic quotes elsewhere (e.g. nl uses “…” on other lines). de, fr, el, ja, pl, zh-hans all look locale-correct, and en/es intentionally use straight quotes to match their surrounding workspaceActions block. Worth aligning nl/it if you're keeping the manual translations.

2. Manual translations vs. the generator. Heads up that you've hand-written all 11 locales. Since this is a fork PR, translations aren't auto-generated, so if an Expensify employee runs the Generate static translations workflow it may regenerate the non-en locales from en.ts and overwrite these. Just make sure the final state is what you intend (either keep the manual ones, or let the workflow own them).

3. Missing-payload fallback. getCurrencyConversionFeeMessage defaults a missing preference to 'employee', so an empty payload still renders a definitive "Employee pays" message rather than nothing. Your unit test documents this as intentional (employee pays unless the company opts in) — flagging only so it's a conscious choice, since it means a malformed/partial action would silently render as "Employee pays" rather than surfacing as unknown.

Testing note

I did not run this through the live web app: the message is produced only by the backend action from the Auth PR, which isn't deployed, so the flow (set FX preference → changelog entry) can't be exercised against the test API yet. The behavior here is fully covered by the unit tests in ReportActionsUtilsTest.ts, which is the right level for this change.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: a7b03f61a1

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…tion

ReportActionsUtils has a capped allowance of unsafe type assertions and the new
one put it over, failing the lint check.
@sakluger

Copy link
Copy Markdown
Contributor

Hey @ishpaul777, how's this one coming?

…reference-changelog

# Conflicts:
#	src/languages/de.ts
#	src/languages/es.ts
#	src/languages/fr.ts
#	src/languages/it.ts
#	src/languages/ja.ts
#	src/languages/nl.ts
#	src/languages/pl.ts
#	src/languages/pt-BR.ts
#	src/languages/zh-hans.ts
@ishpaul777 ishpaul777 closed this Aug 11, 2026
@ishpaul777 ishpaul777 reopened this Aug 11, 2026
@ishpaul777
ishpaul777 marked this pull request as ready for review August 11, 2026 10:05
@ishpaul777
ishpaul777 requested review from a team as code owners August 11, 2026 10:05
@melvin-bot
melvin-bot Bot requested review from ikevin127 and joekaufmanexpensify and removed request for a team August 11, 2026 10:05
@melvin-bot

melvin-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

@ikevin127 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 August 11, 2026 10:05
@ishpaul777

Copy link
Copy Markdown
Contributor Author

this is ready for review now!

@joekaufmanexpensify joekaufmanexpensify left a comment

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.

Core design doc issue

@ikevin127

ikevin127 commented Aug 11, 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 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
    • 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
    • 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 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

Screen.Recording.2026-08-17.at.15.44.01.mov

The message re-translated "Company pays" / "Employee pays" per locale, so the room
disagreed with the picker in most locales. Interpolate the existing
workflowsCurrencyConversionFeesPage labels and derive the preference type from CONST.
Cover the LHN preview, search options and thread name surfaces, mirroring the existing
UPDATE_REQUIRE_COMPANY_CARDS_ENABLED cases.
…reference-changelog

# Conflicts:
#	src/libs/OptionsListUtils/index.ts
#	tests/unit/OptionsListUtilsTest.tsx
#	tests/unit/ReportNameUtilsTest.ts
#	tests/unit/SidebarUtilsTest.ts
@ishpaul777

Copy link
Copy Markdown
Contributor Author

@ikevin127 all inline comments are addressed and pushed, and I added the SidebarUtils / OptionsListUtils / ReportNameUtils wiring tests you flagged. Also merged main to clear the conflict, so this is ready for another look 🙌

@ikevin127

Copy link
Copy Markdown
Contributor

@ishpaul777 Thanks for addressing the comments. I attempted to manually test this PR but was not able to get the actions in #admins: the system message doesn't show up - not sure if the Auth PR was deployed yet (I tried both staging server and dev) so let me know about that as I don't know the status of the Auth PR.

Screen.Recording.2026-08-12.at.18.03.06.mov

The latest code is sound. Two small things, neither blocking:

🟢 src/languages/es.ts:8673 and src/languages/pt-BR.ts:8776 - quote style still doesn't match the neighbours in those two files. es uses straight "${preferenceLabel}" while the adjacent workspaceActions entries quote values with «...», and pt-BR went the other way, using curly “${preferenceLabel}” while its neighbour uses straight "${categoryName}". Everything else lines up (de „“, fr «», el «», pl „”, ja 「」, zh “”, it/nl/en straight). Purely cosmetic, but it's a one-character change per file if you want the set fully consistent.

🟢 tests/unit/OptionsListUtilsTest.tsx:5872 - expect(lastMessage).toBe(getCurrencyConversionFeeMessage(translateLocal, action)) asserts the SUT against the same helper it calls internally, so it proves the wiring routes to the right function but would still pass if the helper produced the wrong string. Worth noting this matches the dominant convention in that describe block (the UPDATE_REQUIRE_COMPANY_CARDS_ENABLED, UPDATE_AUTO_HARVESTING and card-feed cases all do the same), so I'm fine leaving it. If you want it to match the strength of the other two tests you added, assert the literal:

expect(lastMessage).toBe('updated the currency conversion fee setting to "Company pays"');

Also worth adding the employee case here for symmetry with SidebarUtilsTest / ReportNameUtilsTest, which both cover both values.

@quinthar quinthar removed the #convert label Aug 13, 2026
main added UPDATE_REQUIRES_CATEGORY and UPDATE_REQUIRES_TAG, which append to the
same CONST block, else-if chains, resolver map and test suites this branch
touches, so every file it changes conflicted. Both actions' entries are kept
side by side in each list.

Also addresses review feedback that overlapped the conflicts: the
OptionsListUtils case now asserts the rendered string rather than the helper it
calls, and covers both preferences.
SignInModal dismisses itself once IS_LOADING_APP settles to false. The back-handling
test never sets that flag, but Onyx carries it in from whatever ran earlier in the
worker, so the dismiss effect fired in CI and threw on the unmocked dismissModal
before any assertion ran.
@ishpaul777

Copy link
Copy Markdown
Contributor Author

Auth PR was deployed but another dependency https://github.com/Expensify/Web-Expensify/pull/55150 was merged last week but looks like its not deployed yet i'll update once its deployed, for now please verify only by mocking the data in Onyx

@ishpaul777
ishpaul777 requested a review from madmax330 August 13, 2026 12:32
@ishpaul777

Copy link
Copy Markdown
Contributor Author

https://github.com/Expensify/Web-Expensify/pull/55150 was deployed to staging

…elog

# Conflicts:
#	tests/unit/SignInBackButtonTest.tsx
@melvin-bot

melvin-bot Bot commented Aug 16, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx bun ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@ikevin127 ikevin127 left a comment

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.

🟢 LGTM - Tests well

@melvin-bot melvin-bot Bot changed the title Render the currency conversion fee payer changelog entry [Payment due @ikevin127] Render the currency conversion fee payer changelog entry Aug 17, 2026
@melvin-bot

melvin-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

🎯 @ikevin127, thanks for reviewing and testing this PR! 🎉

A payment issue will be created for your review once this PR is deployed to production.
E/E issue linked to the PR - https://www.github.com/Expensify/Expensify/issues/655935.

If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created.

@ishpaul777

Copy link
Copy Markdown
Contributor Author

@madmax330 can you please final review and merge?

@madmax330
madmax330 merged commit d5f49ad into Expensify:main Aug 19, 2026
38 of 40 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

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

@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.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/madmax330 in version: 9.4.57-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

Yes — a help site update is needed. This PR surfaces a new global-reimbursement setting where a Workspace Admin chooses whether the company or the employee pays the currency conversion fees on cross-border reimbursements. The existing article Enable-Global-Reimbursement.md currently states the employee always absorbs these fees, which is no longer accurate.

Draft help site PR: #99022

What it changes:

  • Adds a task-based section documenting the Workflows > Make or track payments > Currency conversion fees setting (Company pays / Employee pays).
  • Updates the FAQ "Why is my employee not receiving the full deposit?" to say the employee absorbs fees by default and admins can change who pays.

Labels/setting text (Currency conversion fees, Company pays, Employee pays) were verified against the App source strings (src/languages/en.ts, src/pages/workspace/workflows/). The setting is beta-gated (globalReimbursement + globalReimbursementFX), so live UI verification wasn't possible on a standard account.

@ishpaul777, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.57-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@melvin-bot

melvin-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #99122

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.

8 participants