Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 6 tasks
lanitochka17 opened this issue Nov 21, 2023 · 26 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 21, 2023

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
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 21, 2023
Copy link

melvin-bot bot commented Nov 21, 2023

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

@melvin-bot melvin-bot bot 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 Nov 21, 2023
Copy link

melvin-bot bot commented Nov 21, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01b92503dafd950d76

Copy link

melvin-bot bot commented Nov 21, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 21, 2023
Copy link

melvin-bot bot commented Nov 21, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Nov 21, 2023

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

@erquhart
Copy link
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.

@DylanDylann
Copy link
Contributor

DylanDylann commented Nov 21, 2023

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

@s-alves10
Copy link
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).

@thesahindia
Copy link
Member

I believe this comes under accessibility, which is not our main focus right now. I believe we should close this.

cc: @laurenreidexpensify

@erquhart
Copy link
Contributor

erquhart commented Nov 22, 2023

Just adding for clarity, in case it isn't clear, using the keyboard instead of the mouse in this list is broken, does not work. This isn't specific to folks with special accessibility needs. Lots of folks, especially your power users, are likely to tab around your interface on a keyboard.

If you've already taken this into account, please disregard!

@melvin-bot melvin-bot bot added the Overdue label Nov 27, 2023
@laurenreidexpensify
Copy link
Contributor

@thesahindia I agree but if there's a proposal that works here I think it's fine to fix it, if none of these suggestions work then we can consider closing

@melvin-bot melvin-bot bot removed the Overdue label Nov 27, 2023
@thesahindia
Copy link
Member

@tienifr's proposal looks good to me!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Nov 28, 2023

Triggered auto assignment to @mountiny, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Dec 8, 2023
@melvin-bot melvin-bot bot changed the title [$500] Workspace - the blue focus is not prioritized over the application highlight [HOLD for payment 2023-12-15] [$500] Workspace - the blue focus is not prioritized over the application highlight Dec 8, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 8, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

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

Copy link

melvin-bot bot commented Dec 8, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.9-5 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 2023-12-15. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

  • @thesahindia requires payment through NewDot Manual Requests
  • @tienifr requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Dec 8, 2023

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:

  • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
  • [@thesahindia] 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:
  • [@thesahindia] 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:
  • [@thesahindia] Determine if we should create a regression test for this bug.
  • [@thesahindia] 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.
  • [@laurenreidexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Dec 14, 2023
@laurenreidexpensify
Copy link
Contributor

Payment due tomorrow

@melvin-bot melvin-bot bot removed the Overdue label Dec 14, 2023
Copy link

melvin-bot bot commented Dec 18, 2023

@mountiny, @laurenreidexpensify, @thesahindia, @tienifr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Dec 18, 2023
@laurenreidexpensify
Copy link
Contributor

laurenreidexpensify commented Dec 18, 2023

Payment Summary:

  • Contributor $500 @tienifr - paid in Upwork
  • C+ review $500 @thesahindia please send a manual request

@melvin-bot melvin-bot bot removed the Overdue label Dec 18, 2023
@laurenreidexpensify
Copy link
Contributor

@thesahindia pls update checklist thanks

@melvin-bot melvin-bot bot added the Overdue label Dec 20, 2023
@laurenreidexpensify
Copy link
Contributor

Waiting for checklist to be completed

@melvin-bot melvin-bot bot removed the Overdue label Dec 20, 2023
@thesahindia
Copy link
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

@melvin-bot melvin-bot bot added the Overdue label Dec 22, 2023
Copy link

melvin-bot bot commented Dec 26, 2023

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

@mountiny
Copy link
Contributor

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

Copy link

melvin-bot bot commented Dec 28, 2023

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

@JmillsExpensify
Copy link

$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
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants