App icon indicating copy to clipboard operation
App copied to clipboard

fix: Show editable Amount by default in report view

Open x-dev90 opened this issue 5 months ago β€’ 15 comments

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

  1. Open an expense report with same-currency expenses.
  2. Verify the Amount column is visible by default.
  3. Verify the Total column is not visible by default.
  4. Open an expense report with a converted/multi-currency expense.
  5. Verify both Amount and Total are visible.
  6. Open report column settings.
  7. Verify Amount is selected as the default required money column.
  8. 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 Issues section above
  • [X] I wrote clear testing steps that cover the changes made in this PR
    • [X] I added steps for local testing in the Tests section
    • [X] I added steps for the expected offline behavior in the Offline steps section
    • [X] I added steps for Staging and/or Production testing in the QA steps section
    • [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 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. toggleReport and not onIconClick)
    • [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] 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 using Avatar are 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] 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 Avatar is modified, I verified that Avatar is 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 Design label and/or tagged @Expensify/design so 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 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

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

x-dev90 avatar Jun 30 '26 04:06 x-dev90

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

melvin-bot[bot] avatar Jun 30 '26 08:06 melvin-bot[bot]

Yup, makes sense to me πŸ‘

shawnborton avatar Jul 01 '26 01:07 shawnborton

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

codecov[bot] avatar Jul 01 '26 11:07 codecov[bot]

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

image

x-dev90 avatar Jul 01 '26 12:07 x-dev90

@gijoe0295 The PR is ready for review. Could you please take a look ?

x-dev90 avatar Jul 01 '26 12:07 x-dev90

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

image

Yep! πŸ‘

trjExpensify avatar Jul 01 '26 13:07 trjExpensify

@gijoe0295, Gentle bump. thanks.

x-dev90 avatar Jul 03 '26 09:07 x-dev90

@gijoe0295 I’ve addressed the feedback comments. Could you please take another look when you get a chance?

x-dev90 avatar Jul 03 '26 13:07 x-dev90

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

gijoe0295 avatar Jul 06 '26 04:07 gijoe0295

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 Issues section 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 Tests section
    • [x] I verified the steps for Staging and/or Production testing are in the QA steps section
    • [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 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. toggleReport and not onIconClick).
    • [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] 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 using Avatar have 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 this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • [x] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • [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 Avatar is modified, I verified that Avatar is 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 Design label and/or tagged @Expensify/design so 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 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.
  • [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 Screenshot_1783688075
Android: mWeb Chrome Screenshot_1783688133
iOS: HybridApp Simulator Screenshot - iPhone 17 - 2026-07-10 at 19 46 48
iOS: mWeb Safari Simulator Screenshot - iPhone 17 - 2026-07-10 at 19 48 48
MacOS: Chrome / Safari Screenshot 2026-07-10 at 18 21 53 Screenshot 2026-07-10 at 18 21 49 Screenshot 2026-07-10 at 18 21 43 Screenshot 2026-07-10 at 18 21 38

gijoe0295 avatar Jul 06 '26 04:07 gijoe0295

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

Screenshot 2026-07-06 at 11 37 04

Would you mind confirming if you want to keep Total "dynamic" (data-driven)?

gijoe0295 avatar Jul 06 '26 04:07 gijoe0295

@trjExpensify, could you please take a look at this comment, when you get a chance. thanks.

x-dev90 avatar Jul 08 '26 05:07 x-dev90

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 Total column. Users coming from Classic are expecting this to show up when applicable, so this keeps the consistency.
  • If the Total column is shown and the user explicitly deselects it, hide the column.
  • If the Total column isn't being shown and the user selects it, show the column.

@shawnborton what do you think?

trjExpensify avatar Jul 08 '26 12:07 trjExpensify

That sounds good to me, let's do it.

shawnborton avatar Jul 08 '26 13:07 shawnborton

@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

x-dev90 avatar Jul 10 '26 10:07 x-dev90

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

github-actions[bot] avatar Jul 10 '26 14:07 github-actions[bot]

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

OSBotify avatar Jul 10 '26 14:07 OSBotify

: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
Android iOS
Web :spider_web:
https://94929.pr-testing.expensify.com
Web

:eyes: View the workflow run that generated this build :eyes:

github-actions[bot] avatar Jul 10 '26 14:07 github-actions[bot]

πŸš€ Deployed to staging by https://github.com/cristipaval in version: 9.4.34-0 πŸš€

platform result
πŸ•Έ web πŸ•Έ success βœ…
πŸ€– android πŸ€– success βœ…
🍎 iOS 🍎 success βœ…

OSBotify avatar Jul 14 '26 11:07 OSBotify

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.md already 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.md documents 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.

MelvinBot avatar Jul 14 '26 11:07 MelvinBot