-
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 2025-01-02] [$250] when selecting categories, the selected categories get reset if we click outside the checkbox #49322
Comments
Triggered auto assignment to @jliexpensify ( |
This comment was marked as off-topic.
This comment was marked as off-topic.
@jliexpensify could you please assign me. I want to C this because I raised this issue |
Job added to Upwork: https://www.upwork.com/jobs/~021835867544323146964 |
Current assignee @rushatgabhane is eligible for the External assigner, not assigning anyone new. |
Done, I think Design is still weighing in though? |
This comment was marked as outdated.
This comment was marked as outdated.
I'll post an update on the expected result whenever design team has reached a decision |
Expected result:
(source) |
@rushatgabhane Please review the PR that introduced this bug. I believe it will provide valuable insights for defining the final expectations. |
Edited by proposal-police: This proposal was edited at 2023-10-07T16:31:35Z. ProposalPlease re-state the problem that we are trying to solve in this issue.RHP opened for the category and all other categories are reset (Unchecked) What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
The similar logic should be removed in this, this and this.
import {NavigationContainerRefContext, useIsFocused} from '@react-navigation/native';
import {useContext, useEffect} from 'react';
import NAVIGATORS from '@src/NAVIGATORS';
let shouldCleanupSelectedOptions = false;
const useCleanupSelectedOptions = (setFunction: ({}: any) => void) => {
const navigationContainerRef = useContext(NavigationContainerRefContext);
const state = navigationContainerRef?.getState();
const lastRoute = state.routes.at(-1);
const isRightModalOpening = lastRoute?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR;
const isFocused = useIsFocused();
useEffect(() => {
if (isFocused || isRightModalOpening) {
return;
}
shouldCleanupSelectedOptions = false;
setFunction?.({});
}, [isFocused, setFunction, isRightModalOpening]);
};
export {useCleanupSelectedOptions}; and just need to use that hook in where we want to clean up its selected option once we visit other pages, such as: In WorkspaceCategoriesPage, we use
so that it will call
What alternative solutions did you explore? (Optional)
I suggest removing that logic, as it was originally added to address an issue where: if you selected options on screen A, navigated to screen B, and returned to A, the selected options were not cleared. However, I believe this is standard behavior in terms of the navigation stack: when you select options on screen A, navigate to B, and then return to A, A's state should naturally be preserved. |
Results for above proposalScreen.Recording.2024-09-17.at.10.08.17.AM.movScreen.Recording.2024-09-17.at.10.10.38.AM.mov |
Updated proposal to remove redundant code changes and add an explanation. |
Triggered auto assignment to @MonilBhavsar, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@rushatgabhane just a note @truph01's solution do not clear categories even for other cases like switching to tags page and come back, so it does not align with the expectations.
|
sorry i didn't know that we should remove selected categories if we navigate away |
@ChavdaSachin for mobile, we want the categories to select if you tap anywhere on the row when in selection mode. |
give me a minute |
This comment was marked as outdated.
This comment was marked as outdated.
spb Your proposal will be dismissed because you did not follow the proposal template. |
This comment was marked as outdated.
This comment was marked as outdated.
Thanks Monil - so here's a tentative Payment Summary
|
Current assignee @rushatgabhane is eligible for the External assigner, not assigning anyone new. |
Damn, I thought that would auto-create a new job (the old one is expired). Will manually create one then. |
@truph01 what's your Upworks profile? Could you add it (or your name) to your GH profile? Thanks. |
@jliexpensify I accepted this automatic offer. Correct amount ($200) could be paid out on that offer later.
Sure, I added my profile link to GH profile. |
@truph01 thanks! Upworks does this annoying thing where after a month, it closes jobs and we can't pay out on them. So I had to create a new job and hire you. |
PR is ready @rushatgabhane |
I'm OOO until the 29th, feel free to reassign if payment is required before then - otherwise will handle when I get back. |
@MonilBhavsar Do we want to address the issue "If we preserve selections and delete category from categorySettingsPage, selection counter on header would not update"? I've had a solution for it. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.78-6 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 2025-01-02. 🎊 For reference, here are some details about the assignees on this issue:
|
@rushatgabhane @jliexpensify @rushatgabhane The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
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: 9.0.36-1
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
Expensify/Expensify Issue URL:
Issue reported by: @rushatgabhane
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1725906909191599
Action Performed:
Expected Result:
RHP opened for selected category and other category remain selected
Actual Result:
RHP opened for the category and all other categories are reset (Unchecked)
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Screen.Recording.2024-09-09.at.21.33.31.mov
Recording.530.mp4
Add any screenshot/video evidence
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @jliexpensifyThe text was updated successfully, but these errors were encountered: