Remove inline-flex from comment anchors and reset chat row text alignment#92776
Conversation
…ment Re-applies the reverted #92387 (links wrap inline) and fixes the resulting deploy blocker where a sole long link/email's wrapped line rendered centered: reset textAlign on the chat message row Pressable so the native <button>'s inherited UA text-align: center no longer cascades into the comment block. Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
|
I looked into the failing checks. The only failing check is There's no code fix for me to push here. This check fails simply because the PR Author Checklist boxes above aren't all ticked. That checklist is a human responsibility — each box verifies that a person consciously reviewed that item (testing on all platforms, console errors, code patterns, etc.), so I intentionally don't fill it out on the author's behalf.
|
|
🤖 Done,
A couple of things to confirm on your end, since these are your attestations as co-author:
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
@MelvinBot Though the comment and anchor element look fine, verify other tag elements too |
|
Verified — the other tag elements are safe. Both changes are correctly scoped and don't regress any other custom HTML tag renderer. Why it's safe (code): the Visual confirmation at a narrow (~360px) viewport, each as a sole/wrapping message — heading, blockquote, code block, inline code, lists, mention, bold/italic/strikethrough, and a sole long auto-linked email all render correctly and left-aligned (the email's wrapped 2nd line is no longer centered): Per-renderer breakdown & the one tag that sets its own alignmentI audited every renderer registered in
The only tag that explicitly sets No descendant in the chat-row subtree relies on inheriting a non-left alignment, so nothing regresses. Confidence: high. |
|
Thanks. Looks good to merge then. |
|
@MelvinBot please fix the checklist in the OP and make sure it's up to date and all checked off |
|
🤖 Done, The checklist was missing 4 newer template items (now added and checked):
Two things I intentionally left for you, since they're human attestations I shouldn't tick on your behalf:
|
|
🚧 @Beamanator has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|




Explanation of Change
This re-applies the change from the reverted #92387 and additionally fixes the deploy blocker it caused (#92668).
1. Re-apply #92387 — links wrap inline (#90362)
Comment anchors (and their text children) in
AnchorRenderer.tsxwere styled withstyles.dInlineFlex(display: inline-flex). On web this turns each link into an atomic inline-flex box, so a multi-word link can't break across line boxes — when it doesn't fit it gets pushed onto its own line instead of wrapping inline at word boundaries. Removingstyles.dInlineFlexlets links participate in normal inline text flow and wrap naturally.2. Fix the regression — sole long link/email wrapped line was centered (#92668)
Removing the anchor's
inline-flexexposed a pre-existing inheritedtext-align: center. Every chat message row renders as aPressableWithSecondaryInteractionwithaccessibilityRole="button", which react-native-web renders as a native<button>. The browser UA stylesheet setstext-align: centeron<button>, and sincetext-alignis inherited and RNW's base view reset doesn't override it, thecentercascades down into the<comment>block. Normal messages are unaffected because every RNW<Text>resets alignment — but a message whose entire content is a single auto-linked email/URL has no resetting<Text>wrapper, so its wrapped (second) line obeyed the inheritedcenter.The fix resets
textAligntolefton thatPressableWithSecondaryInteractionso the native<button>'s inheritedcenternever cascades to its descendants. (React Native'stextAligntype only supportsleft/right/etc., not the CSSstartkeyword; for all currently shipped LTR localesleftis equivalent tostart.)Fixed Issues
$ #90362
$ #92668
PROPOSAL: #90362 (comment)
MelvinBot verification
Verified in the web build at a narrow viewport (links forced to wrap):
textAlign: leftthroughout the ancestor chain from the<a>up to the chat row.AI Tests (run by MelvinBot)
npx prettier --writeon both changed files — cleannpx eslinton both changed files — passed (0 errors; 1 pre-existing seatbelt-allowed warning unrelated to this change)npm run typecheck-tsgo— passednpm run react-compiler-compliance-check check <files>— both COMPILEDnpm test -- tests/ui/PureReportActionItemTest.tsx— 190/190 passedTests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.
sjodinjsojsiojiodnjiosjionsjidnjsijiosndjoinjiosjidoj@gmail.com.Offline tests
Same as Tests — messages render client-side, so the inline link wrapping and alignment behavior is identical while offline. Compose and send the comments above while offline and verify the optimistic messages render correctly.
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas do they need to test for regressions.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.