-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add invoice company name and website update system messages #78488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add invoice company name and website update system messages #78488
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
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 --helpTypically, you'd want to translate only what you changed by running |
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.
|
|
Resolved merge conflicts |
|
@rayane-d This one is still listed as a draft. Is it ready to be reviewed? And it has some manual testing steps, nice! |
|
This is on hold for these BE PRs: |
|
I've resolved the merge conflicts in this PR, but it seems there are failing checks |
| changedInvoiceCompanyName: ({newValue, oldValue}: {newValue: string; oldValue?: string}) => | ||
| oldValue ? `cambió el nombre de la empresa de la factura a "${newValue}" (previamente "${oldValue}")` : `estableció el nombre de la empresa de la factura como "${newValue}"`, | ||
| changedInvoiceCompanyWebsite: ({newValue, oldValue}: {newValue: string; oldValue?: string}) => | ||
| oldValue | ||
| ? `cambió el sitio web de la empresa de la factura a "${newValue}" (previamente "${oldValue}")` | ||
| : `estableció el sitio web de la empresa de la factura como "${newValue}"`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@rayane-d That check that is failing is because I haven't filled out the PR Reviewer Checklist yet. Is this ready for review? If it is, please click the "Ready for review" button and take it out of draft mode. |
|
@justinpersaud 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] |
|
If this requires C+ review, I can help |
There was a problem hiding this comment.
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: 80f78ef808
ℹ️ 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".
src/libs/ReportActionsUtils.ts
Outdated
| function getInvoiceCompanyNameUpdateMessage(translate: LocalizedTranslate, action: ReportAction): string { | ||
| const {newValue, oldValue} = getOriginalMessage(action as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_INVOICE_COMPANY_NAME>) ?? {}; | ||
|
|
||
| if (typeof newValue === 'string' && typeof oldValue === 'string') { | ||
| return translate('workspaceActions.changedInvoiceCompanyName', {newValue, oldValue}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Localize initial invoice name changes when oldValue is missing
When the invoice company name is set for the first time, the changelog payload typically has a newValue but no oldValue. This helper only localizes when both are strings, so first‑time updates fall back to getReportActionText (server English) and bypass the new translated “set …” message. That means non‑English users will see unlocalized text in the system message, LHN preview, and copied message. The same conditional exists in getInvoiceCompanyWebsiteUpdateMessage below, so first‑time website updates will also be unlocalized.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with bot. If oldValue is undefined, it will cause regression of not showing set the invoice company name to "${newValue}".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed: 72c27d4
|
@situchan I've addressed the review comment and added automated tests 👍 |
|
I set company name and website but I don't see system messages in thread Screen.Recording.2026-01-14.at.9.49.25.PM.mov |
|
@situchan are you able to find them in the debug menu/ API response? |
|
Here's video for repro step Screen.Recording.2026-01-14.at.10.01.02.PM.mov |
|
@situchan I'm not able to reproduce: Screen.Recording.2026-01-15.at.4.46.22.PM.mov |
|
@situchan The issue is that some validation is preventing you from setting the website to google.com. Could you try using another test URL?
|
Another URL works. ok we can unblock on this as edge case |
|
@rayane-d what is the logic of creating separate thread? I thought all these system messages were in one thread.
Still I am facing optimistic issue. Updated system messages don't appear until online. Screen.Recording.2026-01-19.at.4.39.11.PM.mov |
There was a problem hiding this comment.
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: 093742fe0a
ℹ️ 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".
| const {newValue, oldValue} = getOriginalMessage(action as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_INVOICE_COMPANY_NAME>) ?? {}; | ||
|
|
||
| if (typeof newValue === 'string') { | ||
| return translate('workspaceActions.changedInvoiceCompanyName', {newValue, oldValue: typeof oldValue === 'string' ? oldValue : undefined}); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add invoice update messages to thread title mapping
These new helpers are used for the report action body/LHN/copy, but thread report titles still come from ReportNameUtils.computeChatThreadReportName/ReportUtils.getReportName, which fall back to getReportActionText for admin rooms. Since UPDATE_INVOICE_COMPANY_NAME/WEBSITE aren’t handled there (unlike other policy change log updates), a thread created from these changelog entries will show the raw backend message (often English and without the new/old values) instead of the localized text you just added. Consider wiring these action types into the report-name mapping so thread titles match the system message.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not found issue but do you think we should update OptionsListUtils.getLastMessageTextForReport, ReportNameUtils.computeReportNameBasedOnReportAction and ReportUtils.getReportName as well to support UPDATE_INVOICE_COMPANY_NAME, UPDATE_INVOICE_COMPANY_WEBSITE types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
These system messages are generated on the backend only; we don't generate optimistic actions for them while offline. |
…ils.computeReportNameBasedOnReportAction` and `ReportUtils.getReportName` to support `UPDATE_INVOICE_COMPANY_NAME`, `UPDATE_INVOICE_COMPANY_WEBSITE` types
|
Final @codex review 😄 |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
✋ 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/deetergp in version: 9.3.5-0 🚀
|




Explanation of Change
Fixed Issues
Part of https://github.com/Expensify/Expensify/issues/568313
PROPOSAL:
Tests
Prerequisites
Test Steps
Expected Results:
-
set the invoice company name to "New company name"-
set the invoice company website to "https://new-company.com"Expected Results:
-
changed the invoice company name to "New company name" (previously "Old company name")-
changed the invoice company website to "https://new-company.com" (previously "https://old-company.com"Change logs screenshot:

Recording:
Screen.Recording.2025-12-27.at.11.44.03.PM.mov
Offline tests
N/A
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