Skip to content

[Due for payment 2025-12-26] [$250] Wrong swipe behavior in RHN #74735

Closed

Description

@Valforte

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: 9.2.48-0
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 at #68983 (comment)
Slack conversation (hyperlinked to channel name):

Action Performed:

  1. Open the page where the tabs are present (for example, create expense)
  2. Use a swipe to go to the tab from which you can go to the next page (for example, from scan to manual).
  3. When you switch, click on the link to go to another page (for example, currency selection).

Expected Result:

The page we clicked on will open and remain open.

Actual Result:

After a short period of time, we are taken to the tab we were swiping to.

Screenshots/Videos

Add any screenshot/video evidence
2025-10-28.19.00.00.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021987966998916927793
  • Upwork Job ID: 1987966998916927793
  • Last Price Increase: 2025-11-24
  • Automatic offers:
    • aimane-chnaif | Reviewer | 109629493
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @johncschuster

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    ExternalAdded to denote the issue can be worked on by a contributor
    on Nov 10, 2025
  2. melvin-bot commented on Nov 10, 2025

    @melvin-bot

    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.

  3. changed the title [-]Wrong swipe behavior in RHN[/-] [+][$250] Wrong swipe behavior in RHN[/+] on Nov 10, 2025
  4. melvin-bot commented on Nov 10, 2025

    @melvin-bot
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 10, 2025
  6. melvin-bot commented on Nov 10, 2025

    @melvin-bot

    Current assignee @aimane-chnaif is eligible for the External assigner, not assigning anyone new.

  7. mdneyazahmad commented on Nov 13, 2025

    @mdneyazahmad
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-11-16 06:51:21 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Interaction with RHN screen is broken, when there is ongoing screen navigation animation.

    What is the root cause of that problem?

    When we swipe the screen, there is a gesture animation, and this does not complete instantly when we release the gesture. It takes some time to finish it. When we interact quickly with a button, which triggers a navigation animation, it seems broken, as the previous animation is not completed and we are starting a new one.

    What changes do you think we should make in order to solve the problem?

    When screen transition happens, it's focused state for the screen changes, so we need to track it's focused state.

    We are already using useFocusEffect, so create one ref variable to store its state, and cancel the interaction with the screen until the animation completes.

    useFocusEffect(
    useCallback(() => {
    focusTimeoutRef.current = setTimeout(() => textInput.current?.focus(), CONST.ANIMATED_TRANSITION);
    return () => {
    if (!focusTimeoutRef.current) {
    return;
    }
    clearTimeout(focusTimeoutRef.current);
    };
    }, []),
    );

         const isScreenReadyForInteraction = useRef(false);
    
         useFocusEffect(
            useCallback(() => {
                isScreenReadyForInteraction.current = true;
                focusTimeoutRef.current = setTimeout(() => textInput.current?.focus(), CONST.ANIMATED_TRANSITION);
                return () => {
                    isScreenReadyForInteraction.current = false;
                    if (!focusTimeoutRef.current) {
                        return;
                    }
                    clearTimeout(focusTimeoutRef.current);
                };
            }, []),
        );
    
        const navigateToCurrencySelectionPage = () => {
            if (!isScreenReadyForInteraction.current) {
                return;
            }
            Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CURRENCY.getRoute(action, iouType, transactionID, reportID, pageIndex, currency, Navigation.getActiveRoute()));
        };

    Updated method

        const navigation = useNavigation();
    
        const navigateToCurrencySelectionPage = () => {
            if (!navigation.isFocused()) {
                return;
            }
            Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CURRENCY.getRoute(action, iouType, transactionID, reportID, pageIndex, currency, Navigation.getActiveRoute()));
        };

    What alternative solutions did you explore? (Optional)

    We can also fix this issue by making setting pointerEvents: none to the screen. This will prevent tab screen from interaction until the screen transition completes.

    We are already using TabScreenWithFocusTrapWrapper as a wrapper to each OnyxTabNavigator screen except one (ShareRootPage), so we can add pointerEvents here, or we can create a completely new component for that.

    <FocusTrapContainerElement
    onContainerElementChanged={handleContainerElementChanged}
    style={[styles.w100, styles.h100]}
    >
    {children}

            const isFocused = useIsFocused();
    
    
            <FocusTrapContainerElement
                onContainerElementChanged={handleContainerElementChanged}
                style={[styles.w100, styles.h100, !isFocused && {pointerEvents: 'none'}]}
            >
                {children}
            </FocusTrapContainerElement>
  8. Valforte commented on Nov 13, 2025

    @Valforte
    ContributorAuthor

    @aimane-chnaif can you review the current proposals?

  9. 41 remaining items

  10. melvin-bot commented on Dec 19, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.84-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 2025-12-26. 🎊

    For reference, here are some details about the assignees on this issue:

  11. melvin-bot commented on Dec 19, 2025

    @melvin-bot

    @aimane-chnaif @johncschuster 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]

  12. mdneyazahmad commented on Dec 31, 2025

    @mdneyazahmad
    Contributor

    Should we continue with payment?

  13. melvin-bot commented on Jan 2, 2026

    @melvin-bot

    @johncschuster Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  14. johncschuster commented on Jan 5, 2026

    @johncschuster
    Contributor

    Payment Summary

    Contributor: @mdneyazahmad paid $250 via Upwork ✅
    Contributor+: @aimane-chnaif paid $250 via Upwork ✅

  15. johncschuster commented on Jan 5, 2026

    @johncschuster
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    Test:

    Do we agree 👍 or 👎

  16. johncschuster commented on Jan 5, 2026

    @johncschuster
    Contributor

    @aimane-chnaif, can you help me out with the checklist above?

  17. aimane-chnaif commented on Jan 5, 2026

    @aimane-chnaif
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: The root cause seems to be in upstream

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue: https://github.com/Expensify/Expensify/issues/584787

    Regression Test Proposal

    Test:

    Screens

    • FAB menu -> Create expense
    • FAB menu -> Track distance
    • FAB menu -> Start chat
    • Select a report -> Split expense
    • Workspaces -> Select a workspace -> Receipt partners -> Manage invites
    • Goto gallery -> Pick an image -> Share -> Expensify (iOS/Android)

    For the above screens, perform the following steps

    1. Switch between tabs
    2. Verify that there is no swipe gesture support for screen transition.
    3. Verify that it works as normal with click / tap.

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-ca6d-af5c-6ab2-566322f5d594
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions