You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version Number: 9.1.77-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:@Eskalifer1 Slack conversation (hyperlinked to channel name): #Open source
Action Performed:
Navigate to the Security page
Click on "Add Copilot"
Proceed through the flow until you receive the magic code
Attempt to close the modal window by clicking outside the modal
Expected Result:
The modal should close smoothly, consistent with the standard animation used across the platform.
Actual Result:
The modal window has no animation and disappears only after another page is rendered
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Platforms Tested:
On which of our officially supported platforms was this issue tested:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence2025-07-07.09.42.11.movRecording.1385.mp4
thrownewError(`Screen ${route.name} does not have a history param. You can use this hook only on the screens that have one defined in SCREEN_TO_HISTORY_PARAM.`);
thrownewError(`The history param ${historyParamName} is not a boolean. Make sure that you used getHistoryParamParse for this screen in linkingConfig/config.ts`);
is not reactive, so navigation.dispatch will not trigger the update of the component, which is why the state will not be updated, which is why the modal window will not close
What changes do you think we should make in order to solve the problem?
We need to make this hook reactive, for this it must have a state, I propose to add a state and its recovery to the hook
This is how it will look like:
functionuseCustomHistoryParam(){constnavigation=useNavigation();constroute=useRoute();consthistoryParamName=SCREEN_TO_HISTORY_PARAM[route.nameasScreen];constgetParamValue=useCallback(()=>{constparamValue=route.params&&historyParamName&&(route.paramsasRecord<string,unknown>)[historyParamName]
? ((route.paramsasRecord<string,unknown>)[historyParamName]asboolean)
: false;if(typeofparamValue!=='boolean'){thrownewError(`The history param ${historyParamName} is not a boolean. Make sure that you used getHistoryParamParse for this screen in linkingConfig/config.ts`);}returnparamValue;},[route.params,historyParamName]);const[historyParam,setHistoryParamState]=useState(getParamValue);if(!historyParamName||typeofhistoryParamName!=='string'){thrownewError(`Screen ${route.name} does not have a history param. You can use this hook only on the screens that have one defined in SCREEN_TO_HISTORY_PARAM.`);}useEffect(()=>{setHistoryParamState(getParamValue());},[route.params,historyParamName]);constsetHistoryParam=(value: boolean)=>{navigation.dispatch({type: CONST.NAVIGATION.ACTION_TYPE.SET_HISTORY_PARAM,payload: {key: historyParamName, value},});setHistoryParamState(value);};return[historyParam,setHistoryParam]asconst;}
PS: Minor changes and other things can be discussed during the PR stage
I also propose to create a hook that we will use for modal windows, it will be a wrapper on top of the usual useState, but it will also have onBeforeRemove(() => setIsModalVisible(false))
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Which would be responsible for displaying the modal window, but would also leave the useCustomHistoryParam hook for the logic Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
This attempts to set the modal's visibility to false. However, unlike other pages where the visibility state is updated immediately (via a simple useState setter), in this case, setting the modal visibility triggers a navigation action:
As a result, when the right-hand panel (RHP) is closed, the modal remains visible until the navigation completes. It then disappears abruptly without an exit animation.
What changes do you think we should make in order to solve the problem?
We can modify the component as follows to immediately hide the modal when the beforeRemove event is triggered.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.98-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@fedirjh@mallenexpensify 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]
Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.
I'm assuming payment isn't due for anyone and that we don't need a regression test (partially cuz the PR has two issues linked in the OP, also cuz it was on hold pending the other issue). Comment/reopen if anyone disagree!
Activity
melvin-bot commentedon Jul 7, 2025
Triggered auto assignment to @mallenexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.Eskalifer1 commentedon Jul 7, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The Delegate confirm modal window does not have a disappearing animation
What is the root cause of that problem?
The problem is in the use of this hook:
App/src/pages/settings/Security/AddDelegate/ConfirmDelegatePage.tsx
Line 37 in f660f73
Before leaving the page, we change the display state of the modal window to false:
App/src/pages/settings/Security/AddDelegate/ConfirmDelegatePage.tsx
Line 45 in f660f73
But the useCustomHistoryParam hook
App/src/libs/Navigation/AppNavigator/customHistory/useCustomHistoryParam.ts
Lines 16 to 40 in f660f73
is not reactive, so navigation.dispatch will not trigger the update of the component, which is why the state will not be updated, which is why the modal window will not close
What changes do you think we should make in order to solve the problem?
We need to make this hook reactive, for this it must have a state, I propose to add a state and its recovery to the hook
This is how it will look like:
PS: Minor changes and other things can be discussed during the PR stage
I also propose to create a hook that we will use for modal windows, it will be a wrapper on top of the usual useState, but it will also have onBeforeRemove(() => setIsModalVisible(false))
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Add a local state for the page
App/src/pages/settings/Security/AddDelegate/ConfirmDelegatePage.tsx
Line 28 in f660f73
Which would be responsible for displaying the modal window, but would also leave the
useCustomHistoryParamhook for the logicReminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Delegate Confirmation Modal Lacks Exit Animation[/-][+][$250] Delegate Confirmation Modal Lacks Exit Animation[/+]melvin-bot commentedon Jul 8, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021942705427324771030
melvin-bot commentedon Jul 8, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (
External)mallenexpensify commentedon Jul 8, 2025
@fedirjh 👀 on @Eskalifer1 's proposal above plz. Please review the Slack thread too please, inc.
truph01 commentedon Jul 10, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
App/src/pages/settings/Security/AddDelegate/ConfirmDelegatePage.tsx
Line 45 in d40d0af
This attempts to set the modal's visibility to
false. However, unlike other pages where the visibility state is updated immediately (via a simpleuseStatesetter), in this case, setting the modal visibility triggers a navigation action:App/src/libs/Navigation/AppNavigator/customHistory/useCustomHistoryParam.ts
Lines 33 to 38 in d40d0af
This navigation introduces a delay before the modal’s state reflects the updated value. Specifically, the
isValidateCodeActionModalVisiblevalue here:App/src/pages/settings/Security/AddDelegate/ConfirmDelegatePage.tsx
Line 37 in d40d0af
requires time to update.
What changes do you think we should make in order to solve the problem?
We can modify the component as follows to immediately hide the modal when the
beforeRemoveevent is triggered.At:
App/src/pages/settings/Security/AddDelegate/ConfirmDelegatePage.tsx
Line 45 in d40d0af
Update to:
Then, at:
App/src/pages/settings/Security/AddDelegate/ConfirmDelegatePage.tsx
Line 99 in d40d0af
Update the modal’s visibility check:
This approach ensures the modal is hidden immediately during the
beforeRemovephase, allowing a smoother exit experience without abrupt disappearance.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
melvin-bot commentedon Jul 14, 2025
@fedirjh Eep! 4 days overdue now. Issues have feelings too...
66 remaining items
[-][HOLD https://github.com/Expensify/App/issues/69171] [$250] Delegate Confirmation Modal Lacks Exit Animation[/-][+][Due for payment 2025-09-02] [HOLD https://github.com/Expensify/App/issues/69171] [$250] Delegate Confirmation Modal Lacks Exit Animation[/+]melvin-bot commentedon Aug 26, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Aug 26, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.98-12 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-09-02. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Aug 26, 2025
@fedirjh @mallenexpensify 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]
melvin-bot commentedon Sep 2, 2025
Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.
mallenexpensify commentedon Sep 4, 2025
@fedirjh are you due compensation here? Looked at a couple PRs and wasn't sure.
fedirjh commentedon Sep 4, 2025
Hey @mallenexpensify No payment is due here. Thank you.
mallenexpensify commentedon Sep 5, 2025
I'm assuming payment isn't due for anyone and that we don't need a regression test (partially cuz the PR has two issues linked in the OP, also cuz it was on hold pending the other issue). Comment/reopen if anyone disagree!