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-07-14] [$1000] Web - On the Invite page, pressing enter shows as selected for an unselected user on the next page #21591

Closed
1 of 6 tasks
kbecciv opened this issue Jun 26, 2023 · 25 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

@kbecciv
Copy link

kbecciv commented Jun 26, 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 App & Press Settings > Workspaces > Go to any workspace
  2. Go to members > Invite
  3. Select 2 users
  4. Press Enter
  5. We can see the Add message page and Check the number of users in the Header

Expected Result:

There should be two users that we have selected on the previous page

Actual Result:

On Add message page, we can see the three users instead of 2; pressing enter is selecting the third user

Workaround:

Unknown

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.32-5
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

enter-press-error.1.mov
Desktop.2023.06.25.-.22.07.55.18.mp4

Expensify/Expensify Issue URL:
Issue reported by: @jayeshmangwani
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1687440846874509

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011875b507eb8a5110
  • Upwork Job ID: 1673518838222045184
  • Last Price Increase: 2023-06-27
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 26, 2023

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

@melvin-bot
Copy link

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

@jayeshmangwani
Copy link
Contributor

Proposal

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

Web - On the Invite page, pressing enter shows as selected for an unselected user on the next page

What is the root cause of that problem?

On WorkspaceInvitePage we are using the FormSubmit for the list

<FormSubmit
style={[styles.flex1]}
onSubmit={this.inviteUser}
>

On form submit we have added condition here where we have input focused then call the enter event

