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-05-09] [$1000] Reclicking CTRL+K or CTRL+Shift+K removes focus from search input #17482

Closed
1 of 6 tasks
kavimuru opened this issue Apr 16, 2023 · 34 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented Apr 16, 2023

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


Action Performed:

  1. Open the app on web chrome or web safari
  2. Click CTRL+K to open search page
  3. Again click CTRL+K and observe that focus is lost from search box
  4. Repeat step 2 and 3 with CTRL+Shift+K

Expected Result:

App should not lose focus from search box on multiple click of CTRL+K and CTRL+Shift+K

Actual Result:

App loses focus from search box on multiple click of CTRL+K and CTRL+Shift+K

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.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
Notes/Photos/Videos: Any additional supporting documentation

Recording.248.mp4
loses.focus.on.double.CTRL.K.and.CTRL.shift.K.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681542071255539

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01bb5b431ab3d094e3
  • Upwork Job ID: 1649402414930432000
  • Last Price Increase: 2023-04-21
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 16, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Apr 16, 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 Overdue label Apr 18, 2023
@MelvinBot
Copy link

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

@MelvinBot
Copy link

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

@MelvinBot
Copy link

Triggered auto assignment to @luacmartins (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@johncschuster
Copy link
Contributor

I was able to reproduce this. Triaging!

@melvin-bot melvin-bot bot removed the Overdue label Apr 20, 2023
@allroundexperts
Copy link
Contributor

allroundexperts commented Apr 21, 2023

Proposal

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

Reclicking CTRL+K or CTRL+Shift+K removes focus from search input

What is the root cause of that problem?

The root cause of this issue is that we're trying to navigate to the same page again which results in triggering of this. This causes the input to go out of focus. Since internally, the page isn't navigated again, the only effect is that the search input goes out of focus.

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

We can prevent this line from triggering if the user is trying to navigate to the same route.

The code for this, can be added here like:

// We can probably also use isActiveRoute() function as well
if (navigationRef.current.getCurrentRoute().path.slice(1) === route) {
	return;
}

The above will make the solution more generic. If we don't want to add the above in the navigate function itself,

We can prevent the navigation function triggering twice in the listener for these keyboard shortcuts by adding the following:

if (Navigation.isActiveRoute(ROUTES.SEARCH)) {
    return;
}

What alternative solutions did you explore? (Optional)

None

@luacmartins luacmartins added the External Added to denote the issue can be worked on by a contributor label Apr 21, 2023
@melvin-bot melvin-bot bot changed the title Reclicking CTRL+K or CTRL+Shift+K removes focus from search input [$1000] Reclicking CTRL+K or CTRL+Shift+K removes focus from search input Apr 21, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

Current assignee @johncschuster is eligible for the External assigner, not assigning anyone new.

@MelvinBot
Copy link

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

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

Current assignee @luacmartins is eligible for the External assigner, not assigning anyone new.

@luacmartins
Copy link
Contributor

@mananjadhav it looks like we already have one proposal

@bernhardoj
Copy link
Contributor

bernhardoj commented Apr 21, 2023

We are going to remove DomUtils.blurActiveElement in this PR #16052.

@allroundexperts
Copy link
Contributor

Hm... I think we should still prevent navigation action to the same page.

@melvin-bot melvin-bot bot added the Overdue label Apr 24, 2023
@luacmartins
Copy link
Contributor

still looking at proposals

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Apr 24, 2023
@luacmartins
Copy link
Contributor

@allroundexperts I think your proposal looks good. Assigning you to the job!

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 2, 2023
@MelvinBot
Copy link

MelvinBot commented May 2, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.8-8 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-05-09. 🎊

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@MelvinBot
Copy link

MelvinBot commented May 2, 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:

  • [@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.
  • [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/284656

@mananjadhav
Copy link
Collaborator

I checked the PR added #15249 this change related to DomUtils.blurActiveElement(); affects this search focus.

Here's the regression test proposal

  1. Open the app on web chrome or web safari
  2. Click CTRL+K to open search page
  3. Again click CTRL+K and verify that focus is not lost from search box
  4. Repeat step 2 and 3 with CTRL+Shift+K

Do we agree 👍 or 👎 ?

I can't think a way this could've been avoided. I think this is difficult to comprehend the impact.

cc - @luacmartins @allroundexperts @johncschuster

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 8, 2023
@mananjadhav
Copy link
Collaborator

@johncschuster This is due for payout today.

and @johncschuster @luacmartins Did you get a chance to look at the previous comment?

@luacmartins
Copy link
Contributor

@mananjadhav test steps look good to me

@johncschuster
Copy link
Contributor

@dhanashree-sawant can you apply to the Upwork job for the bug bounty? I couldn't find you when I attempted to invite you.

@johncschuster
Copy link
Contributor

@allroundexperts, I've sent you an invite on Upwork for the job. Can you accept that when you get a chance?

@allroundexperts
Copy link
Contributor

allroundexperts commented May 12, 2023

@allroundexperts, I've sent you an invite on Upwork for the job. Can you accept that when you get a chance?

@johncschuster Done. Bundle of thanks!

@dhanashree-sawant
Copy link

Hi @johncschuster, thanks I have applied.

@melvin-bot melvin-bot bot added the Overdue label May 15, 2023
@luacmartins
Copy link
Contributor

Just waiting payment

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 15, 2023
@johncschuster
Copy link
Contributor

Great! @dhanashree-sawant and @allroundexperts, can you accept the offers I've sent? Once accepted, I can get payment taken care of.

@melvin-bot melvin-bot bot removed the Overdue label May 17, 2023
@dhanashree-sawant
Copy link

Thanks @johncschuster, I have accepted the offer.

@melvin-bot melvin-bot bot added the Overdue label May 19, 2023
@luacmartins
Copy link
Contributor

Are we good to close this one?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 19, 2023
@luacmartins
Copy link
Contributor

Waiting on ^ @johncschuster is everyone paid out?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 23, 2023
@johncschuster
Copy link
Contributor

Thanks for the bump, team! I missed paying @dhanashree-sawant. I've just paid them now.

We should be good to close this out! 🎉

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants