Skip to content

[HOLD for payment 2024-04-15] [$500] Expense - Item in report list is not highlighted and list cannot be navigated with keyboard #35843

Description

@lanitochka17

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: 1.4-36.1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Issue found when executing PR #35770

Action Performed:

recondition:

  • User is an employee of Collect workspace
  • The Collect workspace has dropdown field set up in "Report and Invoice Fields" on Old Dot
  1. Go to workspace chat
  2. Create a request
  3. Go to expense report
  4. Click on the report field with the selection list set up from Old Dot
  5. Select an item
  6. Click on the field
  7. Use keyboard to navigate through the list

Expected Result:

In Step 6, the selected item is highlighted
In Step 7, the list can be navigated with keyboard

Actual Result:

In Step 6, the selected item is not highlighted
In Step 7, the list cannot be navigated with keyboard

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6368014_1707150918160.bandicam_2024-02-05_21-30-45-302.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013f9bedd40db86a4a
  • Upwork Job ID: 1757818279097016320
  • Last Price Increase: 2024-02-14
  • Automatic offers:
    • ZhenjaHorbach | Contributor | 0

Activity

  1. github-actions commented on Feb 5, 2024

    @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.
  2. melvin-bot commented on Feb 5, 2024

    @melvin-bot

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

  3. lanitochka17 commented on Feb 5, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #wave6
    CC @greg-schroeder

  4. ZhenjaHorbach commented on Feb 5, 2024

    @ZhenjaHorbach
    Contributor

    Proposal

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

    Expense - Item in report list is not highlighted and list cannot be navigated with keyboard

    What is the root cause of that problem?

    The main problem with issue is that we don't pass indexOffset for sections

    const sections = useMemo(() => {
    const filteredRecentOptions = recentlyUsedOptions.filter((option) => option.toLowerCase().includes(searchValue.toLowerCase()));
    const filteredRestOfOptions = fieldOptions.filter((option) => !filteredRecentOptions.includes(option) && option.toLowerCase().includes(searchValue.toLowerCase()));
    return [
    {
    title: translate('common.recents'),
    shouldShow: true,
    data: filteredRecentOptions.map((option) => ({
    text: option,
    keyForList: option,
    searchText: option,
    tooltipText: option,
    })),
    },
    {
    title: translate('common.all'),
    shouldShow: true,
    data: filteredRestOfOptions.map((option) => ({
    text: option,
    keyForList: option,
    searchText: option,
    tooltipText: option,
    })),
    },
    ];
    }, [fieldOptions, recentlyUsedOptions, searchValue, translate]);

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

    To fix this issue we can use logic from TaskAssigneeSelectorModal to count indexOffset for each section

    const sections = useMemo(() => {
    const sectionsList = [];
    let indexOffset = 0;
    if (filteredCurrentUserOption) {
    sectionsList.push({
    title: props.translate('newTaskPage.assignMe'),
    data: [filteredCurrentUserOption],
    shouldShow: true,
    indexOffset,
    });
    indexOffset += 1;
    }
    sectionsList.push({
    title: props.translate('common.recents'),
    data: filteredRecentReports,
    shouldShow: filteredRecentReports?.length > 0,
    indexOffset,
    });
    indexOffset += filteredRecentReports?.length;
    sectionsList.push({
    title: props.translate('common.contacts'),
    data: filteredPersonalDetails,
    shouldShow: filteredPersonalDetails?.length > 0,
    indexOffset,
    });
    indexOffset += filteredPersonalDetails?.length;
    if (filteredUserToInvite) {
    sectionsList.push({
    data: [filteredUserToInvite],
    shouldShow: true,
    indexOffset,
    });
    }
    return sectionsList;
    }, [filteredCurrentUserOption, filteredPersonalDetails, filteredRecentReports, filteredUserToInvite, props]);

    As a result, we need to update sections for EditReportFieldDropdownPage like

            return [
                {
                    title: translate('common.recents'),
                    ...,
                    indexOffset: 0,
                },
                {
                    title: translate('common.all'),
                    ...,
                    indexOffset: filteredRecentOptions.length,
                },
            ];
    

    return [
    {
    title: translate('common.recents'),
    shouldShow: true,
    data: filteredRecentOptions.map((option) => ({
    text: option,
    keyForList: option,
    searchText: option,
    tooltipText: option,
    })),
    },
    {
    title: translate('common.all'),
    shouldShow: true,
    data: filteredRestOfOptions.map((option) => ({
    text: option,
    keyForList: option,
    searchText: option,
    tooltipText: option,
    })),
    },
    ];

    Also we can add focusedIndex={0} for OptionsSelector

    What alternative solutions did you explore? (Optional)

    NA

  5. marcaaron commented on Feb 5, 2024

    @marcaaron
    Contributor

    we can use logic from TaskAssigneeSelectorModal to count indexOffset for each section

    Not really following the solution. This issue does not seem related to tasks.

  6. marcaaron commented on Feb 5, 2024

    @marcaaron
    Contributor

    cc @s77rt since it's linked to your PR

  7. ZhenjaHorbach commented on Feb 5, 2024

    @ZhenjaHorbach
    Contributor

    we can use logic from TaskAssigneeSelectorModal to count indexOffset for each section

    Not really following the solution. This issue does not seem related to tasks.

    Problem related to EditReportFieldDropdownPage )
    I added TaskAssigneeSelectorModal as an example )

  8. marcaaron commented on Feb 5, 2024

    @marcaaron
    Contributor

    Interesting, but doesn't quite explain where the regression has happened. We implemented this feature here.

  9. s77rt commented on Feb 5, 2024

    @s77rt
    Member

    I don't think this is a regression nor a deploy blocker. This bug existed before and should be handled just like any other bug. Using indexOffset is the correct solution.

  10. 49 remaining items

  11. melvin-bot commented on Mar 19, 2024

    @melvin-bot

    This issue has not been updated in over 15 days. @cead22, @mananjadhav, @adelekennedy, @ZhenjaHorbach eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  12. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Apr 8, 2024
  13. changed the title [-][$500] Expense - Item in report list is not highlighted and list cannot be navigated with keyboard[/-] [+][HOLD for payment 2024-04-15] [$500] Expense - Item in report list is not highlighted and list cannot be navigated with keyboard[/+] on Apr 8, 2024
  14. melvin-bot commented on Apr 8, 2024

    @melvin-bot

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

  15. melvin-bot commented on Apr 8, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.60-13 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 2024-04-15. 🎊

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

  16. melvin-bot commented on Apr 8, 2024

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@mananjadhav] The PR that introduced the bug has been identified. Link to the PR:
    • [@mananjadhav] 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:
    • [@mananjadhav] A discussion in #expensify-bugs 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:
    • [@mananjadhav] Determine if we should create a regression test for this bug.
    • [@mananjadhav] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • [@adelekennedy] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  17. adelekennedy commented on Apr 15, 2024

    @adelekennedy
    Contributor

    Payouts due:

    Upwork job is here.

  18. mananjadhav commented on Apr 15, 2024

    @mananjadhav
    Collaborator

    I couldn't trace the offending PR for this one. But with the refactor of the indexOffset I don't think we need a regression test for this one. The change is generic and the other tests for keyboard will take care of it.

  19. JmillsExpensify commented on Apr 15, 2024

    @JmillsExpensify
    Contributor

    $500 approved for @mananjadhav

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions