Skip to content

Fix report custom columns blockers#83981

Open
mukhrr wants to merge 39 commits intoExpensify:mainfrom
mukhrr:fix/custom-report-columns
Open

Fix report custom columns blockers#83981
mukhrr wants to merge 39 commits intoExpensify:mainfrom
mukhrr:fix/custom-report-columns

Conversation

@mukhrr
Copy link
Contributor

@mukhrr mukhrr commented Mar 3, 2026

Explanation of Change

Fixed Issues

$ #82252
$ #83962
$ #83963
$ #83959
$ #83985
$ #83988
$ #83974
$ https://github.com/Expensify/Expensify/issues/614169

PROPOSAL: #83959 (comment)

Tests

  1. Create 2 expenses in a report
  2. Go to Report layout

#83962

  • Try to sort Reimbursable, Billable, Exchange Rate, etc. fields
  • Verify Sorting works

#83963

  • Enable Tax rate in WS settings
  • Verify Tax rate has name as it does in expenses page

#83959

  • Create an expense with foreign currency
  • Verify Exchange Rate is not empty

#83985

  • Go to one of Expenses layout

  • Comment -> Go Back to Report layout

  • Verify chat bubble exists as an comment indicator

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

The same as tests

  • 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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
REC-20260303100105.mp4
Android: mWeb Chrome
REC-20260303100105.mp4
iOS: Native
ios_native.mp4
iOS: mWeb Safari
ios_mWeb.mp4
MacOS: Chrome / Safari
web.mp4

@mukhrr mukhrr requested review from a team as code owners March 3, 2026 04:39
@melvin-bot melvin-bot bot requested review from heyjennahay and removed request for a team March 3, 2026 04:39
@melvin-bot melvin-bot bot requested review from inimaga and removed request for a team March 3, 2026 04:40
@melvin-bot
Copy link

melvin-bot bot commented Mar 3, 2026

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

@mukhrr
Copy link
Contributor Author

mukhrr commented Mar 3, 2026

@inimaga I'd really appreciate if we get this merged ASAP, pls! Hopefully, before this PR gets reverted. cc @trjExpensify

@codecov
Copy link

codecov bot commented Mar 3, 2026

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.

Files with missing lines Coverage Δ
...equestReportView/MoneyRequestReportTableHeader.tsx 0.00% <ø> (ø)
...stReportView/MoneyRequestReportTransactionItem.tsx 0.00% <ø> (ø)
src/libs/DebugUtils.ts 68.89% <100.00%> (+0.06%) ⬆️
src/libs/ReportUtils.ts 79.32% <100.00%> (+0.08%) ⬆️
src/libs/TransactionUtils/index.ts 83.24% <100.00%> (+0.26%) ⬆️
...archList/ListItem/TransactionGroupListExpanded.tsx 66.66% <0.00%> (ø)
src/components/Search/index.tsx 0.70% <0.00%> (ø)
src/components/TransactionItemRow/index.tsx 85.04% <75.00%> (ø)
src/libs/CardUtils.ts 81.62% <0.00%> (-1.87%) ⬇️
...stReportView/MoneyRequestReportTransactionList.tsx 0.00% <0.00%> (-1.15%) ⬇️
... and 1 more
... and 9 files with indirect coverage changes

@trjExpensify
Copy link
Contributor

Do we need @QichenZhu to review this?

@mukhrr
Copy link
Contributor Author

mukhrr commented Mar 3, 2026

Do we need @QichenZhu to review this?

I think so.

@trjExpensify
Copy link
Contributor

Okay, let's jump on that ASAP to fix these blockers.

@trjExpensify trjExpensify requested review from JS00001 and QichenZhu and removed request for inimaga March 3, 2026 10:47
@trjExpensify
Copy link
Contributor

@JS00001 I'm going to put you on this for internal as it's from the columns PR. 👍

@QichenZhu
Copy link
Contributor

#83959

  • Create an expense with foreign currency
  • Verify Exchange Rate is not empty

As far as I know, it needs backend changes.

@mukhrr
Copy link
Contributor Author

mukhrr commented Mar 3, 2026

#83959

  • Create an expense with foreign currency
  • Verify Exchange Rate is not empty

As far as I know, it needs backend changes.

Hmm, after checking several times, you seem to be right. My first conclusion seems correct here #83959 (comment) (strikethroughed one)

@QichenZhu
Copy link
Contributor

@trjExpensify @JS00001, can we hide the Exchange rate column for now since the backend doesn't support it yet?

@trjExpensify
Copy link
Contributor

@JS00001 - don't we have currencyConversionRate stored on the transaction object to utilise? 🤔

image

luacmartins
luacmartins previously approved these changes Mar 20, 2026
Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

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

Nice! I mostly reviewed to check that there wasn't any performance regression to navigating to Search and I can confirm this didn't regress performance

@mukhrr
Copy link
Contributor Author

mukhrr commented Mar 20, 2026

The card column is still inconsistent between the report and search pages. Can we handle it separately?

@QichenZhu thanks for review and feedbacks! I think I should fix this.

@luacmartins
Copy link
Contributor

@mukhrr we have a few failing checks

@mukhrr
Copy link
Contributor Author

mukhrr commented Mar 20, 2026

Yes I am working on this yet

@mukhrr
Copy link
Contributor Author

mukhrr commented Mar 21, 2026

@QichenZhu mind checking one more time, pls?!

I also fixed hiding empty columns based on #83974 (comment)

We show them in Expenses page on Staging now
image

…s in custom reports based on transaction data
@mukhrr mukhrr requested a review from QichenZhu March 21, 2026 03:44
@QichenZhu
Copy link
Contributor

QichenZhu commented Mar 23, 2026

@mukhrr I don't think the issue is fixed. I suggested handling it separately because I was not sure if you could reproduce and test it. Do you have a company card test account?

The recent commits don't seem relevant to the issue. Could you clarify what they address, or revert them?

@mukhrr
Copy link
Contributor Author

mukhrr commented Mar 23, 2026

I also fixed hiding empty columns based on #83974 (comment)

We show them in Expenses page on Staging now

They fix this @QichenZhu

About Card column, yeah I couln't reproduce it

@QichenZhu
Copy link
Contributor

@trjExpensify @JS00001, is it possible to set up an account for @mukhrr to test company card expenses?

@trjExpensify
Copy link
Contributor

On staging and dev do you not all see the "Mock bank" option to connect to?

@mukhrr
Copy link
Contributor Author

mukhrr commented Mar 23, 2026

Yes but how to create expenses with card?

@JS00001
Copy link
Contributor

JS00001 commented Mar 23, 2026

Via Plaid
Login to NewDot on staging or dev. This will not work on production.

Go to Workspaces and create or open a USD workspace.

Tap Company cards.

Tap Add cards.

Proceed with United States.

Proceed with Direct feed.

Select Other and then Next. This opens the Plaid UI.

Tap Continue as guest.

Select any bank. I typically do US Bank.

Enter the Plaid test credentials:

username: user_good

password: pass_good

If prompted for a security code, enter: credential_good.

Select the Plaid credit card ending x3333. This card has test transactions you can use to test/demo features on the reports page that require transactions. If you need a 2nd card, the checking account ending in x0000 has transactions as well.

Follow the remaining steps to connect the card(s) in Plaid.

Select a statement close date.

Tap Assign card and follow the steps to assign the card(s). Select From the beginning to import historical transactions.

You can now use this card and its transactions to test/demo third-party cards, including features like Statements on the Reports page.

@luacmartins
Copy link
Contributor

@mukhrr conflicts

@mukhrr
Copy link
Contributor Author

mukhrr commented Mar 24, 2026

@QichenZhu it seems this bug pre-existing before the PR and I am curios which one is correct. Report layout or expenses page

image image

cc @JS00001 @trjExpensify

@QichenZhu
Copy link
Contributor

@mukhrr, even if the bug existed before, this PR will unmask it, so we need to either resolve it ourselves or wait until it is fixed.

@mukhrr
Copy link
Contributor Author

mukhrr commented Mar 24, 2026

@mukhrr, even if the bug existed before, this PR will unmask it, so we need to either resolve it ourselves or wait until it is fixed.

@QichenZhu Yes, absolutely agree with that. I assume expenses page shows card column correclty and applied it for report layout too

image

Copy link
Contributor

@QichenZhu QichenZhu left a comment

Choose a reason for hiding this comment

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

Image

Good job! The card name issue is resolved.

However, the search page doesn't show deleted cards as deleted after applying this PR. Please see the comment below.

@mukhrr mukhrr requested a review from QichenZhu March 24, 2026 17:20
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.

5 participants