Skip to content

[Due for payment 2025-05-22] [Due for payment 2025-05-20] [$250] Report fields - Search field disappears after entering search term #61652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
6 of 8 tasks
mitarachim opened this issue May 8, 2025 · 31 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2

Comments

@mitarachim
Copy link

mitarachim commented May 8, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.1.42-0
Reproducible in staging?: Yes
Reproducible in production?: Unable to check
If this was caught during regression testing, add the test name, ID and link from TestRail: #60488
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Report fields are enabled in workspace settings > More features.
  • Create a list type report field with at least 16 list values.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Report fields.
  3. Click on the list type report field.
  4. Click List values.
  5. Enter search term in the search field.

Expected Result:

Search field will not disappear after entering search term.

Actual Result:

Search field disappears after entering search term.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6825246_1746684692248.20250508_140838.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021920379890102559140
  • Upwork Job ID: 1920379890102559140
  • Last Price Increase: 2025-05-15
Issue OwnerCurrent Issue Owner: @OfstadC
@mitarachim mitarachim added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels May 8, 2025
Copy link

melvin-bot bot commented May 8, 2025

Triggered auto assignment to @OfstadC (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

Copy link

melvin-bot bot commented May 8, 2025

Triggered auto assignment to @nkuoch (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented May 8, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels May 8, 2025
Copy link
Contributor

github-actions bot commented May 8, 2025

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@Burhan-Rashid
Copy link

Burhan-Rashid commented May 8, 2025

Proposal

Please re-state the problem that we are trying to solve in this issue.

Report fields - Search field disappears after entering search term

What is the root cause of that problem?

we are showing the search bar only if the length of the filtered list items is greater than 15. Once we enter some text in the search bar and the matching items list length is less than 15, the search bar disappears.

{filteredListValues.length > CONST.SEARCH_ITEM_LIMIT && (
<SearchBar
label={translate('workspace.reportFields.findReportField')}

Issue coming from this PR: #60488

What changes do you think we should make in order to solve the problem?

Instead of using the filtered list length filteredListValues.length, we need to use the original list length data.length

{data?.length > CONST.SEARCH_ITEM_LIMIT && (
                    <SearchBar
                        label={translate('workspace.reportFields.findReportField')}
                        inputValue={inputValue}
                        onChangeText={setInputValue}
                        shouldShowEmptyState={!shouldShowEmptyState && filteredListValues.length === 0}
                    />
                )}

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@nkuoch
Copy link
Contributor

nkuoch commented May 8, 2025

@daledah is already working on a fix

@nkuoch nkuoch added the External Added to denote the issue can be worked on by a contributor label May 8, 2025
@melvin-bot melvin-bot bot changed the title Report fields - Search field disappears after entering search term [$250] Report fields - Search field disappears after entering search term May 8, 2025
Copy link

melvin-bot bot commented May 8, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021920379890102559140

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 8, 2025
Copy link

melvin-bot bot commented May 8, 2025

Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)

@nkuoch
Copy link
Contributor

nkuoch commented May 8, 2025

oops, I should probably not have added the external label. Can you remove the upwork job @OfstadC ?

@olivierhabi
Copy link

Proposal

Please re-state the problem that we are trying to solve in this issue.

On the "List values" screen for a report field, the search bar (labeled "Find report field") disappears if the user types a search term that reduces the number of displayed items to below a certain count. This happens even if the search bar was initially shown because the total list was long. This prevents the user from easily changing or clearing their search.

What is the root cause of that problem?

The search bar's visibility is currently determined by whether the number of filtered list items (items matching the search term) is greater than a predefined limit. If searching reduces the item count below this limit, the condition to show the search bar becomes false, and it disappears. The visibility should instead be based on the length of the original, complete list of values.

{filteredListValues.length > CONST.SEARCH_ITEM_LIMIT && (
<SearchBar
label={translate('workspace.reportFields.findReportField')}
inputValue={inputValue}
onChangeText={setInputValue}
shouldShowEmptyState={!shouldShowEmptyState && filteredListValues.length === 0}
/>
)}

What changes do you think we should make in order to solve the problem?

We will modify the condition that decides whether to show the SearchBar component in the ReportFieldsListValuesPage.js file.
Instead of checking if the number of filtered list items is above a certain limit, the new condition will check two things:

  1. That the original, unfiltered list of values is not empty.
  2. That the total number of items in this original, unfiltered list is greater than the predefined limit.

This change ensures that if the search bar is displayed because the overall list is long enough, it will stay visible even if the user's search term results in few or no matching items.

 {!shouldShowEmptyState && data.length > CONST.SEARCH_ITEM_LIMIT && (
              <SearchBar
                  label={translate('workspace.reportFields.findReportField')}
                  inputValue={inputValue}
                  onChangeText={setInputValue}
                  shouldShowEmptyState={!shouldShowEmptyState && filteredListValues.length === 0}
              />
  )}

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

None

What alternative solutions did you explore? (Optional)

None

@Shehram33
Copy link

The search field in the List Values modal was disappearing after entering a search term due to unnecessary re-renders of the parent component. I refactored the component structure to ensure the search field remains persistently mounted and applied local filtering of the list values based on the search term. Tested and confirmed the fix works across Web, Desktop, iOS, and Android.

Copy link

melvin-bot bot commented May 8, 2025

📣 @Shehram33! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@Shehram33
Copy link

Shehram33 commented May 8, 2025 via email

Copy link

melvin-bot bot commented May 8, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented May 8, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented May 8, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@bradyrose
Copy link

bradyrose commented May 8, 2025

Withdrawing this proposal to comply with Expensify’s one-proposal-at-a-time policy.
Hope to circle back if it’s still open later. Thanks!

Copy link

melvin-bot bot commented May 9, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels May 9, 2025
@IuliiaHerets
Copy link

Search field will not disappear after entering the search term. - fixed
BUT there is another bug - it does not filter the result, seems the same root

20250509_193610.mp4

@IuliiaHerets
Copy link

If we need to raise a new issue, let us know

@daledah
Copy link
Contributor

daledah commented May 9, 2025

It's the same RCA as #61752 so I think we don't need a new issue.

Copy link

melvin-bot bot commented May 9, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@mountiny mountiny removed the DeployBlocker Indicates it should block deploying the API label May 12, 2025
@francoisl francoisl removed the DeployBlockerCash This issue or pull request should block deployment label May 13, 2025
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 13, 2025
@melvin-bot melvin-bot bot changed the title [$250] Report fields - Search field disappears after entering search term [Due for payment 2025-05-20] [$250] Report fields - Search field disappears after entering search term May 13, 2025
Copy link

melvin-bot bot commented May 13, 2025

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 13, 2025
Copy link

melvin-bot bot commented May 13, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.44-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-05-20. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented May 13, 2025

@sobitneupane @OfstadC @sobitneupane The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

Copy link

melvin-bot bot commented May 15, 2025

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels May 15, 2025
@melvin-bot melvin-bot bot changed the title [Due for payment 2025-05-20] [$250] Report fields - Search field disappears after entering search term [Due for payment 2025-05-22] [Due for payment 2025-05-20] [$250] Report fields - Search field disappears after entering search term May 15, 2025
Copy link

melvin-bot bot commented May 15, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.45-21 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-05-22. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented May 15, 2025

@sobitneupane @OfstadC @sobitneupane The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@sobitneupane
Copy link
Contributor

This was a regression, and it has been addressed. I believe the issue can now be closed.

@OfstadC OfstadC closed this as completed May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2
Projects
None yet
Development

No branches or pull requests