Repository navigation
Reset text-align in RenderHTML baseStyle and remove dInlineFlex from comment anchors - #93625
Conversation
…comment anchors Add textAlign: 'left' to baseFontStyle (the baseStyle applied to every RenderHTML tree) so inline content never inherits the UA text-align: center from the ancestor button. Remove styles.dInlineFlex from comment anchors so multi-word links wrap inline again. Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
|
@MelvinBot verify all use cases
|
|
Done — this PR is now marked ready for review and I filled in the author checklist. I checked the structural items (issue linked, testing steps written, and the Tests/Offline/QA steps present). I intentionally left these for you, since I can't attest to them on your behalf:
I also left the Tests and QA Steps sections with their |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7fcef56910
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| flex: 1, | ||
| lineHeight: variables.fontSizeNormalHeight, | ||
| ...writingDirection.ltr, | ||
| textAlign: 'left', |
There was a problem hiding this comment.
Keep product-training tooltip text centered
When RenderHTML is centered by an outer container instead of a <centered-text> tag, this global reset overrides that intent. ProductTrainingContext wraps its tooltip RenderHTML in styles.textAlignCenter, while the translations render as <tooltip>... and the tooltip model only adds productTrainingTooltipText without its own textAlign. With this line, every tooltip root now gets an explicit left alignment, so multiline onboarding/product-training tooltips such as outstandingFilter and scanTestDriveTooltip render left-aligned instead of centered; please either scope the reset to the affected chat/comment surfaces or give the tooltip model/renderer its center alignment back.
Useful? React with 👍 / 👎.
Verification:
|
| # | Site | Wrapper style |
|---|---|---|
| 1 | ProductTrainingContext/index.tsx:268 |
View has styles.textAlignCenter; HTML is <tooltip>… with no inner center |
| 2 | IOURequestStepOdometerImage/index.tsx:188 |
<Text style={subTextFileUpload}> → textAlign: 'center' |
| 3 | CameraCapture.tsx:164 |
<Text style={subTextFileUpload}> → textAlign: 'center' |
subTextFileUpload is textAlign: 'center'. Sites 2 & 3 render the multi-line receipt.deniedCameraAccess string (contains an <a> link), so the wrap will be visibly left-aligned. Site 1 affects multi-line product-training tooltips.
Recommended fix: wrap each of these HTML strings in <centered-text>…</centered-text>. This is already the established pattern in the codebase — note the same file IOURequestStepOdometerImage line 86 already uses <centered-text> for its other message. This also makes the centering robust on native (where textAlign doesn't inherit across component boundaries the way it does in DOM/web — so these may already be left-aligned on iOS/Android).
Sites checked and cleared
A scan of all ~160 RenderHTML / RenderHTMLSource / BaseHTMLEngineProvider usage sites found that every other centered surface either (a) already wraps its HTML in <centered-text> (e.g. OutcomeScreenBase, TransactionMerge empty state, merge-expenses messages) or (b) centers via flex (alignItems: center / screenCenteredContainer), which is unchanged. This includes the sign-in pages (Terms, Licenses, EmailDeliveryFailure), all domain pages, EnablePayments terms/KYC pages, and the modals (DecisionModal, FeatureTrainingModal, MigratedUserWelcomeModal).
The two changes themselves correctly fix the original regressions (#92668 / #93068 centering, #90362 inline wrapping). The 3 items above are pre-existing centered surfaces that the broader root reset now catches — worth wrapping in centered-text before merge.
🤖 Reply with @MelvinBot <feedback> to refine this verification.
|
@MelvinBot Verify. |
|
Verified — both proposed fixes are correct. ✅ Site 1 (
Sites 2 & 3 ( Since there are no plain-text consumers, embedding the tags in the string is safe. The key is defined in 10 language files (en, es, fr, it, ja, zh-hans, nl, pl, de, pt-BR) — wrap each. The string contains an 🤖 Reply |
|
@MelvinBot any screenshot of ProductTrainingContext multiline tooltip |
|
⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai. |
|
@MelvinBot implement this #93625 (comment) |
Wrap deniedCameraAccess in <centered-text> across all locales and drop the now-dead textAlignCenter from the product training tooltip, since the RenderHTML baseStyle text-align reset blocks inherited centering. Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
|
@Beamanator Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Implemented the two fixes from the verification comment — pushed as 1. Product training tooltip — removed the now-dead 2. AI Tests run
Could not run locally (sandbox blocks env-var overrides / redirection):
Pre-existing, unrelated: 🤖 Reply with |
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index 99005779fe6..fc8fca46b2a 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -1152,7 +1152,7 @@ const translations: TranslationDeepObject<typeof en> = {
alternativeMethodsTextReceipts: ({phoneNumber}: {phoneNumber: string}) => `<label-text>Belege per SMS an ${phoneNumber} senden (nur US-Nummern)</label-text>`,
takePhoto: 'Foto aufnehmen',
cameraAccess: 'Für das Fotografieren von Belegen ist Kamerazugriff erforderlich.',
- deniedCameraAccess: `<centered-text>Der Kamerazugriff wurde noch nicht gewährt. Bitte folge <a href="${CONST.DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL}">diesen Anweisungen</a>.</centered-text>`,
+ deniedCameraAccess: `<centered-text>Der Kamerazugriff wurde noch immer nicht gewährt. Bitte folgen Sie <a href="${CONST.DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL}">diesen Anweisungen</a>.</centered-text>`,
cameraErrorTitle: 'Kamerafehler',
cameraErrorMessage: 'Beim Aufnehmen eines Fotos ist ein Fehler aufgetreten. Bitte versuche es erneut.',
locationAccessTitle: 'Standortzugriff erlauben',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index d4ad4b35778..92b1dc4fec3 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -1117,7 +1117,7 @@ const translations: TranslationDeepObject<typeof en> = {
alternativeMethodsTextReceipts: ({phoneNumber}) => `<label-text>Envía recibos por SMS a ${phoneNumber} (solo números de EE.UU.)</label-text>`,
takePhoto: 'Haz una foto',
cameraAccess: 'Se requiere acceso a la cámara para hacer fotos de los recibos.',
- deniedCameraAccess: `<centered-text>No se ha concedido el acceso a la cámara, siga <a href="${CONST.DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL}">estas instrucciones</a>.</centered-text>`,
+ deniedCameraAccess: `<centered-text>No se ha concedido el acceso a la cámara, sigue <a href="${CONST.DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL}">estas instrucciones</a>.</centered-text>`,
cameraErrorTitle: 'Error en la cámara',
locationAccessTitle: 'Permitir acceso a la ubicación',
locationAccessMessage: 'El acceso a la ubicación nos ayuda a mantener tu zona horaria y moneda precisas dondequiera que vayas.',
@@ -1753,7 +1753,6 @@ const translations: TranslationDeepObject<typeof en> = {
}
},
[CONST.NEXT_STEP.MESSAGE_KEY.WAITING_TO_MARK_AS_DONE]: (actor, actorType, _eta, _etaType) => {
- // eslint-disable-next-line default-case
switch (actorType) {
case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
return `Esperando a que <strong>tú</strong> lo marques como listo.`;
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 89d5dbf0eed..20271b075e7 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1,6 +1,7 @@
/**
* _____ __ __
* / ___/__ ___ ___ _______ _/ /____ ___/ /
+ * / (_ / -_) _ \/ -_) __/ _ \`/ __/ -_) _ /
* \___/\__/_//_/\__/_/ \_,_/\__/\__/\_,_/
*
* This file was automatically generated. Please consider these alternatives before manually editing it:
@@ -862,7 +863,7 @@ const translations: TranslationDeepObject<typeof en> = {
beginningOfChatHistory: (users: string) => `Cette discussion est avec ${users}.`,
beginningOfChatHistoryPolicyExpenseChat: (workspaceName: string, submitterDisplayName: string) =>
`C’est ici que <strong>${submitterDisplayName}</strong> soumettra des dépenses à <strong>${workspaceName}</strong>. Utilisez simplement le bouton +.`,
- beginningOfChatHistoryPolicyExpenseChatTrack: 'C\u2019est ici que vous suivrez vos dépenses',
+ beginningOfChatHistoryPolicyExpenseChatTrack: 'C’est ici que vous suivrez vos dépenses',
beginningOfChatHistorySelfDM: 'Ceci est votre espace personnel. Utilisez-le pour vos notes, tâches, brouillons et rappels.',
beginningOfChatHistorySystemDM: 'Bienvenue ! Procédons à la configuration.',
chatWithAccountManager: 'Discutez avec votre gestionnaire de compte ici',
@@ -1155,7 +1156,7 @@ const translations: TranslationDeepObject<typeof en> = {
alternativeMethodsTextReceipts: ({phoneNumber}: {phoneNumber: string}) => `<label-text>Envoyez des reçus par SMS au ${phoneNumber} (numéros américains uniquement)</label-text>`,
takePhoto: 'Prendre une photo',
cameraAccess: 'L’accès à la caméra est requis pour prendre des photos de reçus.',
- deniedCameraAccess: `<centered-text>L’accès à la caméra n’a toujours pas été accordé, veuillez suivre <a href="${CONST.DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL}">ces instructions</a>.</centered-text>`,
+ deniedCameraAccess: `<centered-text>L'accès à la caméra n'a toujours pas été accordé, veuillez suivre <a href="${CONST.DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL}">ces instructions</a>.</centered-text>`,
cameraErrorTitle: 'Erreur de caméra',
cameraErrorMessage: 'Une erreur s’est produite lors de la prise de la photo. Veuillez réessayer.',
locationAccessTitle: 'Autoriser l’accès à la position',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 3529c9029ef..d9149a1c3d0 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -1150,7 +1150,7 @@ const translations: TranslationDeepObject<typeof en> = {
alternativeMethodsTextReceipts: ({phoneNumber}: {phoneNumber: string}) => `<label-text>Stuur bonnen per sms naar ${phoneNumber} (alleen Amerikaanse nummers)</label-text>`,
takePhoto: 'Maak een foto',
cameraAccess: 'Cameratoegang is vereist om foto’s van bonnen te maken.',
- deniedCameraAccess: `<centered-text>Er is nog steeds geen cameratoegang verleend, volg alsjeblieft <a href="${CONST.DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL}">deze instructies</a>.</centered-text>`,
+ deniedCameraAccess: `<centered-text>Je hebt nog steeds geen toegang tot de camera gegeven. Volg <a href="${CONST.DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL}">deze instructies</a>.</centered-text>`,
cameraErrorTitle: 'Camerafout',
cameraErrorMessage: 'Er is een fout opgetreden bij het maken van een foto. Probeer het opnieuw.',
locationAccessTitle: 'Locatietoegang toestaan',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 06f01cd9c1e..6e52f229115 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -1150,7 +1150,7 @@ const translations: TranslationDeepObject<typeof en> = {
alternativeMethodsTextReceipts: ({phoneNumber}: {phoneNumber: string}) => `<label-text>Wyślij paragony SMS-em na ${phoneNumber} (tylko numery w USA)</label-text>`,
takePhoto: 'Zrób zdjęcie',
cameraAccess: 'Dostęp do aparatu jest wymagany, aby robić zdjęcia paragonów.',
- deniedCameraAccess: `<centered-text>Dostęp do aparatu nadal nie został przyznany, postępuj zgodnie z <a href="${CONST.DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL}">tymi instrukcjami</a>.</centered-text>`,
+ deniedCameraAccess: `<centered-text>Dostęp do aparatu wciąż nie został przyznany, postępuj zgodnie z <a href="${CONST.DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL}">tymi instrukcjami</a>.</centered-text>`,
cameraErrorTitle: 'Błąd aparatu',
cameraErrorMessage: 'Wystąpił błąd podczas robienia zdjęcia. Spróbuj ponownie.',
locationAccessTitle: 'Zezwól na dostęp do lokalizacji',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 4f2e65e12f1..fc27c89071c 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -1112,7 +1112,7 @@ const translations: TranslationDeepObject<typeof en> = {
alternativeMethodsTextReceipts: ({phoneNumber}: {phoneNumber: string}) => `<label-text>将收据短信发送至 ${phoneNumber}(仅限美国号码)</label-text>`,
takePhoto: '拍照',
cameraAccess: '需要相机访问权限才能为收据拍照。',
- deniedCameraAccess: `<centered-text>仍未授予相机访问权限,请按照<a href="${CONST.DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL}">这些说明</a>进行操作。</centered-text>`,
+ deniedCameraAccess: `<centered-text>仍未获得相机访问权限,请按照<a href="${CONST.DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL}">这些说明</a>进行操作。</centered-text>`,
cameraErrorTitle: '相机错误',
cameraErrorMessage: '拍照时发生错误。请重试。',
locationAccessTitle: '允许访问位置信息',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
|
@MelvinBot needs screenshots for all use cases |
|
🤖 The re-triggered run is green — |
That's a very good idea @Pujan92 😅 |
|
@MelvinBot update the OP to have the full checklist, all checked off |
|
@codex review |
|
🚧 @Beamanator has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
posted to get a bigger test flow going - https://expensify.slack.com/archives/C9YU7BX5M/p1781967442137819 |
|
@Pujan92 conflicts 🙏 Also what exactly do you think i should ask QA to test... everything?? Seems like a tiny PR to have to test "everything" - maybe we can narrow it to fewer flows |
|
@MelvinBot merge main and fix conflicts |
@Beamanator We need to ask them to test wherever we support markdown(those places where RenderHTML is used)
|
|
cool, i'll ask 👍 |
|
and somehow melvin didn't get triggered |
|
@MelvinBot merge main and fix conflicts |
|
@MelvinBot merge main 🙏 |
…AlignAndInlineLinks Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com> # Conflicts: # src/components/MenuItem.tsx # src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx
|
🤖 Merged How the conflicts were resolvedBoth conflicts were the same shape — this PR adds
|
|
Regression was completed and passed No blockers were found |
|
🚧 @Beamanator has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.4.18-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 I reviewed the changes in this PR against Expensify's help site files under No help site changes are required. This is a purely technical CSS/rendering fix. It resets the inherited UA Since the help articles describe product features and workflows rather than text-rendering behavior, there's nothing to update, and no draft PR was created. @Pujan92, since this change doesn't affect any documented behavior, there's no help site PR to review. If you believe a specific article is impacted, let me know and I'll create the draft PR. |
|
@izarutskaya This isn't an issue related to #90362, here the link is long without any break character, so it is not breaking bcoz default |
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.4.18-2 🚀
|
Explanation of Change
This re-fixes two linked regressions in a single, robust place instead of patching each render surface one at a time.
Background: Auto-linked emails/URLs that are the sole content of a message render their wrapped lines centered, because every chat row is wrapped in a
PressableWithSecondaryInteractionthat RNW renders as a native<button>, and the browser UA stylesheet setstext-align: centeron<button>.text-alignis inherited, so a bare inline anchor (with no resetting<Text>ancestor) obeys the inheritedcenter. Earlier fixes addedstyles.textAlignLeftto individual surfaces (chat rows, then expense descriptions), which is whack-a-mole — the same bug regressed twice (#92668, then #93068).This change:
textAlign: 'left'tobaseFontStyle. This is thebaseStyleprop passed toTRenderEngineProviderinBaseHTMLEngineProvider.tsx, so it is applied to the root of every RenderHTML tree. BecausetextAligninherits, this neutralizes the inherited UAcenterfor every inline anchor on every surface at once.'left'is consistent here becausebaseFontStylealready forceswritingDirection: ltr. Content that intentionally centers (centered-text,comment[center]) sets its own styles on descendants, so it still wins.styles.dInlineFlexfrom the comment anchors inAnchorRenderer.tsxso multi-word links wrap inline again (the original fix for [Due for payment 2026-07-01] [$250] Inline Hyperlinks in Chat Messages Break Onto Separate Line Instead of Wrapping Naturally #90362). With thebaseStylereset above in place, removinginline-flexno longer reintroduces the centering regression.Fixed Issues
$ #92668
$ #90362
PROPOSAL: #92668 (comment)
Tests
// TODO: The human co-author must fill out the tests they ran before marking this PR as "ready for review". Please describe what tests you performed that validate your change worked.
Suggested manual checks (web, narrow pane):
sjodinjsojsiojiodnjiosjionsjidnjsijiosndjoinjiosjidoj@gmail.com). Verify the wrapped second line is left-aligned.Offline tests
Same as tests.
QA Steps
// TODO: The human co-author must fill out the QA steps before marking this PR as "ready for review".
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.