Skip to content

[Due for payment 2025-11-19] [$250] Tag - The search bar is displayed when the number of tag < 8 #73079

Closed

Description

@nlemma

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.2.34-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-1374/folder/13176676/41237309/962797970
Email or phone of affected tester (no customers): sustinov@applausemail.com
Issue reported by: Applause Internal Team
Device used: Macbook/13.7.8/Chrome
App Component: Workspace Settings

Action Performed:

  1. Open the Expensify app
  2. Log in with your new HT account
  3. Create a WS
  4. Turn on TAG
  5. Import a list of more than 8 tags
  6. Turn off all tags
  7. Turn on only 3 tags
  8. Go to the WS room
  9. Start creating manual expenses
  10. Enter the amount - next
  11. Click on the TAG field

Expected Result:

The search bar should disappear when the number of tags is less than 8

Actual Result:

The search bar is displayed when the number of tag < 8

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

Bug6979772_1760962061135.Recording__323__2_.mp4

Bug6979772_1760962061113!Tags-2024-11-07_15_43_12.804.csv

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021982653574093305010
  • Upwork Job ID: 1982653574093305010
  • Last Price Increase: 2025-10-27
Issue OwnerCurrent Issue Owner: @brianlee-expensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 21, 2025
  2. melvin-bot commented on Oct 21, 2025

    @melvin-bot

    Triggered auto assignment to @brianlee-expensify (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.

  3. nkdengineer commented on Oct 21, 2025

    @nkdengineer
    Contributor

    Proposal

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

    The search bar is displayed when the number of tag < 8

    What is the root cause of that problem?

    we are using enabledTags variable (filtered for UI rendering purposes) to decide business logic (show search bar), instead of using original data policyTagList.tags

    const isTagsCountBelowThreshold = availableTagsCount < CONST.STANDARD_LIST_ITEM_LIMIT;
    const shouldShowTextInput = !isTagsCountBelowThreshold;

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

    We should update this logic to use getCountOfEnabledTagsOfList function like the way we did in category picker here

        const availableTagsCount = getCountOfEnabledTagsOfList(policyTagList.tags);
        const shouldShowTextInput = availableTagsCount >= CONST.STANDARD_LIST_ITEM_LIMIT;
    

    const categoriesCount = getEnabledCategoriesCount(categories);
    const isCategoriesCountBelowThreshold = categoriesCount < CONST.STANDARD_LIST_ITEM_LIMIT;
    const showInput = !isCategoriesCountBelowThreshold;

    Note: we should do the same with other picker that has the same problem

    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)

    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.

  4. ShridharGoel commented on Oct 21, 2025

    @ShridharGoel
    Contributor

    Proposal

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

    When a workspace has fewer than eight enabled tags, the tag picker should hide the search bar but it doesn't.

    What is the root cause of that problem?

    The component decides if the search input should appear by counting every tag returned from Onyx, even the entries that are disabled. After you turn off tags, the disabled items are still counted, so the app believes there are eight or more tags and keeps the search field visible.

    const availableTagsCount = Array.isArray(enabledTags) ? enabledTags.length : Object.keys(enabledTags).length;
    const isTagsCountBelowThreshold = availableTagsCount < CONST.STANDARD_LIST_ITEM_LIMIT;
    const shouldShowTextInput = !isTagsCountBelowThreshold;

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

    Update the tag counter to look only at enabled tags and move the calculation into a memoized helper so it stays in sync with the tag list. That way, once the active tags drop under the limit, the search input hides.

    Change in src/components/TagPicker.tsx:

        const availableTagsCount = useMemo(() => {
            if (Array.isArray(enabledTags)) {
                return enabledTags.filter((tag) => tag.enabled).length;
            }
    
            return Object.values(enabledTags ?? {}).filter((tag) => tag.enabled).length;
        }, [enabledTags]);
        const shouldShowTextInput = availableTagsCount >= CONST.STANDARD_LIST_ITEM_LIMIT;
  5. brianlee-expensify commented on Oct 27, 2025

    @brianlee-expensify
    Contributor

    verified reproducible on new.expensify.com

    2025-10-26_20-39-17.1.mp4
  6. changed the title [-]Tag - The search bar is displayed when the number of tag < 8[/-] [+][$250] Tag - The search bar is displayed when the number of tag < 8[/+] on Oct 27, 2025
  7. melvin-bot commented on Oct 27, 2025

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 27, 2025
  9. melvin-bot commented on Oct 27, 2025

    @melvin-bot

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

  10. brianlee-expensify commented on Oct 27, 2025

    @brianlee-expensify
    Contributor

    may be related to this previous issue: #69348

  11. 34 remaining items

  12. changed the title [-][$250] Tag - The search bar is displayed when the number of tag < 8[/-] [+][Due for payment 2025-11-19] [$250] Tag - The search bar is displayed when the number of tag < 8[/+] on Nov 12, 2025
  13. melvin-bot commented on Nov 12, 2025

    @melvin-bot

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

  14. melvin-bot commented on Nov 12, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.54-1 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-11-19. 🎊

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

  15. melvin-bot commented on Nov 12, 2025

    @melvin-bot

    @jayeshmangwani @brianlee-expensify 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]

  16. brianlee-expensify commented on Nov 19, 2025

    @brianlee-expensify
    Contributor

    @jayeshmangwani can you complete the bugzero checklist and confirm whether a regression test is required for this?

  17. ShridharGoel commented on Nov 19, 2025

    @ShridharGoel
    Contributor

    @brianlee-expensify Can we please have the payment summary here since it is due for payment?

  18. jayeshmangwani commented on Nov 20, 2025

    @jayeshmangwani
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: Use available tags count based on selection in TagPicker component #69829

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: Not that CRITICAL

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    1. Go to Workspaces.
    2. Create a new workspace.
    3. Turn on Tags.
    4. Import a list of more than 8 tags.
    5. Turn off all tags except 4.
    6. Navigate to the Workspace Expenses.
    7. Start creating a manual expense.
    8. Enter the amount and click Next.
    9. Click on the Tag field.
    10. Verify that the search bar disappears when the number of enabled tags is fewer than 8.

    Do we agree 👍 or 👎

  19. jayeshmangwani commented on Nov 20, 2025

    @jayeshmangwani
    Contributor

    @brianlee-expensify , yes, I think we can add a new regression test case for this.

  20. brianlee-expensify commented on Nov 22, 2025

    @brianlee-expensify
    Contributor

    Payment Summary

    Contributor: @ShridharGoel due $250 via NewDot
    Contributor+: @jayeshmangwani due $250 via NewDot

  21. trjExpensify commented on Dec 3, 2025

    @trjExpensify
    Contributor

    approved $250 for @jayeshmangwani

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions