fix: Show editable Amount by default in report view
Explanation of Change
Updates the expense report table defaults so the editable Amount column is shown by default instead of the read-only Total column. This also keeps the existing multi-currency behavior by showing Total only when a conversion exists, and updates custom-column handling so Comments stay positioned before the active money column.
Fixed Issues
$ https://github.com/Expensify/App/issues/93014 PROPOSAL: https://github.com/Expensify/App/issues/93014#issuecomment-4657400228
Tests
- Open an expense report with same-currency expenses.
- Verify the Amount column is visible by default.
- Verify the Total column is not visible by default.
- Open an expense report with a converted/multi-currency expense.
- Verify both Amount and Total are visible.
- Open report column settings.
- Verify Amount is selected as the default required money column.
- Enable Comments and verify it appears immediately before the Amount column.
- [x] Verify that no errors appear in the JS console
Offline tests
Same as Tests.
QA Steps
Same as Tests.
// TODO: These must be filled out, or the issue title must include "[No QA]."
- [x] Verify that no errors appear in the JS console
PR Author Checklist
- [X] I linked the correct issue in the
### Fixed Issuessection above - [X] I wrote clear testing steps that cover the changes made in this PR
- [X] I added steps for local testing in the
Testssection - [X] I added steps for the expected offline behavior in the
Offline stepssection - [X] I added steps for Staging and/or Production testing in the
QA stepssection - [X] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
- [X] 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)
- [X] 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).
- [X] I added steps for local testing in the
- [X] I included screenshots or videos for tests on all platforms
- [X] I ran the tests on all platforms & verified they passed on:
- [X] Android: Native
- [X] Android: mWeb Chrome
- [X] iOS: Native
- [X] iOS: mWeb Safari
- [X] MacOS: Chrome / Safari
- [X] 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)
- [X] I followed proper code patterns (see Reviewing the code)
- [X] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e.
toggleReportand notonIconClick) - [X] I verified that comments were added to code that is not self explanatory
- [X] 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.
- [X] 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)
- [X] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e.
- [X] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
- [X] I followed the guidelines as stated in the Review Guidelines
- [X] 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 usingAvatarare working as expected) - [X] If any new file was added I verified that:
- [X] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
- [X] If a new CSS style is added I verified that:
- [X] A similar style doesn't already exist
- [X] The style can't be created with an existing StyleUtils function (i.e.
StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
- [X] If new assets were added or existing ones were modified, I verified that:
- [X] The assets are optimized and compressed (for SVG files, run
npm run compress-svg) - [X] The assets load correctly across all supported platforms.
- [X] The assets are optimized and compressed (for SVG files, run
- [X] 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.
- [X] 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
Avataris modified, I verified thatAvataris working as expected in all cases) - [X] 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.
- [X] 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.
- [X] 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:
- [X] I verified that all the inputs inside a form are aligned with each other.
- [X] I added
Designlabel and/or tagged@Expensify/designso the design team can review the changes.
- [X] I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
- [X] If the
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
Not applicable
Android: mWeb Chrome
Not applicable
iOS: Native
Not applicable
iOS: mWeb Safari
Not applicable
MacOS: Chrome / Safari
https://github.com/user-attachments/assets/4d17d2b3-9ff7-4b31-b28c-174af5b07c92
@gijoe0295 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]
Yup, makes sense to me π
Codecov Report
β Changes either increased or maintained existing code coverage, great job!
| Files with missing lines | Coverage Ξ | |
|---|---|---|
| src/libs/SearchUIUtils.ts | 62.87% <100.00%> (ΓΈ) |
|
| ...pages/settings/Report/ReportDetailsColumnsPage.tsx | 0.00% <0.00%> (ΓΈ) |
|
| ... and 34 files with indirect coverage changes |
@trjExpensify Thanks for confirming. Updated the ordering so when both are visible it stays Amount | Total, while Amount remains the default editable column.
Could you please check this ?
@gijoe0295 The PR is ready for review. Could you please take a look ?
@trjExpensify Thanks for confirming. Updated the ordering so when both are visible it stays
Amount | Total, whileAmountremains the default editable column.Could you please check this ?
![]()
Yep! π
@gijoe0295, Gentle bump. thanks.
@gijoe0295 Iβve addressed the feedback comments. Could you please take another look when you get a chance?
@x-dev90 Please update this test step:
Enable Comments and verify it appears immediately before the visible money column.
to:
Enable Comments and verify it appears immediately before the Amount column.
Reviewer Checklist
- [x] I have verified the author checklist is complete (all boxes are checked off).
- [x] I verified the correct issue is linked in the
### Fixed Issuessection above - [x] I verified testing steps are clear and they cover the changes made in this PR
- [x] I verified the steps for local testing are in the
Testssection - [x] I verified the steps for Staging and/or Production testing are in the
QA stepssection - [x] 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)
- [x] 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)
- [x] I verified the steps for local testing are in the
- [x] I checked that screenshots or videos are included for tests on all platforms
- [x] I included screenshots or videos for tests on all platforms
- [x] 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.
- [x] I verified tests pass on all platforms & I tested again on:
- [x] Android: HybridApp
- [x] Android: mWeb Chrome
- [x] iOS: HybridApp
- [x] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [x] 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
- [x] I verified proper code patterns were followed (see Reviewing the code)
- [x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e.
toggleReportand notonIconClick). - [x] I verified that comments were added to code that is not self explanatory
- [x] 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.
- [x] 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)
- [x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e.
- [x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
- [x] I verified that this PR follows the guidelines as stated in the Review Guidelines
- [x] 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 usingAvatarhave been tested & I retested again) - [x] If a new component is created I verified that:
- [x] A similar component doesn't exist in the codebase
- [x] All props are defined accurately and each prop has a
/** comment above it */ - [x] The file is named correctly
- [x] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
- [x] The only data being stored in the state is data necessary for rendering and nothing else
- [x] For Class Components, any internal methods passed to components event handlers are bound to
thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor) - [x] Any internal methods bound to
thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick) - [x] All JSX used for rendering exists in the render method
- [x] 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
- [x] If any new file was added I verified that:
- [x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
- [x] If a new CSS style is added I verified that:
- [x] A similar style doesn't already exist
- [x] The style can't be created with an existing StyleUtils function (i.e.
StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
- [x] 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.
- [x] 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
Avataris modified, I verified thatAvataris working as expected in all cases) - [x] 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.
- [x] 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.
- [x] 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:
- [x] I verified that all the inputs inside a form are aligned with each other.
- [x] I added
Designlabel and/or tagged@Expensify/designso the design team can review the changes.
- [x] For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
- [x] If the
mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps. - [x] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.
Screenshots/Videos
Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
@trjExpensify One question.
Previously Total visibility is data-driven - only shows when:
- currency conversion occurs; or
- report has multiple currencies.
Even if user explicitly selected it in columns settings, it wouldn't show.
But you decided to remove that "dynamic" column settings here (i.e., columns will show when user selects it, regardless of data existence). That'd cause Amount and Total to be duplicates:
Would you mind confirming if you want to keep Total "dynamic" (data-driven)?
@trjExpensify, could you please take a look at this comment, when you get a chance. thanks.
I think it depends on what you mean by "dynamic". The behaviour we discovered over there was confusing whereby someone selected a column and it wouldn't show. What I think we should do here is:
- If an expense on the report is in a foreign currency, show the
Totalcolumn. Users coming from Classic are expecting this to show up when applicable, so this keeps the consistency. - If the
Totalcolumn is shown and the user explicitly deselects it, hide the column. - If the
Totalcolumn isn't being shown and the user selects it, show the column.
@shawnborton what do you think?
That sounds good to me, let's do it.
@gijoe0295 I think the expected behavior is clarified now. Could you please take a look at this comment and confirm whether the PR looks good from your side? thanks
π§ cristipaval has triggered a test Expensify/App build. You can view the workflow run here.
:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.
:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! :test_tube::test_tube: Built from App PR Expensify/App#94929.
| Android :robot: | iOS :apple: |
|---|---|
| https://ad-hoc-expensify-cash.s3.us-east-1.amazonaws.com/rock-artifacts/ad-hoc/rock-android-Adhoc-38b39720b92-a91d37b-d1037fdea11b950ecb45d665228520fb31485efd/index.html | https://ad-hoc-expensify-cash.s3.us-east-1.amazonaws.com/rock-artifacts/ad-hoc/rock-ios-device-AdHoc-38b3972-a91d37b-9fbe00e040aa4584f6afdd5aa486be085aed8183/index.html |
| Web :spider_web: |
|---|
| https://94929.pr-testing.expensify.com |
:eyes: View the workflow run that generated this build :eyes:
π Deployed to staging by https://github.com/cristipaval in version: 9.4.34-0 π
| platform | result |
|---|---|
| πΈ web πΈ | success β |
| π€ android π€ | success β |
| π iOS π | success β |
Help site review β no docs changes required
I reviewed this PR against the help articles under docs/articles and don't believe any updates are needed.
What this PR changes: the default money column in the report-details expense table β showing the editable Amount column by default instead of the read-only Total column, while still showing Total alongside it when a currency conversion exists. The change is scoped to the report-details view (SearchUIUtils.ts getColumnsToShow and ReportDetailsColumnsPage.tsx).
Why no docs update:
Managing-Expenses-in-a-Report.mdalready lists Amount (not Total) among the columns in the report expense table, so it's actually more accurate after this change, not less.Using-Reports-in-New-Expensify.mddocuments the Columns picker for the Spend / Explore views and lists Total as an available column. This PR does not touch that view, and Total remains a selectable column β so the list is still correct.- No help article documents which money column is shown by default in the report-details table, so there is no default-column statement to correct.
Because no article states the previous behavior, there's nothing to bring into alignment, and I did not open a draft docs PR. If you'd prefer we proactively add a note about the editable Amount column to Managing-Expenses-in-a-Report.md, let me know and I'll draft one.
β οΈ Note: browser-based verification was unavailable in this run, so I reviewed the change from the code, tests, and existing help articles only β I could not confirm the live UI labels in a browser.
@x-dev90 β no help site PR was created because no docs changes are required. Please review this assessment and let me know if you'd like me to draft a docs note anyway; I'll then open a draft help site PR for you to mark Ready for review.