Fix text wrapping in Account Manager banner#81743
Conversation
Remove maxWidth:100% from the inner text container that was claiming all parent width and starving sibling elements (button, close icon) of space. Also remove the no-op flexWrap from Text, add flexShrink:0 to the Chat Now button, and use breakWord instead of breakAll for more natural word wrapping. Fixed Issues: Expensify/Expensify#597716 Co-authored-by: John Schuster <johncschuster@users.noreply.github.com>
|
The failing
To fix: Edit the PR description and check off each item after completing the corresponding manual verification. The All other checks (ESLint, verifySignedCommits, spellcheck, builds, etc.) are passing or still running. |
The Changed files ESLint check requires all Pressable components to include a sentryLabel prop for Sentry tracking. Co-authored-by: John Schuster <johncschuster@users.noreply.github.com>
|
Fixed the failing The other failing check ( |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Fixed the failing |
|
Fixed the failing |
Explanation of Change
The Account Manager banner in the Concierge chat has a text wrapping issue where the message overflows its container when displayed alongside the "Chat Now" button and close icon. This is caused by several interacting flex layout issues in
Banner.tsx:styles.mw100from the inner text container —maxWidth: 100%caused the text container to claim the full parent width, leaving no room for the sibling button and close icon.styles.flexShrink0to the "Chat Now" button — prevents the button from being compressed by the flex layout on narrow screens.styles.flexWrapfrom the<Text>element —flexWrapis a ViewStyle property that controls child element wrapping inside a flex container; it has no effect on text content wrapping within a<Text>component.styles.breakAlltostyles.breakWordon the outer container —break-wordproduces more natural word wrapping thanbreak-all(which can break mid-word at any character).Fixed Issues
$ https://github.com/Expensify/Expensify/issues/597716
Tests
Offline tests
N/A — this is a pure styling fix with no network interaction.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari