From 7373e06b0aff689f4d2a291c8ea9d7580c4ee3a6 Mon Sep 17 00:00:00 2001 From: jayeshmangwani Date: Fri, 3 Apr 2026 16:07:40 +0530 Subject: [PATCH 1/3] fixed setString for track user to show correct marked as done copy --- .../report/ContextMenu/BaseReportActionContextMenu.tsx | 4 +++- .../inbox/report/ContextMenu/ContextMenuActions.tsx | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pages/inbox/report/ContextMenu/BaseReportActionContextMenu.tsx b/src/pages/inbox/report/ContextMenu/BaseReportActionContextMenu.tsx index 8296647ad6a1..6f5c44cf82f1 100755 --- a/src/pages/inbox/report/ContextMenu/BaseReportActionContextMenu.tsx +++ b/src/pages/inbox/report/ContextMenu/BaseReportActionContextMenu.tsx @@ -1,4 +1,4 @@ -import {hasSeenTourSelector} from '@selectors/Onboarding'; +import {hasSeenTourSelector, isTrackIntentUserSelector} from '@selectors/Onboarding'; import {deepEqual} from 'fast-equals'; import type {RefObject} from 'react'; import React, {memo, useMemo, useRef, useState} from 'react'; @@ -241,6 +241,7 @@ function BaseReportActionContextMenu({ const {transactions} = useTransactionsAndViolationsForReport(childReport?.reportID); const [tryNewDot] = useOnyx(ONYXKEYS.NVP_TRY_NEW_DOT); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); + const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector}); const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector}); const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST); const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID); @@ -396,6 +397,7 @@ function BaseReportActionContextMenu({ card, originalReport, isTryNewDotNVPDismissed, + isTrackIntentUser, childReport, movedFromReport, movedToReport, diff --git a/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx b/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx index 3753fa96f429..059e729a4050 100644 --- a/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx @@ -22,6 +22,7 @@ import {getForReportAction} from '@libs/ModifiedExpenseMessage'; import Navigation from '@libs/Navigation/Navigation'; import Parser from '@libs/Parser'; import {getCleanedTagName, isPolicyAdmin} from '@libs/PolicyUtils'; +import {isSubmitAndClose} from '@libs/PolicyUtils'; import ReportActionComposeFocusManager from '@libs/ReportActionComposeFocusManager'; import stripFollowupListFromHtml from '@libs/ReportActionFollowupUtils/stripFollowupListFromHtml'; import { @@ -289,6 +290,7 @@ type ContextMenuActionPayload = { originalReport: OnyxEntry; isHarvestReport?: boolean; isTryNewDotNVPDismissed?: boolean; + isTrackIntentUser?: boolean; childReport?: OnyxEntry; movedFromReport?: OnyxEntry; movedToReport?: OnyxEntry; @@ -797,6 +799,7 @@ const ContextMenuActions: ContextMenuAction[] = [ originalReport, isHarvestReport, isTryNewDotNVPDismissed, + isTrackIntentUser, movedFromReport, movedToReport, childReport, @@ -982,7 +985,11 @@ const ContextMenuActions: ContextMenuAction[] = [ if (harvesting) { setClipboardMessage(translate('iou.automaticallySubmitted')); } else { - Clipboard.setString(translate('iou.submitted', getOriginalMessage(reportAction)?.message)); + Clipboard.setString( + isTrackIntentUser && isSubmitAndClose(policy) + ? translate('iou.markedAsDone', getOriginalMessage(reportAction)?.message) + : translate('iou.submitted', getOriginalMessage(reportAction)?.message), + ); } } else if (isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.APPROVED)) { const {automaticAction} = getOriginalMessage(reportAction) ?? {}; From aceed26d867c4532ca037421b7d96007524dc317 Mon Sep 17 00:00:00 2001 From: jayeshmangwani Date: Fri, 3 Apr 2026 16:23:34 +0530 Subject: [PATCH 2/3] Fixed lint issue of multiple imports of PolicyUtils --- src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx b/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx index 059e729a4050..63b3f7f196c3 100644 --- a/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx @@ -21,8 +21,7 @@ import {formatPhoneNumber as formatPhoneNumberPhoneUtils} from '@libs/LocalePhon import {getForReportAction} from '@libs/ModifiedExpenseMessage'; import Navigation from '@libs/Navigation/Navigation'; import Parser from '@libs/Parser'; -import {getCleanedTagName, isPolicyAdmin} from '@libs/PolicyUtils'; -import {isSubmitAndClose} from '@libs/PolicyUtils'; +import {getCleanedTagName, isPolicyAdmin, isSubmitAndClose} from '@libs/PolicyUtils'; import ReportActionComposeFocusManager from '@libs/ReportActionComposeFocusManager'; import stripFollowupListFromHtml from '@libs/ReportActionFollowupUtils/stripFollowupListFromHtml'; import { From 1453a5ac888e3d5f0253ef2ccfc7744f2090135e Mon Sep 17 00:00:00 2001 From: jayeshmangwani Date: Fri, 3 Apr 2026 17:17:15 +0530 Subject: [PATCH 3/3] fixed the sidebar last message to show the updated track message, and added logic to differentiate header messages for admin vs. member workspace chats. --- src/components/LHNOptionsList/OptionRowLHNData.tsx | 3 +++ src/components/ReportWelcomeText.tsx | 3 +++ src/libs/SidebarUtils.ts | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/LHNOptionsList/OptionRowLHNData.tsx b/src/components/LHNOptionsList/OptionRowLHNData.tsx index 47c918bc926f..57716bbaa9f2 100644 --- a/src/components/LHNOptionsList/OptionRowLHNData.tsx +++ b/src/components/LHNOptionsList/OptionRowLHNData.tsx @@ -1,3 +1,4 @@ +import {isTrackIntentUserSelector} from '@selectors/Onboarding'; import React, {useCallback, useMemo} from 'react'; import type {OnyxCollection} from 'react-native-onyx'; import useReportPreviewSenderID from '@components/ReportActionAvatars/useReportPreviewSenderID'; @@ -118,6 +119,7 @@ function OptionRowLHNData({ const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID); const {login} = useCurrentUserPersonalDetails(); const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${fullReport?.policyID}`); + const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector}); const card = useGetExpensifyCardFromReportAction({reportAction: lastAction, policyID: fullReport?.policyID}); @@ -156,6 +158,7 @@ function OptionRowLHNData({ reportAttributesDerived, policyTags, currentUserLogin: login ?? '', + isTrackIntentUser, }); // For single-sender IOUs, trim to the sender's avatar to match the header. diff --git a/src/components/ReportWelcomeText.tsx b/src/components/ReportWelcomeText.tsx index 384b5dd91b1f..1f2a50bb09bd 100644 --- a/src/components/ReportWelcomeText.tsx +++ b/src/components/ReportWelcomeText.tsx @@ -2,6 +2,7 @@ import {isTrackIntentUserSelector} from '@selectors/Onboarding'; import React from 'react'; import {View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx'; +import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; import useEnvironment from '@hooks/useEnvironment'; import useLocalize from '@hooks/useLocalize'; import useMappedPersonalDetails, {personalDetailMapper} from '@hooks/useMappedPersonalDetails'; @@ -66,6 +67,7 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) { const participantAccountIDs = getParticipantsAccountIDsForDisplay(report, undefined, true, true, reportMetadata); const moneyRequestOptions = temporary_getMoneyRequestOptions(report, policy, participantAccountIDs, betas, isReportArchived, isRestrictedToPreferredPolicy); const policyName = getPolicyName({report}); + const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails(); const filteredOptions = moneyRequestOptions.filter( ( @@ -127,6 +129,7 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) { shouldShowUsePlusButtonText, additionalText, isTrackIntentUser: !!isTrackIntentUser, + currentUserAccountID, }); return ( diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index d8ba266c94ce..85efb4ad4851 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -211,6 +211,7 @@ type WelcomeMessageParams = { shouldShowUsePlusButtonText?: boolean; additionalText?: string; isTrackIntentUser?: boolean; + currentUserAccountID?: number; }; function compareStringDates(a: string, b: string): 0 | 1 | -1 { @@ -697,6 +698,7 @@ function getOptionData({ reportAttributesDerived, policyTags, currentUserLogin, + isTrackIntentUser, }: { report: OnyxEntry; oneTransactionThreadReport: OnyxEntry; @@ -721,6 +723,7 @@ function getOptionData({ reportAttributesDerived?: ReportAttributesDerivedValue['reports']; policyTags?: OnyxEntry; currentUserLogin: string; + isTrackIntentUser?: boolean; }): OptionData | undefined { // When a user signs out, Onyx is cleared. Due to the lazy rendering with a virtual list, it's possible for // this method to be called after the Onyx data has been cleared out. In that case, it's fine to do @@ -1164,6 +1167,8 @@ function getOptionData({ conciergeReportID, reportAttributes: reportAttributesDerived, isReportArchived, + isTrackIntentUser, + currentUserAccountID, }).messageText ?? translate('report.noActivityYet'), ); } @@ -1270,6 +1275,7 @@ function getWelcomeMessage(params: WelcomeMessageParams): WelcomeMessage { shouldShowUsePlusButtonText = false, additionalText = '', isTrackIntentUser = false, + currentUserAccountID, } = params; const welcomeMessage: WelcomeMessage = {}; @@ -1285,7 +1291,7 @@ function getWelcomeMessage(params: WelcomeMessageParams): WelcomeMessage { if (policy?.description) { welcomeMessage.messageHtml = policy.description; welcomeMessage.messageText = Parser.htmlToText(welcomeMessage.messageHtml); - } else if (isTrackIntentUser) { + } else if (isTrackIntentUser && report?.ownerAccountID === currentUserAccountID) { welcomeMessage.messageHtml = translate('reportActionsView.beginningOfChatHistoryPolicyExpenseChatTrack'); welcomeMessage.messageText = Parser.htmlToText(welcomeMessage.messageHtml); } else {