App icon indicating copy to clipboard operation
App copied to clipboard

[Due for payment 2026-12-02] [$175] Workspace - Help icon briefly flashes while closing the Concierge right-hand panel

Open izarutskaya opened this issue 1 month ago • 30 comments

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.5.23-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @lorretheboy Slack conversation (hyperlinked to channel name): #expensify_open_source

Action Performed:

  1. Open a workspace and navigate to MCP
  2. Open the Concierge right-hand panel
  3. Close the Concierge panel
  4. Observe the help icon during the closing transition

Expected Result:

The help icon briefly appears to the left of the Concierge panel, then disappears

Actual Result:

The help icon should remain hidden throughout the closing transition

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
  • [x] Windows: Chrome
  • [ ] MacOS: Chrome / Safari

Screenshots/Videos

https://github.com/user-attachments/assets/5bdb5fd3-6d5e-4271-9275-2252bd5fa141

Image

View all open jobs on GitHub

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @sobitneupane

izarutskaya avatar Oct 27 '26 16:10 izarutskaya

Proposal

What is the root cause of that problem?

The help button hides based on the side panel's open/closed value in Onyx, not on whether the close animation has finished.

  • In useSidePanelDisplayStatus.tsx:38, shouldHideHelpButton is !shouldHideSidePanel || .... shouldHideSidePanel comes straight from NVP_SIDE_PANEL.open (line 21).
  • On close, closeSidePanel sets the value to closed right away, so the button renders again at once.
  • The panel then slides out for 300 ms (lines 114-140). The header's right padding shrinks over the same 300 ms, so the button shows beside the panel that is still sliding out.

The panel itself and the tooltip already wait for isSidePanelTransitionEnded. The help button is the only one that doesn't. This affects every header with the help button, not only the workspace MCP page.

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

In SidePanelContextProvider, keep the help button hidden until the close animation finishes:

  1. Track an isSidePanelClosing state. Set it to true in the existing render-time check at lines 102-107 when shouldHideSidePanel changes from false to true.
  2. Set it back to false in the animation's start callback (line 130).
  3. Expose shouldHideHelpButton || isSidePanelClosing as shouldHideHelpButton in the context value (line 168).

This one change fixes every caller on web and native.

What alternative solutions did you explore? (Optional)

You could use shouldHideHelpButton || !isSidePanelTransitionEnded. It's simpler, but the animation effect also runs on first mount and when the window crosses the extra-large breakpoint. The button would then disappear for 300 ms after app load and on resize.

Notes
  • The issue's "Expected Result" and "Actual Result" are swapped. The bug is that the icon flashes; the icon should stay hidden.
  • A web reproduction run couldn't capture a frame during the 300 ms close animation, so the result was inconclusive. After the panel finished closing, the help icon was back in place, as expected. The root cause above comes from reading the code.

Next Steps for Contributor+ team: To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/105159) to create a draft PR. To refine: @MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.

MelvinBot avatar Oct 27 '26 17:10 MelvinBot

Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)

melvin-bot[bot] avatar Oct 27 '26 17:10 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~022115127614553140369

melvin-bot[bot] avatar Oct 27 '26 17:10 melvin-bot[bot]

Proposal

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

When closing the Concierge right-hand side panel on Workspace pages, the Help (?) icon in the page header briefly flashes and becomes visible to the left of the side panel while the 300ms closing slide-out animation is still running.

What is the root cause of that problem?

In src/components/SidePanel/SidePanelContextProvider.tsx and src/hooks/useSidePanelDisplayStatus.tsx:

  1. When closing the Concierge panel, closeSidePanel immediately calls SidePanelActions.dismissSidePanel(), which sets NVP_SIDE_PANEL.open to false in Onyx right away.
  2. In useSidePanelDisplayStatus.tsx (lines 32–38), shouldHideSidePanel immediately evaluates to true, causing shouldHideHelpButton to flip to false instantly:
    const shouldHideHelpButton = !shouldHideSidePanel || !isOnboardingCompleted || isAnonymousUser || isIn2FASetupFlow;
    
  3. However, the side panel slide-out animation takes 300ms (sidePanelOffset and sidePanelTranslateX animating to 0). Because shouldHideHelpButton does not wait for isSidePanelTransitionEnded, the Help icon renders immediately in HeaderWithBackButton while the panel is still actively animating across the screen.
  4. By contrast, the side panel DOM unmount (SidePanel/index.tsx:29) and tooltip visibility (shouldHideToolTip on line 73) already gate on isSidePanelTransitionEnded.

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

In src/components/SidePanel/SidePanelContextProvider.tsx: In the context value memoization, keep shouldHideHelpButton true while the side panel transition is active:

// src/components/SidePanel/SidePanelContextProvider.tsx
const value = useMemo(
    () => ({
        isSidePanelTransitionEnded,
        isSidePanelHiddenOrLargeScreen,
        shouldHideSidePanel,
        shouldHideSidePanelBackdrop,
        shouldHideHelpButton: shouldHideHelpButton || !isSidePanelTransitionEnded,
        shouldHideToolTip,
        sidePanelOffset,
        sidePanelTranslateX,
        openSidePanel: () => SidePanelActions.openSidePanel(!isExtraLargeScreenWidth),
        closeSidePanel,
        reportID: sidePanelNVP?.reportID,
    }),
    [
        isSidePanelTransitionEnded,
        isSidePanelHiddenOrLargeScreen,
        shouldHideSidePanel,
        shouldHideSidePanelBackdrop,
        shouldHideHelpButton,
        shouldHideToolTip,
        sidePanelOffset,
        sidePanelTranslateX,
        closeSidePanel,
        sidePanelNVP?.reportID,
        isExtraLargeScreenWidth,
    ],
);

Ensure isSidePanelTransitionEnded initializes to true when the panel is initially closed so the Help icon renders immediately on initial page mount without unnecessary animation delays.

Why this solution is optimal (KISS & Minimal Blast Radius): This touches only a single line in SidePanelContextProvider.tsx, perfectly matching how tooltips and side panel unmounting already synchronize with the animation lifecycle.

What alternative solutions did you explore? (Optional)

  • Delaying SidePanelActions.dismissSidePanel() until after animation finishes: Rejected because delaying Onyx updates creates race conditions if the user rapidly re-opens the panel or navigates away.

What automated tests can you add to prevent this from re-occurring?

Add unit tests in tests/unit/SidePanelContextProviderTest.tsx:

it('should keep shouldHideHelpButton true while isSidePanelTransitionEnded is false during close transition', () => {
    const {result} = renderHook(() => useSidePanel(), {wrapper: SidePanelContextProvider});
    expect(result.current.shouldHideHelpButton).toBe(true);
});

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01b60d704ba377be83

camesenin avatar Oct 27 '26 17:10 camesenin

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 27 '26 17:10 melvin-bot[bot]

Proposal

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

When closing the Concierge right-hand side panel on Workspace pages, the Help (?) icon in the page header briefly flashes into view next to the side panel while the 300ms closing slide-out animation is still running.


What is the root cause of that problem?

  1. In src/components/SidePanel/SidePanelContextProvider.tsx (lines 142–154), when the user closes the Concierge panel, closeSidePanel immediately calls SidePanelActions.dismissSidePanel(), which sets NVP_SIDE_PANEL.open to false in Onyx right away.
  2. In src/hooks/useSidePanelDisplayStatus.tsx (lines 32–38), shouldHideSidePanel immediately evaluates to true, which immediately flips shouldHideHelpButton to false:
    const shouldHideHelpButton = !shouldHideSidePanel || !isOnboardingCompleted || isAnonymousUser || isIn2FASetupFlow;
    
  3. However, the side panel slide-out animation takes 300ms (CONST.SIDE_PANEL_ANIMATED_TRANSITION) as sidePanelTranslateX animates offscreen.
  4. Because shouldHideHelpButton in useSidePanelDisplayStatus only checks Onyx state and does not account for the closing animation lifecycle, the Help icon renders immediately in HeaderWithBackButton while the panel is still sliding across the viewport.
  5. In SidePanelContextProvider.tsx, tooltip visibility (shouldHideToolTip, line 73) and the side panel unmount gate (SidePanel/index.tsx, line 29) already wait for isSidePanelTransitionEnded. shouldHideHelpButton is currently exposed as raw shouldHideHelpButton without coordinating with isSidePanelTransitionEnded.

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

In src/components/SidePanel/SidePanelContextProvider.tsx: Gate shouldHideHelpButton in the exposed context state value so that while the side panel is transitioning closed (!isSidePanelTransitionEnded), the button remains hidden:

// src/components/SidePanel/SidePanelContextProvider.tsx:168
const stateValue = {
    isSidePanelTransitionEnded,
    isSidePanelHiddenOrLargeScreen,
    shouldHideSidePanel,
    shouldHideSidePanelBackdrop,
    shouldHideHelpButton: shouldHideHelpButton || !isSidePanelTransitionEnded,
    shouldHideToolTip,
    sidePanelOffset,
    sidePanelTranslateX,
    sidePanelNVP,
    sessionStartTime,
};

Because isSidePanelTransitionEnded initializes to true (line 71), the Help button is visible immediately on initial page mount without unnecessary animation delays.


What alternative solutions did you explore? (Optional)

  • Delaying SidePanelActions.dismissSidePanel() until the animation finishes: Rejected because deferring Onyx state updates introduces race conditions if the user triggers another action or navigates before the 300ms timer elapses.
  • Tracking an extra isSidePanelClosing state: Redundant because isSidePanelTransitionEnded is already maintained precisely for the duration of the slide animation in Animated.parallel.start().

What automated tests can you add to prevent this from re-occurring?

Add a unit test in tests/unit/SidePanelContextProviderTest.tsx:

it('keeps shouldHideHelpButton true while isSidePanelTransitionEnded is false during close transition', () => {
    const {result} = renderHook(() => useSidePanelState(), {wrapper: SidePanelContextProvider});
    expect(result.current.shouldHideHelpButton).toBe(true);
});

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01f7d7991785f2ee01

apoorv-xs avatar Oct 27 '26 18:10 apoorv-xs

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 27 '26 18:10 melvin-bot[bot]

Proposal

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

On narrow screens (or mobile web), when opening the Concierge side panel via the ? (Help) icon on the Workspaces page and then closing the Concierge right-hand panel (X), the ? Help icon in the underlying header briefly flashes at the start of the close animation instead of staying hidden until the panel finishes closing.

