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-08-24] [$1000] Web - Pressing space key applies focus to composer & scrolls comments at the same time #23508

Closed
1 of 6 tasks
kbecciv opened this issue Jul 24, 2023 · 35 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 Jul 24, 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!


Action Performed:

  1. Open a report that has multiple, scrollable comments
  2. Scroll to the bottom of comments
  3. Remove focus from the main composer
  4. Press 'Space' key

Expected Result:

The composer should not be focused and the report page should be scrolled.

Actual Result:

Composer is focused & report is scrolled making the function of space key less predictable.

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.44-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

Screencast.from.2023-07-24.13-57-13.mp4
Recording.3885.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Natnael-Guchima
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690196594809449

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0150e7ff18d1f62eb0
  • Upwork Job ID: 1683892863293607936
  • Last Price Increase: 2023-07-25
  • Automatic offers:
    • samh-nl | Contributor | 25928554
    • Natnael-guchima | Reporter | 25928556
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

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

@melvin-bot
Copy link

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

@samh-nl
Copy link
Contributor

samh-nl commented Jul 24, 2023

Proposal

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

Pressing space in a report applies focus to the composer and scrolls comments.

What is the root cause of that problem?

The focusComposerOnKeyPress function (ReportActionCompose.js) is used to place the focus in the composer when a key press event occurs. However, the default behavior of scrolling is still continued.

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

To prevent focusing the composer when space is pressed, we can add a condition to focusComposerOnKeyPress similar to how other keys such as Enter and Shift are ignored.

// If the key pressed is non-character keys like Enter, Shift, ... do not focus
if (e.key.length > 1) {
return;
}

What alternative solutions did you explore? (Optional)

Alternatively, if it's desired that scrolling is blocked but the focusing behavior is maintained, we should add e.preventDefault() right before this.focus() in the focusComposerOnKeyPress function.

@trjExpensify
Copy link
Contributor

@mountiny @JmillsExpensify I found this somewhat similar issue when looking into this one. It's similar in that it's an issue with clicking the space bar. In terms of expected behaviour, I would think we scroll the chat page and don't focus the composer in this case here. Would you agree with that?

@mountiny
Copy link
Contributor

@trjExpensify I agree the expected behaviour should be no focus and just scroll down

@trjExpensify
Copy link
Contributor

Cool, updating the OP's expected behaviour to make that clear. 👍 Moving on!

@trjExpensify trjExpensify added the External Added to denote the issue can be worked on by a contributor label Jul 25, 2023
@melvin-bot melvin-bot bot changed the title Web - Pressing space key applies focus to composer & scrolls comments at the same time [$1000] Web - Pressing space key applies focus to composer & scrolls comments at the same time Jul 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0150e7ff18d1f62eb0

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

melvin-bot bot commented Jul 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

@robertKozik
Copy link
Contributor

@samh-nl could you update your proposal to be in line with the expected behaviour as was stated here. I see that you stated it inside the alternative solutions, but I want this to be more clear as it should be go-to solution

@JmillsExpensify
Copy link

In terms of expected behaviour, I would think we scroll the chat page and don't focus the composer in this case here. Would you agree with that?

I agree with this as well.

@samh-nl
Copy link
Contributor

samh-nl commented Jul 26, 2023

@robertKozik Thank you, I have re-arranged the proposal according to the updated expected behavior.

@robertKozik
Copy link
Contributor

Thank you @samh-nl . Your solution is straightforward and is in line with expected behaviour.

I would choose @samh-nl proposal

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

@saalimzafar
Copy link

Proposal

Problem Statement:

Pressing the space key applies focus to the composer and scrolls through comments simultaneously, leading to an undesirable user experience.

Root Cause:

The root cause of this issue is that the function focusComposerOnKeyPress(e), responsible for handling keypress events, lacks a specific condition to prevent focusing the composer and performing simultaneous comment scrolling when the space key is pressed.

Proposed Changes:

To address the problem, I propose updating the focusComposerOnKeyPress(e) function to include a proper handling mechanism for the space key. By incorporating the necessary condition, we can prevent focusing the composer and avoid triggering the comment scrolling action when users press the space key.

Alternative Solution:

NA

Please review and consider this proposal to resolve the issue.

@robertKozik
Copy link
Contributor

Thanks, @saalimzafar, for your proposal, but the other one has already been selected (here). Your proposal suggests the same fix as the chosen one.

bumping @grgia to review and assign contributor

@saalimzafar
Copy link

It's okay @robertKozik

@melvin-bot melvin-bot bot added the Overdue label Jul 31, 2023
@trjExpensify
Copy link
Contributor

@grgia can you give this a secondary review please so we can keep it moving?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jul 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 3, 2023

📣 @Natnael-Guchima 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@grgia
Copy link
Contributor

grgia commented Aug 3, 2023

Thanks for the bump, I got a chance to review and @samh-nls proposal looks good, thank you!

@melvin-bot melvin-bot bot removed the Overdue label Aug 3, 2023
@saalimzafar
Copy link

Hi @grgia
I want to report a bug which I'm unable to do via github issue, I've already sent the emails to constributors but got no response. Can you help me if possible?

@robertKozik
Copy link
Contributor

Hi @saalimzafar you can submit bug reports via #expensify-bugs channel on slack

@saalimzafar
Copy link

It seems that my invitation is not getting accepted @robertKozik
I already send the emails but no response so far.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 4, 2023
@samh-nl
Copy link
Contributor

samh-nl commented Aug 4, 2023

PR is ready for review: #24162

@trjExpensify
Copy link
Contributor

PR is still in review, @grgia is back this week.

@melvin-bot
Copy link

melvin-bot bot commented Aug 14, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @samh-nl got assigned: 2023-08-03 14:48:18 Z
  • when the PR got merged: 2023-08-14 20:14:05 UTC
  • days elapsed: 7

On to the next one 🚀

@samh-nl
Copy link
Contributor

samh-nl commented Aug 15, 2023

Thanks all. Unsure if this makes a difference, but perhaps worth considering the OOO (I think I've seen precedence on this, but correct me if wrong):

Day 0 (Thu, Aug 3) - Assigned
Day 1 (Fri, Aug 4) - PR ready for review
Day 2 (Mon, Aug 7) - PR reviewed by @robertKozik

@trjExpensify
Copy link
Contributor

Yeah, we take into account things like the weekend and a delay on our internal review.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 17, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - Pressing space key applies focus to composer & scrolls comments at the same time [HOLD for payment 2023-08-24] [$1000] Web - Pressing space key applies focus to composer & scrolls comments at the same time Aug 17, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 17, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.54-13 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-08-24. 🎊

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:

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 Aug 17, 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:

  • [@robertKozik] The PR that introduced the bug has been identified. Link to the PR:
  • [@robertKozik] 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:
  • [@robertKozik] 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:
  • [@robertKozik] Determine if we should create a regression test for this bug.
  • [@robertKozik] 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.
  • [@trjExpensify] 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 and removed Weekly KSv2 labels Aug 23, 2023
@trjExpensify
Copy link
Contributor

👋 @robertKozik can you complete the checklist so we're ready to make payments here?

Confirming payments as follows:

$250 to @Natnael-Guchima for the bug report
$1,500 to @samh-nl for the fix + #urgency bonus
@robertKozik C+ payment will be handled separately.

Note: Urgency bonus being applied taking into account weekend/internal delay noted here.

@robertKozik
Copy link
Contributor

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:

@trjExpensify
Copy link
Contributor

Okay perfect, thanks for confirming!

I'm going to be out of pocket tomorrow, so settled up with @Natnael-Guchima & @samh-nl today. Closing this out, thanks everyone!

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