Follow up: Simplify computation of report name for certain types#82382
Conversation
|
@linhvovan29546 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfe180d107
ℹ️ 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/ReportNameUtils.ts
Outdated
|
|
||
| if (report?.reportName && report.type === CONST.REPORT.TYPE.EXPENSE) { | ||
| return isArchivedNonExpense ? generateArchivedReportName(report?.reportName) : report?.reportName; | ||
| return generateArchivedReportName(report?.reportName); |
There was a problem hiding this comment.
Revert unconditional archive suffix for expense report names
computeReportName() is used to populate derived report names (src/libs/actions/OnyxDerived/configs/reportAttributes.ts), so this branch affects normal UI/report lists. Returning generateArchivedReportName(report.reportName) unconditionally for CONST.REPORT.TYPE.EXPENSE now appends (archived) (and trailing whitespace) to active expense reports too, because this bypasses the archived-state gate (isArchivedNonExpenseReport) that previously prevented suffixing expense report types. This causes incorrect names for non-archived expense reports in places like sidebar/search/transaction contexts.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@sosek108 We should return reportName directly here instead of calling this function.
JmillsExpensify
left a comment
There was a problem hiding this comment.
Product review not required on this one.
linhvovan29546
left a comment
There was a problem hiding this comment.
Simple change, probably doesn't need C+ review, like the original PR cc @neil-marcellini
neil-marcellini
left a comment
There was a problem hiding this comment.
CI failing, and changes needed.
src/libs/ReportNameUtils.ts
Outdated
|
|
||
| if (report?.reportName && report.type === CONST.REPORT.TYPE.EXPENSE) { | ||
| return isArchivedNonExpense ? generateArchivedReportName(report?.reportName) : report?.reportName; | ||
| return generateArchivedReportName(report?.reportName); |
There was a problem hiding this comment.
@sosek108 We should return reportName directly here instead of calling this function.
|
@neil-marcellini sorry for late reply. I was on adhoc sick leave. I did apply requested changes and all tests are passing |
neil-marcellini
left a comment
There was a problem hiding this comment.
Looks great, thanks!
|
Simple optimization, no C+ review needed. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @neil-marcellini 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.3.24-1 🚀
|
|
Hi @sosek108. Could you please add more detailed testing steps? |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.3.24-3 🚀
|
|
@IuliiaHerets Done. I've added steps for most important path |
Explanation of Change
This PR is follow up to #81513 adding further optimizations according to comment #81513 (comment).
Fixed Issues
$ #81339
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Create workspace with
custom report title formula2. Go to Worskspace -> Report -> change Default report title
Create report in this worskpace with one or two transactions
Go to Inbox and verify that report name is correct
Manually change report's name
Go to Inbox and verify that report name is correct
Reload page and verify report name again
In various place check if names of reports are correct. This is especially for expenses and invoices
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