What is the root cause of that problem?

  1. When the user closes the Concierge side panel, closeSidePanel in src/components/SidePanel/SidePanelContextProvider.tsx (lines 140–152) calls setIsSidePanelTransitionEnded(false) and immediately invokes SidePanelActions.dismissSidePanel(...), which updates sidePanelNVP in Onyx so shouldHideSidePanel becomes true at the very start of the 300ms close transition (CONST.SIDE_PANEL_ANIMATED_TRANSITION).
  2. In src/hooks/useSidePanelDisplayStatus.tsx (lines 28–39):
    const shouldHideSidePanel = isSidePanelHiddenOrLargeScreen || !isSidePanelReportSupported || !reportID;
    const shouldHideHelpButton = !shouldHideSidePanel || isAnonymousUser || !conciergeReportID || isReportingSubPage;
    
    Because shouldHideHelpButton only checks !shouldHideSidePanel and does not check whether the Side Panel is still animating closed (!isSidePanelTransitionEnded from SidePanelStateContext), shouldHideHelpButton immediately flips to false as soon as dismissSidePanel is called—while the Side Panel is still visible and sliding out over 300ms.
  3. Critical side effect on initial mount missed if we only add !isSidePanelTransitionEnded to useSidePanelDisplayStatus.tsx: Look at src/components/SidePanel/SidePanelContextProvider.tsx (lines 100 and 113–138):
    const [isSidePanelTransitionEnded, setIsSidePanelTransitionEnded] = useState(true);
    ...
    useEffect(() => {
        setIsSidePanelTransitionEnded(false);
        Animated.parallel([
            Animated.timing(sidePanelOffset.current, {
                toValue: shouldApplySidePanelOffset ? styles.sidePanel.width : 0,
                duration: CONST.SIDE_PANEL_ANIMATED_TRANSITION,
                useNativeDriver: false,
            }),
            Animated.timing(sidePanelTranslateX.current, {
                toValue: shouldHideSidePanel ? sidePanelWidth : 0,
                duration: CONST.SIDE_PANEL_ANIMATED_TRANSITION,
                useNativeDriver: true,
            }),
        ]).start(() => setIsSidePanelTransitionEnded(true));
    }, [shouldHideSidePanel, shouldApplySidePanelOffset, sidePanelWidth, styles.sidePanel.width]);
    
    This useEffect runs on initial mount (and whenever sidePanelWidth / shouldApplySidePanelOffset changes on window resize), even when the Side Panel is already closed (shouldHideSidePanel === true)! On initial mount when the Side Panel is closed, it immediately calls setIsSidePanelTransitionEnded(false) and runs a 300ms no-op animation before setting isSidePanelTransitionEnded back to true. Therefore, if we only add || !isSidePanelTransitionEnded to shouldHideHelpButton in useSidePanelDisplayStatus.tsx, the Help button on every screen in the app will be hidden for the first 300ms on initial mount and on window resizes when the Side Panel is closed!

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

  1. src/components/SidePanel/SidePanelContextProvider.tsx: Track the previous values of shouldHideSidePanel and shouldApplySidePanelOffset (using usePrevious), and only run the 300ms transition (and setIsSidePanelTransitionEnded(false)) when shouldHideSidePanel or shouldApplySidePanelOffset actually transitions, setting the animated values directly without starting a transition when the Side Panel is already hidden:

    const prevShouldHideSidePanel = usePrevious(shouldHideSidePanel);
    const prevShouldApplySidePanelOffset = usePrevious(shouldApplySidePanelOffset);
    
    useEffect(() => {
        const hasVisibilityChanged = prevShouldHideSidePanel !== shouldHideSidePanel || prevShouldApplySidePanelOffset !== shouldApplySidePanelOffset;
        if (!hasVisibilityChanged && shouldHideSidePanel) {
            sidePanelOffset.current.setValue(shouldApplySidePanelOffset ? styles.sidePanel.width : 0);
            sidePanelTranslateX.current.setValue(sidePanelWidth);
            setIsSidePanelTransitionEnded(true);
            return;
        }
    
        setIsSidePanelTransitionEnded(false);
        Animated.parallel([
            Animated.timing(sidePanelOffset.current, {
                toValue: shouldApplySidePanelOffset ? styles.sidePanel.width : 0,
                duration: CONST.SIDE_PANEL_ANIMATED_TRANSITION,
                useNativeDriver: false,
            }),
            Animated.timing(sidePanelTranslateX.current, {
                toValue: shouldHideSidePanel ? sidePanelWidth : 0,
                duration: CONST.SIDE_PANEL_ANIMATED_TRANSITION,
                useNativeDriver: true,
            }),
        ]).start(() => setIsSidePanelTransitionEnded(true));
    }, [
        prevShouldApplySidePanelOffset,
        prevShouldHideSidePanel,
        shouldHideSidePanel,
        shouldApplySidePanelOffset,
        sidePanelWidth,
        styles.sidePanel.width,
    ]);
    
  2. src/hooks/useSidePanelDisplayStatus.tsx: Read isSidePanelTransitionEnded from useSidePanelState() (or useContext(SidePanelStateContext)) and keep shouldHideHelpButton true while the Side Panel transition is in progress (!isSidePanelTransitionEnded):

    const {isSidePanelTransitionEnded} = useSidePanelState();
    ...
    const shouldHideHelpButton = !shouldHideSidePanel || !isSidePanelTransitionEnded || isAnonymousUser || !conciergeReportID || isReportingSubPage;
    

    (Note: in HeaderWithBackButton / TopBar, when shouldShowHelpButton is true, <SidePanelButton> is mounted inside the header, whereas on Workspaces / Settings narrow headers, when shouldHideHelpButton is true, the header omits <SidePanelButton> while the open/closing <SidePanel> overlays the screen. Keeping shouldHideHelpButton true until isSidePanelTransitionEnded becomes true prevents the underlying header's Help button from flashing during the close animation without hiding it on initial mount.)

What alternative solutions did you explore? (Optional)

  • Delaying SidePanelActions.dismissSidePanel() inside closeSidePanel until Animated.parallel(...).start() finishes was considered, but closeSidePanel relies on changing shouldHideSidePanel from false to true to trigger the useEffect that drives sidePanelTranslateX to sidePanelWidth.
  • Only adding !isSidePanelTransitionEnded in useSidePanelDisplayStatus.tsx without fixing the initial-mount useEffect in SidePanelContextProvider.tsx was rejected because useEffect unconditionally sets isSidePanelTransitionEnded to false for 300ms on mount even when the Side Panel is closed.

huhuli083-creator avatar Oct 27 '26 19:10 huhuli083-creator

@sobitneupane! I’ve reproduced this issue and verified a clean, working fix locally. we wanted to highlight a key limitation in MelvinBot's proposal (and existing proposals) so you have full context during review.

Why MelvinBot's (and other proposals') approach is not ideal:

  1. Redundant state & render-phase state updates in MelvinBot: MelvinBot introduces an extra isSidePanelClosing state and calls setState directly during the render phase (prevShouldHideSidePanel !== shouldHideSidePanel), which triggers unnecessary re-renders when the provider already tracks transition state.
  2. Hidden initial-mount regression in other proposals: Other proposals tried to simply check !isSidePanelTransitionEnded, but missed that SidePanelContextProvider's animation effect runs unconditionally on initial mount. As a result, their approach causes a noticeable 300ms regression where the Help button disappears across the app on initial page load / refresh.

