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-05-13] [$250] Web - Pressing on keyboard enter key on notification option of a room takes back two steps #40551

Closed
1 of 6 tasks
kavimuru opened this issue Apr 19, 2024 · 42 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 19, 2024

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.63-0
Reproducible in staging?: y
Reproducible in production?: no
If this was caught during regression testing, add the test name, ID and link from TestRail: EXP around https://expensify.testrail.io/index.php?/tests/view/4494233
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. Navigate to staging.new.expensify.com
  2. Create a room
  3. Open the room page
  4. Click on header
  5. Click on settings
  6. Click on Notify me about new messages
  7. Select a notification preference option by using the keyboard arrow keys
  8. Press enter on one of the options

Expected Result:

App should navigate to Settings page

Actual Result:

App navigates to Room details page

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

Bug6454735_1713521652242.bandicam_2024-04-19_13-08-56-915.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01889a2544214bb02d
  • Upwork Job ID: 1781342777391833088
  • Last Price Increase: 2024-04-19
  • Automatic offers:
    • suneox | Contributor | 0
Issue OwnerCurrent Issue Owner: @kevinksullivan
@kavimuru kavimuru added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 19, 2024
Copy link

melvin-bot bot commented Apr 19, 2024

Triggered auto assignment to @kevinksullivan (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.

Copy link

melvin-bot bot commented Apr 19, 2024

Triggered auto assignment to @mountiny (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Apr 19, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@kavimuru
Copy link
Author

@mountiny FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

@kavimuru
Copy link
Author

We think this bug might be related to #vip-vsb

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Apr 19, 2024
@melvin-bot melvin-bot bot changed the title Web - Pressing on keyboard enter key on notification option of a room takes back two steps [$250] Web - Pressing on keyboard enter key on notification option of a room takes back two steps Apr 19, 2024
Copy link

melvin-bot bot commented Apr 19, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01889a2544214bb02d

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

melvin-bot bot commented Apr 19, 2024

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

@suneox
Copy link
Contributor

suneox commented Apr 19, 2024

Proposal

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

Web - Pressing on keyboard enter key on notification option of a room takes back two steps

What is the root cause of that problem?

We have a double event raised when pressing the enter key at BaseListItem, and keyboard shortcuts at this lines
So updateNotificationPreference will we call 2 times and navigate back also call 2 times

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

Due to at BaseSelectionList we have handle keyboard shortcut to select item, so we should prevent press event at this line when submit by keyboard by adding props shouldPreventEnterKeySubmit into BaseListItem then check condition event from keyboard or not

      ref={pressableRef}
      onPress={(e) => {
          if (shouldPreventEnterKeySubmit && e instanceof KeyboardEvent && e.key === 'Enter') {
              return;
          }
          onSelectRow(item);
      }}

Finally set shouldPreventEnterKeySubmit at renderItem function in BaseSelectionList

What alternative solutions did you explore? (Optional)

Instead of add props to BaseListItem, we can check condition and pass props disableEnterShortcut into BaseSelectionList

@gijoe0295
Copy link
Contributor

Dupe of #40507.

@allroundexperts
Copy link
Contributor

Since we have a better proposal here, we can close the other.

@allroundexperts
Copy link
Contributor

@suneox Were you able to figure out the PR which caused this issue?

@suneox
Copy link
Contributor

suneox commented Apr 19, 2024

@suneox Were you able to figure out the PR which caused this issue?

Sure, Let me find

Copy link

melvin-bot bot commented Apr 19, 2024

⚠️ 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.

@suneox
Copy link
Contributor

suneox commented Apr 20, 2024

@suneox Were you able to figure out the PR which caused this issue?

@allroundexperts I think it looks like a regression from this PR when the fix uses a tab key to focus an item, but the owner isn't aware the code base also has a shortcut key to select an item with the condition isFocused to active the shortcut

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

So We have 2 places trigger onSelectRow event at this line (current focused) and event by shortcut key

Tested branch

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Hourly KSv2 labels Apr 20, 2024
@allroundexperts
Copy link
Contributor

PR: #40642

@suneox
Copy link
Contributor

suneox commented Apr 20, 2024

PR: #40642

Hi @allroundexperts could you please check my commit your PR was missing set shouldPreventEnterKeySubmit=true for the BaseSelectionList so the result still not fix

@allroundexperts
Copy link
Contributor

Checking 👀

@suneox
Copy link
Contributor

suneox commented Apr 20, 2024

Hi @allroundexperts could you please check my commit your PR was missing set shouldPreventEnterKeySubmit=true for the BaseSelectionList so the result still not fix

<SelectionList
sections={[{data: notificationPreferenceOptions}]}
ListItem={RadioListItem}
onSelectRow={(option) =>
report && ReportActions.updateNotificationPreference(report.reportID, report.notificationPreference, option.value, true, undefined, undefined, report)

I'd like to explain for my commit change

At page NotificationPreferencePage SelectionList using ListItem={RadioListItem} so we have to forward shouldPreventEnterKeySubmit props inside RadioListItem

And we can use CONST.KEYBOARD_SHORTCUTS.ENTER.shortcutKey instead of string 'Enter'

@allroundexperts
Copy link
Contributor

Hi @allroundexperts could you please check my commit your PR was missing set shouldPreventEnterKeySubmit=true for the BaseSelectionList so the result still not fix

<SelectionList
sections={[{data: notificationPreferenceOptions}]}
ListItem={RadioListItem}
onSelectRow={(option) =>
report && ReportActions.updateNotificationPreference(report.reportID, report.notificationPreference, option.value, true, undefined, undefined, report)

I'd like to explain for my commit change

At page NotificationPreferencePage SelectionList using ListItem={RadioListItem} so we have to forward shouldPreventEnterKeySubmit props inside RadioListItem

And we can use CONST.KEYBOARD_SHORTCUTS.ENTER.shortcutKey instead of string 'Enter'

Is this limited to RadioListItem only? I feel like we should do this for all list items.

@suneox
Copy link
Contributor

suneox commented Apr 20, 2024

Is this limited to RadioListItem only? I feel like we should do this for all list items.

Yes, maybe we should apply for all lists but we don't have any context for other list items. So I think we can go ahead with this list first. But we have to set shouldPreventEnterKeySubmit=true at BaseSelectionList instead of passing from props

@allroundexperts
Copy link
Contributor

@suneox Makes sense. Let's fix the radio item list first. Updated the PR.

@allroundexperts
Copy link
Contributor

Will update the screen recordings in the next few mins as well.

@suneox
Copy link
Contributor

suneox commented Apr 20, 2024

Could you please check your merge change? It's mixing with another commit and the code change also update MoneyRequestView file

@allroundexperts
Copy link
Contributor

@suneox Updated and added screen recordings. Let's take this convo to the PR.

@suneox
Copy link
Contributor

suneox commented Apr 20, 2024

@suneox you can test the PR as a C+ role

@mountiny Could you assign me a review on this PR

PR look good to me but i can not approve these change

@mountiny
Copy link
Contributor

@suneox I believe you cannot review a you are not C+, but you can leave comments with the checklist and approve by comment

@mountiny mountiny removed the DeployBlockerCash This issue or pull request should block deployment label Apr 23, 2024
@suneox
Copy link
Contributor

suneox commented Apr 25, 2024

The PR has been deployed to production 3 days ago, I think we should update hold for payment

@suneox
Copy link
Contributor

suneox commented Apr 30, 2024

Hi @mountiny This issue has been deployed to production over 1 week, so I think we should process payment. Thank you!

@suneox
Copy link
Contributor

suneox commented May 3, 2024

Friendly bump @mountiny

@suneox
Copy link
Contributor

suneox commented May 11, 2024

@mountiny could you please process payment for this issue?

@mountiny mountiny changed the title [$250] Web - Pressing on keyboard enter key on notification option of a room takes back two steps [HOLD for payment 2024-05-13] [$250] Web - Pressing on keyboard enter key on notification option of a room takes back two steps May 13, 2024
@mountiny mountiny added Daily KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review Weekly KSv2 labels May 13, 2024
@melvin-bot melvin-bot bot added the Overdue label May 13, 2024
@kevinksullivan
Copy link
Contributor

Payment summary:

@JmillsExpensify
Copy link

$250 approved for @allroundexperts

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

7 participants