Skip to content

Add a sortable Rejected column to Search - #104566

Open
c3024 wants to merge 4 commits into
Expensify:mainfrom
c3024:chaitanya/685831-rejected-column
Open

c3024 wants to merge 4 commits into
Expensify:mainfrom
c3024:chaitanya/685831-rejected-column

Conversation

@c3024

@c3024 c3024 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds an optional Rejected column to Spend > Expenses and Spend > Reports, next to the declined: filter from #103309. It shows Yes or No like Billable, can be sorted by, and is included in Export > Current view with the same "Rejected" label as the filter.

The column key is declined. When it is shown or sorted by, the backend returns a boolean declined on each expense and expense report, and the export adds a declined column. That backend change is https://github.com/Expensify/Auth/pull/25720, which is deployed.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/685831
PROPOSAL:

Tests

  1. As a submitter on a workspace with approvals, submit three reports to an approver.
  2. As the approver, reject one expense on the first report.
  3. As the approver, reject the whole second report.
  4. As the submitter, go to Spend > Expenses and open the column picker.
  5. Verify Rejected is listed and is not selected by default.
  6. Select Rejected and save.
  7. Verify the Rejected column shows Yes for the rejected expense and No for the others.
  8. Click the Rejected column header.
  9. Verify the rejected expense moves to the top, then to the bottom when the header is clicked again.
  10. Click Export > Current view and open the file.
  11. Verify it has a Rejected column with Yes for the rejected expense and No for the others.
  12. Go to Spend > Reports, open the column picker, select Rejected and save.
  13. Verify the Rejected column shows Yes for the second report and No for the first and third reports.
  14. Click the Rejected column header.
  15. Verify the second report moves to the top, then to the bottom when the header is clicked again.
  16. Click Export > Current view and open the file.
  17. Verify it has a Rejected column with Yes for the second report and No for the others.
  • Verify that no errors appear in the JS console

Offline tests

  1. Show the Rejected column on Spend > Expenses while online.
  2. Go offline.
  3. Verify the Rejected column still shows the values that were loaded.

QA Steps

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 any copy / text that was added to the app 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 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 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 the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari 685831-col-12-offline 685831-col-10-reports-sort-2 685831-col-09-reports-sort-1 685831-col-08-reports-column 685831-col-06-export-menu 685831-col-05-expenses-sort-2 685831-col-04-expenses-sort-1 685831-col-03-expenses-column 685831-col-02-picker-selected

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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 Δ
src/CONST/index.ts 95.90% <ø> (ø)
...omponents/Search/SearchList/ListItem/YesNoCell.tsx 100.00% <100.00%> (ø)
src/components/Search/SearchList/ListItem/types.ts 100.00% <ø> (ø)
src/components/Search/SearchTableHeader.tsx 48.91% <ø> (ø)
...ents/TransactionItemRow/TransactionItemRowWide.tsx 98.48% <100.00%> (ø)
src/libs/SearchUIUtils.ts 73.95% <100.00%> (+0.21%) ⬆️
src/libs/getTransactionFromTransactionListItem.ts 100.00% <ø> (ø)
src/styles/utils/index.ts 66.27% <100.00%> (-0.20%) ⬇️
src/components/Search/SortableTableHeader.tsx 45.83% <0.00%> (ø)
...ReportListItemRow/ExpenseReportListItemRowWide.tsx 0.00% <0.00%> (ø)
... and 17 files with indirect coverage changes

c3024 added 2 commits October 25, 2026 17:11
…cted-column

# Conflicts:
#	src/CONST/index.ts
#	src/components/Search/SearchTableHeader.tsx
#	src/components/Search/SortableTableHeader.tsx
#	src/components/TransactionItemRow/TransactionItemRowWide.tsx
#	src/libs/SearchUIUtils.ts
#	src/styles/utils/index.ts
#	tests/unit/Search/__snapshots__/ColumnAvailabilityTest.ts.snap
@c3024 c3024 changed the title [HOLD Auth 25720] Add a sortable Rejected column to Search Add a sortable Rejected column to Search Oct 25, 2026
@c3024
c3024 marked this pull request as ready for review October 26, 2026 07:44
@c3024
c3024 requested review from a team as code owners October 26, 2026 07:44
@melvin-bot
melvin-bot Bot requested review from ikevin127 and removed request for a team October 26, 2026 07:44
@melvin-bot

melvin-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

@ikevin127 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 requested review from dylanexpensify and removed request for a team October 26, 2026 07:44
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-26T07:44:21.931455Z 73c2826 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

/>
</View>
),
[CONST.SEARCH.TABLE_COLUMNS.DECLINED]: (

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.

❌ CONSISTENCY-3 (docs)

This new DECLINED cell renders a Yes/No value with <View style={[getSearchColumnStyles(column)]}><Text selectable dataSet={COPYABLE_TEXT_DATA_SET}>{value ? translate('common.yes') : translate('common.no')}</Text></View>, which is the exact structure already implemented by the renderYesNoCell helper in TransactionItemRowWide.tsx (lines 183-195). Duplicating this across the two row components means a future change to the Yes/No cell (styling, copy, clipboard behavior) has to be made in two places and can drift.

Extract the Yes/No cell into a shared component (e.g. SearchList/ListItem/YesNoCell.tsx) and use it from both rows:

[CONST.SEARCH.TABLE_COLUMNS.DECLINED]: (
    <YesNoCell
        columnName={CONST.SEARCH.TABLE_COLUMNS.DECLINED}
        value={!!item.declined}
    />
),

and have TransactionItemRowWide.tsx's renderYesNoCell delegate to the same component.


Reviewed at: 73c2826 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

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.

Moved the Yes/No cell into a shared YesNoCell component that both rows use, in 6131f51.

This branch has not been deployed

No deployments
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.

1 participant