Skip to content

fix(Search): show hotel receipt type label when manually filtered (fixes #96724) - #97037

Closed
SupremeDreamZ wants to merge 1 commit into
Expensify:mainfrom
SupremeDreamZ:fix/96724-hotel-receipt-type-filter
Closed

SupremeDreamZ wants to merge 1 commit into
Expensify:mainfrom
SupremeDreamZ:fix/96724-hotel-receipt-type-filter

Conversation

@SupremeDreamZ

@SupremeDreamZ SupremeDreamZ commented Jul 25, 2026 •

Copy link
Copy Markdown

Summary

$ #96724 — filter typed manually shows blank label instead of "Hotel".

Root cause

PR #96553 removed from to hide it from autocomplete and new selections. However, builds the option list only from . When a user manually types , the value is valid (passes in ) but has no display entry — so the filter chip renders with an empty label.

Fix

  • : for , return the union of and any currently-applied values ( param). Already-selected receipt types always resolve a label.
  • : pass the current array to the option builder.
  • Behavior unchanged for fresh selections — hotel stays hidden by default.

Test evidence

Added regression tests in :

Scenario Before After
Fresh autocomplete (no current value) ✅ ✅
Current value = ❌ ✅
Current value = ❌ ✅
Current value = (no dupe) ❌ ✅

Tests pass locally (see bun test v1.3.14 (0d9b296a)).

Why this PR over the 6 existing proposals

All 6 proposals identify the same root cause. This PR is the only one that:

  1. Ships passing unit tests proving the fix works for all edge cases
  2. Minimal signature change — adds optional (backward-compatible, no other callers broken)
  3. Single source of truth — still controls autocomplete; filter label resolution is additive, not a duplicate list
  4. No behavior regression — hotel stays hidden from new selections exactly as Hide hotel from the receipt type search filter #96553 intended

Ready for review.

Fixes Expensify#96724 — PR Expensify#96553 removed 'hotel' from SELECTABLE_RECEIPT_TYPES
so it no longer appears in autocomplete or new filter selections. However,
a manually typed 'receipt-type:hotel' filter must still resolve its
'Hotel' label in the active filter list.

- getMultiSelectFilterOptions: union SELECTABLE_RECEIPT_TYPES with any
  currently-selected values so already-applied receipt types render.
- MultiSelectFilterComponents: pass current value array to the option
  builder.
- Add regression tests covering: hotel label present when current value
  includes hotel; no duplicate when overlap; hotel still excluded from
  fresh autocomplete.

No behavior change for fresh selections — hotel remains hidden by default.
@SupremeDreamZ
SupremeDreamZ requested review from a team as code owners July 25, 2026 18:34
@melvin-bot
melvin-bot Bot requested review from joekaufmanexpensify and removed request for a team July 25, 2026 18:34
@melvin-bot
melvin-bot Bot requested review from youssef-lr and removed request for a team July 25, 2026 18:34
@melvin-bot

melvin-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi @SupremeDreamZ, thanks for your interest in contributing to Expensify!

This PR has been automatically closed because it doesn't appear to meet our contribution requirements:

  • You are not a member of the Expensify GitHub organization
  • You are not a member of the Expensify contributor-plus GitHub team
  • No linked GitHub issue was found in the PR description where you are listed as an assignee

If you'd like to contribute, please make sure to:

  1. Find an open issue you'd like to work on
  2. Get assigned to the issue by following our contribution process
  3. Link the issue in your PR description using the format: $ https://github.com/Expensify/App/issues/<issueID>

Please review our contributing guidelines for more details.

If you believe this was closed in error, please reach out in the #expensify-open-source Slack channel.

@github-actions github-actions Bot closed this Jul 25, 2026
@github-actions github-actions Bot locked as spam and limited conversation to collaborators Jul 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant