Skip to content

[Due for payment 2026-05-22] [Due for payment 2026-05-20] Web - Search - After closing "Search" RHP. chats are briefly visible on top of screen again. #90510

Closed

Description

@jponikarchuk

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.3.73-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #90358
Email or phone of affected tester (no customers): ibellicotest+2250@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Windows 11 / Chrome
App Component: Search

Action Performed:

  1. Open the staging.new.expensify.com website,
  2. Navigate to "Inbox"
  3. Click on the search icon on the top right corner.
  4. Close "Search" RHP by clicking outside of it or pressing "ESC" on keyboard.
  5. Note that after RHP is closed, chats reappear briefly on top of screen where RHP was displayed.

Expected Result:

RHP modal should be dismissed correctly without any flickering after clicking outside of it or pressing "ESC" on keyboard.

Actual Result:

After closing "Search" RHP by clicking outside of it ot pressing "ESC" on keyboard, chats from list are briefly visible again on top of the screen where RHP was displayed.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @abzokhattab

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 13, 2026
  2. melvin-bot commented on May 13, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #90358

  3. melvin-bot commented on May 13, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on May 13, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. OSBotify commented on May 13, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #90358 - "Refactor ReanimatedModal/index.tsx to follow Rules of React and compile with React Compiler" by @roryabraham (High confidence)
    Related Issues: #68765 (partial fix referenced in PR)

    Recommendation: REVERT

    The PR introduced a regression in the modal close animation by removing the isVisibleState state variable, which now causes the container children to be unmounted immediately when isVisible becomes false, while the modal shell remains visible during the exit animation — producing visible flickering on web.

    Assigned: @roryabraham (PR author), @abzokhattab (approving reviewer), @carlosmiceli (approving reviewer)
    Labels: DeployBlockerCash kept (frontend App PR caused this issue). No label changes made.

    Detailed Analysis

    Evidence

    Verification

    Root Cause

    The refactor eliminated isVisibleState (a one-render-lagged mirror of the isVisible prop) and replaced it with direct use of the isVisible prop throughout the render output.

    In the old code, the container children were rendered conditionally on isVisibleState (not isVisible). When the modal was dismissed, isVisible became false first, then isVisibleState followed one render later after the exit animation had already been set in motion. This kept the children mounted during the exit animation.

    In the new code, {isVisible && containerView} causes the container children to be unmounted immediately when isVisible flips to false. However, modalVisibility = isVisible || isTransitioning evaluates to true at the same moment (because isContainerOpen is still true, making isTransitioning = true). This means the React Native <Modal> wrapper remains visible={true} while the container content is already unmounted — leaving an empty, transparent modal shell briefly over the screen. The underlying LHN/chat list renders through this transparent shell, causing the flicker reported in the issue.

    The fix direction is either:

    1. Revert the PR to restore the previous behavior.
    2. Roll forward with a targeted fix: change {isVisible && containerView} to {(isVisible || isTransitioning) && containerView} so the container stays mounted during the exit animation, matching the intent of the old isVisibleState logic.

    Revert is recommended as the safest option given deploy blocker severity.

  6. MelvinBot commented on May 13, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    PR #90358 refactored ReanimatedModal to derive isTransitioning from state instead of tracking it explicitly, and replaced the internal isVisibleState with the raw isVisible prop. This created a mismatch between what keeps the Modal wrapper visible (isVisible || isTransitioning) and what keeps the Container content mounted (just isVisible).

    When the RHP closes, isVisible flips to false immediately. The Container unmounts instantly at index.tsx:237, but the Modal wrapper stays visible for the transition period at index.tsx:201-207. This creates a ~200ms window where the transparent Modal is still mounted but empty — the underlying chat list shows through where the RHP content used to be.

    Before the refactor, the old isVisibleState was an internal state variable that stayed true during the exit animation, keeping the Container mounted while it animated out. The new code removed that buffering.

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

    Change the Container render guard from {isVisible && containerView} to {modalVisibility && containerView} (on both occurrences at lines 228 and 237) in src/components/Modal/ReanimatedModal/index.tsx. This keeps the Container in the tree during the exit transition so Reanimated's exiting Keyframe animation can play, matching the pre-refactor behavior.

    What alternative solutions did you explore? (Optional)

    Using modalVisibility is the minimal fix — it aligns the Container's lifecycle with the Modal's lifecycle, which is the correct semantic (the Container should be mounted whenever the Modal is visible).


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. 3 remaining items

  8. changed the title [-]Web - Search - After closing "Search" RHP. chats are briefly visible on top of screen again.[/-] [+][Due for payment 2026-05-20] Web - Search - After closing "Search" RHP. chats are briefly visible on top of screen again.[/+] on May 13, 2026
  9. melvin-bot commented on May 13, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  10. melvin-bot commented on May 13, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.73-4 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 2026-05-20. 🎊

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

    • @abzokhattab requires payment through NewDot Manual Requests
  11. melvin-bot commented on May 13, 2026

    @melvin-bot

    @abzokhattab 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. changed the title [-][Due for payment 2026-05-20] Web - Search - After closing "Search" RHP. chats are briefly visible on top of screen again.[/-] [+][Due for payment 2026-05-22] [Due for payment 2026-05-20] Web - Search - After closing "Search" RHP. chats are briefly visible on top of screen again.[/+] on May 15, 2026
  13. melvin-bot commented on May 15, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.74-7 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 2026-05-22. 🎊

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

    • @abzokhattab requires payment through NewDot Manual Requests
  14. melvin-bot commented on May 15, 2026

    @melvin-bot

    @abzokhattab 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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions