-
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-01-11] [$500] Status - Highlighting minutes and pressing Back key does not reset it to 00 #33143
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01a5a5a8e401086431 |
Triggered auto assignment to @bfitzexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
Triggered auto assignment to @pecanoro ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Can't delete the whole hour or minute by selecting the text. What is the root cause of that problem?Currently, if we delete the whole hour/minute, the App/src/components/TimePicker/TimePicker.js Lines 119 to 124 in 8bef4bb
What changes do you think we should make in order to solve the problem?Let's handle the case where the
(we need to do this for minute too) |
ProposalPlease re-state the problem that we are trying to solve in this issue.The backspace logic on TimePicker is broken. What is the root cause of that problem?This happens because of the function we are calling on the App/src/components/TimePicker/TimePicker.js Lines 323 to 332 in 8bef4bb
The purpose of this function is to move the caret to the Hours section if we press Backspace while being at the beginning of the Minutes section. This is logical, but we do not check if there is an actual selection, we only check the caret position. What changes do you think we should make in order to solve the problem?The whole idea is based on these 2 points:
Now to the technical details.First, we should alter the logic of if (selectionMinute.start !== 0 || selectionMinute.end !== 0 || e.key !== 'Backspace') {
return;
} App/src/components/TimePicker/TimePicker.js Lines 323 to 332 in 8bef4bb
Second, we should fix the way we handle the hours & minutes change to allow deleting the selection: Introduce 2 util functions as they will be reused: const resetHours = () => {
setHours('00');
setSelectionHour({start: 0, end: 0});
}
const resetMinutes = () => {
setMinute('00');
setSelectionMinute({start: 0, end: 0});
focusHourInputOnLastCharacter();
} Here in the In both const handleHourChange = (text) => {
if (_.isEmpty(text)) {
resetHours();
return;
}
...
}
const handleMinutesChange = (text) => {
if (_.isEmpty(text)) {
resetMinutes();
return;
}
...
} For the digital pad, make the following changes to add early returns by resetting hours or minutes if the full value was selected: if (isHourFocused) {
if (selectionHour.start === 0 && selectionHour.end === 2) {
resetHours();
return;
}
...
} else if (isMinuteFocused) {
if (selectionMinute.start === 0 && selectionMinute.end === 2) {
resetMinutes();
return;
}
if (selectionMinute.start === 0 && selectionMinute.end === 0) {
focusHourInputOnLastCharacter();
return;
}
...
} App/src/components/TimePicker/TimePicker.js Lines 263 to 278 in aa1d87c
What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Nothing happens to the minutes and the cursor moves to the beginning of hours. What is the root cause of that problem?When we highlight all minutes and click on Backspace key, we will only focus on the hour App/src/components/TimePicker/TimePicker.js Lines 325 to 328 in 8bef4bb
What changes do you think we should make in order to solve the problem?
App/src/components/TimePicker/TimePicker.js Lines 325 to 328 in 8bef4bb
App/src/components/TimePicker/TimePicker.js Line 122 in 8bef4bb
App/src/components/TimePicker/TimePicker.js Line 191 in 8bef4bb
What alternative solutions did you explore? (Optional)NA |
@bernhardoj Thanks for the proposal. Your solution makes sense but it does not cover the minute case. Can you please update your proposal to cover it? Also we need to make it work with the backbutton in the software keyboard too Screen.Recording.2023-12-16.at.2.15.05.AM.mov |
@paultsimura Thanks for the proposal. The approach looks good to me. Is there any reason we need to adjust the regex instead of just checking if the text is empty beforehand? Also same note above regarding the soft num pad backbutton |
@dukenv0307 Thanks for the proposal. I don't think we should clear the input on the key press event. Handling this on |
@s77rt This key press function only apply for backspace. |
Current assignee @pecanoro is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
Assigning @paultsimura! |
📣 @s77rt 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @paultsimura 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Thanks. The PR is ready for review: #33344 |
@pecanoro while working on this issue, we've decided to fix not only this one but a couple of other bugs related to the TimePicker (it was quite buggy actually). This led to spending a solid week of day-to-day development and testing from both the C and C+ sides. I've seen that in such cases, contributors negotiate for a larger bounty since otherwise these bugs would have been fixed as separate issues later. I'll leave the bounty decision up to you, but could we please make this PR free from potential regression penalties? As it did cover a lot of logic changes to fix different cases, but we might have missed some edge cases. For instance, here are 4 other fixed bugs that were out of scope here: Unexpected re-conversion of 24h to 12h format when entering the first digit
12_24_on_input.movJumping cursor when moving from hours to minutes
jumping_cursor.movBuggy behavior when removing digits using the "Delete" button
removal_by_delete.movBuggy behavior when pressing "Space"
space_removal.mov |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.21-4 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-01-11. 🎊 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:
|
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:
|
|
Issue is ready for payment but no BZ is assigned. @lschurr you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks! |
Hmm @bfitzexpensify is already on this one. Are you able to handle, Benny? Un-assigning myself :) |
Payments complete, agreed we don't need a regression test here. Closing this one out. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: v1.4.13-2
Reproducible in staging?: Y
Reproducible in production?: N
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
Expensify/Expensify Issue URL:
Issue reported by: Applause-Internal Team
Slack conversation: @
Action Performed:
Expected Result:
The minutes will be reset to 00.
Actual Result:
Nothing happens to the minutes and the cursor moves to the beginning of hours.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6313966_1702609442496.-871908312044640390bandicam_2023-12-15_10-03-29-401.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: