From 5c7962449dbdf798cd3c6a742532e66b37f339ab Mon Sep 17 00:00:00 2001 From: Ryan Teguh Date: Wed, 8 Apr 2026 23:08:16 +0800 Subject: [PATCH 1/2] fix: Room header displays a two-line description inconsistently --- src/libs/ReportActionsUtils.ts | 4 +++- src/pages/inbox/HeaderView.tsx | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 1c31711ce7a7..21fdad24fa32 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -2839,7 +2839,9 @@ function isPolicyChangeLogDeleteMemberMessage( function getWorkspaceDescriptionUpdatedMessage(translate: LocalizedTranslate, action: ReportAction) { const {oldDescription, newDescription} = getOriginalMessage(action as ReportAction) ?? {}; const message = - typeof oldDescription === 'string' && newDescription ? translate('workspaceActions.updateWorkspaceDescription', newDescription, oldDescription) : getReportActionText(action); + typeof oldDescription === 'string' && newDescription + ? translate('workspaceActions.updateWorkspaceDescription', Parser.htmlToText(newDescription), Parser.htmlToText(oldDescription)) + : getReportActionText(action); return message; } diff --git a/src/pages/inbox/HeaderView.tsx b/src/pages/inbox/HeaderView.tsx index 841f4f40da35..2466c133325f 100644 --- a/src/pages/inbox/HeaderView.tsx +++ b/src/pages/inbox/HeaderView.tsx @@ -74,6 +74,7 @@ import { shouldDisableDetailPage as shouldDisableDetailPageReportUtils, shouldReportShowSubscript, } from '@libs/ReportUtils'; +import StringUtils from '@libs/StringUtils'; import {shouldShowDiscountBanner} from '@libs/SubscriptionUtils'; import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan'; import EarlyDiscountBanner from '@pages/settings/Subscription/CardSection/BillingBanner/EarlyDiscountBanner'; @@ -155,9 +156,9 @@ function HeaderView({onNavigationMenuButtonClicked, reportID}: HeaderViewProps) const statusColorForInvoiceReport = isParentInvoiceAndIsChatThread ? getReportStatusColorStyle(theme, reportHeaderData?.stateNum, reportHeaderData?.statusNum) : {}; const isParentReportHeaderDataArchived = useReportIsArchived(reportHeaderData?.parentReportID); const parentNavigationSubtitleData = getParentNavigationSubtitle(parentNavigationReport, policy, conciergeReportID, isParentReportHeaderDataArchived); - const reportDescription = Parser.htmlToText(getReportDescription(report)); + const reportDescription = StringUtils.lineBreaksToSpaces(Parser.htmlToText(getReportDescription(report))); const policyName = getPolicyName({report, returnEmptyIfNotFound: true}); - const policyDescription = getPolicyDescriptionText(policy); + const policyDescription = StringUtils.lineBreaksToSpaces(getPolicyDescriptionText(policy)); const isPersonalExpenseChat = isPolicyExpenseChat && isCurrentUserSubmitter(report); const hasTeam2025Pricing = useHasTeam2025Pricing(); // This is used to ensure that we display the text exactly as the user entered it when displaying thread header text, instead of parsing their text to HTML. From 518aa66cbd070d3ec9d8b1c630874c763aad6711 Mon Sep 17 00:00:00 2001 From: Ryan Teguh Date: Thu, 9 Apr 2026 13:31:53 +0800 Subject: [PATCH 2/2] fix: Room header displays a two-line description inconsistently --- src/libs/ReportActionsUtils.ts | 4 +--- src/libs/SidebarUtils.ts | 5 +++-- src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 21fdad24fa32..1c31711ce7a7 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -2839,9 +2839,7 @@ function isPolicyChangeLogDeleteMemberMessage( function getWorkspaceDescriptionUpdatedMessage(translate: LocalizedTranslate, action: ReportAction) { const {oldDescription, newDescription} = getOriginalMessage(action as ReportAction) ?? {}; const message = - typeof oldDescription === 'string' && newDescription - ? translate('workspaceActions.updateWorkspaceDescription', Parser.htmlToText(newDescription), Parser.htmlToText(oldDescription)) - : getReportActionText(action); + typeof oldDescription === 'string' && newDescription ? translate('workspaceActions.updateWorkspaceDescription', newDescription, oldDescription) : getReportActionText(action); return message; } diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index 01c351f1a673..15bc32a959c5 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -193,6 +193,7 @@ import { shouldReportBeInOptionList, shouldReportShowSubscript, } from './ReportUtils'; +import StringUtils from './StringUtils'; import {getTaskReportActionMessage} from './TaskUtils'; type WelcomeMessage = {phrase1?: string; messageText?: string; messageHtml?: string}; @@ -936,7 +937,7 @@ function getOptionData({ } else if (isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.ACTIONABLE_CARD_FRAUD_ALERT) && getOriginalMessage(lastAction)?.resolution) { result.alternateText = getActionableCardFraudAlertResolutionMessage(translate, lastAction); } else if (isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_DESCRIPTION)) { - result.alternateText = getWorkspaceDescriptionUpdatedMessage(translate, lastAction); + result.alternateText = StringUtils.lineBreaksToSpaces(Parser.htmlToText(getWorkspaceDescriptionUpdatedMessage(translate, lastAction))); } else if (isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_CURRENCY)) { result.alternateText = getWorkspaceCurrencyUpdateMessage(translate, lastAction); } else if (isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_AUTO_REPORTING_FREQUENCY)) { @@ -1053,7 +1054,7 @@ function getOptionData({ } else if (lastAction && isOldDotReportAction(lastAction)) { result.alternateText = getMessageOfOldDotReportAction(translate, lastAction); } else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_DESCRIPTION) { - result.alternateText = Parser.htmlToText(getUpdateRoomDescriptionMessage(translate, lastAction)); + result.alternateText = StringUtils.lineBreaksToSpaces(Parser.htmlToText(getUpdateRoomDescriptionMessage(translate, lastAction))); } else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_AVATAR) { result.alternateText = getRoomAvatarUpdatedMessage(translate, lastAction); } else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_EMPLOYEE) { diff --git a/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx b/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx index 3753fa96f429..b7b7aaa36298 100644 --- a/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx @@ -858,7 +858,7 @@ const ContextMenuActions: ContextMenuAction[] = [ } else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_NAME) { Clipboard.setString(Str.htmlDecode(getWorkspaceNameUpdatedMessage(translate, reportAction))); } else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_DESCRIPTION) { - Clipboard.setString(getWorkspaceDescriptionUpdatedMessage(translate, reportAction)); + setClipboardMessage(getWorkspaceDescriptionUpdatedMessage(translate, reportAction)); } else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_CURRENCY) { Clipboard.setString(getWorkspaceCurrencyUpdateMessage(translate, reportAction)); } else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_AUTO_REPORTING_FREQUENCY) {