From a29a3de2c816911382a71588fbae937a106a35c8 Mon Sep 17 00:00:00 2001 From: neil-marcellini Date: Fri, 27 Dec 2024 13:37:20 -0800 Subject: [PATCH 1/3] Revert "Merge pull request #51172 from christianwen/fix/10731-auto-focus-input" This reverts commit 8819d9c9cf2eb62d34f34770e11d58a96a731d78, reversing changes made to 52b4ecad6ac1d3f0c02c0f9ea384b7f3d22021a0. --- .../Composer/implementation/index.native.tsx | 17 +---- .../Composer/implementation/index.tsx | 20 +----- src/components/Composer/types.ts | 3 - src/libs/actions/EmojiPickerAction.ts | 4 +- src/pages/home/ReportScreen.tsx | 8 +-- .../ComposerWithSuggestions.tsx | 67 +++++++++---------- .../ReportActionCompose.tsx | 25 ++----- src/pages/home/report/ReportFooter.tsx | 36 ++++------ .../ReportActionCompose.perf-test.tsx | 2 - 9 files changed, 59 insertions(+), 123 deletions(-) diff --git a/src/components/Composer/implementation/index.native.tsx b/src/components/Composer/implementation/index.native.tsx index a02767d24c87..0cddb32f5aeb 100644 --- a/src/components/Composer/implementation/index.native.tsx +++ b/src/components/Composer/implementation/index.native.tsx @@ -1,7 +1,7 @@ import type {MarkdownStyle} from '@expensify/react-native-live-markdown'; import mimeDb from 'mime-db'; import type {ForwardedRef} from 'react'; -import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; +import React, {useCallback, useEffect, useMemo, useRef} from 'react'; import type {NativeSyntheticEvent, TextInput, TextInputChangeEventData, TextInputPasteEventData} from 'react-native'; import {StyleSheet} from 'react-native'; import type {FileObject} from '@components/AttachmentModal'; @@ -9,7 +9,6 @@ import type {ComposerProps} from '@components/Composer/types'; import type {AnimatedMarkdownTextInputRef} from '@components/RNMarkdownTextInput'; import RNMarkdownTextInput from '@components/RNMarkdownTextInput'; import useAutoFocusInput from '@hooks/useAutoFocusInput'; -import useKeyboardState from '@hooks/useKeyboardState'; import useMarkdownStyle from '@hooks/useMarkdownStyle'; import useResetComposerFocus from '@hooks/useResetComposerFocus'; import useStyleUtils from '@hooks/useStyleUtils'; @@ -38,7 +37,6 @@ function Composer( selection, value, isGroupPolicyReport = false, - showSoftInputOnFocus = true, ...props }: ComposerProps, ref: ForwardedRef, @@ -51,11 +49,7 @@ function Composer( const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); - const [contextMenuHidden, setContextMenuHidden] = useState(true); - const {inputCallbackRef, inputRef: autoFocusInputRef} = useAutoFocusInput(); - const keyboardState = useKeyboardState(); - const isKeyboardShown = keyboardState?.isKeyboardShown ?? false; useEffect(() => { if (autoFocus === !!autoFocusInputRef.current) { @@ -64,13 +58,6 @@ function Composer( inputCallbackRef(autoFocus ? textInput.current : null); }, [autoFocus, inputCallbackRef, autoFocusInputRef]); - useEffect(() => { - if (!showSoftInputOnFocus || !isKeyboardShown) { - return; - } - setContextMenuHidden(false); - }, [showSoftInputOnFocus, isKeyboardShown]); - useEffect(() => { if (!textInput.current || !textInput.current.setSelection || !selection || isComposerFullSize) { return; @@ -171,8 +158,6 @@ function Composer( props?.onBlur?.(e); }} onClear={onClear} - showSoftInputOnFocus={showSoftInputOnFocus} - contextMenuHidden={contextMenuHidden} /> ); } diff --git a/src/components/Composer/implementation/index.tsx b/src/components/Composer/implementation/index.tsx index 9171132964f6..5af76a2406b5 100755 --- a/src/components/Composer/implementation/index.tsx +++ b/src/components/Composer/implementation/index.tsx @@ -5,7 +5,7 @@ import type {BaseSyntheticEvent, ForwardedRef} from 'react'; import React, {useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react'; // eslint-disable-next-line no-restricted-imports import type {NativeSyntheticEvent, TextInput, TextInputKeyPressEventData, TextInputSelectionChangeEventData} from 'react-native'; -import {DeviceEventEmitter, InteractionManager, StyleSheet} from 'react-native'; +import {DeviceEventEmitter, StyleSheet} from 'react-native'; import type {ComposerProps} from '@components/Composer/types'; import type {AnimatedMarkdownTextInputRef} from '@components/RNMarkdownTextInput'; import RNMarkdownTextInput from '@components/RNMarkdownTextInput'; @@ -50,7 +50,6 @@ function Composer( isComposerFullSize = false, shouldContainScroll = true, isGroupPolicyReport = false, - showSoftInputOnFocus = true, ...props }: ComposerProps, ref: ForwardedRef, @@ -75,11 +74,6 @@ function Composer( }); const [hasMultipleLines, setHasMultipleLines] = useState(false); const [isRendered, setIsRendered] = useState(false); - - // On mobile safari, the cursor will move from right to left with inputMode set to none during report transition - // To avoid that we should hide the cursor util the transition is finished - const [shouldTransparentCursor, setShouldTransparentCursor] = useState(!showSoftInputOnFocus && Browser.isMobileSafari()); - const isScrollBarVisible = useIsScrollBarVisible(textInput, value ?? ''); const [prevScroll, setPrevScroll] = useState(); const [prevHeight, setPrevHeight] = useState(); @@ -266,15 +260,6 @@ function Composer( setIsRendered(true); }, []); - useEffect(() => { - if (!shouldTransparentCursor) { - return; - } - InteractionManager.runAfterInteractions(() => { - setShouldTransparentCursor(false); - }); - }, [shouldTransparentCursor]); - const clear = useCallback(() => { if (!textInput.current) { return; @@ -362,12 +347,11 @@ function Composer( placeholderTextColor={theme.placeholderText} ref={(el) => (textInput.current = el)} selection={selection} - style={[inputStyleMemo, shouldTransparentCursor ? {caretColor: 'transparent'} : undefined]} + style={[inputStyleMemo]} markdownStyle={markdownStyle} value={value} defaultValue={defaultValue} autoFocus={autoFocus} - inputMode={showSoftInputOnFocus ? 'text' : 'none'} /* eslint-disable-next-line react/jsx-props-no-spreading */ {...props} onSelectionChange={addCursorPositionToSelectionChange} diff --git a/src/components/Composer/types.ts b/src/components/Composer/types.ts index 6ea3bdb2f824..3df5508f1dd7 100644 --- a/src/components/Composer/types.ts +++ b/src/components/Composer/types.ts @@ -68,9 +68,6 @@ type ComposerProps = Omit & { /** Indicates whether the composer is in a group policy report. Used for disabling report mentioning style in markdown input */ isGroupPolicyReport?: boolean; - - /** Whether to show the keyboard on focus */ - showSoftInputOnFocus?: boolean; }; export type {TextSelection, ComposerProps, CustomSelectionChangeEvent}; diff --git a/src/libs/actions/EmojiPickerAction.ts b/src/libs/actions/EmojiPickerAction.ts index 134364ddbad6..e6123733b0e8 100644 --- a/src/libs/actions/EmojiPickerAction.ts +++ b/src/libs/actions/EmojiPickerAction.ts @@ -79,8 +79,8 @@ function hideEmojiPicker(isNavigating?: boolean) { /** * Whether Emoji Picker is active for the given id. */ -function isActive(id?: string): boolean { - if (!emojiPickerRef.current || !id) { +function isActive(id: string): boolean { + if (!emojiPickerRef.current) { return false; } diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index ea0961701a52..559ca91ec2e6 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -252,6 +252,7 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro const {reportPendingAction, reportErrors} = ReportUtils.getReportOfflinePendingActionAndErrors(report); const screenWrapperStyle: ViewStyle[] = [styles.appContent, styles.flex1, {marginTop: viewportOffsetTop}]; + const isEmptyChat = useMemo(() => ReportUtils.isEmptyReport(report), [report]); const isOptimisticDelete = report?.statusNum === CONST.REPORT.STATUS_NUM.CLOSED; const indexOfLinkedMessage = useMemo( (): number => reportActions.findIndex((obj) => String(obj.reportActionID) === String(reportActionIDFromRoute)), @@ -279,7 +280,6 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro const policy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID ?? '-1'}`]; const isTopMostReportId = currentReportID === reportIDFromRoute; const didSubscribeToReportLeavingEvents = useRef(false); - const [showSoftInputOnFocus, setShowSoftInputOnFocus] = useState(false); useEffect(() => { if (!report?.reportID || shouldHideReport) { @@ -757,7 +757,7 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro ) : null} diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx index b56109b64c40..7b0d6663facf 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx @@ -40,6 +40,7 @@ import getPlatform from '@libs/getPlatform'; import * as KeyDownListener from '@libs/KeyboardShortcut/KeyDownPressListener'; import Parser from '@libs/Parser'; import ReportActionComposeFocusManager from '@libs/ReportActionComposeFocusManager'; +import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import * as ReportUtils from '@libs/ReportUtils'; import updateMultilineInputRange from '@libs/updateMultilineInputRange'; import willBlurTextInputOnTapOutsideFunc from '@libs/willBlurTextInputOnTapOutside'; @@ -125,26 +126,27 @@ type ComposerWithSuggestionsProps = Partial & { /** The ref to the next modal will open */ isNextModalWillOpenRef: MutableRefObject; + /** Wheater chat is empty */ + isEmptyChat?: boolean; + /** The last report action */ lastReportAction?: OnyxEntry; /** Whether to include chronos */ includeChronos?: boolean; + /** The parent report action ID */ + parentReportActionID?: string; + + /** The parent report ID */ + // eslint-disable-next-line react/no-unused-prop-types -- its used in the withOnyx HOC + parentReportID: string | undefined; + /** Whether report is from group policy */ isGroupPolicyReport: boolean; /** policy ID of the report */ - policyID?: string; - - /** Whether to show the keyboard on focus */ - showSoftInputOnFocus: boolean; - - /** A method to update showSoftInputOnFocus */ - setShowSoftInputOnFocus: (value: boolean) => void; - - /** Whether the main composer was hidden */ - didHideComposerInput?: boolean; + policyID: string; }; type SwitchToCurrentReportProps = { @@ -185,6 +187,10 @@ const debouncedBroadcastUserIsTyping = lodashDebounce( const willBlurTextInputOnTapOutside = willBlurTextInputOnTapOutsideFunc(); +// We want consistent auto focus behavior on input between native and mWeb so we have some auto focus management code that will +// prevent auto focus on existing chat for mobile device +const shouldFocusInputOnScreenFocus = canFocusInputOnScreenFocus(); + /** * This component holds the value and selection state. * If a component really needs access to these state values it should be put here. @@ -195,8 +201,11 @@ function ComposerWithSuggestions( { // Props: Report reportID, + parentReportID, includeChronos, + isEmptyChat, lastReportAction, + parentReportActionID, isGroupPolicyReport, policyID, @@ -227,9 +236,6 @@ function ComposerWithSuggestions( // For testing children, - showSoftInputOnFocus, - setShowSoftInputOnFocus, - didHideComposerInput, }: ComposerWithSuggestionsProps, ref: ForwardedRef, ) { @@ -251,12 +257,14 @@ function ComposerWithSuggestions( } return draftComment; }); - const commentRef = useRef(value); + const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`); const [modal] = useOnyx(ONYXKEYS.MODAL); const [preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {selector: EmojiUtils.getPreferredSkinToneIndex}); const [editFocused] = useOnyx(ONYXKEYS.INPUT_FOCUSED); + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + const [parentReportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReportID || '-1'}`, {canEvict: false, initWithStoredValues: false}); const lastTextRef = useRef(value); useEffect(() => { @@ -266,7 +274,13 @@ function ComposerWithSuggestions( const {shouldUseNarrowLayout} = useResponsiveLayout(); const maxComposerLines = shouldUseNarrowLayout ? CONST.COMPOSER.MAX_LINES_SMALL_SCREEN : CONST.COMPOSER.MAX_LINES; - const shouldAutoFocus = !modal?.isVisible && shouldShowComposeInput && Modal.areAllModalsHidden() && isFocused && !didHideComposerInput; + const parentReportAction = useMemo(() => parentReportActions?.[parentReportActionID ?? '-1'], [parentReportActionID, parentReportActions]); + const shouldAutoFocus = + !modal?.isVisible && + Modal.areAllModalsHidden() && + isFocused && + (shouldFocusInputOnScreenFocus || (isEmptyChat && !ReportActionsUtils.isTransactionThread(parentReportAction) && !ReportUtils.isTaskReport(report))) && + shouldShowComposeInput; const valueRef = useRef(value); valueRef.current = value; @@ -629,15 +643,7 @@ function ComposerWithSuggestions( // We want to focus or refocus the input when a modal has been closed or the underlying screen is refocused. // We avoid doing this on native platforms since the software keyboard popping // open creates a jarring and broken UX. - if ( - !( - (willBlurTextInputOnTapOutside || (shouldAutoFocus && canFocusInputOnScreenFocus())) && - !isNextModalWillOpenRef.current && - !modal?.isVisible && - isFocused && - (!!prevIsModalVisible || !prevIsFocused) - ) - ) { + if (!((willBlurTextInputOnTapOutside || shouldAutoFocus) && !isNextModalWillOpenRef.current && !modal?.isVisible && isFocused && (!!prevIsModalVisible || !prevIsFocused))) { return; } @@ -769,19 +775,6 @@ function ComposerWithSuggestions( onScroll={hideSuggestionMenu} shouldContainScroll={Browser.isMobileSafari()} isGroupPolicyReport={isGroupPolicyReport} - showSoftInputOnFocus={showSoftInputOnFocus} - onTouchStart={() => { - if (showSoftInputOnFocus) { - return; - } - if (Browser.isMobileSafari()) { - setTimeout(() => { - setShowSoftInputOnFocus(true); - }, CONST.ANIMATED_TRANSITION); - return; - } - setShowSoftInputOnFocus(true); - }} /> diff --git a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx index c3caaf16a3ef..78d3288d05f0 100644 --- a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx +++ b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx @@ -64,7 +64,7 @@ type SuggestionsRef = { getIsSuggestionsMenuVisible: () => boolean; }; -type ReportActionComposeProps = Pick & { +type ReportActionComposeProps = Pick & { /** A method to call when the form is submitted */ onSubmit: (newComment: string) => void; @@ -88,15 +88,6 @@ type ReportActionComposeProps = Pick void; - - /** Whether the main composer was hidden */ - didHideComposerInput?: boolean; }; // We want consistent auto focus behavior on input between native and mWeb so we have some auto focus management code that will @@ -116,13 +107,11 @@ function ReportActionCompose({ report, reportID, isReportReadyForDisplay = true, + isEmptyChat, lastReportAction, shouldShowEducationalTooltip, - showSoftInputOnFocus, onComposerFocus, onComposerBlur, - setShowSoftInputOnFocus, - didHideComposerInput, }: ReportActionComposeProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); @@ -335,7 +324,7 @@ function ReportActionCompose({ // We are returning a callback here as we want to incoke the method on unmount only useEffect( () => () => { - if (!EmojiPickerActions.isActive(report?.reportID)) { + if (!EmojiPickerActions.isActive(report?.reportID ?? '-1')) { return; } EmojiPickerActions.hideEmojiPicker(); @@ -498,9 +487,12 @@ function ReportActionCompose({ isScrollLikelyLayoutTriggered={isScrollLikelyLayoutTriggered} raiseIsScrollLikelyLayoutTriggered={raiseIsScrollLikelyLayoutTriggered} reportID={reportID} - policyID={report?.policyID} + policyID={report?.policyID ?? '-1'} + parentReportID={report?.parentReportID} + parentReportActionID={report?.parentReportActionID} includeChronos={ReportUtils.chatIncludesChronos(report)} isGroupPolicyReport={isGroupPolicyReport} + isEmptyChat={isEmptyChat} lastReportAction={lastReportAction} isMenuVisible={isMenuVisible} inputPlaceholder={inputPlaceholder} @@ -515,10 +507,7 @@ function ReportActionCompose({ onFocus={onFocus} onBlur={onBlur} measureParentContainer={measureContainer} - showSoftInputOnFocus={showSoftInputOnFocus} - setShowSoftInputOnFocus={setShowSoftInputOnFocus} onValueChange={onValueChange} - didHideComposerInput={didHideComposerInput} /> { diff --git a/src/pages/home/report/ReportFooter.tsx b/src/pages/home/report/ReportFooter.tsx index 174549806db9..8cb30b01adb5 100644 --- a/src/pages/home/report/ReportFooter.tsx +++ b/src/pages/home/report/ReportFooter.tsx @@ -1,6 +1,6 @@ import {Str} from 'expensify-common'; import lodashIsEqual from 'lodash/isEqual'; -import React, {memo, useCallback, useEffect, useState} from 'react'; +import React, {memo, useCallback} from 'react'; import {Keyboard, View} from 'react-native'; import {useOnyx} from 'react-native-onyx'; import type {OnyxEntry} from 'react-native-onyx'; @@ -45,6 +45,12 @@ type ReportFooterProps = { /** The last report action */ lastReportAction?: OnyxEntry; + /** Whether to show educational tooltip in workspace chat for first-time user */ + workspaceTooltip: OnyxEntry; + + /** Whether the chat is empty */ + isEmptyChat?: boolean; + /** The pending action when we are adding a chat */ pendingAction?: PendingAction; @@ -59,12 +65,6 @@ type ReportFooterProps = { /** A method to call when the input is blur */ onComposerBlur: () => void; - - /** Whether to show the keyboard on focus */ - showSoftInputOnFocus: boolean; - - /** A method to update showSoftInputOnFocus */ - setShowSoftInputOnFocus: (value: boolean) => void; }; function ReportFooter({ @@ -73,12 +73,12 @@ function ReportFooter({ report = {reportID: '-1'}, reportMetadata, policy, + isEmptyChat = true, isReportReadyForDisplay = true, isComposerFullSize = false, - showSoftInputOnFocus, + workspaceTooltip, onComposerBlur, onComposerFocus, - setShowSoftInputOnFocus, }: ReportFooterProps) { const styles = useThemeStyles(); const {isOffline} = useNetwork(); @@ -103,7 +103,7 @@ function ReportFooter({ } }, }); - const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID}`); + const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID ?? -1}`); const chatFooterStyles = {...styles.chatFooter, minHeight: !isOffline ? CONST.CHAT_FOOTER_MIN_HEIGHT : 0}; const isArchivedRoom = ReportUtils.isArchivedRoom(report, reportNameValuePairs); @@ -172,15 +172,6 @@ function ReportFooter({ [report.reportID, handleCreateTask], ); - const [didHideComposerInput, setDidHideComposerInput] = useState(!shouldShowComposeInput); - - useEffect(() => { - if (didHideComposerInput || shouldShowComposeInput) { - return; - } - setDidHideComposerInput(true); - }, [shouldShowComposeInput, didHideComposerInput]); - return ( <> {!!shouldHideComposer && ( @@ -222,14 +213,12 @@ function ReportFooter({ onComposerBlur={onComposerBlur} reportID={report.reportID} report={report} + isEmptyChat={isEmptyChat} lastReportAction={lastReportAction} pendingAction={pendingAction} isComposerFullSize={isComposerFullSize} isReportReadyForDisplay={isReportReadyForDisplay} shouldShowEducationalTooltip={didScreenTransitionEnd && shouldShowEducationalTooltip} - showSoftInputOnFocus={showSoftInputOnFocus} - setShowSoftInputOnFocus={setShowSoftInputOnFocus} - didHideComposerInput={didHideComposerInput} /> @@ -246,9 +235,10 @@ export default memo( lodashIsEqual(prevProps.report, nextProps.report) && prevProps.pendingAction === nextProps.pendingAction && prevProps.isComposerFullSize === nextProps.isComposerFullSize && + prevProps.isEmptyChat === nextProps.isEmptyChat && prevProps.lastReportAction === nextProps.lastReportAction && prevProps.isReportReadyForDisplay === nextProps.isReportReadyForDisplay && - prevProps.showSoftInputOnFocus === nextProps.showSoftInputOnFocus && + prevProps.workspaceTooltip?.shouldShow === nextProps.workspaceTooltip?.shouldShow && lodashIsEqual(prevProps.reportMetadata, nextProps.reportMetadata) && lodashIsEqual(prevProps.policy?.employeeList, nextProps.policy?.employeeList) && lodashIsEqual(prevProps.policy?.role, nextProps.policy?.role), diff --git a/tests/perf-test/ReportActionCompose.perf-test.tsx b/tests/perf-test/ReportActionCompose.perf-test.tsx index 1827e23ffe4b..845727c75c97 100644 --- a/tests/perf-test/ReportActionCompose.perf-test.tsx +++ b/tests/perf-test/ReportActionCompose.perf-test.tsx @@ -96,8 +96,6 @@ function ReportActionComposeWrapper() { disabled={false} report={LHNTestUtils.getFakeReport()} isComposerFullSize - showSoftInputOnFocus={false} - setShowSoftInputOnFocus={() => {}} /> ); From b8fd400b8f8dfcc9dd84c61fa326c5a54975f20e Mon Sep 17 00:00:00 2001 From: neil-marcellini Date: Fri, 27 Dec 2024 13:41:37 -0800 Subject: [PATCH 2/3] Remove reverted changes no longer on main --- src/pages/home/ReportScreen.tsx | 1 - src/pages/home/report/ReportFooter.tsx | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index 559ca91ec2e6..15c1da81acc8 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -856,7 +856,6 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro isComposerFullSize={!!isComposerFullSize} isEmptyChat={isEmptyChat} lastReportAction={lastReportAction} - workspaceTooltip={workspaceTooltip} /> ) : null} diff --git a/src/pages/home/report/ReportFooter.tsx b/src/pages/home/report/ReportFooter.tsx index 8cb30b01adb5..3c0ef1e23978 100644 --- a/src/pages/home/report/ReportFooter.tsx +++ b/src/pages/home/report/ReportFooter.tsx @@ -45,9 +45,6 @@ type ReportFooterProps = { /** The last report action */ lastReportAction?: OnyxEntry; - /** Whether to show educational tooltip in workspace chat for first-time user */ - workspaceTooltip: OnyxEntry; - /** Whether the chat is empty */ isEmptyChat?: boolean; @@ -103,7 +100,7 @@ function ReportFooter({ } }, }); - const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID ?? -1}`); + const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID}`); const chatFooterStyles = {...styles.chatFooter, minHeight: !isOffline ? CONST.CHAT_FOOTER_MIN_HEIGHT : 0}; const isArchivedRoom = ReportUtils.isArchivedRoom(report, reportNameValuePairs); @@ -238,7 +235,6 @@ export default memo( prevProps.isEmptyChat === nextProps.isEmptyChat && prevProps.lastReportAction === nextProps.lastReportAction && prevProps.isReportReadyForDisplay === nextProps.isReportReadyForDisplay && - prevProps.workspaceTooltip?.shouldShow === nextProps.workspaceTooltip?.shouldShow && lodashIsEqual(prevProps.reportMetadata, nextProps.reportMetadata) && lodashIsEqual(prevProps.policy?.employeeList, nextProps.policy?.employeeList) && lodashIsEqual(prevProps.policy?.role, nextProps.policy?.role), From 15aec97b7eec4d19ca1fd3a5602234b032254cbb Mon Sep 17 00:00:00 2001 From: neil-marcellini Date: Fri, 27 Dec 2024 13:48:54 -0800 Subject: [PATCH 3/3] Remove one more revert addition I missed --- src/pages/home/report/ReportFooter.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/home/report/ReportFooter.tsx b/src/pages/home/report/ReportFooter.tsx index 3c0ef1e23978..912594e568c7 100644 --- a/src/pages/home/report/ReportFooter.tsx +++ b/src/pages/home/report/ReportFooter.tsx @@ -73,7 +73,6 @@ function ReportFooter({ isEmptyChat = true, isReportReadyForDisplay = true, isComposerFullSize = false, - workspaceTooltip, onComposerBlur, onComposerFocus, }: ReportFooterProps) {