Skip to content

[Due for payment 2025-02-28] [$250] Web - Reports - Unable to navigate search router with keyboard after opening filter page #56038

Closed

Description

@IuliiaHerets

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.0.92-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): applausetester+100106kh@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.0 / Chrome
App Component: Search

Action Performed:

Precondition:

  • User has created some expenses.
  1. Go to staging.new.expensify.com
  2. Go to Reports.
  3. Enter anything that will give results.
  4. Use keyboard up and down key.
  5. Note that the navigation happens within the search result.
  6. Click on the filter button.
  7. Close the filter.
  8. Click on the search field to focus it.
  9. Use keyboard up and down key.

Expected Result:

The navigation will happen within the search result.

Actual Result:

The search router is dismissed and the navigation happens in the expense list instead of search router,

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6728227_1738218480320.20250130_142126.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021885040797343861848
  • Upwork Job ID: 1885040797343861848
  • Last Price Increase: 2025-02-06
Issue OwnerCurrent Issue Owner: @bfitzexpensify

Activity

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

    @melvin-bot

    Triggered auto assignment to @bfitzexpensify (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. Krishna2323 commented on Jan 30, 2025

    @Krishna2323
    Contributor

    Proposal

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

    Web - Reports - Unable to navigate search router with keyboard after opening filter page

    What is the root cause of that problem?

    • We are rendering SelectionList twice: once for autocomplete suggestions and once for listing transactions/reports. As a result, the arrow key listener is captured on the transactions/reports after opening and closing the filters page.
      <SelectionListWithModal<ReportListItemType | TransactionListItemType | ReportActionListItemType>
      ref={handleSelectionListScroll(sortedSelectedData)}
      sections={[{data: sortedSelectedData, isDisabled: false}]}

    <SelectionList<OptionData | SearchQueryItem>
    sections={sections}
    onSelectRow={onListItemPress}
    ListItem={SearchRouterItem}

    // If `initiallyFocusedOptionKey` is not passed, we fall back to `-1`, to avoid showing the highlight on the first member
    const [focusedIndex, setFocusedIndex] = useArrowKeyFocusManager({
    initialFocusedIndex: flattenedSections.allOptions.findIndex((option) => option.keyForList === initiallyFocusedOptionKey),
    maxIndex: Math.min(flattenedSections.allOptions.length - 1, CONST.MAX_SELECTION_LIST_PAGE_LENGTH * currentPage - 1),
    disabledIndexes: disabledArrowKeyIndexes,
    isActive: true,
    onFocusedIndexChange: (index: number) => {
    const focusedItem = flattenedSections.allOptions.at(index);
    if (focusedItem) {
    onArrowFocus(focusedItem);
    }
    if (shouldScrollToFocusedIndex) {
    (shouldDebounceScrolling ? debouncedScrollToIndex : scrollToIndex)(index, true);
    }
    },
    isFocused,
    });

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

    • We would need to introduce priority parameter in useArrowKeyFocusManager hook function with default value of 0
    • Then we would need to introduce a new prop in BaseSelectionList called arrowKeyPriority which will have the default value of 0 and pass that to useArrowKeyFocusManager through priority param.
    • In SearchRouterList introduce a new prop isVisible and pass arrowKeyPriority={isVisible ? 0 : 1} to selection list.
    • And lastly we need to pass isVisible={isSearchRouterDisplayed} from SearchRouter and isVisible={isAutocompleteListVisible} from SearchPageHeaderInput.

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

    NA

    What alternative solutions did you explore? (Optional)

    TEST BRANCH

    Result

    arrow_key_focus.mp4
  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 30, 2025
  5. changed the title [-]Web - Reports - Unable to navigate search router with keyboard after opening filter page[/-] [+][$250] Web - Reports - Unable to navigate search router with keyboard after opening filter page[/+] on Jan 30, 2025
  6. melvin-bot commented on Jan 30, 2025

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

    @melvin-bot

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

  9. melvin-bot commented on Feb 3, 2025

    @melvin-bot

    @fedirjh, @bfitzexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

  10. linhvovan29546 commented on Feb 3, 2025

    @linhvovan29546
    Contributor

    @Krishna2323 Seems like you missed adding priority to useKeyboardShortcut as well. 😁

  11. melvin-bot commented on Feb 5, 2025

    @melvin-bot

    @fedirjh, @bfitzexpensify Eep! 4 days overdue now. Issues have feelings too...

  12. 45 remaining items

  13. bfitzexpensify commented on Mar 4, 2025

    @bfitzexpensify
    Contributor

    @fedirjh please complete the BZ checklist

  14. melvin-bot commented on Mar 10, 2025

    @melvin-bot

    @bfitzexpensify Huh... This is 4 days overdue. Who can take care of this?

  15. bfitzexpensify commented on Mar 11, 2025

    @bfitzexpensify
    Contributor
  16. melvin-bot commented on Mar 17, 2025

    @melvin-bot

    @bfitzexpensify Huh... This is 4 days overdue. Who can take care of this?

  17. fedirjh commented on Mar 17, 2025

    @fedirjh
    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.

      Link to comment: The author is aware and has addressed this issue as a follow-up to their previous 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: N/A

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

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    • User has created expenses.

    Test:

    1. Go to Reports.
    2. Enter anything that will give results.
    3. Use the keyboard up and down key.
    4. Verify that when AutocompleteList is visible, Navigation happens only in Autocomplete List.

    Do we agree 👍 or 👎

  18. bfitzexpensify commented on Mar 18, 2025

    @bfitzexpensify
    Contributor

    Thanks @fedirjh

    Payment summary:

    @fedirjh owed $250 via ND request for C+ work.

  19. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Mar 18, 2025
  20. garrettmknight commented on Apr 22, 2025

    @garrettmknight
    Contributor

    $250 approved for @fedirjh

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