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 2024-01-02] [$500] Web - Search - Selected dropdown item with tab key is not opened in Search #32388

Closed
1 of 6 tasks
lanitochka17 opened this issue Dec 1, 2023 · 39 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 Dec 1, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.7-0
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. Login to ND Expensify
  2. Press CTRL+K or click Magnifying glass icon
  3. Select any dropdown item with Tab key
  4. Press Enter key

Expected Result:

Items in search dropdown should be selected consistently both with up&down and tab keys, and the correct one is opened after pressing Enter key

Actual Result:

Highlighted item (default first one) with Up&Down keys is opened instead of blue bordered item which is selected with Tab key

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence

Bug6297806_1701459856402.2023-12-01_20-58-59.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015640f29df912d30c
  • Upwork Job ID: 1730709594365632512
  • Last Price Increase: 2023-12-01
  • Automatic offers:
    • alitoshmatov | Reviewer | 28062509
    • DylanDylann | Contributor | 28062510
@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 Dec 1, 2023
@melvin-bot melvin-bot bot changed the title Web - Search - Selected dropdown item with tab key is not opened in Search [$500] Web - Search - Selected dropdown item with tab key is not opened in Search Dec 1, 2023
Copy link

melvin-bot bot commented Dec 1, 2023

Job added to Upwork: https://www.upwork.com/jobs/~015640f29df912d30c

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

melvin-bot bot commented Dec 1, 2023

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

Copy link

melvin-bot bot commented Dec 1, 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

Copy link

melvin-bot bot commented Dec 1, 2023

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

@unidev727
Copy link
Contributor

unidev727 commented Dec 1, 2023

Proposal

from: @unicorndev-727

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

Highlighted item (default first one) with Up&Down keys is opened instead of blue bordered item which is selected with Tab key

What is the root cause of that problem?

The root cause is that the pressOnEnter is set on Confirm button and it's priority is 1 so when we click enter, the button is pressed first with highlighted item.

<Button
success
style={[this.props.themeStyles.w100]}
text={defaultConfirmButtonText}
onPress={this.props.onConfirmSelection}
pressOnEnter
enterKeyEventListenerPriority={1}

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

we need to adjust button's priority here or can change the default item when we select other item using tab.

What alternative solutions did you explore? (Optional)

N/A

@DylanDylann
Copy link
Contributor

DylanDylann commented Dec 2, 2023

Proposal

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

  • Web - Search - Selected dropdown item with tab key is not opened in Search

What is the root cause of that problem?

  • We're selecting the row based on highlighted item, and we don't consider the blue focus one
    selectFocusedOption() {
    const focusedOption = this.state.allOptions[this.state.focusedIndex];
    if (!focusedOption || !this.props.isFocused) {
    return;
    }
    if (this.props.canSelectMultipleOptions) {
    this.selectRow(focusedOption);
    } else if (!this.state.shouldDisableRowSelection) {
    this.setState({shouldDisableRowSelection: true});
    let result = this.selectRow(focusedOption);
    if (!(result instanceof Promise)) {
    result = Promise.resolve();
    }
    setTimeout(() => {
    result.finally(() => {
    this.setState({shouldDisableRowSelection: false});
    });
    }, 500);
    }
    }

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

  1. Passing additional prop named keyForList to OptionRow. It will become to:
            <OptionRow
                keyForList={item.keyForList}
  1. Then, pass the above keyForList props to PressableWithFeedback
    It will become to:
                    <PressableWithFeedback
                        testID={props.keyForList}
  1. Finally, update the logic to get the focusedOption in here:
    const focusedOption = this.state.allOptions[this.state.focusedIndex];

    It will become to:
const focusedItemKey = lodashGet(e, ['target', 'attributes', 'data-testid', 'value']);
        const focusedOption = focusedItemKey ? _.find(this.state.allOptions, (option) => option.keyForList === focusedItemKey) : this.state.allOptions[this.state.focusedIndex];

What alternative solutions did you explore? (Optional)

  • NA

@melvin-bot melvin-bot bot added the Overdue label Dec 4, 2023
@alexpensify
Copy link
Contributor

@alitoshmatov please keep us posted if any of the proposals will fix this issue. Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Dec 4, 2023
@alitoshmatov
Copy link
Contributor

Reviewing

@alitoshmatov
Copy link
Contributor

@unicorndev-727 I don't think confirm button is related here.

@alitoshmatov
Copy link
Contributor

@Sourcecodedeveloper I think binding tab key to our selection will effect native accessibility that used by tab key. Moreover
as @DylanDylann mention #32252 PR already solved similar issue, and logical approach would be applying consistent, similar approach here.

@alitoshmatov
Copy link
Contributor

