Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.49k stars 2.84k forks source link

[HOLD for payment 2023-06-02] [$1000] The ordering of the last two keyboard shortcuts is not consistent across different browsers #18542

Closed kavimuru closed 1 year ago

kavimuru commented 1 year ago

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 the app in Chrome
  2. Press CMD + J to open the keyboard shortcuts dialog
  3. Observe the CMD + J shortcut is in the last row
  4. Open the app in Safari
  5. Press CMD + J to open the keyboard shortcuts dialog
  6. Observe the CMD + J shortcut is in the second last row

Expected Result:

The ordering of the keyboard shortcuts is consistent across different browsers.

Actual Result:

The ordering of the keyboard shortcuts is not consistent across different browsers.

Workaround:

Can the user still use Expensify without this being fixed?

Yes.

Have you informed them of the workaround?

No actual user cares about this.

Platforms:

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

Version Number: 1.3.11-2 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

https://user-images.githubusercontent.com/43996225/236687782-ee7b3f67-cb04-46b1-bd65-de3e2322517d.mov

Uploading Recording #182.mp4…

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cbc0a7bdb5971dcf
  • Upwork Job ID: 1658160595766345728
  • Last Price Increase: 2023-05-15
melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

allroundexperts commented 1 year ago

Proposal

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

Keyboard shortcuts modal does not display the shortcuts in a fixed order.

What is the root cause of that problem?

This is a side effect of a bigger problem. We're showing the shortcuts in the modal depending if they've been subscribed to or not. If they are subscribed, we're saving those in a static file here. This approach has multiple issues:

  1. If a listener gets subscribed to AFTER the modal has loaded, it never shows up because the KeyboardShortcutsModal doesn't re-render since the documentedShortcuts is not stored in a state.
  2. The order of the listeners, as they are subscribed, can't be guaranteed across browsers.

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

We should use a Context that exposes the functions in this file. Using it, will cause our model to re-render whenever a shortcut gets subscribed.

The Context should also return the subscribed shortcuts in a sorted order such that the order always remains the same.

What alternative solutions did you explore? (Optional)

We can just sort the results in this file if using a context is not an option.

kavimuru commented 1 year ago

Keyboard shortcut bugs are not in scope. Closing the bug as per this comment

sonialiap commented 1 year ago

Issue reopened per this comment and the following ones

melvin-bot[bot] commented 1 year ago

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

marcaaron commented 1 year ago

I can't think of a reason why the order of these things would change. I have some suggestions about the clarity of the issue description.

The positioning of the keyboard shortcuts is consistent across different browsers

I would change "positioning" to "ordering". I spent a while looking at the modal and wondering why we care about it's "position" changing a few pixels. Then saw it. Which maybe gives an idea about how urgent this issue is :D

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

aayushagrawal9 commented 1 year ago

Proposal

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

When pressing CMD+J to list keyboard shortcuts, the last two shortcuts in the list appear inconsistently with respect to their order across different browsers

What is the root cause of that problem?

The shortcut list is stored here and set here

As we can see the shortcuts are populated in first-come-first-serve order to the subscribe() function. As a result a race condition can make the ordering inconsistent.

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

Sorting documentedShortcuts each time a new shortcut is added should resolve the issue

What alternative solutions did you explore? (Optional)

Using a Context may be a better solution that would also fix the problem of new shortcuts being added after the CMD+J page is loaded. I also noticed that there is no error thrown in case more than one attempts to register the same shortcut combination is there.

melvin-bot[bot] commented 1 year ago

📣 @aayushagrawal9! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
aayushagrawal9 commented 1 year ago

Contributor details Your Expensify account email: aayush@lunadawn.dev Upwork Profile Link: https://www.upwork.com/freelancers/aayushagrawal

melvin-bot[bot] commented 1 year ago

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

eVoloshchak commented 1 year ago

@allroundexperts, awesome job investigating this, we definitely should fix the bigger problem here. In addition to that, this will resolve another issue here. The discussion in Slack concluded that this is worth fixing, so I think we can move forward with @allroundexperts's proposal

🎀👀🎀 C+ reviewed! cc: @marcaaron

melvin-bot[bot] commented 1 year ago

@sonialiap, @marcaaron Whoops! This issue is 2 days overdue. Let's get this updated quick!

marcaaron commented 1 year ago

Assigning @allroundexperts. But I think I prefer the alternate solution? This issue doesn't seem related to whatever other problem is being discussed here. Can we implement this without using Context?

melvin-bot[bot] commented 1 year ago

📣 @eVoloshchak You have been assigned to this job by @marcaaron! Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Keep in mind: Code of Conduct | Contributing 📖

melvin-bot[bot] commented 1 year ago

📣 @allroundexperts You have been assigned to this job by @marcaaron! Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Keep in mind: Code of Conduct | Contributing 📖

allroundexperts commented 1 year ago

PR created https://github.com/Expensify/App/pull/19305

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.18-2 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-06-02. :confetti_ball:

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.

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

melvin-bot[bot] commented 1 year ago

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:

sonialiap commented 1 year ago

Not overdue, will issue payment on June 2

eVoloshchak commented 1 year ago
sonialiap commented 1 year ago

@adeel0202 offer sent for reporting issue - paid @allroundexperts offer sent for the fix + 3 day merge bonus - paid @eVoloshchak offer sent for the review + 3 day merge bonus - paid

sonialiap commented 1 year ago

Whoops, @eVoloshchak the Upwork job got closed early 🤦 recreating it and sending you a new offer

Edit: Sent

eVoloshchak commented 1 year ago

@sonialiap, accepted, thanks!

sonialiap commented 1 year ago

Everyone has been paid ✅