Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,7 @@ const CONST = {
CONCIERGE_ICON_URL_2021: `${CLOUDFRONT_URL}/images/icons/concierge_2021.png`,
CONCIERGE_ICON_URL: `${CLOUDFRONT_URL}/images/icons/concierge_2022.png`,
COMPANY_CARD_PLAID: `${CLOUDFRONT_URL}/images/plaid/`,
CONCIERGE_EXPLAIN_LINK_PATH: '/concierge/explain',
UPWORK_URL: 'https://github.com/Expensify/App/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22',
DEEP_DIVE_EXPENSIFY_CARD: 'https://community.expensify.com/discussion/4848/deep-dive-expensify-card-and-quickbooks-online-auto-reconciliation-how-it-works',
DEEP_DIVE_ERECEIPTS: 'https://community.expensify.com/discussion/5542/deep-dive-what-are-ereceipts/',
Expand Down Expand Up @@ -8012,6 +8013,7 @@ const CONST = {
DEBUG: 'ContextMenu-Debug',
DELETE: 'ContextMenu-Delete',
MENU: 'ContextMenu-Menu',
EXPLAIN: 'ContextMenu-Explain',
},
MORE_MENU: {
MORE_BUTTON: 'MoreMenu-MoreButton',
Expand Down
7 changes: 5 additions & 2 deletions src/components/RenderHTML.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ 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}: RenderHTMLProps) {
function RenderHTML({html: htmlParam, onLinkPress, isSelectable}: RenderHTMLProps) {
const {windowWidth} = useWindowDimensions();
const html = useMemo(() => {
return (
Expand Down Expand Up @@ -49,7 +52,7 @@ function RenderHTML({html: htmlParam, onLinkPress}: RenderHTMLProps) {

return onLinkPress ? (
<RenderHTMLConfigProvider
defaultTextProps={{selectable: true, allowFontScaling: false}}
defaultTextProps={{selectable: isSelectable ?? true, allowFontScaling: false}}
renderersProps={renderersProps}
>
{htmlSource}
Expand Down
3 changes: 3 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,8 @@ const translations: TranslationDeepObject<typeof en> = {
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',
Expand Down Expand Up @@ -1480,6 +1482,7 @@ const translations: TranslationDeepObject<typeof en> = {
amountTooLargeError: 'Der Gesamtbetrag ist zu hoch. Verringere die Stunden oder reduziere den Satz.',
},
correctDistanceRateError: 'Beheben Sie den Fehler beim Entfernungssatz und versuchen Sie es erneut.',
AskToExplain: `. <a href="${CONST.CONCIERGE_EXPLAIN_LINK_PATH}"><strong>Erklären</strong></a> &#x2728;`,
},
transactionMerge: {
listPage: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,8 @@ 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',
Expand Down Expand Up @@ -1464,6 +1466,7 @@ const translations = {
amountTooLargeError: 'The total amount is too large. Lower the hours or reduce the rate.',
},
correctDistanceRateError: 'Fix the distance rate error and try again.',
AskToExplain: `. <a href="${CONST.CONCIERGE_EXPLAIN_LINK_PATH}"><strong>Explain</strong></a> &#x2728;`,
},
transactionMerge: {
listPage: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,8 @@ const translations: TranslationDeepObject<typeof en> = {
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',
Expand Down Expand Up @@ -1209,6 +1211,7 @@ const translations: TranslationDeepObject<typeof en> = {
amountTooLargeError: 'El importe total es demasiado alto. Reduce las horas o disminuye la tasa.',
},
correctDistanceRateError: 'Corrige el error de la tasa de distancia y vuelve a intentarlo.',
AskToExplain: `. <a href="${CONST.CONCIERGE_EXPLAIN_LINK_PATH}"><strong>Explicar</strong></a> &#x2728;`,
},
transactionMerge: {
listPage: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,8 @@ const translations: TranslationDeepObject<typeof en> = {
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',
Expand Down Expand Up @@ -1483,6 +1485,7 @@ const translations: TranslationDeepObject<typeof en> = {
amountTooLargeError: 'Le montant total est trop élevé. Réduisez le nombre d’heures ou diminuez le tarif.',
},
correctDistanceRateError: 'Corrigez l’erreur de taux de distance et réessayez.',
AskToExplain: `. <a href="${CONST.CONCIERGE_EXPLAIN_LINK_PATH}"><strong>Expliquer</strong></a> &#x2728;`,
},
transactionMerge: {
listPage: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,8 @@ const translations: TranslationDeepObject<typeof en> = {
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',
Expand Down Expand Up @@ -1477,6 +1479,7 @@ const translations: TranslationDeepObject<typeof en> = {
amountTooLargeError: 'L’importo totale è troppo elevato. Riduci le ore o diminuisci la tariffa.',
},
correctDistanceRateError: "Correggi l'errore nella tariffa della distanza e riprova.",
AskToExplain: `. <a href="${CONST.CONCIERGE_EXPLAIN_LINK_PATH}"><strong>Spiega</strong></a> &#x2728;`,
},
transactionMerge: {
listPage: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,8 @@ const translations: TranslationDeepObject<typeof en> = {
return `この${type}を削除してもよろしいですか?`;
},
onlyVisible: 'にのみ表示',
explain: '説明する',
explainMessage: 'これを説明してください。',
replyInThread: 'スレッドに返信',
joinThread: 'スレッドに参加',
leaveThread: 'スレッドから退出',
Expand Down Expand Up @@ -1475,6 +1477,7 @@ const translations: TranslationDeepObject<typeof en> = {
amountTooLargeError: '合計金額が大きすぎます。時間を減らすか、レートを下げてください。',
},
correctDistanceRateError: '距離レートのエラーを修正して、もう一度お試しください。',
AskToExplain: `. <a href="${CONST.CONCIERGE_EXPLAIN_LINK_PATH}"><strong>説明する</strong></a> &#x2728;`,
},
transactionMerge: {
listPage: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,8 @@ const translations: TranslationDeepObject<typeof en> = {
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',
Expand Down Expand Up @@ -1476,6 +1478,7 @@ const translations: TranslationDeepObject<typeof en> = {
amountTooLargeError: 'Het totale bedrag is te hoog. Verlaag het aantal uren of verlaag het tarief.',
},
correctDistanceRateError: 'Los het foutieve kilometertarief op en probeer het opnieuw.',
AskToExplain: `. <a href="${CONST.CONCIERGE_EXPLAIN_LINK_PATH}"><strong>Uitleggen</strong></a> &#x2728;`,
},
transactionMerge: {
listPage: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,8 @@ const translations: TranslationDeepObject<typeof en> = {
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',
Expand Down Expand Up @@ -1475,6 +1477,7 @@ const translations: TranslationDeepObject<typeof en> = {
amountTooLargeError: 'Całkowita kwota jest zbyt wysoka. Zmniejsz liczbę godzin lub obniż stawkę.',
},
correctDistanceRateError: 'Napraw błąd stawki za dystans i spróbuj ponownie.',
AskToExplain: `. <a href="${CONST.CONCIERGE_EXPLAIN_LINK_PATH}"><strong>Wyjaśnij</strong></a> &#x2728;`,
},
transactionMerge: {
listPage: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,8 @@ const translations: TranslationDeepObject<typeof en> = {
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',
Expand Down Expand Up @@ -1473,6 +1475,7 @@ const translations: TranslationDeepObject<typeof en> = {
amountTooLargeError: 'O valor total é muito alto. Reduza as horas ou diminua a tarifa.',
},
correctDistanceRateError: 'Corrija o erro na taxa de distância e tente novamente.',
AskToExplain: `. <a href="${CONST.CONCIERGE_EXPLAIN_LINK_PATH}"><strong>Explicar</strong></a> &#x2728;`,
},
transactionMerge: {
listPage: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,8 @@ const translations: TranslationDeepObject<typeof en> = {
return `您确定要删除此${type}吗?`;
},
onlyVisible: '仅对…可见',
explain: '解释',
explainMessage: '请为我解释一下。',
replyInThread: '在线程中回复',
joinThread: '加入话题',
leaveThread: '离开会话',
Expand Down Expand Up @@ -1452,6 +1454,7 @@ const translations: TranslationDeepObject<typeof en> = {
amountTooLargeError: '总金额过大。请减少工时或降低费率。',
},
correctDistanceRateError: '修复里程费率错误后请重试。',
AskToExplain: `. <a href="${CONST.CONCIERGE_EXPLAIN_LINK_PATH}"><strong>解释</strong></a> &#x2728;`,
},
transactionMerge: {
listPage: {
Expand Down
9 changes: 9 additions & 0 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
}

let allReportActions: OnyxCollection<ReportActions>;
Onyx.connect({

Check warning on line 76 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand All @@ -85,7 +85,7 @@
});

let allReports: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 88 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -94,13 +94,13 @@
});

let isNetworkOffline = false;
Onyx.connect({

Check warning on line 97 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NETWORK,
callback: (val) => (isNetworkOffline = val?.isOffline ?? false),
});

let deprecatedCurrentUserAccountID: number | undefined;
Onyx.connect({

Check warning on line 103 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, value is undefined
Expand Down Expand Up @@ -3729,6 +3729,14 @@
return mentionedUsers?.some((accountID) => systemAccountIDs.has(accountID)) ?? false;
}

/**
* Checks if an action has reasoning.
*/
function hasReasoning(action: OnyxInputOrEntry<ReportAction>): boolean {
const originalMessage = getOriginalMessage(action);
return !!originalMessage && typeof originalMessage === 'object' && 'reasoning' in originalMessage && !!originalMessage.reasoning;
}

export {
doesReportHaveVisibleActions,
extractLinksFromMessageHtml,
Expand Down Expand Up @@ -3773,6 +3781,7 @@
getTextFromHtml,
getTrackExpenseActionableWhisper,
getWhisperedTo,
hasReasoning,
hasRequestFromCurrentAccount,
isActionOfType,
isActionableWhisper,
Expand Down
84 changes: 58 additions & 26 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
/** @deprecated This value is deprecated and will be removed soon after migration. Use the email from useCurrentUserPersonalDetails hook instead. */
let deprecatedCurrentUserLogin: string | undefined;

Onyx.connect({

Check warning on line 283 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, val is undefined
Expand All @@ -294,7 +294,7 @@
},
});

Onyx.connect({

Check warning on line 297 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.CONCIERGE_REPORT_ID,
callback: (value) => (conciergeReportIDOnyxConnect = value),
});
Expand All @@ -302,7 +302,7 @@
// map of reportID to all reportActions for that report
const allReportActions: OnyxCollection<ReportActions> = {};

Onyx.connect({

Check warning on line 305 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
callback: (actions, key) => {
if (!key || !actions) {
Expand All @@ -314,7 +314,7 @@
});

let allReports: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 317 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -323,7 +323,7 @@
});

let allPersonalDetails: OnyxEntry<PersonalDetailsList> = {};
Onyx.connect({

Check warning on line 326 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
allPersonalDetails = value ?? {};
Expand All @@ -338,7 +338,7 @@
});

let onboarding: OnyxEntry<Onboarding>;
Onyx.connect({

Check warning on line 341 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_ONBOARDING,
callback: (val) => {
if (Array.isArray(val)) {
Expand Down Expand Up @@ -1583,42 +1583,72 @@
}

/**
* This will navigate to an existing thread, or create a new one if necessary
* 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().
*
* @param childReport The report we are trying to open
* @param parentReportAction the parent comment of a thread
* @param parentReport The parent report
*/
function navigateToAndOpenChildReport(childReport: OnyxEntry<Report>, parentReportAction: ReportAction, parentReport: OnyxEntry<Report>) {
if (childReport?.reportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(childReport.reportID, undefined, undefined, Navigation.getActiveRoute()));
const report = childReport ?? createChildReport(childReport, parentReportAction, parentReport);

Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID, undefined, undefined, Navigation.getActiveRoute()));
}

/**
* Creates a child report and returns it without checking for existing reports.
* If childReportID is not provided, creates an optimistic report and calls openReport()
Comment thread
samranahm marked this conversation as resolved.
* so the optimistic data is available when navigating to the thread.
*/
function createChildReport(childReport: OnyxEntry<Report>, parentReportAction: ReportAction, parentReport: OnyxEntry<Report>): Report {
const participantAccountIDs = [...new Set([deprecatedCurrentUserAccountID, Number(parentReportAction.actorAccountID)])];
// 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: parentReport?.reportID,
optimisticReportID: parentReportAction.childReportID,
});

const childReportID = childReport?.reportID ?? parentReportAction.childReportID;
if (!childReportID) {
const participantLogins = PersonalDetailsUtils.getLoginsByAccountIDs(Object.keys(newChat.participants ?? {}).map(Number));
openReport(newChat.reportID, '', participantLogins, newChat, parentReportAction.reportActionID, undefined, undefined, undefined, true);
} else {
const participantAccountIDs = [...new Set([deprecatedCurrentUserAccountID, Number(parentReportAction.actorAccountID)])];
// 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: parentReport?.reportID,
optimisticReportID: parentReportAction.childReportID,
});
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${childReportID}`, newChat);
}

const childReportID = childReport?.reportID ?? parentReportAction.childReportID;
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);
}
return newChat;
}

Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(newChat.reportID, undefined, undefined, Navigation.getActiveRoute()));
/**
* 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<ReportAction>, originalReportID: string | undefined, translate: LocalizedTranslate, timezone: Timezone = CONST.DEFAULT_TIME_ZONE) {
if (!originalReportID || !reportAction) {
return;
}

// Check if explanation thread report already exists
const existingChildReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportAction.childReportID}`];
const originalReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${originalReportID}`];
const report = existingChildReport ?? createChildReport(existingChildReport, reportAction, originalReport);

Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID, undefined, undefined, Navigation.getActiveRoute()));
Comment thread
samranahm marked this conversation as resolved.
// 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);
});
}

/**
Expand Down Expand Up @@ -6524,6 +6554,7 @@
doneCheckingPublicRoom,
downloadReportPDF,
editReportComment,
explain,
expandURLPreview,
exportReportToCSV,
exportReportToPDF,
Expand All @@ -6547,6 +6578,7 @@
markAsManuallyExported,
markCommentAsUnread,
navigateToAndOpenChildReport,
createChildReport,
navigateToAndOpenReport,
navigateToAndOpenReportWithAccountIDs,
navigateToConciergeChat,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ function BaseReportActionContextMenu({
'Bug',
'Trashcan',
'Checkmark',
'Concierge',
] as const);
const StyleUtils = useStyleUtils();
const {translate, getLocalDateFromDatetime} = useLocalize();
Expand Down Expand Up @@ -196,7 +197,7 @@ function BaseReportActionContextMenu({
const [childChatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${childReport?.chatReportID}`, {canBeMissing: true});
const parentReportAction = getReportAction(childReport?.parentReportID, childReport?.parentReportActionID);
const {reportActions: paginatedReportActions} = usePaginatedReportActions(childReport?.reportID);
const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
const currentUserPersonalDetails = useCurrentUserPersonalDetails();
const transactionThreadReportID = useMemo(
() => getOneTransactionThreadReportID(childReport, childChatReport, paginatedReportActions ?? [], isOffline),
[paginatedReportActions, isOffline, childReport, childChatReport],
Expand Down Expand Up @@ -388,7 +389,8 @@ function BaseReportActionContextMenu({
harvestReport,
isDelegateAccessRestricted,
showDelegateNoAccessModal,
currentUserAccountID,
currentUserAccountID: currentUserPersonalDetails?.accountID,
currentUserPersonalDetails,
};

if ('renderContent' in contextAction) {
Expand Down
Loading
Loading