-
Notifications
You must be signed in to change notification settings - Fork 3k
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-04-09] [$500] Search/Send money/Request money - Last option is not selected when pressing up arrow key #38430
Comments
Triggered auto assignment to @bfitzexpensify ( |
@bfitzexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
We think that this bug might be related to #vip-vsp |
Job added to Upwork: https://www.upwork.com/jobs/~0121c95e267ea04cc2 |
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.Last option is not selected when pressing up arrow key What is the root cause of that problem?The root cause of this issue lies in the calculation of
What changes do you think we should make in order to solve the problem?Adjust
maxIndex={slicedSections.flatMap((section) => section.data).length - 1}
maxIndex={flattenedSections.allOptions.slice(0, CONST.MAX_OPTIONS_SELECTOR_PAGE_LENGTH * currentPage).length - 1}
... Additionally, the current behavior of slicing options is buggy, as it improperly applies the 500-option limit per section rather than cumulatively. We need to amend this by iterating through sections and slicing options until reaching the global limit ( const [slicedSections, ShowMoreButtonInstance] = useMemo(() => {
let maxRemainingOptions = CONST.MAX_OPTIONS_SELECTOR_PAGE_LENGTH * currentPage;
const processedSections = sections.map((section) => {
const data = !isEmpty(section.data) && maxRemainingOptions > 0 ? section.data.slice(0, maxRemainingOptions) : [];
maxRemainingOptions -= data.length;
return {
...section,
data,
};
});
// Determine if the "Show More" button should be displayed.
const shouldShowMoreButton = flattenedSections.allOptions.length > CONST.MAX_OPTIONS_SELECTOR_PAGE_LENGTH * currentPage;
const showMoreButton = shouldShowMoreButton ? (
<ShowMoreButton
containerStyle={[styles.mt2, styles.mb5]}
currentCount={CONST.MAX_OPTIONS_SELECTOR_PAGE_LENGTH * currentPage}
totalCount={flattenedSections.allOptions.length}
onPress={incrementPage}
/>
) : null;
return [processedSections, showMoreButton];
// we don't need to add styles here as they change
// we don't need to add flattendedSections here as they will change along with sections
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [sections, currentPage]); |
I am not able to reproduce this bug, are you able to reproduce @abzokhattab ? |
@GandalfGwaihir Yeah but you need to have more than
Screen.Recording.2024-03-16.at.1.14.03.AM.mov
Screen.Recording.2024-03-16.at.1.25.00.AM.mov
Screen.Recording.2024-03-16.at.1.30.19.AM.mov |
Proposals ready for review @mollfpr - thank you! |
I can't reproduce it on staging Screen.Recording.2024-03-19.at.23.31.20.mp4 |
Still reproducible on staging and production on my account: Screen.Recording.2024-03-19.at.6.37.02.PM.movScreen.Recording.2024-03-19.at.6.37.56.PM.mov |
I guess 700+ reports don't reproduce the issue. @abzokhattab How do you get the account with 4k report? nvm I can reproduce it in my main account |
I don't know but this is the main account 😂
seems like it, but the code has a bug, I believe we should fix it. |
@abzokhattab I tried your solution It works on my account with 4k reports but it is not with 700+ reports. Screen.Recording.2024-03-20.at.23.24.14.mp4 |
could you try again please, there was a small issue in the |
Thanks @abzokhattab it's working great now! The proposal from @abzokhattab looks good to me! 🎀 👀 🎀 C+ reviewed! |
Triggered auto assignment to @Gonals, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @mollfpr 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @abzokhattab 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
The PR is ready! please check it out and let me know if you have any comments. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.58-8 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-04-09. 🎊 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:
|
Payment summary: $500 to @abzokhattab for contributor work - paid via Upwork ✅ |
Sorry for the delay @bfitzexpensify! I'll do a manual request in NewDot, thank you!
I couldn't find the offending PR.
The regression step should be good.
|
$500 approved for @mollfpr |
Thanks @mollfpr - agree with those regression steps, proposed they be added via https://github.com/Expensify/Expensify/issues/387069. Closing this out - thanks everyone! |
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: 1.4.53-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: https://expensify.testrail.io/index.php?/tests/view/4428031
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Last option in the list should be selected and the list should scroll down to the bottom as it is the case in Start chat list
Actual Result:
List does not move at all
Reproducible in Search, Send money and Request money lists
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6415407_1710535393957.2024-03-15_21-39-36.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: