Skip to content

fix: Show editable Amount by default in report view#94929

Merged
cristipaval merged 12 commits into
Expensify:mainfrom
x-dev90:fix/93014-default-report-amount-column
Jul 10, 2026
Merged

fix: Show editable Amount by default in report view#94929
cristipaval merged 12 commits into
Expensify:mainfrom
x-dev90:fix/93014-default-report-amount-column

Conversation

@x-dev90

@x-dev90 x-dev90 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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

$ #93014
PROPOSAL: #93014 (comment)

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.
  • 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]."

  • 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 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)
    • 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 any new file was added I verified that:
    • 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
  • 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

Not applicable

Android: mWeb Chrome

Not applicable

iOS: Native

Not applicable

iOS: mWeb Safari

Not applicable

MacOS: Chrome / Safari
Screen.Recording.2026-06-30.at.12.06.23.PM.mov

@x-dev90 x-dev90 marked this pull request as ready for review June 30, 2026 08:58
@x-dev90 x-dev90 requested review from a team as code owners June 30, 2026 08:58
@melvin-bot melvin-bot Bot requested review from gijoe0295 and trjExpensify June 30, 2026 08:58
@melvin-bot

melvin-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

@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 melvin-bot Bot removed request for a team June 30, 2026 08:58

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

I still think we should keep the orientation we had before whereby the Total column is after the Amount column so the totals on the report line up better:

Image

What do you think @iwiznia @shawnborton?

@shawnborton

Copy link
Copy Markdown
Contributor

Yup, makes sense to me 👍

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

@x-dev90

x-dev90 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@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

x-dev90 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

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

@trjExpensify

Copy link
Copy Markdown
Contributor

@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! 👍

@x-dev90

x-dev90 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@gijoe0295, Gentle bump. thanks.

Comment thread src/libs/SearchUIUtils.ts
[CONST.SEARCH.TABLE_COLUMNS.COMMENTS]: shouldShowCommentsColumn,
[CONST.SEARCH.TABLE_COLUMNS.TOTAL]: true,
[CONST.SEARCH.TABLE_COLUMNS.TOTAL]: false,
[CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT]: true,

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.

Why did you reorder the columns here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reordered it to keep Comments immediately before the money columns, consistent with the behavior from #90301.

Without this change, same-currency reports render as Amount | Comments, while multi-currency reports render as Amount | Comments | Total. Moving COMMENTS before TOTAL_AMOUNT keeps the layout consistent:

  • same currency: Comments | Amount
  • multi-currency: Comments | Amount | Total

This also preserves the latest design feedback that Total should remain after Amount when both are visible.

Please let me know if you think we should handle this differently.

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.

This also preserves the latest design feedback that Total should remain after Amount when both are visible.

Without the reordering, Amount was already to the left of Total.

multi-currency reports render as Amount | Comments | Total

The Comments column reordering is already done manually:

App/src/libs/SearchUIUtils.ts

Lines 5927 to 5934 in c8d6035

if (shouldShowCommentsColumn && !addedColumns.has(CONST.SEARCH.TABLE_COLUMNS.COMMENTS)) {
const totalIndex = result.indexOf(CONST.SEARCH.TABLE_COLUMNS.TOTAL);
if (totalIndex === -1) {
result.push(CONST.SEARCH.TABLE_COLUMNS.COMMENTS);
} else {
result.splice(totalIndex, 0, CONST.SEARCH.TABLE_COLUMNS.COMMENTS);
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Comments column reordering is already done manually

The manual Comments insertion handles the custom-columns path, but it does not run for the default path when visibleColumns is empty. In the default path, the order comes from Object.keys(columns).

So if we keep the previous order, default reports with comments render as Amount | Comments / Amount | Comments | Total.

Since the expected layout is Comments | Amount and Comments | Amount | Total, I think we still need to move COMMENTS before TOTAL_AMOUNT in the default map as well.

Image Image

Comment thread src/libs/SearchUIUtils.ts Outdated
if (shouldShowCommentsColumn && !addedColumns.has(CONST.SEARCH.TABLE_COLUMNS.COMMENTS)) {
const totalIndex = result.indexOf(CONST.SEARCH.TABLE_COLUMNS.TOTAL);
if (totalIndex === -1) {
const moneyColumnIndexes = [result.indexOf(CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT), result.indexOf(CONST.SEARCH.TABLE_COLUMNS.TOTAL)].filter((index) => index !== -1);

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.

I think we only need to change TOTAL to TOTAL_AMOUNT here.

When there're both TOTAL and TOTAL_AMOUNT, TOTAL_AMOUNT is always before TOTAL. Wdyt?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Since TOTAL_AMOUNT is now the default money column and should always come before TOTAL, anchoring COMMENTS directly before TOTAL_AMOUNT is enough. I simplified the logic. Thanks

Comment thread src/libs/SearchUIUtils.ts Outdated
// Expense report view: TOTAL_AMOUNT (transaction amount) is shown by default. TOTAL
// (workspace currency) is added when a conversion exists. ORIGINAL_AMOUNT never
// renders by default in report view because it must be explicitly selected.
// Search page: ORIGINAL_AMOUNT stays data-driven (shown whenever a conversion exists).

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.

Search page: ORIGINAL_AMOUNT stays data-driven (shown whenever a conversion exists).

Where does this come from? Does not seem right.

On Search page, we always show TOTAL_AMOUNT alone. We don't show the converted amount.

Also ORIGINAL_AMOUNT is not the converted amount.

Update: This is a stale logic that was removed in #93146. Please merge main and remove it.

Comment thread src/libs/SearchUIUtils.ts Outdated

if (customResult) {
return customResult;
return customResult.filter((col) => col !== CONST.SEARCH.TABLE_COLUMNS.TOTAL || columns[CONST.SEARCH.TABLE_COLUMNS.TOTAL]);

@gijoe0295 gijoe0295 Jul 3, 2026

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.

I traced the PR that removes the nonDataColumns predicate. They intentionally want to always show the selected columns even when they have no data. See #92692 (comment).

So let's remove this change, returning customResult is correct here.

@x-dev90

x-dev90 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

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

Comment thread src/libs/SearchUIUtils.ts Outdated
Comment on lines +6031 to +6032
// Expense report view: TOTAL_AMOUNT (transaction amount) is shown by default.
// TOTAL (workspace currency) is added when a conversion exists.

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.

Suggested change
// Expense report view: TOTAL_AMOUNT (transaction amount) is shown by default.
// TOTAL (workspace currency) is added when a conversion exists.

Not needed. Code is self-explanatory.

@gijoe0295

Copy link
Copy Markdown
Contributor

@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

gijoe0295 commented Jul 6, 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 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).
    • 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 and each prop has a /** comment above it */
    • The file is named correctly
    • 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
    • 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)
    • 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)
    • All JSX used for rendering exists in the render method
    • 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 any new file was added I verified that:
    • 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
  • 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

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

gijoe0295 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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

@x-dev90

x-dev90 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

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

@trjExpensify

Copy link
Copy Markdown
Contributor

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?

@shawnborton

Copy link
Copy Markdown
Contributor

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

@x-dev90

x-dev90 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@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

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

@melvin-bot melvin-bot Bot requested a review from cristipaval July 10, 2026 12:56
@cristipaval cristipaval merged commit 38b3972 into Expensify:main Jul 10, 2026
35 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 cristipaval 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.

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.

6 participants