@DylanDylann your RCA is correct. Your solution looks good also as you mention we can follow #32252 PR and apply the same solution here. But can you make sure we are covering all instances of this issue so that we don not come across similar one again.

@alitoshmatov
Copy link
Contributor

We can go with @DylanDylann 's proposal.

C+ reviewed 🎀 👀 🎀

Copy link

melvin-bot bot commented Dec 7, 2023

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

@situchan
Copy link
Contributor

situchan commented Dec 7, 2023

@DylanDylann
Copy link
Contributor

@situchan I think the #31635 is fixed, so, for consistency, I think we should fix this issue as well

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

melvin-bot bot commented Dec 11, 2023

@deetergp, @alexpensify, @alitoshmatov Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@alitoshmatov
Copy link
Contributor

I agree with @DylanDylann, @deetergp Can you confirm this?

@melvin-bot melvin-bot bot removed the Overdue label Dec 11, 2023
@alexpensify
Copy link
Contributor

@deetergp - can we get feedback here? Let me know if we need to have a bigger discussion in Open Source. Thanks!

@alexpensify
Copy link
Contributor

Daily Update: PR is in review!

@alexpensify
Copy link
Contributor

Heads up, I will be offline from Friday, December 22, to Thursday, January 4, 2024. I will not be actively watching over this GitHub during that period. If anything urgent is needed here, please ask for help in the #expensify-open-source Slack Room-- thanks!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 26, 2023
@melvin-bot melvin-bot bot changed the title [$500] Web - Search - Selected dropdown item with tab key is not opened in Search [HOLD for payment 2024-01-02] [$500] Web - Search - Selected dropdown item with tab key is not opened in Search Dec 26, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 26, 2023
Copy link

melvin-bot bot commented Dec 26, 2023

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

Copy link

melvin-bot bot commented Dec 26, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.16-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 2024-01-02. 🎊

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:

Copy link

melvin-bot bot commented Dec 26, 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:

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

Copy link

melvin-bot bot commented Dec 27, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@alexpensify
Copy link
Contributor

alexpensify commented Dec 29, 2023

Here is the payment summary-- TBD, @alitoshmatov please confirm if this regression is due to this PR or something else. Thank you!

  • External issue reporter - N/A
  • Contributor that fixed the issue - @DylanDylann $500
  • Contributor+ that helped on the issue and/or PR - @alitoshmatov $500

Upwork Job: https://www.upwork.com/jobs/~015640f29df912d30c

Extra Notes regarding payment: Heads up, I'm OOO until January 4, but I will log in on Wednesday, January 3, to check this payment process pending if the regression is resolved by then. I've confirmed that everyone here is a pending hire, so all set here for the payment date.

January 11 Update

Based on the feedback here #32388 (comment), we will keep the payment amounts the same and there is no penalty.

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 Daily KSv2 labels Jan 1, 2024
@alexpensify
Copy link
Contributor

@alitoshmatov or @deetergp - can you please help confirm if this PR did cause regression? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Jan 3, 2024
@alitoshmatov
Copy link
Contributor

Based on my observation, our PR didn't directly cause this regression, the regression didn't occur after merging our PR. However our solution was based on faulty approach which was already implemented by #32252. We took this solution for granted and followed the same approach. Finally #33491 PR caused the regression which broke our faulty solution. I am okay if penalty is applied to my payment, since I should have been more cautious on my review.

cc: @alexpensify, @deetergp, @Beamanator (since you worked on fixing the regression)

@alexpensify
Copy link
Contributor

Thank you @alitoshmatov for this update. @Beamanator and @deetergp can I get some feedback here regarding this payment? Thanks!

@melvin-bot melvin-bot bot added the Overdue label Jan 8, 2024
Copy link

melvin-bot bot commented Jan 8, 2024

@deetergp, @alexpensify, @alitoshmatov, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick!

@alexpensify
Copy link
Contributor

Bumping - @deetergp and @Beamanator can I get your feedback here?

@melvin-bot melvin-bot bot removed the Overdue label Jan 8, 2024
@Beamanator
Copy link
Contributor

I agree with @alitoshmatov 's summary here: #32388 (comment)

  1. The PR for this issue (Fix: focusing on item by tab key does not work #33265) was merged 3 weeks ago
  2. The PR which technically caused the regression was [NoQA] add perf tests to OptionsSelector #33491, which was merged 2 weeks ago

While the PR for this issue and this one were a bit iffy & weren't perfect, they didn't cause the regressions so I don't believe payment here should have the penalty applied

@alexpensify
Copy link
Contributor

Thanks, I'll work on the payment process tomorrow.

@alexpensify
Copy link
Contributor

Closing - I updated the summary here: #32388 (comment)

Everyone has been paid via Upwork and I closed that job.

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

8 participants