-
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 2024-03-25] [$500] Message action menu - Last option is not selected when pressing up key #36245
Comments
Job added to Upwork: https://www.upwork.com/jobs/~017003c89d832c6ad8 |
Triggered auto assignment to @puneetlath ( |
We think that this bug might be related to #vip-vsb |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Last option is not selected when pressing up key What is the root cause of that problem?Because index '0' is disabled it breaks early here App/src/hooks/useArrowKeyFocusManager.ts Lines 75 to 76 in b9aada8
What changes do you think we should make in order to solve the problem?Change this App/src/hooks/useArrowKeyFocusManager.ts Lines 86 to 88 in 91ea979
to
And there is a similar problem with arrow key down too as there is no check if it is greater than
What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.What is the root cause of that problem?We reduce the value of App/src/hooks/useArrowKeyFocusManager.ts Lines 74 to 76 in b9aada8
What changes do you think we should make in order to solve the problem?Instead of checking for the Update the while loop to check if the while (disabledIndexes.includes(newFocusedIndex)) {
newFocusedIndex -= allowHorizontalArrowKeys ? itemsPerRow : 1;
if (newFocusedIndex === -1) {
return disableCyclicTraversal ? actualIndex : maxIndex
.
.
What alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.Message action menu - Last option is not selected when pressing up key What is the root cause of that problem?In the code below the while loop will be executed when the App/src/hooks/useArrowKeyFocusManager.ts Lines 73 to 77 in b9aada8
We also have similar bug in arrow_down_issue.mp4What changes do you think we should make in order to solve the problem?For Up arrow key:Instead of exiting the loop, we need to find the next focusable option from last, we can't directly return We need to update the code below: App/src/hooks/useArrowKeyFocusManager.ts Lines 75 to 77 in b9aada8
To: if (newFocusedIndex < minIndex) {
if (disableCyclicTraversal) {
return actualIndex;
}
let newIndexFromLast = maxIndex;
while (disabledIndexes.includes(newIndexFromLast)) {
newIndexFromLast -= allowHorizontalArrowKeys ? itemsPerRow : 1;
if (newIndexFromLast < minIndex) {
return actualIndex;
}
}
return newIndexFromLast;
} For Down arrow key:We need to add the code below in the while loop of if (newFocusedIndex >= maxIndex) {
if (disableCyclicTraversal) {
return actualIndex;
}
let newIndexStart = 0;
while (disabledIndexes.includes(newIndexStart)) {
newIndexStart += allowHorizontalArrowKeys ? itemsPerRow : 1;
if (nextIndex >= maxIndex) {
return actualIndex;
}
}
return newIndexStart;
} PS: Minor code changes or refactoring can be done during the PR, the general idea will be the same. Resultfix_demo_arrow_keys.mp4 |
Will get to this today. |
|
Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
Edit: sorry I got it wrong, but still I think we should handle it correctly, the selected proposal just passes |
@Ollyws, sorry, I didn't get that, can you pls explain what do you mean by this? I think we use disabled indexes for the down arrow key. App/src/hooks/useArrowKeyFocusManager.ts Line 123 in b635cc5
|
What I meant was, that I can't see anywhere in which this issue affects the app and while it would be nice to fix this along with the issue you mentioned it would mean passing up an earlier working proposal for one that fixes an issue that's arguably out of scope, which doesn't quite seem fair to me. |
@Ollyws Thanks! that was a nice catch 👍 But I have to point that the selected proposal is principally wrong in two ways
Now the emoji case is an exception where in App/src/components/EmojiPicker/EmojiPickerMenu/index.js Lines 95 to 96 in 3a702ce
So the perfect solution is to add to my proposal an option in App/src/hooks/useArrowKeyFocusManager.ts Lines 75 to 76 in b9aada8
|
@Ollyws, thanks for the clarification, but the selected proposal doesn't fix the issue correctly and since There are 2 point which makes my proposal better than the selected one:
Also, I think they not smaller details and would have been easily missed during the PR phase. cc: @puneetlath |
Hello @FitseTLT @Krishna2323 , as stated, the core solution remains the same, I can improve on your suggestions if they have valid grounds during the PR stage 👍 Thanks and hope you understand |
@GandalfGwaihir, proposals should also cover every edge case(if any) and similar bugs instead of the just core idea. Also it should be complete to not cause any regressions in the future. |
I think edge cases can be left for PR phase but this case is not at all about being an edge case. The only reason it didn't break the search input focus was a sheer luck that for emoji we have 8 item per row so when it deducts on the while loop it becomes 2024-02-13.20-21-32.mp4 |
I mean't the similar bugs.
This isn't a edge case, this follows the current code implementation approach and is important to not cause similar bugs in future. |
@Ollyws mind summarizing the current state of this issue for me? |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Awaiting PR |
@puneetlath, @Ollyws, @FitseTLT Whoops! This issue is 2 days overdue. Let's get this updated quick! |
same |
@puneetlath @Ollyws @FitseTLT this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks! |
Current assignee @Ollyws is eligible for the Internal assigner, not assigning anyone new. |
Just reviewing some details, should be good to go in a day or two. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.53-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 2024-03-25. 🎊 For reference, here are some details about the assignees on this 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:
|
@Ollyws friendly reminder about the checklist so that we can pay on Monday. |
BugZero Checklist:
N/A
Yes.
Regression Test Proposal
Do we agree 👍 or 👎 |
All paid. Thanks y'all! Regression test issue is here: https://github.com/Expensify/Expensify/issues/382048 |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: v1.4.39-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: https://expensify.testrail.io/index.php?/tests/view/4294106
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal team
Slack conversation:
Action Performed:
Expected Result:
Focus should be applied on 'Delete comment' option
Actual Result:
Focus is not applied on 'Delete comment' option
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6373696_1707490365897.Screen_Recording_2024-02-09_at_2.50.43_at_night.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: