Skip to content
Merged
12 changes: 9 additions & 3 deletions src/hooks/useSidePanelDisplayStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ONYXKEYS from '@src/ONYXKEYS';
import {hasCompletedGuidedSetupFlowSelector} from '@src/selectors/Onboarding';
import useEnvironment from './useEnvironment';
import useOnyx from './useOnyx';
import useResponsiveLayout from './useResponsiveLayout';
Expand All @@ -10,19 +11,24 @@ function useSidePanelDisplayStatus() {
const {isExtraLargeScreenWidth, shouldUseNarrowLayout} = useResponsiveLayout();
const [sidePanelNVP] = useOnyx(ONYXKEYS.NVP_SIDE_PANEL, {canBeMissing: true});
const {isProduction} = useEnvironment();

const [isOnboardingCompleted = false] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {
selector: hasCompletedGuidedSetupFlowSelector,
canBeMissing: true,
});
const isSidePanelVisible = isExtraLargeScreenWidth ? sidePanelNVP?.open : sidePanelNVP?.openNarrowScreen;

// The Side Panel is hidden when:
// - NVP is not set or it is false
// - Production environment (will be removed in the future once it's tested on staging)
const shouldHideSidePanel = !isSidePanelVisible || !sidePanelNVP || isProduction;
// - Onboarding is not completed
const shouldHideSidePanel = !isSidePanelVisible || !sidePanelNVP || isProduction || !isOnboardingCompleted;
const isSidePanelHiddenOrLargeScreen = !isSidePanelVisible || isExtraLargeScreenWidth || isProduction || !sidePanelNVP;

// The help button is hidden when:
// - Side Panel is displayed currently
// - Production environment (will be removed in the future once it's tested on staging)
const shouldHideHelpButton = !shouldHideSidePanel || isProduction;
// - Onboarding is not completed
const shouldHideHelpButton = !shouldHideSidePanel || isProduction || !isOnboardingCompleted;

@aimane-chnaif aimane-chnaif Jan 7, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming from #78446 and #78185: We ended up hiding this button for anonymous users.

const shouldHideSidePanelBackdrop = shouldHideSidePanel || isExtraLargeScreenWidth || shouldUseNarrowLayout;

return {
Expand Down
6 changes: 4 additions & 2 deletions src/hooks/useTackInputFocus/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {useCallback, useEffect} from 'react';
import useDebouncedState from '@hooks/useDebouncedState';
import useSidePanel from '@hooks/useSidePanel';
import {isChromeIOS} from '@libs/Browser';
import CONST from '@src/CONST';

Expand All @@ -8,6 +9,7 @@ import CONST from '@src/CONST';
*/
export default function useTackInputFocus(enable = false): boolean {
const [, isInputFocusDebounced, setIsInputFocus] = useDebouncedState(false);
const {shouldHideSidePanel} = useSidePanel();

const handleFocusIn = useCallback(
(event: FocusEvent) => {
Expand All @@ -30,7 +32,7 @@ export default function useTackInputFocus(enable = false): boolean {
);

useEffect(() => {
if (!enable) {
if (!enable || !shouldHideSidePanel) {
return;
}
// Putting the function here so a new instance of the function is created for each usage of the hook
Expand All @@ -51,7 +53,7 @@ export default function useTackInputFocus(enable = false): boolean {
window.removeEventListener('focusout', handleFocusOut);
window.visualViewport?.removeEventListener('scroll', resetScrollPositionOnVisualViewport);
};
}, [enable, handleFocusIn, handleFocusOut]);
}, [enable, handleFocusIn, handleFocusOut, shouldHideSidePanel]);

return isInputFocusDebounced;
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ function BaseOnboardingAccounting({shouldUseNativeStyles, route}: BaseOnboarding
shouldShowBackButton={!isVsb}
progressBarPercentage={80}
onBackButtonPress={() => Navigation.goBack(ROUTES.ONBOARDING_EMPLOYEES.getRoute())}
shouldDisplayHelpButton={false}
/>
<View style={[onboardingIsMediumOrLargerScreenWidth && styles.mt5, onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5]}>
<Text style={[styles.textHeadlineH1, styles.mb5]}>{translate('onboarding.accounting.title')}</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE
onBackButtonPress={() => {
Navigation.goBack(ROUTES.ONBOARDING_PURPOSE.getRoute());
}}
shouldDisplayHelpButton={false}
/>
<Text style={[styles.textHeadlineH1, styles.mb5, onboardingIsMediumOrLargerScreenWidth && styles.mt5, onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5]}>
{translate('onboarding.employees.title')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin
shouldShowBackButton
progressBarPercentage={90}
onBackButtonPress={() => Navigation.goBack(ROUTES.ONBOARDING_ACCOUNTING.getRoute())}
shouldDisplayHelpButton={false}
/>
<View style={[onboardingIsMediumOrLargerScreenWidth && styles.mt5, onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5]}>
<Text style={[styles.textHeadlineH1, styles.mb5]}>{translate('onboarding.interestedFeatures.title')}</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat

Navigation.goBack(ROUTES.ONBOARDING_PURPOSE.getRoute(route.params?.backTo));
}}
shouldDisplayHelpButton={false}
/>
<FormProvider
style={[styles.flexGrow1, onboardingIsMediumOrLargerScreenWidth && styles.mt5, onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function BaseOnboardingPrivateDomain({shouldUseNativeStyles, route}: BaseOnboard
shouldShowBackButton
progressBarPercentage={40}
onBackButtonPress={handleBackButtonPress}
shouldDisplayHelpButton={false}
/>
<ScrollView
style={[styles.w100, styles.h100, styles.flex1]}
Expand Down
1 change: 1 addition & 0 deletions src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ function BaseOnboardingPurpose({shouldUseNativeStyles, shouldEnableMaxHeight, ro
shouldShowBackButton={false}
iconFill={theme.iconColorfulBackground}
progressBarPercentage={isPrivateDomainAndHasAccessiblePolicies ? 60 : 20}
shouldDisplayHelpButton={false}
/>
</View>
<ScrollView style={[styles.flex1, styles.flexGrow1, onboardingIsMediumOrLargerScreenWidth && styles.mt5, paddingHorizontal]}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ function BaseOnboardingWorkEmail({shouldUseNativeStyles}: BaseOnboardingWorkEmai
<HeaderWithBackButton
progressBarPercentage={10}
shouldShowBackButton={false}
shouldDisplayHelpButton={false}
/>
{onboardingValues?.isMergingAccountBlocked ? (
<View style={[styles.flex1, onboardingIsMediumOrLargerScreenWidth && styles.mt5, onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5]}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function BaseOnboardingWorkEmailValidation({shouldUseNativeStyles}: BaseOnboardi
onBackButtonPress={() => {
updateOnboardingValuesAndNavigation(onboardingValues);
}}
shouldDisplayHelpButton={false}
/>
{onboardingValues?.isMergingAccountBlocked ? (
<View style={[styles.flex1, onboardingIsMediumOrLargerScreenWidth && styles.mt5, onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5]}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ function BaseOnboardingWorkspaceConfirmation({shouldUseNativeStyles}: BaseOnboar
testID="BaseOnboardingWorkspaceConfirmation"
style={[styles.defaultModalContainer, shouldUseNativeStyles && styles.pt8]}
>
<HeaderWithBackButton progressBarPercentage={100} />
<HeaderWithBackButton
progressBarPercentage={100}
shouldDisplayHelpButton={false}
/>
<FormProvider
style={[styles.flexGrow1, onboardingIsMediumOrLargerScreenWidth && styles.mt5, onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5]}
formID={ONYXKEYS.FORMS.ONBOARDING_WORKSPACE_DETAILS_FORM}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function BaseOnboardingWorkspaceCurrency({route, shouldUseNativeStyles}: BaseOnb
<HeaderWithBackButton
progressBarPercentage={100}
onBackButtonPress={goBack}
shouldDisplayHelpButton={false}
/>
<View style={[onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5, onboardingIsMediumOrLargerScreenWidth ? styles.flexRow : styles.flexColumn, styles.mb5]}>
<Text style={styles.textHeadlineH1}>{translate('common.currency')}</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ function BaseOnboardingWorkspaceInvite({shouldUseNativeStyles}: BaseOnboardingWo
<HeaderWithBackButton
progressBarPercentage={100}
shouldShowBackButton={false}
shouldDisplayHelpButton={false}
/>
<View style={[onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5, onboardingIsMediumOrLargerScreenWidth ? styles.flexRow : styles.flexColumn, styles.mb3]}>
<Text style={styles.textHeadlineH1}>{translate('onboarding.inviteMembers.title')}</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ function BaseOnboardingWorkspaceOptional({shouldUseNativeStyles}: BaseOnboarding
testID="BaseOnboardingWorkspaceOptional"
style={[styles.defaultModalContainer, shouldUseNativeStyles && styles.pt8]}
>
<HeaderWithBackButton progressBarPercentage={100} />
<HeaderWithBackButton
progressBarPercentage={100}
shouldDisplayHelpButton={false}
/>
<View style={[styles.flexGrow1, onboardingIsMediumOrLargerScreenWidth && styles.mt5, onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5]}>
<View style={[onboardingIsMediumOrLargerScreenWidth ? styles.flexRow : styles.flexColumn, styles.mb3]}>
<Text style={styles.textHeadlineH1}>{translate('onboarding.workspace.title')}</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function BaseOnboardingWorkspaces({route, shouldUseNativeStyles}: BaseOnboarding
shouldShowBackButton
progressBarPercentage={60}
onBackButtonPress={handleBackButtonPress}
shouldDisplayHelpButton={false}
/>
<SelectionList
data={policyIDItems}
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr
reportTransactions={reportTransactions}
// If the report is from the 'Send Money' flow, we add the comment to the `iou` report because for these we don't combine reportActions even if there is a single transaction (they always have a single transaction)
transactionThreadReportID={isSentMoneyReport ? undefined : transactionThreadReportID}
isInSidePanel={isInSidePanel}
/>
) : null}
</View>
Expand Down
6 changes: 5 additions & 1 deletion src/pages/home/report/ReportFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ type ReportFooterProps = {

/** A method to call when the input is blur */
onComposerBlur?: () => void;

/** Whether the report screen is being displayed in the side panel */
isInSidePanel?: boolean;
};

function ReportFooter({
Expand All @@ -87,6 +90,7 @@ function ReportFooter({
onComposerFocus,
reportTransactions,
transactionThreadReportID,
isInSidePanel,
}: ReportFooterProps) {
const styles = useThemeStyles();
const {isOffline} = useNetwork();
Expand Down Expand Up @@ -219,7 +223,7 @@ function ReportFooter({
{isAnonymousUser && !isArchivedRoom && (
<AnonymousReportFooter
report={report}
isSmallSizeLayout={isSmallSizeLayout}
isSmallSizeLayout={isSmallSizeLayout || isInSidePanel}
/>
)}
{isArchivedRoom && <ArchivedReportFooter report={report} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ function AccountDetailsPage() {
<HeaderWithBackButton
title={translate('mergeAccountsPage.mergeAccount')}
onBackButtonPress={() => Navigation.dismissModal()}
shouldDisplayHelpButton={false}
Comment thread
blazejkustra marked this conversation as resolved.
Resolved
/>
<FullPageOfflineBlockingView>
<FormProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ function AccountValidatePage() {
onBackButtonPress={() => {
Navigation.goBack(ROUTES.SETTINGS_MERGE_ACCOUNTS.getRoute());
}}
shouldDisplayHelpButton={false}
/>
<ScrollView
style={[styles.w100, styles.h100, styles.flex1]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ function MergeResultPage() {
onBackButtonPress={() => {
Navigation.goBack(backTo ?? ROUTES.SETTINGS_MERGE_ACCOUNTS.getRoute());
}}
shouldDisplayHelpButton={false}
/>
<ConfirmationPage
containerStyle={{...styles.flexGrow1, ...styles.mt3}}
Expand Down