-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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-09-21] [$1000] dev: ESC keyboard shortcut shows up in modal on second render on login page #25448
Comments
Triggered auto assignment to @conorpendergrast ( |
Bug0 Triage Checklist (Main S/O)
|
Proposal by @chiragxaroraPlease re-state the problem that we are trying to solve in this issue.ESC keyboard shortcut shows up in modal on second render on login page What is the root cause of that problem?Root cause of this issue is as follows: App/src/libs/KeyboardShortcut/index.js Lines 135 to 142 in fdcae9f
Now coming to the modal, we are subscribing to the ESC shortcut inside App/src/components/KeyboardShortcutsModal.js Lines 49 to 56 in fdcae9f
And from when the page loads till the point we open the modal once using CMD+J, this piece of code never executes because App/src/components/KeyboardShortcutsModal.js Lines 128 to 131 in fdcae9f
same case with second useEffect, where it always lands in the else object App/src/components/KeyboardShortcutsModal.js Lines 143 to 152 in fdcae9f
Thus the ESC shortcut is never subscribed until we open the modal once on login screen, unlike other places Now once you open the modal, it gets subscribed, and now when you close it, you get to see the ESC shortcut for a brief moment and after that, we see it whenever we open the modal What changes do you think we should make in order to solve the problem?We need to subscribe to openmodal shortcuts without any condition on modal mounting which essentially means the following changes: replacing this App/src/components/KeyboardShortcutsModal.js Lines 128 to 131 in fdcae9f
with this subscribeOpenModalShortcuts(); ResultsWhat alternative solutions did you explore? (Optional)None |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
ProposalPlease re-state the problem that we are trying to solve in this issue.ESC keyboard shortcut shows up in modal on second render on login page What is the root cause of that problem?
When the components load (initial), we call the function KeyboardShortcut.getDocumentedShortcuts() and store the result in the constant variable shortcuts . In useEffect we are callingsubscribeOpenModalShortcuts() subscribe function but fail to handle any changes in the shortcuts variable. Based on changes we are not rendering it.
For this #25448 (comment) cause is App/src/libs/KeyboardShortcut/index.js Lines 83 to 87 in fdcae9f
When unsubscribing, we remove event listeners but not shortcuts from the variable What changes do you think we should make in order to solve the problem?
we can handle const [shortcuts,setShortcurts] = useState([]) In these two places call App/src/components/KeyboardShortcutsModal.js Lines 143 to 146 in fdcae9f
App/src/components/KeyboardShortcutsModal.js Lines 127 to 131 in fdcae9f
if (isShortcutsModalOpen) {
subscribeOpenModalShortcuts();
setShortcurts(KeyboardShortcut.getDocumentedShortcuts())
} We are setting the state when the modal is opened, Once the component unmounts reset the state. bug.resolved.shortcut.mp4 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@conorpendergrast Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@Charan-hs, yes please report to #expensify-bugs! I'll hide the comments here for that separate bug, to keep this one focused on the bug in the OP |
Job added to Upwork: https://www.upwork.com/jobs/~01a6b0de738da985ac |
Current assignee @conorpendergrast is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.ESC shortcut is visible for a brief moment while shortcut modal closes, later it is shown consistently What is the root cause of that problem?In here, we're getting the list of shortcuts to display, but we're using the method So when new shortcuts are subscribed, for example in here, the UI is not updated. What changes do you think we should make in order to solve the problem?We need to make sure To do this, we can add a We cannot just use a state in What alternative solutions did you explore? (Optional)If we don't want to use Onyx, we can also create a |
I'll review the proposals in the morning; I ran out of time and got cold (again) 🙏 |
@Charan-hs This is exactly why we should make the state in the component always in sync with the actual data, currently the data is in another place and any changes to that data, will not reflect in the state. Setting the state when we mount the |
@chiragxarora I think there will be a drawback: #18425. Even thought we don't have it now, I'd like to keep the logic as it is. @tienifr I don't think we need new Onyx keys for this where it can be avoided I think using the local state seems to be working. It makes sense to me we get the current shortcuts list, and we only care to show the list when the shortcuts modal opens. The proposal from @Charan-hs looks good to me! 🎀 👀 🎀 C+ reviewed! |
Triggered auto assignment to @Christinadobrzyn ( |
This comment was marked as duplicate.
This comment was marked as duplicate.
@Christinadobrzyn I'm on parental leave; re-assigning! A proposal has been accepted and is getting worked on at the moment |
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀 |
Thanks @mollfpr @arosiclair @conorpendergrast @arosiclair is this still eligible for a speed bonus? |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.69-2 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-09-21. 🎊 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.
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:
|
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:
|
prepping for payment...
|
Just bringing up this comment The speed bonus timeline might need to be reevaluated.
So I think the bonus would actually apply here? @arosiclair @mollfpr? |
@Christinadobrzyn pls send offer, I don't have connects |
Yeah that makes sense to me. There's no hard rule but here's a thread where we talked about it. |
I couldn't make sure if there's a PR causing the regression. The implementation was already there years ago, and a lot of changes on our keyboard shortcut handle.
The regression step should be enough.
|
@chiragxarora I sent an Upwork invitation to you - here's the job posting - https://www.upwork.com/jobs/~01a6b0de738da985ac |
Accepted! @Christinadobrzyn |
Friendly bump @Christinadobrzyn |
Regression test: https://github.com/Expensify/Expensify/issues/319173 This issue was created before Aug 30th so we'll adhere to the old payment scale Payouts due: Issue Reporter: $250 @chiragxarora Eligible for 50% #urgency bonus? Y - #25448 (comment) Upwork job is here. Paid! Thanks for all your help! |
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:
Expected Result:
ESC shortcut should always be shown in the modal
Actual Result:
ESC shortcut is visible for a brief moment while shortcut modal closes, later it is shown consistently
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: v1.3.55-7
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
Screen.Recording.2023-08-08.at.4.52.04.PM.mov
Expensify/Expensify Issue URL:
Issue reported by: @chiragxarora
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691493991739999
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: