From a6882587fb69c0600b7fca3817ebdd9d80de411c Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Mon, 17 Mar 2025 18:48:33 +0530 Subject: [PATCH 01/11] fix: title image rendering in task preview and task view. Signed-off-by: krishna2323 --- src/components/ReportActionItem/TaskPreview.tsx | 6 +++++- src/components/ReportActionItem/TaskView.tsx | 4 +++- src/pages/tasks/NewTaskPage.tsx | 1 + src/styles/utils/textDecorationLine.ts | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/ReportActionItem/TaskPreview.tsx b/src/components/ReportActionItem/TaskPreview.tsx index 4f22d65cbea0..20d21822a9a7 100644 --- a/src/components/ReportActionItem/TaskPreview.tsx +++ b/src/components/ReportActionItem/TaskPreview.tsx @@ -24,6 +24,7 @@ import ControlSelection from '@libs/ControlSelection'; import {canUseTouchScreen} from '@libs/DeviceCapabilities'; import getButtonState from '@libs/getButtonState'; import Navigation from '@libs/Navigation/Navigation'; +import Parser from '@libs/Parser'; import {isCanceledTaskReport, isOpenTaskReport, isReportManager} from '@libs/ReportUtils'; import type {ContextMenuAnchor} from '@pages/home/report/ContextMenu/ReportActionContextMenu'; import CONST from '@src/CONST'; @@ -64,6 +65,9 @@ function TaskPreview({taskReportID, action, contextMenuAnchor, chatReportID, che const {translate} = useLocalize(); const theme = useTheme(); const [taskReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${taskReportID}`); + const taskTitle = taskReport?.reportName ?? action?.childReportName ?? ''; + + const taskTitleWithoutImage = Parser.replace(Parser.htmlToMarkdown(taskTitle), {disabledRules: ['image']}); // The reportAction might not contain details regarding the taskReport // Only the direct parent reportAction will contain details about the taskReport @@ -127,7 +131,7 @@ function TaskPreview({taskReportID, action, contextMenuAnchor, chatReportID, che )} - ${taskReport?.reportName ?? action?.childReportName ?? ''}`} /> + ${taskTitleWithoutImage}`} /> {shouldShowGreenDotIndicator && ( diff --git a/src/components/ReportActionItem/TaskView.tsx b/src/components/ReportActionItem/TaskView.tsx index bc12663e5170..fc6405f40fea 100644 --- a/src/components/ReportActionItem/TaskView.tsx +++ b/src/components/ReportActionItem/TaskView.tsx @@ -22,6 +22,7 @@ import convertToLTR from '@libs/convertToLTR'; import getButtonState from '@libs/getButtonState'; import Navigation from '@libs/Navigation/Navigation'; import {getAvatarsForAccountIDs, getPersonalDetailsForAccountIDs} from '@libs/OptionsListUtils'; +import Parser from '@libs/Parser'; import {getDisplayNameForParticipant, getDisplayNamesWithTooltips, isCompletedTaskReport, isOpenTaskReport} from '@libs/ReportUtils'; import {isActiveTaskEditRoute} from '@libs/TaskUtils'; import {callFunctionIfActionIsAllowed} from '@userActions/Session'; @@ -44,7 +45,8 @@ function TaskView({report}: TaskViewProps) { useEffect(() => { setTaskReport(report); }, [report]); - const taskTitle = `${convertToLTR(report?.reportName ?? '')}`; + const htmlWithoutImage = Parser.replace(Parser.htmlToMarkdown(report?.reportName ?? ''), {disabledRules: ['image']}); + const taskTitle = `${convertToLTR(htmlWithoutImage)}`; const assigneeTooltipDetails = getDisplayNamesWithTooltips(getPersonalDetailsForAccountIDs(report?.managerID ? [report?.managerID] : [], personalDetails), false); const isOpen = isOpenTaskReport(report); diff --git a/src/pages/tasks/NewTaskPage.tsx b/src/pages/tasks/NewTaskPage.tsx index afe396891894..489c92d196a3 100644 --- a/src/pages/tasks/NewTaskPage.tsx +++ b/src/pages/tasks/NewTaskPage.tsx @@ -139,6 +139,7 @@ function NewTaskPage({route}: NewTaskPageProps) { shouldShowRightIcon rightLabel={translate('common.required')} shouldParseTitle + excludedMarkdownRules={['image']} /> ; From 30d2bbec35a8975a5e3135d46cd6d063422e9c5d Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Mon, 17 Mar 2025 18:58:22 +0530 Subject: [PATCH 02/11] fix: Task with multiline title is not displayed correctly in search list. Signed-off-by: krishna2323 --- src/components/Search/SearchAutocompleteList.tsx | 8 +++++++- src/components/Search/SearchRouter/SearchRouter.tsx | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Search/SearchAutocompleteList.tsx b/src/components/Search/SearchAutocompleteList.tsx index 9407c59718bd..5b730d70d8af 100644 --- a/src/components/Search/SearchAutocompleteList.tsx +++ b/src/components/Search/SearchAutocompleteList.tsx @@ -34,6 +34,7 @@ import { parseForAutocomplete, } from '@libs/SearchAutocompleteUtils'; import {buildSearchQueryJSON, buildUserReadableQueryString, sanitizeSearchValue} from '@libs/SearchQueryUtils'; +import StringUtils from '@libs/StringUtils'; import Timing from '@userActions/Timing'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -478,7 +479,12 @@ function SearchAutocompleteList( sections.push({title: translate('search.recentSearches'), data: recentSearchesData}); } - const styledRecentReports = recentReportsOptions.map((item) => ({...item, pressableStyle: styles.br2, wrapperStyle: [styles.pr3, styles.pl3]})); + const styledRecentReports = recentReportsOptions.map((item) => ({ + ...item, + pressableStyle: styles.br2, + text: StringUtils.lineBreaksToSpaces(item.text), + wrapperStyle: [styles.pr3, styles.pl3], + })); sections.push({title: autocompleteQueryValue.trim() === '' ? translate('search.recentChats') : undefined, data: styledRecentReports}); if (autocompleteSuggestions.length > 0) { diff --git a/src/components/Search/SearchRouter/SearchRouter.tsx b/src/components/Search/SearchRouter/SearchRouter.tsx index 5281032967cf..f3c8353c36c9 100644 --- a/src/components/Search/SearchRouter/SearchRouter.tsx +++ b/src/components/Search/SearchRouter/SearchRouter.tsx @@ -145,7 +145,7 @@ function SearchRouter({onRouterClose, shouldHideInputCaret}: SearchRouterProps, { data: [ { - text: `${translate('search.searchIn')} ${reportForContextualSearch.text ?? reportForContextualSearch.alternateText}`, + text: StringUtils.lineBreaksToSpaces(`${translate('search.searchIn')} ${reportForContextualSearch.text ?? reportForContextualSearch.alternateText}`), singleIcon: Expensicons.MagnifyingGlass, searchQuery: reportQueryValue, autocompleteID, From 69cde61bafcb824bd24a5375b5a13d18382ab858 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Mon, 17 Mar 2025 19:04:19 +0530 Subject: [PATCH 03/11] fix: Task - Hyperlink underline is blocked by inline code in the task report. Signed-off-by: krishna2323 --- src/styles/index.ts | 6 ++++-- src/styles/utils/index.ts | 2 +- src/styles/variables.ts | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/styles/index.ts b/src/styles/index.ts index ad7f3a5bb808..68646107aae8 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -4278,18 +4278,20 @@ const styles = (theme: ThemeColors) => ...writingDirection.ltr, ...headlineFont, fontSize: variables.fontSizeXLarge, - lineHeight: variables.lineHeightSizeh2, + lineHeight: variables.lineHeighTaskTitle, maxWidth: '100%', ...wordBreak.breakWord, + textUnderlineOffset: -1, }, taskTitleMenuItemItalic: { ...writingDirection.ltr, ...headlineItalicFont, fontSize: variables.fontSizeXLarge, - lineHeight: variables.lineHeightSizeh2, + lineHeight: variables.lineHeighTaskTitle, maxWidth: '100%', ...wordBreak.breakWord, + textUnderlineOffset: -1, }, taskDescriptionMenuItem: { diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index b6ee3085d981..c6df26fa2304 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -635,7 +635,7 @@ function getCodeFontSize(isInsideH1: boolean, isInsideTaskTitle?: boolean) { return 15; } if (isInsideTaskTitle) { - return 19; + return 18; } return 13; } diff --git a/src/styles/variables.ts b/src/styles/variables.ts index 2b39f2320b91..15b3edb3736f 100644 --- a/src/styles/variables.ts +++ b/src/styles/variables.ts @@ -113,6 +113,7 @@ export default { lineHeightXXXLarge: getValueUsingPixelRatio(32, 37), lineHeightSizeh1: getValueUsingPixelRatio(28, 32), lineHeightSizeh2: getValueUsingPixelRatio(24, 28), + lineHeighTaskTitle: getValueUsingPixelRatio(26, 30), lineHeightSignInHeroXSmall: getValueUsingPixelRatio(32, 37), inputHeight: getValueUsingPixelRatio(52, 72), inputHeightSmall: 28, From 3c5588c5b1fd4ba2cc3585862842781a45eb54d7 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Mon, 17 Mar 2025 19:11:10 +0530 Subject: [PATCH 04/11] fix: Chat - Bold markdown is not applied for url. Signed-off-by: krishna2323 --- src/styles/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/styles/index.ts b/src/styles/index.ts index 68646107aae8..ce8e916cf5c7 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -161,6 +161,12 @@ const webViewStyles = (theme: ThemeColors) => textDecorationStyle: 'solid', }, + strong: { + // We set fontFamily and fontWeight directly in order to avoid overriding fontStyle. + fontFamily: FontUtils.fontFamily.platform.EXP_NEUE_BOLD.fontFamily, + fontWeight: FontUtils.fontFamily.platform.EXP_NEUE_BOLD.fontWeight, + }, + a: link(theme), ul: { From d67712397915f68c4846f83a5173b5c195f04297 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Mon, 17 Mar 2025 19:56:50 +0530 Subject: [PATCH 05/11] fix image rendering in task confirmation page. Signed-off-by: krishna2323 --- .../HTMLRenderers/AnchorRenderer.tsx | 19 +++++++++++++++++-- src/pages/tasks/NewTaskPage.tsx | 1 - 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx index b4d163306cb3..4b53eb0b9913 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx +++ b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx @@ -72,7 +72,15 @@ function AnchorRenderer({tnode, style, key}: AnchorRendererProps) { // eslint-disable-next-line react/jsx-props-no-multi-spaces target={htmlAttribs.target || '_blank'} rel={htmlAttribs.rel || 'noopener noreferrer'} - style={[style, parentStyle, textDecorationLineStyle, styles.textUnderlinePositionUnder, styles.textDecorationSkipInkNone, isChildOfTaskTitle && styles.taskTitleMenuItem]} + style={[ + style, + parentStyle, + textDecorationLineStyle, + styles.textUnderlinePositionUnder, + styles.textDecorationSkipInkNone, + isChildOfTaskTitle && styles.taskTitleMenuItem, + styles.dInlineFlex, + ]} key={key} // Only pass the press handler for internal links. For public links or whitelisted internal links fallback to default link handling onPress={internalNewExpensifyPath || internalExpensifyPath ? () => openLink(attrHref, environmentURL, isAttachment) : undefined} @@ -88,7 +96,14 @@ function AnchorRenderer({tnode, style, key}: AnchorRendererProps) { return ( {props.childTnode.data} diff --git a/src/pages/tasks/NewTaskPage.tsx b/src/pages/tasks/NewTaskPage.tsx index 489c92d196a3..afe396891894 100644 --- a/src/pages/tasks/NewTaskPage.tsx +++ b/src/pages/tasks/NewTaskPage.tsx @@ -139,7 +139,6 @@ function NewTaskPage({route}: NewTaskPageProps) { shouldShowRightIcon rightLabel={translate('common.required')} shouldParseTitle - excludedMarkdownRules={['image']} /> Date: Mon, 17 Mar 2025 20:05:25 +0530 Subject: [PATCH 06/11] minor udpate. Signed-off-by: krishna2323 --- src/pages/tasks/NewTaskPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/tasks/NewTaskPage.tsx b/src/pages/tasks/NewTaskPage.tsx index afe396891894..489c92d196a3 100644 --- a/src/pages/tasks/NewTaskPage.tsx +++ b/src/pages/tasks/NewTaskPage.tsx @@ -139,6 +139,7 @@ function NewTaskPage({route}: NewTaskPageProps) { shouldShowRightIcon rightLabel={translate('common.required')} shouldParseTitle + excludedMarkdownRules={['image']} /> Date: Mon, 17 Mar 2025 22:51:54 +0530 Subject: [PATCH 07/11] disable image rule for task title. Signed-off-by: krishna2323 --- src/libs/ReportUtils.ts | 9 +++++---- src/libs/actions/Task.ts | 2 +- src/pages/tasks/TaskTitlePage.tsx | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index c847a92554a5..e7aed68a1aec 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4862,7 +4862,7 @@ function completeShortMention(text: string): string { * For comments shorter than or equal to 10k chars, convert the comment from MD into HTML because that's how it is stored in the database * For longer comments, skip parsing, but still escape the text, and display plaintext for performance reasons. It takes over 40s to parse a 100k long string!! */ -function getParsedComment(text: string, parsingDetails?: ParsingDetails, mediaAttributes?: Record): string { +function getParsedComment(text: string, parsingDetails?: ParsingDetails, mediaAttributes?: Record, isTaskAction?: boolean): string { let isGroupPolicyReport = false; if (parsingDetails?.reportID) { const currentReport = getReportOrDraftReport(parsingDetails?.reportID); @@ -4877,11 +4877,12 @@ function getParsedComment(text: string, parsingDetails?: ParsingDetails, mediaAt } const textWithMention = completeShortMention(text); + const disabledRules = isTaskAction ? ['image'] : []; return text.length <= CONST.MAX_MARKUP_LENGTH ? Parser.replace(textWithMention, { shouldEscapeText: parsingDetails?.shouldEscapeText, - disabledRules: isGroupPolicyReport ? [] : ['reportMentions'], + disabledRules: isGroupPolicyReport ? [...disabledRules] : ['reportMentions', ...disabledRules], extras: {mediaAttributeCache: mediaAttributes}, }) : lodashEscape(text); @@ -6506,7 +6507,7 @@ function buildOptimisticEditedTaskFieldReportAction({title, description}: Task): { type: CONST.REPORT.MESSAGE.TYPE.COMMENT, text: changelog, - html: getParsedComment(changelog), + html: getParsedComment(changelog, undefined, undefined, title !== undefined), }, ], person: [ @@ -6851,7 +6852,7 @@ function buildOptimisticTaskReport( return { reportID: generateReportID(), - reportName: getParsedComment(title ?? ''), + reportName: getParsedComment(title ?? '', undefined, undefined, true), description: getParsedComment(description ?? '', {}, mediaAttributes), ownerAccountID, participants, diff --git a/src/libs/actions/Task.ts b/src/libs/actions/Task.ts index 9045b1123451..c7b1a7218bcf 100644 --- a/src/libs/actions/Task.ts +++ b/src/libs/actions/Task.ts @@ -550,7 +550,7 @@ function editTask(report: OnyxTypes.Report, {title, description}: OnyxTypes.Task // Ensure title is defined before parsing it with getParsedComment. If title is undefined, fall back to reportName from report. // Trim the final parsed title for consistency. - const reportName = title ? ReportUtils.getParsedComment(title) : report?.reportName ?? ''; + const reportName = title ? ReportUtils.getParsedComment(title, undefined, undefined, true) : report?.reportName ?? ''; const parsedTitle = (reportName ?? '').trim(); // Description can be unset, so we default to an empty string if so diff --git a/src/pages/tasks/TaskTitlePage.tsx b/src/pages/tasks/TaskTitlePage.tsx index 30beb0bd700d..2b3daeebb6e8 100644 --- a/src/pages/tasks/TaskTitlePage.tsx +++ b/src/pages/tasks/TaskTitlePage.tsx @@ -41,7 +41,7 @@ function TaskTitlePage({report, currentUserPersonalDetails}: TaskTitlePageProps) ({title}: FormOnyxValues): FormInputErrors => { const errors: FormInputErrors = {}; - const parsedTitle = getParsedComment(title); + const parsedTitle = getParsedComment(title, undefined, undefined, true); const parsedTitleLength = getCommentLength(parsedTitle); if (!parsedTitle) { @@ -110,7 +110,7 @@ function TaskTitlePage({report, currentUserPersonalDetails}: TaskTitlePageProps) name={INPUT_IDS.TITLE} label={translate('task.title')} accessibilityLabel={translate('task.title')} - defaultValue={Parser.htmlToMarkdown(report?.reportName ?? '')} + defaultValue={Parser.htmlToMarkdown(report?.reportName ?? '', {})} ref={(element: AnimatedTextInputRef) => { if (!element) { return; From e48320e42bf80cc48fc727c34ed6c7455aea5faa Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Tue, 18 Mar 2025 03:44:54 +0530 Subject: [PATCH 08/11] minor updates. Signed-off-by: krishna2323 --- src/components/ReportActionItem/TaskView.tsx | 4 ++-- src/styles/utils/textDecorationLine.ts | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/ReportActionItem/TaskView.tsx b/src/components/ReportActionItem/TaskView.tsx index fc6405f40fea..08c33516d911 100644 --- a/src/components/ReportActionItem/TaskView.tsx +++ b/src/components/ReportActionItem/TaskView.tsx @@ -45,8 +45,8 @@ function TaskView({report}: TaskViewProps) { useEffect(() => { setTaskReport(report); }, [report]); - const htmlWithoutImage = Parser.replace(Parser.htmlToMarkdown(report?.reportName ?? ''), {disabledRules: ['image']}); - const taskTitle = `${convertToLTR(htmlWithoutImage)}`; + const titleWithoutImage = Parser.replace(Parser.htmlToMarkdown(report?.reportName ?? ''), {disabledRules: ['image']}); + const taskTitle = `${convertToLTR(titleWithoutImage)}`; const assigneeTooltipDetails = getDisplayNamesWithTooltips(getPersonalDetailsForAccountIDs(report?.managerID ? [report?.managerID] : [], personalDetails), false); const isOpen = isOpenTaskReport(report); diff --git a/src/styles/utils/textDecorationLine.ts b/src/styles/utils/textDecorationLine.ts index 0ea6ad4586ed..5e830cbf08c1 100644 --- a/src/styles/utils/textDecorationLine.ts +++ b/src/styles/utils/textDecorationLine.ts @@ -9,8 +9,4 @@ export default { textDecorationLine: 'underline line-through', textDecorationStyle: 'solid', }, - underlineLine: { - textDecorationLine: 'underline', - textDecorationStyle: 'solid', - }, } satisfies Record; From f04b73d201f4628ed7e42eb78e7070fe3571352b Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Tue, 18 Mar 2025 03:51:30 +0530 Subject: [PATCH 09/11] pass disabled rules to getParsedComment. Signed-off-by: krishna2323 --- src/CONST.ts | 2 +- src/libs/ReportUtils.ts | 10 +++++----- src/libs/actions/Task.ts | 2 +- src/pages/tasks/TaskTitlePage.tsx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 0ef02fcbd328..6983eb0bfcb3 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -373,7 +373,7 @@ const CONST = { BILLABLE: 'billable', NON_BILLABLE: 'nonBillable', }, - + TASK_TITLE_DISABLED_RULES: ['image'], // Note: Group and Self-DM excluded as these are not tied to a Workspace WORKSPACE_ROOM_TYPES: [chatTypes.POLICY_ADMINS, chatTypes.POLICY_ANNOUNCE, chatTypes.DOMAIN_ALL, chatTypes.POLICY_ROOM, chatTypes.POLICY_EXPENSE_CHAT, chatTypes.INVOICE], ANDROID_PACKAGE_NAME, diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index e7aed68a1aec..c5879d5d6fc4 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4862,7 +4862,7 @@ function completeShortMention(text: string): string { * For comments shorter than or equal to 10k chars, convert the comment from MD into HTML because that's how it is stored in the database * For longer comments, skip parsing, but still escape the text, and display plaintext for performance reasons. It takes over 40s to parse a 100k long string!! */ -function getParsedComment(text: string, parsingDetails?: ParsingDetails, mediaAttributes?: Record, isTaskAction?: boolean): string { +function getParsedComment(text: string, parsingDetails?: ParsingDetails, mediaAttributes?: Record, disabledRules?: string[]): string { let isGroupPolicyReport = false; if (parsingDetails?.reportID) { const currentReport = getReportOrDraftReport(parsingDetails?.reportID); @@ -4877,12 +4877,12 @@ function getParsedComment(text: string, parsingDetails?: ParsingDetails, mediaAt } const textWithMention = completeShortMention(text); - const disabledRules = isTaskAction ? ['image'] : []; + const rules = disabledRules ?? []; return text.length <= CONST.MAX_MARKUP_LENGTH ? Parser.replace(textWithMention, { shouldEscapeText: parsingDetails?.shouldEscapeText, - disabledRules: isGroupPolicyReport ? [...disabledRules] : ['reportMentions', ...disabledRules], + disabledRules: isGroupPolicyReport ? [...rules] : ['reportMentions', ...rules], extras: {mediaAttributeCache: mediaAttributes}, }) : lodashEscape(text); @@ -6507,7 +6507,7 @@ function buildOptimisticEditedTaskFieldReportAction({title, description}: Task): { type: CONST.REPORT.MESSAGE.TYPE.COMMENT, text: changelog, - html: getParsedComment(changelog, undefined, undefined, title !== undefined), + html: getParsedComment(changelog, undefined, undefined, title !== undefined ? [...CONST.TASK_TITLE_DISABLED_RULES] : undefined), }, ], person: [ @@ -6852,7 +6852,7 @@ function buildOptimisticTaskReport( return { reportID: generateReportID(), - reportName: getParsedComment(title ?? '', undefined, undefined, true), + reportName: getParsedComment(title ?? '', undefined, undefined, [...CONST.TASK_TITLE_DISABLED_RULES]), description: getParsedComment(description ?? '', {}, mediaAttributes), ownerAccountID, participants, diff --git a/src/libs/actions/Task.ts b/src/libs/actions/Task.ts index c7b1a7218bcf..52ad31b64dea 100644 --- a/src/libs/actions/Task.ts +++ b/src/libs/actions/Task.ts @@ -550,7 +550,7 @@ function editTask(report: OnyxTypes.Report, {title, description}: OnyxTypes.Task // Ensure title is defined before parsing it with getParsedComment. If title is undefined, fall back to reportName from report. // Trim the final parsed title for consistency. - const reportName = title ? ReportUtils.getParsedComment(title, undefined, undefined, true) : report?.reportName ?? ''; + const reportName = title ? ReportUtils.getParsedComment(title, undefined, undefined, [...CONST.TASK_TITLE_DISABLED_RULES]) : report?.reportName ?? ''; const parsedTitle = (reportName ?? '').trim(); // Description can be unset, so we default to an empty string if so diff --git a/src/pages/tasks/TaskTitlePage.tsx b/src/pages/tasks/TaskTitlePage.tsx index 2b3daeebb6e8..63d24418cfb7 100644 --- a/src/pages/tasks/TaskTitlePage.tsx +++ b/src/pages/tasks/TaskTitlePage.tsx @@ -41,7 +41,7 @@ function TaskTitlePage({report, currentUserPersonalDetails}: TaskTitlePageProps) ({title}: FormOnyxValues): FormInputErrors => { const errors: FormInputErrors = {}; - const parsedTitle = getParsedComment(title, undefined, undefined, true); + const parsedTitle = getParsedComment(title, undefined, undefined, [...CONST.TASK_TITLE_DISABLED_RULES]); const parsedTitleLength = getCommentLength(parsedTitle); if (!parsedTitle) { From 9273f0df1b7cb2b31fa25f3a1614cea987912d49 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Tue, 18 Mar 2025 17:42:45 +0530 Subject: [PATCH 10/11] minor fixes. Signed-off-by: krishna2323 --- src/components/ReportActionItem/TaskPreview.tsx | 4 ++-- src/components/ReportActionItem/TaskView.tsx | 2 +- src/pages/tasks/NewTaskPage.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ReportActionItem/TaskPreview.tsx b/src/components/ReportActionItem/TaskPreview.tsx index 20d21822a9a7..9c7e2827a128 100644 --- a/src/components/ReportActionItem/TaskPreview.tsx +++ b/src/components/ReportActionItem/TaskPreview.tsx @@ -65,9 +65,9 @@ function TaskPreview({taskReportID, action, contextMenuAnchor, chatReportID, che const {translate} = useLocalize(); const theme = useTheme(); const [taskReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${taskReportID}`); - const taskTitle = taskReport?.reportName ?? action?.childReportName ?? ''; + const taskTitle = action?.childReportName ?? taskReport?.reportName ?? ''; - const taskTitleWithoutImage = Parser.replace(Parser.htmlToMarkdown(taskTitle), {disabledRules: ['image']}); + const taskTitleWithoutImage = Parser.replace(Parser.htmlToMarkdown(taskTitle), {disabledRules: [...CONST.TASK_TITLE_DISABLED_RULES]}); // The reportAction might not contain details regarding the taskReport // Only the direct parent reportAction will contain details about the taskReport diff --git a/src/components/ReportActionItem/TaskView.tsx b/src/components/ReportActionItem/TaskView.tsx index 08c33516d911..1ec73130e4af 100644 --- a/src/components/ReportActionItem/TaskView.tsx +++ b/src/components/ReportActionItem/TaskView.tsx @@ -45,7 +45,7 @@ function TaskView({report}: TaskViewProps) { useEffect(() => { setTaskReport(report); }, [report]); - const titleWithoutImage = Parser.replace(Parser.htmlToMarkdown(report?.reportName ?? ''), {disabledRules: ['image']}); + const titleWithoutImage = Parser.replace(Parser.htmlToMarkdown(report?.reportName ?? ''), {disabledRules: [...CONST.TASK_TITLE_DISABLED_RULES]}); const taskTitle = `${convertToLTR(titleWithoutImage)}`; const assigneeTooltipDetails = getDisplayNamesWithTooltips(getPersonalDetailsForAccountIDs(report?.managerID ? [report?.managerID] : [], personalDetails), false); diff --git a/src/pages/tasks/NewTaskPage.tsx b/src/pages/tasks/NewTaskPage.tsx index 489c92d196a3..c3d0fd55e54c 100644 --- a/src/pages/tasks/NewTaskPage.tsx +++ b/src/pages/tasks/NewTaskPage.tsx @@ -139,7 +139,7 @@ function NewTaskPage({route}: NewTaskPageProps) { shouldShowRightIcon rightLabel={translate('common.required')} shouldParseTitle - excludedMarkdownRules={['image']} + excludedMarkdownRules={[...CONST.TASK_TITLE_DISABLED_RULES]} /> Date: Tue, 18 Mar 2025 18:05:57 +0530 Subject: [PATCH 11/11] remove bold link fix. Signed-off-by: krishna2323 --- src/styles/index.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/styles/index.ts b/src/styles/index.ts index ce8e916cf5c7..68646107aae8 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -161,12 +161,6 @@ const webViewStyles = (theme: ThemeColors) => textDecorationStyle: 'solid', }, - strong: { - // We set fontFamily and fontWeight directly in order to avoid overriding fontStyle. - fontFamily: FontUtils.fontFamily.platform.EXP_NEUE_BOLD.fontFamily, - fontWeight: FontUtils.fontFamily.platform.EXP_NEUE_BOLD.fontWeight, - }, - a: link(theme), ul: {