diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 8135c6a27a30..725ba747497c 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -7937,7 +7937,6 @@ const CONST = { DEBUG: 'ContextMenu-Debug', DELETE: 'ContextMenu-Delete', MENU: 'ContextMenu-Menu', - EXPLAIN: 'ContextMenu-Explain', }, MORE_MENU: { MORE_BUTTON: 'MoreMenu-MoreButton', diff --git a/src/components/RenderHTML.tsx b/src/components/RenderHTML.tsx index 2372adac3df8..83157ebbb413 100644 --- a/src/components/RenderHTML.tsx +++ b/src/components/RenderHTML.tsx @@ -12,16 +12,13 @@ type RenderHTMLProps = { /** Callback to handle link press */ onLinkPress?: LinkPressHandler; - - /** Whether the rendered text should be selectable */ - isSelectable?: boolean; }; // We are using the explicit composite architecture for performance gains. // Configuration for RenderHTML is handled in a top-level component providing // context to RenderHTMLSource components. See https://git.io/JRcZb // The provider is available at src/components/HTMLEngineProvider/ -function RenderHTML({html: htmlParam, onLinkPress, isSelectable}: RenderHTMLProps) { +function RenderHTML({html: htmlParam, onLinkPress}: RenderHTMLProps) { const {windowWidth} = useWindowDimensions(); const html = useMemo(() => { return ( @@ -52,7 +49,7 @@ function RenderHTML({html: htmlParam, onLinkPress, isSelectable}: RenderHTMLProp return onLinkPress ? ( {htmlSource} diff --git a/src/languages/de.ts b/src/languages/de.ts index 84d6ea89131c..dcb5ecbe73c4 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -903,8 +903,6 @@ const translations: TranslationDeepObject = { return `Sind Sie sicher, dass Sie diesen ${type} löschen möchten?`; }, onlyVisible: 'Nur sichtbar für', - explain: 'Erklären', - explainMessage: 'Bitte erkläre mir das.', replyInThread: 'Im Thread antworten', joinThread: 'Thread beitreten', leaveThread: 'Thread verlassen', @@ -1499,7 +1497,6 @@ const translations: TranslationDeepObject = { splitByDate: 'Nach Datum aufteilen', routedDueToDEW: ({to}: RoutedDueToDEWParams) => `bericht aufgrund eines benutzerdefinierten Genehmigungsworkflows an ${to} weitergeleitet`, timeTracking: {hoursAt: (hours: number, rate: string) => `${hours} ${hours === 1 ? 'Stunde' : 'Stunden'} @ ${rate} / Stunde`, hrs: 'Std.'}, - AskToExplain: '. Erklären ✨', }, transactionMerge: { listPage: { diff --git a/src/languages/en.ts b/src/languages/en.ts index ee67f27a85f5..b8f6b2991e0e 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -889,8 +889,6 @@ const translations = { return `Are you sure you want to delete this ${type}?`; }, onlyVisible: 'Only visible to', - explain: 'Explain', - explainMessage: 'Please explain this to me.', replyInThread: 'Reply in thread', joinThread: 'Join thread', leaveThread: 'Leave thread', @@ -1483,7 +1481,6 @@ const translations = { hoursAt: (hours: number, rate: string) => `${hours} ${hours === 1 ? 'hour' : 'hours'} @ ${rate} / hour`, hrs: 'hrs', }, - AskToExplain: '. Explain ✨', }, transactionMerge: { listPage: { diff --git a/src/languages/es.ts b/src/languages/es.ts index 7ede5aa91f98..7a93665054c4 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -619,8 +619,6 @@ const translations: TranslationDeepObject = { return `¿Estás seguro de que quieres eliminar este ${type}?`; }, onlyVisible: 'Visible sólo para', - explain: 'Explicar', - explainMessage: 'Por favor explícame esto.', replyInThread: 'Responder en el hilo', joinThread: 'Unirse al hilo', leaveThread: 'Dejar hilo', @@ -1213,7 +1211,6 @@ const translations: TranslationDeepObject = { hoursAt: (hours: number, rate: string) => `${hours} ${hours === 1 ? 'hora' : 'horas'} a ${rate} / hora`, hrs: 'h', }, - AskToExplain: '. Explicar ✨', }, transactionMerge: { listPage: { diff --git a/src/languages/fr.ts b/src/languages/fr.ts index 8eb300d4e3a2..e0ed752099d3 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -905,8 +905,6 @@ const translations: TranslationDeepObject = { return `Voulez-vous vraiment supprimer ce(tte) ${type} ?`; }, onlyVisible: 'Visible uniquement pour', - explain: 'Expliquer', - explainMessage: 'Veuillez m’expliquer cela.', replyInThread: 'Répondre dans le fil', joinThread: 'Rejoindre la discussion', leaveThread: 'Quitter la discussion', @@ -1500,7 +1498,6 @@ const translations: TranslationDeepObject = { splitByDate: 'Scinder par date', routedDueToDEW: ({to}: RoutedDueToDEWParams) => `rapport acheminé vers ${to} en raison d'un workflow d'approbation personnalisé`, timeTracking: {hoursAt: (hours: number, rate: string) => `${hours} ${hours === 1 ? 'heure' : 'heures'} @ ${rate} / heure`, hrs: 'h'}, - AskToExplain: '. Expliquer ✨', }, transactionMerge: { listPage: { diff --git a/src/languages/it.ts b/src/languages/it.ts index ee9dfe181b75..f6713dafc323 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -903,8 +903,6 @@ const translations: TranslationDeepObject = { return `Sei sicuro di voler eliminare questo ${type}?`; }, onlyVisible: 'Visibile solo a', - explain: 'Spiega', - explainMessage: 'Per favore, spiegami questo.', replyInThread: 'Rispondi nel thread', joinThread: 'Unisciti al thread', leaveThread: 'Abbandona conversazione', @@ -1494,7 +1492,6 @@ const translations: TranslationDeepObject = { splitByDate: 'Dividi per data', routedDueToDEW: ({to}: RoutedDueToDEWParams) => `rapporto inoltrato a ${to} a causa del flusso di lavoro di approvazione personalizzato`, timeTracking: {hoursAt: (hours: number, rate: string) => `${hours} ${hours === 1 ? 'ora' : 'ore'} @ ${rate} / ora`, hrs: 'ore'}, - AskToExplain: '. Spiegare ✨', }, transactionMerge: { listPage: { diff --git a/src/languages/ja.ts b/src/languages/ja.ts index b40dfa35c3ab..1e0f1465b5e0 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -901,8 +901,6 @@ const translations: TranslationDeepObject = { return `この${type}を削除してもよろしいですか?`; }, onlyVisible: 'にのみ表示', - explain: '説明する', - explainMessage: 'これを説明してください。', replyInThread: 'スレッドに返信', joinThread: 'スレッドに参加', leaveThread: 'スレッドから退出', @@ -1493,7 +1491,6 @@ const translations: TranslationDeepObject = { splitByDate: '日付で分割', routedDueToDEW: ({to}: RoutedDueToDEWParams) => `カスタム承認ワークフローにより、${to} 宛にルーティングされたレポート`, timeTracking: {hoursAt: (hours: number, rate: string) => `${hours} ${hours === 1 ? '時間' : '時間'} @ ${rate} / 時間`, hrs: '時間'}, - AskToExplain: '. 説明する ✨', }, transactionMerge: { listPage: { diff --git a/src/languages/nl.ts b/src/languages/nl.ts index 6139f13de42b..ff93ef78706e 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -903,8 +903,6 @@ const translations: TranslationDeepObject = { return `Weet je zeker dat je dit ${type} wilt verwijderen?`; }, onlyVisible: 'Alleen zichtbaar voor', - explain: 'Uitleggen', - explainMessage: 'Leg dit alstublieft aan mij uit.', replyInThread: 'Antwoord in thread', joinThread: 'Deelnemen aan thread', leaveThread: 'Thread verlaten', @@ -1493,7 +1491,6 @@ const translations: TranslationDeepObject = { splitByDate: 'Splitsen op datum', routedDueToDEW: ({to}: RoutedDueToDEWParams) => `rapport doorgestuurd naar ${to} vanwege aangepaste goedkeuringsworkflow`, timeTracking: {hoursAt: (hours: number, rate: string) => `${hours} ${hours === 1 ? 'uur' : 'uren'} @ ${rate} / uur`, hrs: 'uur'}, - AskToExplain: '. Uitleggen ✨', }, transactionMerge: { listPage: { diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 3fb33efbe925..dee93876af4f 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -902,8 +902,6 @@ const translations: TranslationDeepObject = { return `Czy na pewno chcesz usunąć ten element typu ${type}?`; }, onlyVisible: 'Widoczne tylko dla', - explain: 'Wyjaśnij', - explainMessage: 'Proszę, wyjaśnij mi to.', replyInThread: 'Odpowiedz w wątku', joinThread: 'Dołącz do wątku', leaveThread: 'Opuść wątek', @@ -1491,7 +1489,6 @@ const translations: TranslationDeepObject = { splitByDate: 'Podziel według daty', routedDueToDEW: ({to}: RoutedDueToDEWParams) => `raport przekazany do ${to} z powodu niestandardowego procesu zatwierdzania`, timeTracking: {hoursAt: (hours: number, rate: string) => `${hours} ${hours === 1 ? 'godzina' : 'godziny'} @ ${rate} / godzinę`, hrs: 'godz.'}, - AskToExplain: '. Wyjaśnij ✨', }, transactionMerge: { listPage: { diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index 4b17be3565d8..5ee2a3e7e70b 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -902,8 +902,6 @@ const translations: TranslationDeepObject = { return `Tem certeza de que deseja excluir este(a) ${type}?`; }, onlyVisible: 'Visível apenas para', - explain: 'Explicar', - explainMessage: 'Por favor, explique isso para mim.', replyInThread: 'Responder na conversa', joinThread: 'Participar da conversa', leaveThread: 'Sair da conversa', @@ -1490,7 +1488,6 @@ const translations: TranslationDeepObject = { splitByDate: 'Dividir por data', routedDueToDEW: ({to}: RoutedDueToDEWParams) => `relatório encaminhado para ${to} devido ao fluxo de trabalho de aprovação personalizado`, timeTracking: {hoursAt: (hours: number, rate: string) => `${hours} ${hours === 1 ? 'hora' : 'horas'} @ ${rate} / hora`, hrs: 'h'}, - AskToExplain: '. Explicar ✨', }, transactionMerge: { listPage: { diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index 5db7cd4b0d3f..dd16d1586472 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -896,8 +896,6 @@ const translations: TranslationDeepObject = { return `您确定要删除此${type}吗?`; }, onlyVisible: '仅对…可见', - explain: '解释', - explainMessage: '请为我解释一下。', replyInThread: '在线程中回复', joinThread: '加入话题', leaveThread: '离开会话', @@ -1468,7 +1466,6 @@ const translations: TranslationDeepObject = { splitByDate: '按日期拆分', routedDueToDEW: ({to}: RoutedDueToDEWParams) => `报告因自定义审批工作流而转发至 ${to}`, timeTracking: {hoursAt: (hours: number, rate: string) => `${hours} ${hours === 1 ? '小时' : '小时'} @ ${rate} / 小时`, hrs: '小时'}, - AskToExplain: '. 解释 ✨', }, transactionMerge: { listPage: { diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index b836b48c78cc..2edc758c96f7 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -1469,74 +1469,43 @@ function navigateToAndOpenReportWithAccountIDs(participantAccountIDs: number[], } /** - * This will navigate to an existing thread, or create a new one if necessary. - * If the child report doesn't exist, creates an optimistic report and calls openReport(). + * This will navigate to an existing thread, or create a new one if necessary * * @param childReportID The reportID we are trying to open * @param parentReportAction the parent comment of a thread * @param parentReportID The reportID of the parent */ function navigateToAndOpenChildReport(childReportID: string | undefined, parentReportAction: Partial = {}, parentReportID?: string) { - const existingChildReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${childReportID}`]; - const report = existingChildReport ?? buildOptimisticChildReport(childReportID, parentReportAction, parentReportID); - - if (!existingChildReport) { - const participantLogins = PersonalDetailsUtils.getLoginsByAccountIDs(Object.keys(report.participants ?? {}).map(Number)); - openReport(report.reportID, '', participantLogins, report, parentReportAction.reportActionID, undefined, undefined, undefined, true); - } - - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID, undefined, undefined, Navigation.getActiveRoute())); -} - -/** - * Builds an optimistic child report and returns it without checking for existing reports. - */ -function buildOptimisticChildReport(childReportID: string | undefined, parentReportAction: Partial = {}, parentReportID?: string): Report { - const participantAccountIDs = [...new Set([deprecatedCurrentUserAccountID, Number(parentReportAction.actorAccountID)])]; - const parentReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`]; - // Threads from DMs and selfDMs don't have a chatType. All other threads inherit the chatType from their parent - const childReportChatType = parentReport && isSelfDM(parentReport) ? undefined : parentReport?.chatType; - const newChat = buildOptimisticChatReport({ - participantList: participantAccountIDs, - reportName: ReportActionsUtils.getReportActionText(parentReportAction), - chatType: childReportChatType, - policyID: parentReport?.policyID ?? CONST.POLICY.OWNER_EMAIL_FAKE, - ownerAccountID: CONST.POLICY.OWNER_ACCOUNT_ID_FAKE, - oldPolicyName: parentReport?.policyName ?? '', - notificationPreference: getChildReportNotificationPreference(parentReportAction), - parentReportActionID: parentReportAction.reportActionID, - parentReportID, - optimisticReportID: childReportID, - }); - - Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${childReportID ?? newChat.reportID}`, newChat); - - return newChat; -} + const childReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${childReportID}`]; + if (childReport?.reportID) { + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(childReportID, undefined, undefined, Navigation.getActiveRoute())); + } else { + const participantAccountIDs = [...new Set([deprecatedCurrentUserAccountID, Number(parentReportAction.actorAccountID)])]; + const parentReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`]; + // Threads from DMs and selfDMs don't have a chatType. All other threads inherit the chatType from their parent + const childReportChatType = parentReport && isSelfDM(parentReport) ? undefined : parentReport?.chatType; + const newChat = buildOptimisticChatReport({ + participantList: participantAccountIDs, + reportName: ReportActionsUtils.getReportActionText(parentReportAction), + chatType: childReportChatType, + policyID: parentReport?.policyID ?? CONST.POLICY.OWNER_EMAIL_FAKE, + ownerAccountID: CONST.POLICY.OWNER_ACCOUNT_ID_FAKE, + oldPolicyName: parentReport?.policyName ?? '', + notificationPreference: getChildReportNotificationPreference(parentReportAction), + parentReportActionID: parentReportAction.reportActionID, + parentReportID, + optimisticReportID: childReportID, + }); -/** - * Creates an explanation thread for a report action with reasoning - * Adds a "Please explain this to me." comment from the user - */ -function explain(reportAction: OnyxEntry, originalReportID: string | undefined, translate: LocalizedTranslate, timezone: Timezone = CONST.DEFAULT_TIME_ZONE) { - if (!originalReportID || !reportAction) { - return; - } + if (!childReportID) { + const participantLogins = PersonalDetailsUtils.getLoginsByAccountIDs(Object.keys(newChat.participants ?? {}).map(Number)); + openReport(newChat.reportID, '', participantLogins, newChat, parentReportAction.reportActionID, undefined, undefined, undefined, true); + } else { + Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${childReportID}`, newChat); + } - // Check if explanation thread report already exists - const existingChildReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportAction.childReportID}`]; - const report = existingChildReport ?? buildOptimisticChildReport(reportAction.childReportID, reportAction, originalReportID); - if (!existingChildReport) { - const participantLogins = PersonalDetailsUtils.getLoginsByAccountIDs(Object.keys(report.participants ?? {}).map(Number)); - openReport(report.reportID, '', participantLogins, report, reportAction.reportActionID, undefined, undefined, undefined, true); + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(newChat.reportID, undefined, undefined, Navigation.getActiveRoute())); } - - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID, undefined, undefined, Navigation.getActiveRoute())); - // Schedule adding the explanation comment on the next animation frame - // so it runs immediately after navigation completes. - requestAnimationFrame(() => { - addComment(report, report.reportID, [], translate('reportActionContextMenu.explainMessage'), timezone, true); - }); } /** @@ -6453,7 +6422,6 @@ export { doneCheckingPublicRoom, downloadReportPDF, editReportComment, - explain, expandURLPreview, exportReportToCSV, exportReportToPDF, @@ -6478,7 +6446,6 @@ export { markAsManuallyExported, markCommentAsUnread, navigateToAndOpenChildReport, - buildOptimisticChildReport, navigateToAndOpenReport, navigateToAndOpenReportWithAccountIDs, navigateToConciergeChat, diff --git a/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx b/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx index 457f739bde86..b0c80ac45b24 100755 --- a/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx +++ b/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx @@ -150,7 +150,6 @@ function BaseReportActionContextMenu({ 'Bug', 'Trashcan', 'Checkmark', - 'Concierge', ] as const); const StyleUtils = useStyleUtils(); const {translate, getLocalDateFromDatetime} = useLocalize(); @@ -237,7 +236,6 @@ function BaseReportActionContextMenu({ const {transactions} = useTransactionsAndViolationsForReport(childReport?.reportID); const [tryNewDot] = useOnyx(ONYXKEYS.NVP_TRY_NEW_DOT, {canBeMissing: false}); const isTryNewDotNVPDismissed = !!tryNewDot?.classicRedirect?.dismissed; - const currentUserPersonalDetails = useCurrentUserPersonalDetails(); const isMoneyRequest = useMemo(() => ReportUtilsIsMoneyRequest(childReport), [childReport]); const isTrackExpenseReport = ReportUtilsIsTrackExpenseReport(childReport); @@ -410,7 +408,6 @@ function BaseReportActionContextMenu({ translate, harvestReport, currentUserAccountID, - currentUserPersonalDetails, }; if ('renderContent' in contextAction) { diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index 455d72f64cf9..017607b74134 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -10,7 +10,6 @@ import type {ExpensifyIconName} from '@components/Icon/ExpensifyIconLoader'; import type {LocaleContextProps, LocalizedTranslate} from '@components/LocaleContextProvider'; import MiniQuickEmojiReactions from '@components/Reactions/MiniQuickEmojiReactions'; import QuickEmojiReactions from '@components/Reactions/QuickEmojiReactions'; -import type useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; import addEncryptedAuthTokenToURL from '@libs/addEncryptedAuthTokenToURL'; import {isMobileSafari} from '@libs/Browser'; import Clipboard from '@libs/Clipboard'; @@ -147,7 +146,6 @@ import {getTaskCreatedMessage, getTaskReportActionMessage} from '@libs/TaskUtils import {setDownload} from '@userActions/Download'; import { deleteReportActionDraft, - explain, markCommentAsUnread, navigateToAndOpenChildReport, openReport, @@ -244,7 +242,6 @@ type ContextMenuActionPayload = { policyTags: OnyxEntry; translate: LocalizedTranslate; harvestReport?: OnyxEntry; - currentUserPersonalDetails: ReturnType; }; type OnPress = (closePopover: boolean, payload: ContextMenuActionPayload, selection?: string, reportID?: string, draftMessage?: string) => void; @@ -263,21 +260,7 @@ type ContextMenuActionWithIcon = WithSentryLabel & { | IconAsset | Extract< ExpensifyIconName, - | 'Download' - | 'ThreeDots' - | 'ChatBubbleReply' - | 'ChatBubbleUnread' - | 'Mail' - | 'Pencil' - | 'Stopwatch' - | 'Bell' - | 'Copy' - | 'LinkCopy' - | 'Pin' - | 'Flag' - | 'Bug' - | 'Trashcan' - | 'Concierge' + 'Download' | 'ThreeDots' | 'ChatBubbleReply' | 'ChatBubbleUnread' | 'Mail' | 'Pencil' | 'Stopwatch' | 'Bell' | 'Copy' | 'LinkCopy' | 'Pin' | 'Flag' | 'Bug' | 'Trashcan' >; successTextTranslateKey?: TranslationPaths; successIcon?: @@ -299,7 +282,6 @@ type ContextMenuActionWithIcon = WithSentryLabel & { | 'Bug' | 'Trashcan' | 'ThreeDots' - | 'Concierge' >; onPress: OnPress; getDescription: GetDescription; @@ -414,40 +396,6 @@ const ContextMenuActions: ContextMenuAction[] = [ getDescription: () => {}, sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.MARK_AS_UNREAD, }, - { - isAnonymousAction: false, - textTranslateKey: 'reportActionContextMenu.explain', - icon: 'Concierge', - shouldShow: ({type, reportAction, isArchivedRoom}): boolean => { - if (type !== CONST.CONTEXT_MENU_TYPES.REPORT_ACTION || isArchivedRoom || !reportAction) { - return false; - } - - const originalMessage = getOriginalMessage(reportAction); - const hasReasoning = !!(originalMessage && typeof originalMessage === 'object' && 'reasoning' in originalMessage && originalMessage.reasoning); - - return hasReasoning; - }, - onPress: (closePopover, {reportAction, reportID, translate, currentUserPersonalDetails}) => { - if (!reportID) { - return; - } - - const originalReportID = getOriginalReportID(reportID, reportAction); - if (closePopover) { - hideContextMenu(false, () => { - KeyboardUtils.dismiss().then(() => { - explain(reportAction, originalReportID, translate, currentUserPersonalDetails?.timezone); - }); - }); - return; - } - - explain(reportAction, originalReportID, translate, currentUserPersonalDetails?.timezone); - }, - getDescription: () => {}, - sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.EXPLAIN, - }, { isAnonymousAction: false, textTranslateKey: 'reportActionContextMenu.markAsRead', diff --git a/src/pages/home/report/PureReportActionItem.tsx b/src/pages/home/report/PureReportActionItem.tsx index b519ce5d0f59..05bbb7dba144 100644 --- a/src/pages/home/report/PureReportActionItem.tsx +++ b/src/pages/home/report/PureReportActionItem.tsx @@ -172,7 +172,6 @@ import { getForcedCorporateUpgradeMessage, getMovedActionMessage, getMovedTransactionMessage, - getOriginalReportID, getPolicyChangeMessage, getRejectedReportMessage, getUnreportedTransactionMessage, @@ -199,7 +198,6 @@ import {acceptJoinRequest, declineJoinRequest} from '@userActions/Policy/Member' import { createTransactionThreadReport, expandURLPreview, - explain, resolveActionableMentionConfirmWhisper, resolveConciergeCategoryOptions, resolveConciergeDescriptionOptions, @@ -1252,24 +1250,9 @@ function PureReportActionItem({ } else if (isReimbursementDeQueuedOrCanceledAction(action)) { children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE) { - const originalMessage = getOriginalMessage(action); - const isAISource = !!originalMessage && typeof originalMessage === 'object' && 'source' in originalMessage && originalMessage.source === CONST.CATEGORY_SOURCE.AI; - const modifiedExpenseMessageText = isAISource ? `${modifiedExpenseMessage}${translate('iou.AskToExplain')}` : modifiedExpenseMessage; - children = ( - ${modifiedExpenseMessageText}`} - isSelectable={false} - onLinkPress={(_evt, href) => { - if (href !== `${CONST.DEEPLINK_BASE_URL}concierge/explain`) { - return; - } - - const actionOriginalReportID = getOriginalReportID(reportID, action); - explain(action, actionOriginalReportID, translate, personalDetail?.timezone); - }} - /> + ${modifiedExpenseMessage}`} /> ); } else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.SUBMITTED) || isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.SUBMITTED_AND_CLOSED) || isMarkAsClosedAction(action)) { diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 912dbdd73757..b677fc135661 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -730,9 +730,6 @@ type OriginalMessageModifiedExpense = { /** Whether the updated description was generated by AI */ aiGenerated?: boolean; - - /** The Concierge reasoning for the action */ - reasoning?: string; }; /** Model of a `travel update` report action */ @@ -1225,7 +1222,7 @@ type OriginalMessageMap = { Record, OriginalMessagePolicyChangeLog> & Record, OriginalMessageChangeLog>; -type OriginalMessage = T extends keyof OriginalMessageMap ? OriginalMessageMap[T] : never; +type OriginalMessage = OriginalMessageMap[T]; export default OriginalMessage; export type {