Skip to content

[HOLD for payment 2023-12-15] [$500] Workspace - the blue focus is not prioritized over the application highlight #31635

Closed

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.1-7
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:

Action Performed:

  1. Go to settings > Workspace > Members
  2. Click on existing workspace
  3. Members > Invite
  4. Click on 'Tab' key to bring the blue focus from accessibility
  5. Notice that the lists are focused(Blue focused)
  6. Move the blue Focus using the 'Tab' key to focus on the users
  7. Click Enter
    Notice that clicking enter selects the user that the app highlight is on. It does not select the User focused with the blue marker

Expected Result:

the blue focus is prioritized when clicking enter rather than the application highlight

Actual Result:

The blue focus is not prioritized over the application highlight

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

Bug6285482_1700572695327.test4_BlueFocus.mp4

Bug6285482_1700572695311!image

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @laurenreidexpensify

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 21, 2023
  2. melvin-bot commented on Nov 21, 2023

    @melvin-bot

    Triggered auto assignment to @laurenreidexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. changed the title [-]Workspace - the blue focus is not prioritized over the application highlight[/-] [+][$500] Workspace - the blue focus is not prioritized over the application highlight[/+] on Nov 21, 2023
  4. melvin-bot commented on Nov 21, 2023

    @melvin-bot
  5. melvin-bot commented on Nov 21, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 21, 2023
  7. melvin-bot commented on Nov 21, 2023

    @melvin-bot

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

  8. tienifr commented on Nov 21, 2023

    @tienifr
    Contributor

    Proposal

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

    We're selecting the row based on highlighted item, and we don't consider the blue focus one

    selectRow(focusedOption);

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

    1. We need identify each item in list by providing the normalizedIndex

    Add normalizedIndex to BaseListItem

    1. In BaseListItem, add testID={item_${index}} to PressableWithFeedback
    2. In selectFocusedOption we get the blue focus item
        const selectFocusedOption = (e) => {
            const focusedIndexByTab = toNumber(e.target.attributes['data-testid']?.value.substring(5) || '-1')
            const focusedOption = focusedIndexByTab!==-1 ? flattenedSections.allOptions[focusedIndexByTab]: flattenedSections.allOptions[focusedIndex];
    ...
    

    Result

    Screen.Recording.2023-11-21.at.23.51.54.mov
  9. erquhart commented on Nov 21, 2023

    @erquhart
    Contributor

    I don't disagree with a quick patch for this particular case, but up/down handling and tab key handling are totally separate right now, and that's a major flaw. Both appearance and controls of tab key and arrow key navigation should be identical. This is not limited to this view, it's a general issue.

    If we try to fix this one small bug at a time the end result is unlikely to be cohesive or forward moving.

  10. DylanDylann commented on Nov 21, 2023

    @DylanDylann
    Contributor

    Proposal

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

    • Workspace - the blue focus is not prioritized over the application highlight

    What is the root cause of that problem?

    • Currently, we have the logic that allows the user to choose an option by using the ARROW key and ENTER key: ARROW key is used to change the focused option, and ENTER is used to select this option.
    • When we change the focused component to option A by using tab key, and using ARROW key to change the focused component to option B, then pressing ENTER, it will call the selectRow with option B rather than option A

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

    <BaseListItem onFocus={()=>setIsFocusedIndexByTab(true)} onBlur={()=>setIsFocusedIndexByTab(false)} ... />
    
    • Then disable the onEnter callback when we are focusing on any option by updating:
      useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ENTER, selectFocusedOption, {
      captureOnInputs: true,
      shouldBubble: () => !flattenedSections.allOptions[focusedIndex],
      shouldStopPropagation,
      isActive: !disableKeyboardShortcuts && !disableEnterShortcut && isFocused,
      });

      to:
        useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ENTER, selectFocusedOption, {
            captureOnInputs: true,
            shouldBubble: () => !flattenedSections.allOptions[focusedIndex],
            shouldStopPropagation,
    +      isActive: !disableKeyboardShortcuts && !disableEnterShortcut && isFocused && isFocusedIndexByTab,
        });

    What alternative solutions did you explore? (Optional)

    • NA
  11. dummy-1111 commented on Nov 21, 2023

    @dummy-1111
    Contributor

    @tienifr

    Your proposal looks great. I think we can use item.keyForList instead of normalized index. This value is unique across the SelectionList and always exist. We can find the focused option with

            const focusedItemKey = e.target.attributes['data-key-for-list']?.value;
            const focusedOption = focusedItemKey ? flattenedSections.allOptions.find(option => option.keyForList === focusedItemKey) : flattenedSections.allOptions[focusedIndex];
    

    This way, we don't need extra props(normalizedIndex).

  12. 27 remaining items

  13. laurenreidexpensify commented on Dec 18, 2023

    @laurenreidexpensify
    Contributor

    Payment Summary:

    • Contributor $500 @tienifr - paid in Upwork
    • C+ review $500 @thesahindia please send a manual request
  14. laurenreidexpensify commented on Dec 18, 2023

    @laurenreidexpensify
    Contributor

    @thesahindia pls update checklist thanks

  15. laurenreidexpensify commented on Dec 20, 2023

    @laurenreidexpensify
    Contributor

    Waiting for checklist to be completed

  16. thesahindia commented on Dec 22, 2023

    @thesahindia
    Member

    We can skip the checklist on this one. This is how it was from the starting.

    If we want we can add a test case. Steps:-

    1. Go to settings > Workspace > Members
    2. Click on existing workspace
    3. Members > Invite
    4. Click on 'Tab' key to bring the blue focus from accessibility
    5. Notice that the lists are focused(Blue focused)
    6. Move the blue Focus using the 'Tab' key to focus on the users
    7. Click Enter
    8. Verify that the blue focus is prioritized when clicking enter rather than the application highlight
  17. melvin-bot commented on Dec 26, 2023

    @melvin-bot

    @mountiny, @laurenreidexpensify, @thesahindia, @tienifr Huh... This is 4 days overdue. Who can take care of this?

  18. mountiny commented on Dec 26, 2023

    @mountiny
    Contributor

    I think we do not need the new regression test for this

  19. melvin-bot commented on Dec 28, 2023

    @melvin-bot

    @mountiny, @laurenreidexpensify, @thesahindia, @tienifr Still overdue 6 days?! Let's take care of this!

  20. JmillsExpensify commented on Jan 14, 2024

    @JmillsExpensify
    Contributor

    $500 payment approved for @thesahindia based on this comment.

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