Our Solution:

Instead of adding new state or introducing mount regressions, we resolved this in ~5 lines within SidePanelContextProvider.tsx by reusing the existing transition state and properly guarding the initial mount. This completely stops the flash on close while ensuring the Help icon renders immediately on page load with zero extra re-renders.

Demos:

  • Repro Video:

https://github.com/user-attachments/assets/fdd8bcd8-7839-4a53-8e1e-78dcf367ebf4

  • Fix Demo Video:

https://github.com/user-attachments/assets/2dc1b084-0c64-4035-a557-b11d365a1b01

Would you like us to submit our complete proposal with these details?

emkhalid avatar Oct 28 '26 08:10 emkhalid

Proposal

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

When closing the Concierge side panel on Workspace pages (or any page with a Help button in the header), the Help (?) icon briefly flashes into view next to the side panel while it is still animating / sliding off-screen, instead of remaining hidden until the close transition has completely finished.

What is the root cause of that problem?

  1. In useSidePanelDisplayStatus.tsx:38, shouldHideHelpButton is derived synchronously from !shouldHideSidePanel:
    const shouldHideHelpButton = !shouldHideSidePanel || !isOnboardingCompleted || isAnonymousUser || isIn2FASetupFlow;
    
  2. When the user closes the Concierge side panel, closeSidePanel calls SidePanelActions.dismissSidePanel(), which immediately updates Onyx key NVP_SIDE_PANEL (open: false).
  3. This causes shouldHideSidePanel to become true on the very first render, which immediately flips shouldHideHelpButton to false.
  4. As a result, SidePanelButtonBase mounts the Help button into the header immediately, while the <SidePanel>'s 300ms slide-out animation (Animated.parallel) is still in progress. During this 300ms transition, the Help button is visible and flashes awkwardly beside the closing panel.
  5. Furthermore, in SidePanelContextProvider.tsx:114-140, the transition useEffect runs unconditionally on initial mount. If the side panel is closed on initial load (shouldHideSidePanel === true), it starts a redundant 300ms animation and sets setIsSidePanelTransitionEnded(false). This is why previous attempts to merely check !isSidePanelTransitionEnded caused a 300ms regression where the Help button would disappear across the app on initial page load / refresh.

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

In src/components/SidePanel/SidePanelContextProvider.tsx:

  1. Add an isFirstRender ref to skip the redundant animation on initial mount when the Side Panel is already closed.
  2. In stateValue, expose shouldHideHelpButton: shouldHideHelpButton || !isSidePanelTransitionEnded.
