Skip to content

Batch expense review filter changes and show the filtered total - #151

Merged
sprucely merged 1 commit into
mainfrom
swe/expense-review-multiselect-filters
Nov 30, 2026
Merged

sprucely merged 1 commit into
mainfrom
swe/expense-review-multiselect-filters

Conversation

@sprucely

@sprucely sprucely commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator
  • Apply multi-select changes once when the filter menu closes.
  • Keep Export CSV and Continue disabled while edits are pending or results are loading.
  • Show the total amount across all filtered rows above the table.

Closes #146

Summary by CodeRabbit

  • New Features
    • Expense review filters now support selecting multiple options, with changes applied when the picker closes.
    • Transaction results show the filtered total amount and grouped-row count.
  • Improvements
    • CSV export and workflow continuation remain unavailable while filter edits are pending or required transaction results are loading or unsuccessful.
    • Changing filters or include states updates the displayed filtered total.

- Apply multi-select changes once when the filter menu closes.
- Keep Export CSV and Continue disabled while edits are pending or results are loading.
- Show the total amount across all filtered rows above the table.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Expense Review filter dropdowns now support multi-select edits that apply when the dropdown closes. Export and Continue are disabled during pending filter edits and required transaction requests. Transaction results display the filtered total and grouped-row count.

Changes: Expense Review filters and results

Layer / File(s) Summary
Multi-select picker behavior
client/src/components/expenseReview/FilterTypeahead.tsx, client/src/test/components/expenseReview/FilterTypeahead.test.tsx
The picker supports draft multi-selection and applies changed selections when it closes. Single-choice behavior remains available. Tests cover click, keyboard, blur, Escape, outside clicks, and unchanged selections.
Filter application and action gating
client/src/components/expenseReview/ExpenseReviewStage.tsx, client/src/test/components/expenseReview/ExpenseReviewStage.test.tsx
ExpenseReviewStage applies selected values through a transition. Export and Continue are disabled while filter edits or required transaction requests are pending. Tests cover multi-value filters, requests, export, and workflow continuation.
Filtered result summary
client/src/components/expenseReview/ExpenseReviewStage.tsx, client/src/test/components/expenseReview/ExpenseReviewStage.test.tsx
Results display the filtered total alongside the grouped-row count. Tests cover totals across pages, filter changes, and states without displayed results.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor Reviewer
  participant FilterTypeahead
  participant ExpenseReviewStage
  participant TransactionAPI
  participant ExportControl
  Reviewer->>FilterTypeahead: Select multiple filter options
  FilterTypeahead->>ExpenseReviewStage: Commit selection when dropdown closes
  ExpenseReviewStage->>TransactionAPI: Request filtered transactions
  TransactionAPI-->>ExpenseReviewStage: Return filtered results
  ExpenseReviewStage-->>ExportControl: Enable actions when pending work completes
Loading

Possibly related PRs

  • ucdavis/AD419#126: Changes when Expense Review loads data after filter selections, which is related to when this PR applies multi-select edits and gates actions during loading.
  • ucdavis/AD419#123: Adds Expense Review CSV export, whose control state this PR changes.

Suggested reviewers: rmartinsen-ucd

Merge Risk: Minimal · up to 52b3f

Expense Review filters now support multi-select edits that apply when the dropdown closes, and a filtered total appears above the results. Export and Continue stay disabled while edits or loads are pending. No concrete merge-blocking risk was found in the supplied changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Batch expense review filter changes and show the filtered total" matches the main changes. The diff adds multi-select filter support in FilterTypeahead, applies filter edits once when the m…
Linked Issues check Passed Directly linked issue #146 has two coding requirements: (1) multiselect Expense Review filter dropdowns, allowing more than one value per filter; (2) a total above the results that reflects the curren…
Out of Scope Changes check Passed The PR changes stay within the filter and results area named by #146, with these related items:
- Applying multi-select changes once on menu close: part of the multiselect behavior in FilterTypeahead.…
Full details: Title check

Explanation

The title "Batch expense review filter changes and show the filtered total" matches the main changes. The diff adds multi-select filter support in FilterTypeahead, applies filter edits once when the menu closes, disables Export and Continue while edits are pending, and shows a filtered total above the results. The title names the two primary aspects of the change. It does not mention the multi-select capability or the disabled-state behavior, which is acceptable for a title.

Full details: Linked Issues check

Explanation

Directly linked issue #146 has two coding requirements: (1) multiselect Expense Review filter dropdowns, allowing more than one value per filter; (2) a total above the results that reflects the current filters.

Requirement 1 (multiselect filters): FilterTypeahead.tsx now has a multi-select mode with a draft selection, option toggling, and a commit of changed selections on popup close. The stage's test helper selects multiple options, and CSV export tests cover multiple selected funds, which relies on multi-select values reaching the filters. The exact JSX wiring in ExpenseReviewStage.tsx was not fully read because the file output was truncated. This wiring is supported by the test coverage summary but was not confirmed line by line.

Requirement 2 (filtered total): ExpenseReviewStage.tsx shows the filtered total amount with the transaction results. Tests assert the "Filtered total" label on idle, cleared-filter, obsolete-request, and empty-result states, and verify that the total stays above both result pages and updates with include state.

No unmet coding requirement was found in the evidence. Automated tests exist for both requirements.

Full details: Out of Scope Changes check

Explanation

The PR changes stay within the filter and results area named by #146, with these related items:

  • Applying multi-select changes once on menu close: part of the multiselect behavior in FilterTypeahead.tsx.
  • Disabling Export CSV and Continue while filters are edited, applied, or loading: a guard that prevents exporting or continuing with stale results. It sits in the results and filter flow. The PR description lists it as intended.
  • Removing the grouped-row count above the filter controls and showing a singularized grouped-row count with the total: a results-area display change. The PR description lists it as intended.
  • Tests and fixtures: they support the changed behavior.

No change was demonstrated to be unrelated to #146. The Export and Continue guard and the count display change are not named in #146 itself. They fall under the results changes that the PR objectives describe.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0689cd5c-072f-423f-8e3e-10fcc8fa9017
Commits

Reviewing files that changed from the base of the PR and between acdf4c0 and 52b3f6a.

Files selected for processing: 4

  • client/src/components/expenseReview/ExpenseReviewStage.tsx
  • client/src/components/expenseReview/FilterTypeahead.tsx
  • client/src/test/components/expenseReview/ExpenseReviewStage.test.tsx
  • client/src/test/components/expenseReview/FilterTypeahead.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sprucely
sprucely merged commit 13b6f34 into main Nov 30, 2026
5 checks passed
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.

Expense Review: multiselect dropdowns and a total above the results

2 participants