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
{{ message }}
Repository navigation
[$250] Edit per diem rates button is not responsive when Per diem tab is opened by swiping with cursor #68983
🚨 Edited by proposal-police: This proposal was edited at 2025-09-12 14:14:10 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Edit per diem rates button is not responsive when Per diem tab is opened by swiping with cursor
What is the root cause of that problem?
The button's onPress handler was wrapped in InteractionManager.runAfterInteractions(), which caused timing issues when the tab was accessed programmatically rather than through direct user interaction.
The logic was first introduced in this PR, however it was likely to be added by following the existing pattern seen in other parts of the codebase for "safe" navigation
But InteractionManager.runAfterInteractions has a critical limitation: it only executes callbacks after "user-initiated" interactions complete. When the Per diem tab is accessed programmatically (via cursor swiping), the interaction manager doesn't recognize this as a completed user interaction, causing the callback to never execute
What changes do you think we should make in order to solve the problem?
We should remove InteractionManager.runAfterInteractions
It is safe to remove this case as there are no complex animations or modal transitions that would require interaction coordination in this page. We have many places are navigating without InteractionManager.runAfterInteractions such as in workspace settings, company cards settings,...
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
NA
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.
But this page is located in OnyxTab, which, due to its internal implementation in the browser, behaves slightly differently than on native devices, causing a significant delay when switching between tabs via swipe. This can be seen in the URL, which immediately after the transition displays the PerDiem page, but the link is still at a distance
But we need a delay when pressing the button, because, considering what I wrote above, if we switch to the PerDiem tab by swiping and immediately press the button, we will take the backTo link not to the PerDiem page, but to the Distance page. And this is regression.
What changes do you think we should make in order to solve the problem?
There are two ways to solve this problem:
The first option is more complicated, but it is accurate:
On the general page, add ref for perDiem, as well as a function for onTabSelect (this approach is used on the chat/group creation page):
constperDiemDestinationRef=useRef<IOURequestStepDestinationRef|null>(null);constonTabSelectFocusHandler=({index}: {index: number})=>{// We runAfterInteractions since the function is called in the animate block on web-based// implementation, this fixes an animation glitch and matches the native internal delayInteractionManager.runAfterInteractions(()=>{// 3 - PerDiemif(index===3){perDiemDestinationRef.current?.setIsPerDiemTabLoaded(true);}else{perDiemDestinationRef.current?.setIsPerDiemTabLoaded(false);}});};
Pass the functions to OnyxTabnavigator:
onTabSelect={onTabSelectFocusHandler}
Pass the ref itself:
ref={perDiemDestinationRef}
Add ref to the Destination page (don't forget about forwardRef):
Disable the button until we load (I gave an example with blocking, but we may want to do something else, which can be discussed during the PR, Since I am proposing a general concept for solving the problem here):
isDisabled={!isTabLoaded}
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
We can use setTimeout for browser instead of InteractionManager and on native leave as it is now. We can create a separae hook for this(If this does not exist yet)
We can try not to take the active navigation path, but always pass the backTo parameter to this page.
Remove swipe for PC 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.
changed the title [-]Edit per diem rates button is not responsive when Per diem tab is opened by swiping with cursor[/-][+][$250] Edit per diem rates button is not responsive when Per diem tab is opened by swiping with cursor[/+]on Aug 27, 2025
@Valforte
Here's context:
The original bug in OP is not reproducible
But there are another 2 bugs found while doing repro step. #68983 (comment) and #68983 (comment)
Should we close this issue and create 2 new issues separately (as they seem to have different root cause)?
Or should fix here?
Or do nothing for now?
I feel like for tracking purposes, it's best to create new issues, as this one is already fixed. I'll create the two new issues in a moment, I'll assign the first one #68983 (comment) to @Eskalifer1 as your proposal is already approved. I'll also assign both to @aimane-chnaif as C+ reviewer. Feel free to post a proposal for the second issue #68983 (comment) as well. I'll comment here when I have them created
Hi @Valforte I think there's been a bit of confusion here. As I understand it, my solution, which was chosen for this task(#68983), is no longer needed (unless we want to get rid of InteractionManager).
I don't have a solution for this bug(#68983 (comment)), i just have reported that.
I'll just try to leave a proposal for this task(#68983 (comment)).
Activity
melvin-bot commentedon Aug 22, 2025
Triggered auto assignment to @johncschuster (
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.lorretheboy commentedon Aug 22, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-09-12 14:14:10 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Edit per diem rates button is not responsive when Per diem tab is opened by swiping with cursor
What is the root cause of that problem?
The button's onPress handler was wrapped in InteractionManager.runAfterInteractions(), which caused timing issues when the tab was accessed programmatically rather than through direct user interaction.
App/src/pages/iou/request/step/IOURequestStepDestination.tsx
Line 154 in 239ac5e
The logic was first introduced in this PR, however it was likely to be added by following the existing pattern seen in other parts of the codebase for "safe" navigation
https://github.com/Expensify/App/pull/54252/files#diff-c979a87a1f20182674201b96a286a881bf6ff0ef3708aebf5ad0888979c62255R136-R140
But
InteractionManager.runAfterInteractionshas a critical limitation: it only executes callbacks after "user-initiated" interactions complete. When the Per diem tab is accessed programmatically (via cursor swiping), the interaction manager doesn't recognize this as a completed user interaction, causing the callback to never executeApp/src/libs/Navigation/navigateAfterInteraction/index.ts
Lines 1 to 3 in 98010bc
What changes do you think we should make in order to solve the problem?
We should remove
InteractionManager.runAfterInteractionsIt is safe to remove this case as there are no complex animations or modal transitions that would require interaction coordination in this page. We have many places are navigating without
InteractionManager.runAfterInteractionssuch as in workspace settings, company cards settings,...What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
NA
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.
Eskalifer1 commentedon Aug 22, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Edit per diem rates button is not responsive when Per diem tab is opened by swiping with cursor
What is the root cause of that problem?
We use InteractionManager when clicking on the button:
App/src/pages/iou/request/step/IOURequestStepDestination.tsx
Lines 154 to 156 in 1a33bbc
But this page is located in OnyxTab, which, due to its internal implementation in the browser, behaves slightly differently than on native devices, causing a significant delay when switching between tabs via swipe. This can be seen in the URL, which immediately after the transition displays the PerDiem page, but the link is still at a distance
But we need a delay when pressing the button, because, considering what I wrote above, if we switch to the PerDiem tab by swiping and immediately press the button, we will take the backTo link not to the PerDiem page, but to the Distance page. And this is regression.
What changes do you think we should make in order to solve the problem?
There are two ways to solve this problem:
The first option is more complicated, but it is accurate:
App/src/pages/iou/request/IOURequestStartPage.tsx
Line 46 in 1a33bbc
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
We can use setTimeout for browser instead of InteractionManager and on native leave as it is now. We can create a separae hook for this(If this does not exist yet)
We can try not to take the active navigation path, but always pass the backTo parameter to this page.
Remove swipe for PC
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.
melvin-bot commentedon Aug 25, 2025
@johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick!
[-]Edit per diem rates button is not responsive when Per diem tab is opened by swiping with cursor[/-][+][$250] Edit per diem rates button is not responsive when Per diem tab is opened by swiping with cursor[/+]melvin-bot commentedon Aug 27, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021960547651103314341
melvin-bot commentedon Aug 27, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (
External)95 remaining items
aimane-chnaif commentedon Nov 5, 2025
🎀 👀 🎀
Let's get engineer how to move this forward.
melvin-bot commentedon Nov 5, 2025
Triggered auto assignment to @Valforte, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
aimane-chnaif commentedon Nov 5, 2025
@Valforte
Here's context:
The original bug in OP is not reproducible
But there are another 2 bugs found while doing repro step. #68983 (comment) and #68983 (comment)
Should we close this issue and create 2 new issues separately (as they seem to have different root cause)?
Or should fix here?
Or do nothing for now?
Eskalifer1 commentedon Nov 5, 2025
Just to add 👆.
I proposed solution for one of the bug that is partially related to origin bug( since it occurs after pressing the button to this) here
IMO this is not related to this task and should be created another issue for this
I think my solution for original bug is usefull in case we want to remove
InteractionManagerso we can use it in the futuremvtglobally commentedon Nov 8, 2025
Issue not reproducible during KI retests. (First week)
Valforte commentedon Nov 10, 2025
I feel like for tracking purposes, it's best to create new issues, as this one is already fixed. I'll create the two new issues in a moment, I'll assign the first one #68983 (comment) to @Eskalifer1 as your proposal is already approved. I'll also assign both to @aimane-chnaif as C+ reviewer. Feel free to post a proposal for the second issue #68983 (comment) as well. I'll comment here when I have them created
Eskalifer1 commentedon Nov 10, 2025
Hi @Valforte I think there's been a bit of confusion here. As I understand it, my solution, which was chosen for this task(#68983), is no longer needed (unless we want to get rid of InteractionManager).
I don't have a solution for this bug(#68983 (comment)), i just have reported that.
I'll just try to leave a proposal for this task(#68983 (comment)).
aimane-chnaif commentedon Nov 10, 2025
None of issues have approved proposal yet.
Valforte commentedon Nov 10, 2025
Ok sorry about that, I'm creating both issues now and will open them for proposals
quinthar commentedon Nov 19, 2025
Approved $125 for @getusha