--- a/src/components/SidePanel/SidePanelContextProvider.tsx
+++ b/src/components/SidePanel/SidePanelContextProvider.tsx
@@ -78,6 +78,7 @@ function SidePanelContextProvider({children}: PropsWithChildren) {
     const sidePanelWidthRef = useRef(sidePanelWidth);
+    const isFirstRender = useRef(true);
 
     const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
@@ -114,6 +115,13 @@ function SidePanelContextProvider({children}: PropsWithChildren) {
     // sidePanelWidth dependency in useEffect below caused the help panel content to slide in on window resize
     useEffect(() => {
+        if (isFirstRender.current) {
+            isFirstRender.current = false;
+            if (shouldHideSidePanel) {
+                return;
+            }
+        }
+
         // We need to set transition state to false when animation starts, then back to true when it completes.
         // This is intentional state management for coordinating with the animation lifecycle.
         // eslint-disable-next-line react-hooks/set-state-in-effect
@@ -165,7 +173,7 @@ function SidePanelContextProvider({children}: PropsWithChildren) {
         isSidePanelHiddenOrLargeScreen,
         shouldHideSidePanel,
         shouldHideSidePanelBackdrop,
-        shouldHideHelpButton,
+        shouldHideHelpButton: shouldHideHelpButton || !isSidePanelTransitionEnded,
         shouldHideToolTip,
         sidePanelOffset,
         sidePanelTranslateX,

Why this is the cleanest solution:

  • Zero flash on close: When closing the panel, isSidePanelTransitionEnded is false during the 300ms slide-out animation, ensuring the Help button stays hidden until the panel has completely cleared the screen.
  • Zero mount / refresh regression: Because isFirstRender skips the animation when shouldHideSidePanel is already true, isSidePanelTransitionEnded stays true from initial mount, so the Help button appears immediately on page load without any delay.
  • Zero redundant state: Reuses the provider's existing isSidePanelTransitionEnded animation state instead of adding new states or calling setState during render.

What alternative solutions did you explore? (Optional)

  • MelvinBot's proposal: Adding an isSidePanelClosing state and updating it during render (prevShouldHideSidePanel !== shouldHideSidePanel). Rejected because updating state during the render phase causes extra re-render cycles and duplicates state when isSidePanelTransitionEnded already exists to track transition lifecycle.
  • Only checking !isSidePanelTransitionEnded without isFirstRender: Rejected because SidePanelContextProvider's animation effect runs on initial mount and sets isSidePanelTransitionEnded(false) for 300ms, which causes the Help button to erroneously disappear for 300ms on initial page load / refresh.

Contributor details

Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0105126232377c4c5c

ayolyn avatar Oct 28 '26 08:10 ayolyn

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 28 '26 08:10 melvin-bot[bot]

Proposal

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

When closing the Concierge right-hand side panel on Workspace pages, the ? (Help) icon in the header briefly flashes into view while the 300ms slide-out animation is still running, instead of remaining hidden until the panel finishes closing.

What is the root cause of that problem?

  1. When closing the Concierge panel, closeSidePanel in src/components/SidePanel/SidePanelContextProvider.tsx (lines 142-154) immediately calls SidePanelActions.dismissSidePanel(), which updates NVP_SIDE_PANEL (open: false) in Onyx at the start of the 300ms animation.
  2. In src/hooks/useSidePanelDisplayStatus.tsx (line 38), shouldHideHelpButton is computed synchronously from !shouldHideSidePanel:
    const shouldHideHelpButton = !shouldHideSidePanel || !isOnboardingCompleted || isAnonymousUser || isIn2FASetupFlow;
    
    Because shouldHideSidePanel flips to true immediately, shouldHideHelpButton flips to false on the very first frame of the 300ms close transition while the panel is still sliding off-screen.
  3. In src/components/SidePanel/SidePanelContextProvider.tsx (lines 114-140), isSidePanelTransitionEnded already tracks the 300ms animation lifecycle (and is used by shouldHideToolTip on line 73 and SidePanel/index.tsx on line 29). However, the animation useEffect in SidePanelContextProvider.tsx also runs unconditionally on initial mount even when shouldHideSidePanel is already true, temporarily setting isSidePanelTransitionEnded to false for 300ms on initial load.

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

In src/components/SidePanel/SidePanelContextProvider.tsx:

  1. Skip starting a redundant 300ms animation on initial mount when the side panel is already hidden (shouldHideSidePanel === true) using an isFirstRender ref so isSidePanelTransitionEnded stays true on initial page load.
  2. Expose shouldHideHelpButton: shouldHideHelpButton || !isSidePanelTransitionEnded in stateValue (line 168) so the Help icon stays hidden until the 300ms close animation finishes:
--- a/src/components/SidePanel/SidePanelContextProvider.tsx
+++ b/src/components/SidePanel/SidePanelContextProvider.tsx
@@ -78,6 +78,7 @@ function SidePanelContextProvider({children}: PropsWithChildren) {
     const sidePanelWidthRef = useRef(sidePanelWidth);
+    const isFirstRender = useRef(true);
 
     const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
@@ -114,6 +115,13 @@ function SidePanelContextProvider({children}: PropsWithChildren) {
     // sidePanelWidth dependency in useEffect below caused the help panel content to slide in on window resize
     useEffect(() => {
+        if (isFirstRender.current) {
+            isFirstRender.current = false;
+            if (shouldHideSidePanel) {
+                return;
+            }
+        }
+
         // We need to set transition state to false when animation starts, then back to true when it completes.
         // This is intentional state management for coordinating with the animation lifecycle.
         // eslint-disable-next-line react-hooks/set-state-in-effect
@@ -165,7 +173,7 @@ function SidePanelContextProvider({children}: PropsWithChildren) {
         isSidePanelHiddenOrLargeScreen,
         shouldHideSidePanel,
         shouldHideSidePanelBackdrop,
-        shouldHideHelpButton,
+        shouldHideHelpButton: shouldHideHelpButton || !isSidePanelTransitionEnded,
         shouldHideToolTip,
         sidePanelOffset,
         sidePanelTranslateX,

What alternative solutions did you explore? (Optional)

  • MelvinBot's proposal (adding a separate isSidePanelClosing state and calling setState during render): Rejected because calling setState during render causes extra re-renders and duplicates state when isSidePanelTransitionEnded already tracks the exact animation lifecycle.
  • Checking !isSidePanelTransitionEnded without guarding initial mount: Rejected because the useEffect runs on initial mount when the panel is closed, which would hide the Help button across the app for 300ms on initial page load.

Enes2553 avatar Oct 28 '26 17:10 Enes2553

@sobitneupane Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Oct 30 '26 21:10 melvin-bot[bot]

@sobitneupane Friendly check-in on #105159. The fix for the Help button flash during Concierge panel close is verified and ready for PR review whenever you have a moment.

apoorv-xs avatar Nov 01 '26 20:11 apoorv-xs

Proposal from @MelvinBot looks good to me.

🎀 👀 🎀 C+ reviewed

sobitneupane avatar Nov 03 '26 11:11 sobitneupane

Triggered auto assignment to @grgia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Nov 03 '26 11:11 melvin-bot[bot]

@grgia Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Nov 06 '26 21:11 melvin-bot[bot]

Proposal

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

When closing the Concierge side panel (right-hand panel), the header's ? Help button immediately reappears and flashes while the side panel is still sliding out over its 300ms close animation.

What is the root cause of that problem?

  1. In src/hooks/useSidePanelDisplayStatus.tsx (lines 21 and 38), shouldHideHelpButton is computed as !shouldHideSidePanel || ..., where shouldHideSidePanel reads NVP_SIDE_PANEL.open directly from Onyx.
  2. When the user closes the side panel, closeSidePanel in src/components/SidePanel/SidePanelContextProvider.tsx (lines 142–154) immediately updates the Onyx state to closed (shouldHideSidePanel = true), while the panel's slide-out animation runs for 300ms (lines 114–140).
  3. Although the SidePanel component itself and tooltips wait for isSidePanelTransitionEnded before unmounting, shouldHideHelpButton becomes false on the very first frame of the close animation, causing the Help button to render while the side panel is still visibly sliding out.

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

  1. In src/components/SidePanel/SidePanelContextProvider.tsx (around lines 102–107 and 130), track an isSidePanelClosing state (or use isSidePanelTransitionEnded) that becomes true when shouldHideSidePanel transitions from false to true and resets to false inside the Animated.timing(...).start() completion callback at line 130.
  2. In SidePanelContextProvider.tsx (line 168), expose shouldHideHelpButton: shouldHideHelpButton || isSidePanelClosing in the context value so the Help button remains hidden until the 300ms slide-out animation finishes.
  3. Add a unit test verifying that shouldHideHelpButton stays true while the side panel close transition is in progress and becomes false once the transition completes.

What alternative solutions did you explore? (Optional)

We considered delaying the Onyx SidePanel.open update until after the 300ms animation finishes, but updating shouldHideHelpButton in SidePanelContextProvider keeps the close animation responsive while preventing the Help icon from rendering prematurely.

jeffrey-graham avatar Nov 07 '26 04:11 jeffrey-graham

📣 @jeffrey-graham! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Nov 07 '26 04:11 melvin-bot[bot]

@sobitneupane @grgia this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Nov 10 '26 21:11 melvin-bot[bot]