Skip to content

[Due for payment 2025-09-19] [$250] Dependent tags - Search field is shown in the tag list when there is less than 8 tags #69348

Closed

Description

@jponikarchuk

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.1.99-5
Reproducible in staging?: Yes
Reproducible in production?: Unable to validate in Prod
If this was caught during regression testing, add the test name, ID and link from TestRail: #69118
Email or phone of affected tester (no customers): sdhusdhbidshius@gmail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Import dependent tags to the workspace using the file attached.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Click + > Create expense > Manual.
  4. Enter amount > Next.
  5. On confirm page, click Fund > Select Woodbridge : Operations.
  6. Click GL > Select 91.
  7. Click GL_DEPARTMENT_DESCRIPTION.

Expected Result:

There will be no search field in the tag list when there is less than 8 tags.

Actual Result:

Search field is shown in the tag list when there is less than 8 tags.

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

Dep_tags.csv

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021960773407717036167
  • Upwork Job ID: 1960773407717036167
  • Last Price Increase: 2025-08-27
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @kadiealexander

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 27, 2025
  2. melvin-bot commented on Aug 27, 2025

    @melvin-bot

    Triggered auto assignment to @kadiealexander (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. melvin-bot commented on Aug 27, 2025

    @melvin-bot

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

  4. melvin-bot commented on Aug 27, 2025

    @melvin-bot

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

  5. github-actions commented on Aug 27, 2025

    @github-actions
    Contributor

    👋 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.
  6. ShridharGoel commented on Aug 27, 2025

    @ShridharGoel
    Contributor

    Proposal

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

    The tag search field incorrectly appears when there are fewer than 8 tags available in the current context.

    What is the root cause of that problem?

    In multi-level tag systems, the search field shows even when a parent tag (e.g., "Woodbridge") has only 1 child tag, because the component was counting all policy tags instead of contextually filtered tags.

    1. getCountOfEnabledTagsOfList(policyTagList.tags) counts ALL tags in the policy, not the tags available in the current selection context
    2. Default parameter logic shouldShowTextInput = !!textInputLabel || !!textInputIconLeft overrides explicit props when textInputLabel is passed

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

    Instead of counting all policy tags, count the tags that are actually available to the user in the current context:

    // Before: Counted all policy tags
    const policyTagsCount = getCountOfEnabledTagsOfList(policyTagList.tags);
    
    // After: Count filtered/available tags
    const availableTagsCount = Array.isArray(enabledTags) ? enabledTags.length : Object.keys(enabledTags).length;

    Also, prevent BaseSelectionList default override by conditionally passing textInputLabel:

    <SelectionList
        textInputLabel={shouldShowTextInput ? translate('common.search') : undefined}
        // ... other props
    />

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

    We can add new tests to ensure that such scenarios of filtered tags are handled.

  7. Eskalifer1 commented on Aug 27, 2025

    @Eskalifer1
    Contributor

    Proposal

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

    Dependent tags - Search field is shown in the tag list when there is less than 8 tags

    What is the root cause of that problem?

    We display search results only if there are more than 8 items:

    const policyTagList = getTagList(policyTags, tagListIndex);
    const policyTagsCount = getCountOfEnabledTagsOfList(policyTagList.tags);
    const isTagsCountBelowThreshold = policyTagsCount < CONST.STANDARD_LIST_ITEM_LIMIT;
    const shouldShowTextInput = !isTagsCountBelowThreshold;

    But since the tags are dependent, we have a slightly different logic: we display each subsequent tag after “:”. There were 6 tags at the first level, so their length is 6, at the second level there is 1, so the length remains 6, but at the third level their number increases and 6 more are added to each of the previous tags, resulting in 100 tags, but only 1 is displayed.

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

    We need to obtain the length of the elements that are actually displayed. To do this, we can count all the elements inside the data of each element:

        const tagsLength = sections.reduce((total, section) => total + (section.data?.length ?? 0), 0);
    
        const isTagsCountBelowThreshold = tagsLength && tagsLength < CONST.STANDARD_LIST_ITEM_LIMIT;
    
        const shouldShowTextInput = !isTagsCountBelowThreshold;

    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.

  8. samranahm commented on Aug 27, 2025

    @samranahm
    Contributor

    Unable to produce

  9. 29 remaining items

  10. changed the title [-][$250] Dependent tags - Search field is shown in the tag list when there is less than 8 tags[/-] [+][Due for payment 2025-09-19] [$250] Dependent tags - Search field is shown in the tag list when there is less than 8 tags[/+] on Sep 12, 2025
  11. melvin-bot commented on Sep 12, 2025

    @melvin-bot

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

  12. melvin-bot commented on Sep 12, 2025

    @melvin-bot

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

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

  13. melvin-bot commented on Sep 12, 2025

    @melvin-bot

    @ZhenjaHorbach @kadiealexander 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]

  14. ZhenjaHorbach commented on Sep 19, 2025

    @ZhenjaHorbach
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [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.

      Unfortunately, I did not find a suitable PR

    • [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: NA

    • [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

    Precondition:

    • Import dependent tags to the workspace using the file attached in the linked issue.

    Test:

    1. Go to workspace chat.
    2. Click + > Create expense > Manual.
    3. Enter amount > Next.
    4. On the confirm page, click Fund > Select Woodbridge: Operations.
    5. Click GL_DEPARTMENT_DESCRIPTION.
    6. Verify that it should not show the search bar.

    Do we agree 👍 or 👎

  15. melvin-bot commented on Sep 19, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@kadiealexander)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1960773407717036167/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  16. kadiealexander commented on Sep 22, 2025

    @kadiealexander
    Contributor

    @ShridharGoel please accept the Upwork offer.

  17. ZhenjaHorbach commented on Sep 24, 2025

    @ZhenjaHorbach
    Contributor

    Requested in ND!

  18. flaviadefaria commented on Oct 2, 2025

    @flaviadefaria
    Contributor

    $250 approved for @ZhenjaHorbach

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.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions