Skip to content

Commit 21d10c5

Browse files
authored
Merge pull request Expensify#93625 from Expensify/claude-renderHTMLLeftAlignAndInlineLinks
Reset text-align in RenderHTML baseStyle and remove dInlineFlex from comment anchors
2 parents 1d88d34 + ec236ea commit 21d10c5

6 files changed

Lines changed: 14 additions & 10 deletions

File tree

src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ function AnchorRenderer({tnode, style, key}: AnchorRendererProps) {
141141
styles.textUnderlinePositionUnder,
142142
styles.textDecorationSkipInkNone,
143143
isChildOfTaskTitle && styles.taskTitleMenuItem,
144-
styles.dInlineFlex,
145144
hoverStyle,
146145
]}
147146
key={key}
@@ -168,7 +167,6 @@ function AnchorRenderer({tnode, style, key}: AnchorRendererProps) {
168167
textDecorationLineStyle,
169168
styles.textUnderlinePositionUnder,
170169
styles.textDecorationSkipInkNone,
171-
styles.dInlineFlex,
172170
hoverStyle,
173171
]}
174172
>

src/components/MenuItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ function MenuItem({
10281028
fsClass={forwardedFSClass}
10291029
>
10301030
{!!title && (shouldRenderAsHTML || (shouldParseTitle && !!html.length)) && (
1031-
<View style={[styles.renderHTMLTitle, shouldApplyIconPaddingToHTMLTitle && iconLeftPadding]}>
1031+
<View style={[styles.renderHTMLTitle, styles.textAlignLeft, shouldApplyIconPaddingToHTMLTitle && iconLeftPadding]}>
10321032
<RenderHTML html={processedTitle} />
10331033
</View>
10341034
)}

src/components/ReportActionItem/TaskPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function TaskPreview({action, chatReportID, currentUserPersonalDetails, isHovere
146146
</View>
147147
</UserDetailsTooltip>
148148
)}
149-
<View style={[styles.alignSelfCenter, styles.flex1]}>
149+
<View style={[styles.alignSelfCenter, styles.flex1, styles.textAlignLeft]}>
150150
<RenderHTML html={getTaskHTML()} />
151151
</View>
152152
</>

src/components/ReportActionItem/TaskView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function TaskView({report, parentReport, action}: TaskViewProps) {
173173
{({pressed}) => {
174174
const titleContent = (
175175
<>
176-
<View style={[styles.flexRow, styles.flex1]}>
176+
<View style={[styles.flexRow, styles.flex1, styles.textAlignLeft]}>
177177
<RenderHTML html={taskTitle} />
178178
</View>
179179
{!isDisableInteractive && (

src/pages/inbox/report/ReportActionItem.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,15 @@ function ReportActionItem({
558558
/>
559559
)}
560560
<View
561-
style={StyleUtils.getReportActionItemStyle(
562-
hovered || isWhisper || isContextMenuActive || !!isEmojiPickerActive || hasDraft || isPaymentMethodPopoverActive,
563-
!hasDraft && !!onPress,
564-
)}
561+
style={[
562+
StyleUtils.getReportActionItemStyle(
563+
hovered || isWhisper || isContextMenuActive || !!isEmojiPickerActive || hasDraft || isPaymentMethodPopoverActive,
564+
!hasDraft && !!onPress,
565+
),
566+
// The Pressable above renders as a role=button, whose UA text-align:center is inherited by
567+
// bare inline content (e.g. an auto-linked URL with no wrapping Text). Reset it to left here.
568+
styles.textAlignLeft,
569+
]}
565570
>
566571
<OfflineWithFeedback
567572
onClose={onClose}

src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function ToggleSettingOptionRow({
168168
if (typeof subtitle === 'string') {
169169
if (!!subtitle && shouldParseSubtitle) {
170170
return (
171-
<View style={[styles.flexRow, styles.renderHTML, subtitleSpacingStyle]}>
171+
<View style={[styles.flexRow, styles.renderHTML, styles.textAlignLeft, subtitleSpacingStyle]}>
172172
<RenderHTML html={processedSubtitle} />
173173
</View>
174174
);
@@ -195,6 +195,7 @@ function ToggleSettingOptionRow({
195195
styles.mutedNormalTextLabel,
196196
styles.flexRow,
197197
styles.renderHTML,
198+
styles.textAlignLeft,
198199
subtitleSpacingStyle,
199200
subtitleStyle,
200201
processedSubtitle,

0 commit comments

Comments
 (0)