// ENTER is pressed on INPUT or SELECT element, call the submit callback.
if (tagName === 'INPUT' || tagName === 'SELECT') {

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

We dont need to call the submit event here, so we can safely remove the
tagName === 'INPUT' from this condition

// ENTER is pressed on INPUT or SELECT element, call the submit callback.
if (tagName === 'INPUT' || tagName === 'SELECT') {

What alternative solutions did you explore? (Optional)

none

@sophiepintoraetz
Copy link
Contributor

sophiepintoraetz commented Jun 27, 2023

I'm able to replicate this for the Invite Member flow but the flow for New Group chat is that when you press enter, the third person is selected but it doesn't automatically create the group. We may want to keep that consistent. I don't think this is a bug, per se, just an improvement.
2023-06-27_14-26-37 (1)

@sophiepintoraetz sophiepintoraetz added the External Added to denote the issue can be worked on by a contributor label Jun 27, 2023
@melvin-bot melvin-bot bot changed the title Web - On the Invite page, pressing enter shows as selected for an unselected user on the next page [$1000] Web - On the Invite page, pressing enter shows as selected for an unselected user on the next page Jun 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 27, 2023

Job added to Upwork: https://www.upwork.com/jobs/~011875b507eb8a5110

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

melvin-bot bot commented Jun 27, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 27, 2023

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

@bernhardoj
Copy link
Contributor

Proposal

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

In the workspace invite page, pressing enter will select the focused user and navigate to the invite message page.

What is the root cause of that problem?

In the workspace invite page, we have a FormSubmit component that will trigger onSubmit if an ENTER key is pressed while input is focused.

<FormSubmit
style={[styles.flex1]}
onSubmit={this.inviteUser}
>

// ENTER is pressed on INPUT or SELECT element, call the submit callback.
if (tagName === 'INPUT' || tagName === 'SELECT') {
this.props.onSubmit();
return;
}
// Pressing Enter on TEXTAREA element adds a new line. When `dataset.submitOnEnter` prop is passed, call the submit callback.
if (tagName === 'TEXTAREA' && lodashGet(event, 'target.dataset.submitOnEnter', 'false') === 'true') {
this.props.onSubmit();
return;
}
// ENTER is pressed on checkbox element, call the submit callback.
if (lodashGet(event, 'target.role') === 'checkbox') {
this.props.onSubmit();
}

We also have an ENTER key listener in the options selector that will select the focused row/user.

this.unsubscribeEnter = KeyboardShortcut.subscribe(
enterConfig.shortcutKey,
() => {
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);
}
},

Both callback is triggered which will select the focused user-to-invite and navigate to the invite message page.

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

Notice that on the workspace invite page, the Next button has a disablePressOnEnter props which means that we actually don't want to trigger the button action (navigate to invite message page) if an ENTER key is pressed.

<FormAlertWithSubmitButton
isDisabled={!this.state.selectedOptions.length}
isAlertVisible={this.getShouldShowAlertPrompt()}
buttonText={this.props.translate('common.next')}
onSubmit={this.inviteUser}
message={this.props.policy.alertMessage}
containerStyles={[styles.flexReset, styles.flexGrow0, styles.flexShrink0, styles.flexBasisAuto, styles.mb5]}
enabledWhenOffline
disablePressOnEnter
/>

So, to have the same behavior with New Group, we should remove FormSubmit from the workspace invite page.

@madmax330 madmax330 removed the Reviewing Has a PR in review label Jun 28, 2023
@sophiepintoraetz
Copy link
Contributor

sophiepintoraetz commented Jun 29, 2023

@eVoloshchak - would you mind reviewing @bernhardoj's and @jayeshmangwani proposal?

@eVoloshchak
Copy link
Contributor

@bernhardoj's proposal looks good to me.
FormSubmit isn't present on New Group page and it isn't needed here, so removing it is the right approach.
There is, however, another bug with selection on both pages:

  1. Go to Workspace -> Members -> Invite
  2. Select a user using keyboard navigation (tab key)
  3. Press enter
  4. Notice how both users are selected
Screen.Recording.2023-06-29.at.22.48.56.mov

@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

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.

@sophiepintoraetz
Copy link
Contributor

@eVoloshchak - does @bernhardoj need to amend the proposal to account for the bug?

@bernhardoj
Copy link
Contributor

We have an issue for that bug here #21392 (the linked issue is on split bill participant, but they use the same component, i.e. OptionsSelector)

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 30, 2023

📣 @eVoloshchak 🎉 An offer has been automatically sent to your Upwork account 🎉

Reviewer - [$1000] Web - On the Invite page, pressing enter shows as selected for an unselected user on the next page

@melvin-bot
Copy link

melvin-bot bot commented Jun 30, 2023

📣 @bernhardoj You have been assigned to this job!
Please apply to this job in Upwork here and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Jun 30, 2023

📣 @jayeshmangwani 🎉 An offer has been automatically sent to your Upwork account 🎉

Reporter - [$1000] Web - On the Invite page, pressing enter shows as selected for an unselected user on the next page

@bernhardoj
Copy link
Contributor

PR is ready.

cc: @eVoloshchak

@melvin-bot
Copy link

melvin-bot bot commented Jul 2, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 3, 2023

🎯 ⚡️ Woah @eVoloshchak / @bernhardoj, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @bernhardoj got assigned: 2023-06-30 04:35:30 Z
  • when the PR got merged: 2023-07-03 22:44:26 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jul 7, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - On the Invite page, pressing enter shows as selected for an unselected user on the next page [HOLD for payment 2023-07-14] [$1000] Web - On the Invite page, pressing enter shows as selected for an unselected user on the next page Jul 7, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 7, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 7, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.37-7 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-07-14. 🎊

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

@melvin-bot
Copy link

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

  • [@eVoloshchak] The PR that introduced the bug has been identified. Link to the PR:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] Determine if we should create a regression test for this bug.
  • [@eVoloshchak] 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.
  • [@puneetlath / @sophiepintoraetz] 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 Jul 13, 2023
@eVoloshchak
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: The change was introduced in Fix form accessibility 2/4 #12370, but I wouldn't call this a regression, the expected result has changed now. There was also a concern raised in the PR itself about this:

There are some challenges about the Enter key press to submit the form, as the current implementation attaches a global handler for each form. This submits the form whenever enter key is pressed, and this is not expected. Sometimes user wants to press enter on a button, and this produces some secondary interaction (also submits the form).

  • 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: N/A

  • 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: I don't think additional discussion is needed here, this is a simple bug, we just needed to align on the expected behavior

  • Determine if we should create a regression test for this bug
    Is it easy to test for this bug? Yes
    Is the bug related to an important user flow? No
    Is it an impactful bug? No

    It isn't an impactful bug (occurs only for users navigating with keyboard, doesn't break the user experience), regression test isn't needed I think

@melvin-bot melvin-bot bot removed the Overdue label Jul 17, 2023
@sophiepintoraetz
Copy link
Contributor

All right offers sent - thanks so much for the checklist - we good.

@anmurali
Copy link

Approved 1500 to @eVoloshchak based on #21591 (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
8 participants