[Due for payment 2026-12-02] [$175] Workspace - Help icon briefly flashes while closing the Concierge right-hand panel
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:
- Open a workspace and navigate to MCP
- Open the Concierge right-hand panel
- Close the Concierge panel
- 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
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022115127614553140369
- Upwork Job ID: 2115127614553140369
- Last Price Increase: 2026-10-27
Issue Owner
Current Issue Owner: @sobitneupane
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,shouldHideHelpButtonis!shouldHideSidePanel || ....shouldHideSidePanelcomes straight fromNVP_SIDE_PANEL.open(line 21). - On close,
closeSidePanelsets 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:
- Track an
isSidePanelClosingstate. Set it to true in the existing render-time check at lines 102-107 whenshouldHideSidePanelchanges from false to true. - Set it back to false in the animation's
startcallback (line 130). - Expose
shouldHideHelpButton || isSidePanelClosingasshouldHideHelpButtonin 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.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)
Job added to Upwork: https://www.upwork.com/jobs/~022115127614553140369
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:
- When closing the Concierge panel,
closeSidePanelimmediately callsSidePanelActions.dismissSidePanel(), which setsNVP_SIDE_PANEL.opentofalsein Onyx right away. - In
useSidePanelDisplayStatus.tsx(lines 32–38),shouldHideSidePanelimmediately evaluates totrue, causingshouldHideHelpButtonto flip tofalseinstantly:const shouldHideHelpButton = !shouldHideSidePanel || !isOnboardingCompleted || isAnonymousUser || isIn2FASetupFlow; - However, the side panel slide-out animation takes 300ms (
sidePanelOffsetandsidePanelTranslateXanimating to 0). BecauseshouldHideHelpButtondoes not wait forisSidePanelTransitionEnded, the Help icon renders immediately inHeaderWithBackButtonwhile the panel is still actively animating across the screen. - By contrast, the side panel DOM unmount (
SidePanel/index.tsx:29) and tooltip visibility (shouldHideToolTipon line 73) already gate onisSidePanelTransitionEnded.
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
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
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?
- In
src/components/SidePanel/SidePanelContextProvider.tsx(lines 142–154), when the user closes the Concierge panel,closeSidePanelimmediately callsSidePanelActions.dismissSidePanel(), which setsNVP_SIDE_PANEL.opentofalsein Onyx right away. - In
src/hooks/useSidePanelDisplayStatus.tsx(lines 32–38),shouldHideSidePanelimmediately evaluates totrue, which immediately flipsshouldHideHelpButtontofalse:const shouldHideHelpButton = !shouldHideSidePanel || !isOnboardingCompleted || isAnonymousUser || isIn2FASetupFlow; - However, the side panel slide-out animation takes 300ms (
CONST.SIDE_PANEL_ANIMATED_TRANSITION) assidePanelTranslateXanimates offscreen. - Because
shouldHideHelpButtoninuseSidePanelDisplayStatusonly checks Onyx state and does not account for the closing animation lifecycle, the Help icon renders immediately inHeaderWithBackButtonwhile the panel is still sliding across the viewport. - In
SidePanelContextProvider.tsx, tooltip visibility (shouldHideToolTip, line 73) and the side panel unmount gate (SidePanel/index.tsx, line 29) already wait forisSidePanelTransitionEnded.shouldHideHelpButtonis currently exposed as rawshouldHideHelpButtonwithout coordinating withisSidePanelTransitionEnded.
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
isSidePanelClosingstate: Redundant becauseisSidePanelTransitionEndedis already maintained precisely for the duration of the slide animation inAnimated.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
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
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?
- When the user closes the Concierge side panel,
closeSidePanelinsrc/components/SidePanel/SidePanelContextProvider.tsx(lines 140–152) callssetIsSidePanelTransitionEnded(false)and immediately invokesSidePanelActions.dismissSidePanel(...), which updatessidePanelNVPin Onyx soshouldHideSidePanelbecomestrueat the very start of the 300ms close transition (CONST.SIDE_PANEL_ANIMATED_TRANSITION). - In
src/hooks/useSidePanelDisplayStatus.tsx(lines 28–39):
Becauseconst shouldHideSidePanel = isSidePanelHiddenOrLargeScreen || !isSidePanelReportSupported || !reportID; const shouldHideHelpButton = !shouldHideSidePanel || isAnonymousUser || !conciergeReportID || isReportingSubPage;shouldHideHelpButtononly checks!shouldHideSidePaneland does not check whether the Side Panel is still animating closed (!isSidePanelTransitionEndedfromSidePanelStateContext),shouldHideHelpButtonimmediately flips tofalseas soon asdismissSidePanelis called—while the Side Panel is still visible and sliding out over 300ms. - Critical side effect on initial mount missed if we only add
!isSidePanelTransitionEndedtouseSidePanelDisplayStatus.tsx: Look atsrc/components/SidePanel/SidePanelContextProvider.tsx(lines 100 and 113–138):
Thisconst [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]);useEffectruns on initial mount (and wheneversidePanelWidth/shouldApplySidePanelOffsetchanges on window resize), even when the Side Panel is already closed (shouldHideSidePanel === true)! On initial mount when the Side Panel is closed, it immediately callssetIsSidePanelTransitionEnded(false)and runs a 300ms no-op animation before settingisSidePanelTransitionEndedback totrue. Therefore, if we only add|| !isSidePanelTransitionEndedtoshouldHideHelpButtoninuseSidePanelDisplayStatus.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?
-
src/components/SidePanel/SidePanelContextProvider.tsx: Track the previous values ofshouldHideSidePanelandshouldApplySidePanelOffset(usingusePrevious), and only run the 300ms transition (andsetIsSidePanelTransitionEnded(false)) whenshouldHideSidePanelorshouldApplySidePanelOffsetactually 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, ]); -
src/hooks/useSidePanelDisplayStatus.tsx: ReadisSidePanelTransitionEndedfromuseSidePanelState()(oruseContext(SidePanelStateContext)) and keepshouldHideHelpButtontruewhile the Side Panel transition is in progress (!isSidePanelTransitionEnded):const {isSidePanelTransitionEnded} = useSidePanelState(); ... const shouldHideHelpButton = !shouldHideSidePanel || !isSidePanelTransitionEnded || isAnonymousUser || !conciergeReportID || isReportingSubPage;(Note: in
HeaderWithBackButton/TopBar, whenshouldShowHelpButtonistrue,<SidePanelButton>is mounted inside the header, whereas on Workspaces / Settings narrow headers, whenshouldHideHelpButtonistrue, the header omits<SidePanelButton>while the open/closing<SidePanel>overlays the screen. KeepingshouldHideHelpButtontrueuntilisSidePanelTransitionEndedbecomestrueprevents 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()insidecloseSidePaneluntilAnimated.parallel(...).start()finishes was considered, butcloseSidePanelrelies on changingshouldHideSidePanelfromfalsetotrueto trigger theuseEffectthat drivessidePanelTranslateXtosidePanelWidth. - Only adding
!isSidePanelTransitionEndedinuseSidePanelDisplayStatus.tsxwithout fixing the initial-mountuseEffectinSidePanelContextProvider.tsxwas rejected becauseuseEffectunconditionally setsisSidePanelTransitionEndedtofalsefor 300ms on mount even when the Side Panel is closed.
@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:
- Redundant state & render-phase state updates in MelvinBot: MelvinBot introduces an extra
isSidePanelClosingstate and callssetStatedirectly during the render phase (prevShouldHideSidePanel !== shouldHideSidePanel), which triggers unnecessary re-renders when the provider already tracks transition state. - Hidden initial-mount regression in other proposals: Other proposals tried to simply check
!isSidePanelTransitionEnded, but missed thatSidePanelContextProvider'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?
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?
- In
useSidePanelDisplayStatus.tsx:38,shouldHideHelpButtonis derived synchronously from!shouldHideSidePanel:const shouldHideHelpButton = !shouldHideSidePanel || !isOnboardingCompleted || isAnonymousUser || isIn2FASetupFlow; - When the user closes the Concierge side panel,
closeSidePanelcallsSidePanelActions.dismissSidePanel(), which immediately updates Onyx keyNVP_SIDE_PANEL(open: false). - This causes
shouldHideSidePanelto becometrueon the very first render, which immediately flipsshouldHideHelpButtontofalse. - As a result,
SidePanelButtonBasemounts 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. - Furthermore, in
SidePanelContextProvider.tsx:114-140, the transitionuseEffectruns unconditionally on initial mount. If the side panel is closed on initial load (shouldHideSidePanel === true), it starts a redundant 300ms animation and setssetIsSidePanelTransitionEnded(false). This is why previous attempts to merely check!isSidePanelTransitionEndedcaused 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:
- Add an
isFirstRenderref to skip the redundant animation on initial mount when the Side Panel is already closed. - In
stateValue, exposeshouldHideHelpButton: 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,
isSidePanelTransitionEndedisfalseduring the 300ms slide-out animation, ensuring the Help button stays hidden until the panel has completely cleared the screen. - Zero mount / refresh regression: Because
isFirstRenderskips the animation whenshouldHideSidePanelis alreadytrue,isSidePanelTransitionEndedstaystruefrom initial mount, so the Help button appears immediately on page load without any delay. - Zero redundant state: Reuses the provider's existing
isSidePanelTransitionEndedanimation state instead of adding new states or callingsetStateduring render.
What alternative solutions did you explore? (Optional)
- MelvinBot's proposal: Adding an
isSidePanelClosingstate and updating it during render (prevShouldHideSidePanel !== shouldHideSidePanel). Rejected because updating state during the render phase causes extra re-render cycles and duplicates state whenisSidePanelTransitionEndedalready exists to track transition lifecycle. - Only checking
!isSidePanelTransitionEndedwithoutisFirstRender: Rejected becauseSidePanelContextProvider's animation effect runs on initial mount and setsisSidePanelTransitionEnded(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
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
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?
- When closing the Concierge panel,
closeSidePanelinsrc/components/SidePanel/SidePanelContextProvider.tsx(lines 142-154) immediately callsSidePanelActions.dismissSidePanel(), which updatesNVP_SIDE_PANEL(open: false) in Onyx at the start of the 300ms animation. - In
src/hooks/useSidePanelDisplayStatus.tsx(line 38),shouldHideHelpButtonis computed synchronously from!shouldHideSidePanel:
Becauseconst shouldHideHelpButton = !shouldHideSidePanel || !isOnboardingCompleted || isAnonymousUser || isIn2FASetupFlow;shouldHideSidePanelflips totrueimmediately,shouldHideHelpButtonflips tofalseon the very first frame of the 300ms close transition while the panel is still sliding off-screen. - In
src/components/SidePanel/SidePanelContextProvider.tsx(lines 114-140),isSidePanelTransitionEndedalready tracks the 300ms animation lifecycle (and is used byshouldHideToolTipon line 73 andSidePanel/index.tsxon line 29). However, the animationuseEffectinSidePanelContextProvider.tsxalso runs unconditionally on initial mount even whenshouldHideSidePanelis alreadytrue, temporarily settingisSidePanelTransitionEndedtofalsefor 300ms on initial load.
What changes do you think we should make in order to solve the problem?
In src/components/SidePanel/SidePanelContextProvider.tsx:
- Skip starting a redundant 300ms animation on initial mount when the side panel is already hidden (
shouldHideSidePanel === true) using anisFirstRenderref soisSidePanelTransitionEndedstaystrueon initial page load. - Expose
shouldHideHelpButton: shouldHideHelpButton || !isSidePanelTransitionEndedinstateValue(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
isSidePanelClosingstate and callingsetStateduring render): Rejected because callingsetStateduring render causes extra re-renders and duplicates state whenisSidePanelTransitionEndedalready tracks the exact animation lifecycle. - Checking
!isSidePanelTransitionEndedwithout guarding initial mount: Rejected because theuseEffectruns on initial mount when the panel is closed, which would hide the Help button across the app for 300ms on initial page load.
@sobitneupane Whoops! This issue is 2 days overdue. Let's get this updated quick!
@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.
Triggered auto assignment to @grgia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@grgia Whoops! This issue is 2 days overdue. Let's get this updated quick!
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?
- In
src/hooks/useSidePanelDisplayStatus.tsx(lines 21 and 38),shouldHideHelpButtonis computed as!shouldHideSidePanel || ..., whereshouldHideSidePanelreadsNVP_SIDE_PANEL.opendirectly from Onyx. - When the user closes the side panel,
closeSidePanelinsrc/components/SidePanel/SidePanelContextProvider.tsx(lines 142–154) immediately updates the Onyx state to closed (shouldHideSidePanel = true), while the panel's slide-out animation runs for300ms(lines 114–140). - Although the
SidePanelcomponent itself and tooltips wait forisSidePanelTransitionEndedbefore unmounting,shouldHideHelpButtonbecomesfalseon 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?
- In
src/components/SidePanel/SidePanelContextProvider.tsx(around lines 102–107 and 130), track anisSidePanelClosingstate (or useisSidePanelTransitionEnded) that becomestruewhenshouldHideSidePaneltransitions fromfalsetotrueand resets tofalseinside theAnimated.timing(...).start()completion callback at line 130. - In
SidePanelContextProvider.tsx(line 168), exposeshouldHideHelpButton: shouldHideHelpButton || isSidePanelClosingin the context value so the Help button remains hidden until the 300ms slide-out animation finishes. - Add a unit test verifying that
shouldHideHelpButtonstaystruewhile the side panel close transition is in progress and becomesfalseonce 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! 📣 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:
- Make sure you've read and understood the contributing guidelines.
- 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.
- 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.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
@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!