Skip to content

[Hold for payment Aug 3] KeyboadShortcut is broken #4028

Closed

Description

@rushatgabhane

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 Search with Cmd + K
  2. Open New Group with Cmd + Shift + K
  3. Click outside New Group popup to close it.
  4. Press Escape to close Search.

Expected Result:

Escape should close the Search page.

Actual Result:

Escape doesn't close the Search page.

Workaround:

The user can click outside Search page/ click on the close button.

Platform:

Where is this issue occurring?

Web ✔️
iOS
Android
Desktop App ✔️
Mobile Web

Version Number:
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

issueDemo.mp4

Expensify/Expensify Issue URL:

View all open jobs on Upwork

Upwork job: https://www.upwork.com/jobs/~011663eb89a2b43197

Activity

  1. MelvinBot commented on Jul 14, 2021

    @MelvinBot
    Contributor

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

  2. removed
    AutoAssignerTriageAuto assign issues for triage to an available triage team member
    on Jul 14, 2021
  3. rushatgabhane commented on Jul 14, 2021

    @rushatgabhane
    MemberAuthor

    Why is this issue occuring?

    The issue is occuring because Push/Pop in KeyboardShortcut isn't implemented correctly.
    When we click outside New Group page, all the eventListeners for Escape key are deleted.

    Proposal

    Instead of delete events[keyCode], do events[keyCode].pop().
    https://github.com/Expensify/Expensify.cash/blob/b9569af14376b23fd8633883f2a3126a91d3fae4/src/libs/KeyboardShortcut/index.js#L129

    Loop eventCallbacks in reverse and return early when the right event is triggered.
    https://github.com/Expensify/Expensify.cash/blob/b9569af14376b23fd8633883f2a3126a91d3fae4/src/libs/KeyboardShortcut/index.js#L17

    This is done because we don't want to trigger all the events of a key.
    This'll fix escape key closing New Group, and Search at the same time, instead of one at a time.

    Don't export the unsubscribe() method, so that we're forced to take return value from KeyboardShortcut.subscribe()
    Modify Authscreen.js to accept the the return value for unsubscribing.

    Replace the callback of Escape key to Navigation.closeDrawer()
    This changes the behaviour of Escape key from Go Back to Close.

    Demo

    solution.demo.mp4
  4. parasharrajat commented on Jul 14, 2021

    @parasharrajat
    Member

    This needs further planning.

  5. rushatgabhane commented on Jul 15, 2021

    @rushatgabhane
    MemberAuthor

    slack convo here

  6. mallenexpensify commented on Jul 16, 2021

    @mallenexpensify
    Contributor

    Added Daily label so @puneetlath will see it for triage.
    @parasharrajat , can you elaborate what needs further planning? I saw @rushatgabhane 's Slack post but there are no comments there. We can followup in a comment there and 'share with room' to try to get more eyes on, if needed

  7. rushatgabhane commented on Jul 17, 2021

    @rushatgabhane
    MemberAuthor

    I don't think further planning is required.
    Just need feedback on my proposal in case I'm missing something.

  8. parasharrajat commented on Jul 18, 2021

    @parasharrajat
    Member

    So via further planning, I meant what has desired behaviour of ESC? If you look at the cross button on the Modal screen it does not take you back instead close the whole Modal Screen Stack and take you back to Report Screen. I think Esc is meant to do the same. Does Esc navigate back in the browser history? Open any page and navigate the website. Press ESC, will it go back in history?

  9. rushatgabhane commented on Jul 18, 2021

    @rushatgabhane
    MemberAuthor

    @parasharrajat I don't think so.
    Because if you take a look at callbacks for Escape key, goBack is set as the callback.
    https://github.com/Expensify/Expensify.cash/blob/fc965f68d308167d19d00a29b91e85ca33707882/src/components/ScreenWrapper.js#L61-L62
    This tells me that the expected behaviour is to go back, instead of closing all the Modal screens.

  10. mallenexpensify commented on Jul 19, 2021

    @mallenexpensify
    Contributor

    Posted to Upwork, assigning an engineer to review.
    https://www.upwork.com/jobs/~011663eb89a2b43197

  11. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 19, 2021
  12. 10 remaining items

  13. puneetlath commented on Jul 21, 2021

    @puneetlath
    Contributor

    Great. I went ahead and hired @rushatgabhane in Upwork.

  14. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 26, 2021
  15. MelvinBot commented on Jul 26, 2021

    @MelvinBot
    Contributor

    @tgolen, @puneetlath, @rushatgabhane Eep! 4 days overdue now. Issues have feelings too...

  16. rushatgabhane commented on Jul 26, 2021

    @rushatgabhane
    MemberAuthor

    Just waiting for review of PR 🙂

  17. changed the title [-]KeyboadShortcut is broken[/-] [+][Hold for payment Aug 3] KeyboadShortcut is broken[/+] on Jul 30, 2021
  18. MelvinBot commented on Aug 2, 2021

    @MelvinBot
    Contributor

    @tgolen, @puneetlath, @rushatgabhane it looks like no one is assigned to work on this job.
    Please double the price or add a comment stating why the job isn't being doubled.

  19. mallenexpensify commented on Aug 3, 2021

    @mallenexpensify
    Contributor

    ^ was from a test, disregard

  20. puneetlath commented on Aug 3, 2021

    @puneetlath
    Contributor

    Paid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions