From 4ad526ac99bb4599d44184e36ef42776a5e93912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Miko=C5=82ajczak?= Date: Wed, 13 Aug 2025 09:45:34 +0200 Subject: [PATCH 1/6] remove isBlockedFromConcierge from ComposerWithSuggestions --- .../ComposerWithSuggestions.tsx | 10 +++------- .../report/ReportActionCompose/ReportActionCompose.tsx | 3 +-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx index ea17a85766d9..c8f09dfc435b 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx @@ -101,11 +101,8 @@ type ComposerWithSuggestionsProps = Partial & { /** Function to display a file in a modal */ displayFilesInModal: (file: FileObject[]) => void; - /** Whether the user is blocked from concierge */ - isBlockedFromConcierge: boolean; - - /** Whether the input is disabled */ - disabled: boolean; + /** Whether the input is disabled, defaults to false */ + disabled?: boolean; /** Function to set whether the comment is empty */ setIsCommentEmpty: (isCommentEmpty: boolean) => void; @@ -215,7 +212,6 @@ function ComposerWithSuggestions( isMenuVisible, inputPlaceholder, displayFilesInModal, - isBlockedFromConcierge, disabled, setIsCommentEmpty, handleSendMessage, @@ -815,7 +811,7 @@ function ComposerWithSuggestions( displayFilesInModal([file]); }} onClear={onClear} - isDisabled={isBlockedFromConcierge || disabled} + isDisabled={disabled} selection={selection} onSelectionChange={onSelectionChange} isComposerFullSize={isComposerFullSize} diff --git a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx index 72404c18fa8d..e3aba8be27da 100644 --- a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx +++ b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx @@ -660,8 +660,7 @@ function ReportActionCompose({ setIsFullComposerAvailable={setIsFullComposerAvailable} displayFilesInModal={displayFilesInModal} onCleared={submitForm} - isBlockedFromConcierge={isBlockedFromConcierge} - disabled={disabled} + disabled={disabled || isBlockedFromConcierge} setIsCommentEmpty={setIsCommentEmpty} handleSendMessage={handleSendMessage} shouldShowComposeInput={shouldShowComposeInput} From 8b4b9bad7aeebf0c0070d8302642c8bfa91e1eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Miko=C5=82ajczak?= Date: Wed, 13 Aug 2025 09:48:39 +0200 Subject: [PATCH 2/6] remove disabled from ReportActionCompose --- .../ReportActionCompose/ReportActionCompose.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx index e3aba8be27da..605a6913a82a 100644 --- a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx +++ b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx @@ -108,9 +108,6 @@ type ReportActionComposeProps = Pick void; - /** Should the input be disabled */ - disabled?: boolean; - /** Whether the main composer was hidden */ didHideComposerInput?: boolean; }; @@ -125,7 +122,6 @@ const willBlurTextInputOnTapOutside = willBlurTextInputOnTapOutsideFunc(); let onSubmitAction = noop; function ReportActionCompose({ - disabled = false, isComposerFullSize = false, onSubmit, pendingAction, @@ -393,11 +389,11 @@ function ReportActionCompose({ const isGroupPolicyReport = useMemo(() => !!report?.policyID && report.policyID !== CONST.POLICY.ID_FAKE, [report]); const reportRecipientAccountIDs = getReportRecipientAccountIDs(report, currentUserPersonalDetails.accountID); const reportRecipient = personalDetails?.[reportRecipientAccountIDs[0]]; - const shouldUseFocusedColor = !isBlockedFromConcierge && !disabled && isFocused; + const shouldUseFocusedColor = !isBlockedFromConcierge && isFocused; const hasReportRecipient = !isEmptyObject(reportRecipient); - const isSendDisabled = isCommentEmpty || isBlockedFromConcierge || !!disabled || !!exceededMaxLength; + const isSendDisabled = isCommentEmpty || isBlockedFromConcierge || !!exceededMaxLength; // Note: using JS refs is not well supported in reanimated, thus we need to store the function in a shared value // useSharedValue on web doesn't support functions, so we need to wrap it in an object. @@ -622,7 +618,7 @@ function ReportActionCompose({ isFullComposerAvailable={isFullComposerAvailable} isComposerFullSize={isComposerFullSize} isBlockedFromConcierge={isBlockedFromConcierge} - disabled={disabled} + disabled={false} setMenuVisibility={setMenuVisibility} isMenuVisible={isMenuVisible} onTriggerAttachmentPicker={onTriggerAttachmentPicker} @@ -660,7 +656,7 @@ function ReportActionCompose({ setIsFullComposerAvailable={setIsFullComposerAvailable} displayFilesInModal={displayFilesInModal} onCleared={submitForm} - disabled={disabled || isBlockedFromConcierge} + disabled={isBlockedFromConcierge} setIsCommentEmpty={setIsCommentEmpty} handleSendMessage={handleSendMessage} shouldShowComposeInput={shouldShowComposeInput} @@ -695,7 +691,7 @@ function ReportActionCompose({ {canUseTouchScreen() && isMediumScreenWidth ? null : ( { if (isNavigating) { return; From 639ca6316506ab0eae7620b7463c45bdd7b68cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Miko=C5=82ajczak?= Date: Wed, 13 Aug 2025 09:53:19 +0200 Subject: [PATCH 3/6] remove isReportReadyForDisplay from ReportFooter and its descendants --- .../report/ReportActionCompose/ReportActionCompose.tsx | 8 ++------ src/pages/home/report/ReportFooter.tsx | 7 +------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx index 605a6913a82a..7aebf59c968f 100644 --- a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx +++ b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx @@ -99,9 +99,6 @@ type ReportActionComposeProps = Pick void; @@ -127,7 +124,6 @@ function ReportActionCompose({ pendingAction, report, reportID, - isReportReadyForDisplay = true, lastReportAction, onComposerFocus, onComposerBlur, @@ -409,13 +405,13 @@ function ReportActionCompose({ throw new Error('The composerRefShared.clear function is not set yet. This should never happen, and indicates a developer error.'); } - if (isSendDisabled || !isReportReadyForDisplay) { + if (isSendDisabled) { return; } // This will cause onCleared to be triggered where we actually send the message clearComposer(); - }, [isSendDisabled, isReportReadyForDisplay, composerRefShared]); + }, [isSendDisabled, composerRefShared]); const measureComposer = useCallback( (e: LayoutChangeEvent) => { diff --git a/src/pages/home/report/ReportFooter.tsx b/src/pages/home/report/ReportFooter.tsx index 1e7257e7f260..4d9b4fb015d7 100644 --- a/src/pages/home/report/ReportFooter.tsx +++ b/src/pages/home/report/ReportFooter.tsx @@ -62,9 +62,6 @@ type ReportFooterProps = { /** The pending action when we are adding a chat */ pendingAction?: PendingAction; - /** Whether the report is ready for display */ - isReportReadyForDisplay?: boolean; - /** Whether the composer is in full size */ isComposerFullSize?: boolean; @@ -81,7 +78,7 @@ function ReportFooter({ report = {reportID: '-1'}, reportMetadata, policy, - isReportReadyForDisplay = true, + isComposerFullSize = false, onComposerBlur, onComposerFocus, @@ -234,7 +231,6 @@ function ReportFooter({ lastReportAction={lastReportAction} pendingAction={pendingAction} isComposerFullSize={isComposerFullSize} - isReportReadyForDisplay={isReportReadyForDisplay} didHideComposerInput={didHideComposerInput} reportTransactions={reportTransactions} /> @@ -254,7 +250,6 @@ export default memo( prevProps.pendingAction === nextProps.pendingAction && prevProps.isComposerFullSize === nextProps.isComposerFullSize && prevProps.lastReportAction === nextProps.lastReportAction && - prevProps.isReportReadyForDisplay === nextProps.isReportReadyForDisplay && deepEqual(prevProps.reportMetadata, nextProps.reportMetadata) && deepEqual(prevProps.policy?.employeeList, nextProps.policy?.employeeList) && deepEqual(prevProps.policy?.role, nextProps.policy?.role) && From fa4f16226acbc7ee3c6d11aafd3bf7c38f15471b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Miko=C5=82ajczak?= Date: Wed, 13 Aug 2025 09:56:23 +0200 Subject: [PATCH 4/6] remove isBlockedFromConcierge from AttachmentPickerWithMenuItems --- .../AttachmentPickerWithMenuItems.tsx | 10 +++------- .../report/ReportActionCompose/ReportActionCompose.tsx | 3 +-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx b/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx index 858a34d0471f..7050fd8ce850 100644 --- a/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx +++ b/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx @@ -58,9 +58,6 @@ type AttachmentPickerWithMenuItemsProps = { /** Whether or not the composer is full size */ isComposerFullSize: boolean; - /** Whether or not the user is blocked from concierge */ - isBlockedFromConcierge: boolean; - /** Whether or not the attachment picker is disabled */ disabled?: boolean; @@ -112,7 +109,6 @@ function AttachmentPickerWithMenuItems({ isFullComposerAvailable, isComposerFullSize, reportID, - isBlockedFromConcierge, disabled, setMenuVisibility, isMenuVisible, @@ -373,7 +369,7 @@ function AttachmentPickerWithMenuItems({ setMenuVisibility(!isMenuVisible); }} style={styles.composerSizeButton} - disabled={isBlockedFromConcierge || disabled} + disabled={disabled} role={CONST.ROLE.BUTTON} accessibilityLabel={translate('common.create')} > @@ -400,7 +396,7 @@ function AttachmentPickerWithMenuItems({ // Keep focus on the composer when Collapse button is clicked. onMouseDown={(e) => e.preventDefault()} style={styles.composerSizeButton} - disabled={isBlockedFromConcierge || disabled} + disabled={disabled} role={CONST.ROLE.BUTTON} accessibilityLabel={translate('reportActionCompose.collapse')} > @@ -424,7 +420,7 @@ function AttachmentPickerWithMenuItems({ // Keep focus on the composer when Expand button is clicked. onMouseDown={(e) => e.preventDefault()} style={styles.composerSizeButton} - disabled={isBlockedFromConcierge || disabled} + disabled={disabled} role={CONST.ROLE.BUTTON} accessibilityLabel={translate('reportActionCompose.expand')} > diff --git a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx index 7aebf59c968f..ae2895467544 100644 --- a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx +++ b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx @@ -613,8 +613,7 @@ function ReportActionCompose({ reportParticipantIDs={reportParticipantIDs} isFullComposerAvailable={isFullComposerAvailable} isComposerFullSize={isComposerFullSize} - isBlockedFromConcierge={isBlockedFromConcierge} - disabled={false} + disabled={isBlockedFromConcierge} setMenuVisibility={setMenuVisibility} isMenuVisible={isMenuVisible} onTriggerAttachmentPicker={onTriggerAttachmentPicker} From e233bf7d9bfa144ba305fbf66b74017c188c8bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Miko=C5=82ajczak?= <62747088+kacper-mikolajczak@users.noreply.github.com> Date: Wed, 13 Aug 2025 10:49:54 +0200 Subject: [PATCH 5/6] Update src/pages/home/report/ReportFooter.tsx Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com> --- 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 4d9b4fb015d7..bba82ceceb97 100644 --- a/src/pages/home/report/ReportFooter.tsx +++ b/src/pages/home/report/ReportFooter.tsx @@ -78,7 +78,6 @@ function ReportFooter({ report = {reportID: '-1'}, reportMetadata, policy, - isComposerFullSize = false, onComposerBlur, onComposerFocus, From ec2313249d047e2093e7efc9ececbfc4ea608a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Miko=C5=82ajczak?= Date: Wed, 13 Aug 2025 10:52:46 +0200 Subject: [PATCH 6/6] remove disabled from perf tests --- tests/perf-test/ReportActionCompose.perf-test.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/perf-test/ReportActionCompose.perf-test.tsx b/tests/perf-test/ReportActionCompose.perf-test.tsx index 757e334286e0..e69f853ee784 100644 --- a/tests/perf-test/ReportActionCompose.perf-test.tsx +++ b/tests/perf-test/ReportActionCompose.perf-test.tsx @@ -83,7 +83,6 @@ function ReportActionComposeWrapper() { jest.fn()} reportID="1" - disabled={false} report={LHNTestUtils.getFakeReport()} isComposerFullSize />