Skip to content

fix(fxa-settings): prevent CJK button labels breaking one character per line#20724

Open
sreecharan-desu wants to merge 1 commit into
mozilla:mainfrom
sreecharan-desu:fix/fxa-11485-cjk-button-line-breaking
Open

fix(fxa-settings): prevent CJK button labels breaking one character per line#20724
sreecharan-desu wants to merge 1 commit into
mozilla:mainfrom
sreecharan-desu:fix/fxa-11485-cjk-button-line-breaking

Conversation

@sreecharan-desu

Copy link
Copy Markdown
Contributor

Summary

  • Stop settings page CTA buttons from shrinking in flex layouts, which caused Japanese, Chinese, and Korean labels to stack one character per line.
  • Apply shrink-0 and whitespace-nowrap to shared CTA styles (with specificity high enough to override flex-1 on modal buttons).
  • Allow paired modal/sub-row action buttons to wrap as a group when horizontal space is limited.

Fixes #18683

Test plan

  • Set browser language to Japanese (or Chinese/Korean) and open the account settings page.
  • Confirm row action buttons (Add, Change, Disable, etc.) render on a single line.
  • Open a settings modal with Cancel/Confirm and verify the Cancel label does not break one character per line.
  • Spot-check English/German locales to ensure buttons still layout correctly on mobile and landscape widths.

Made with Cursor

…er line

Flex-shrink on settings row and modal CTA buttons was squeezing Japanese,
Chinese, and Korean labels to a single character per line. Keep button text
on one line and let paired modal actions wrap as a group when space is tight.

Fixes mozilla#18683

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a flexbox/layout issue in fxa-settings where CJK (Chinese/Japanese/Korean) CTA button labels could be squeezed into extremely narrow widths and end up rendering one character per line.

Changes:

  • Updated shared CTA styling to prevent flex items from shrinking and to keep CTA labels on one line.
  • Applied additional CTA non-shrinking / no-wrapping rules within settings unit-row action areas.
  • Allowed modal/button groups to wrap when space is constrained by adding flex-wrap to the button container.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/fxa-settings/src/styles/unit-row.css Prevent CTA buttons/links inside unit-row actions from shrinking and wrapping.
packages/fxa-settings/src/components/Settings/SubRow/index.tsx Allow passkey delete modal action buttons to wrap as a group.
packages/fxa-settings/src/components/Settings/Modal/index.tsx Allow generic modal action buttons to wrap as a group.
packages/fxa-react/styles/ctas.css Adjust CTA sizing behavior and add higher-specificity utilities to override flex-1 shrink behavior and prevent wrapping.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


{hasButtons && (
<div className="flex justify-center mx-auto mt-6 max-w-64">
<div className="flex flex-wrap justify-center gap-2 mx-auto mt-6 max-w-64">
</p>
</FtlMsg>
<div className="flex justify-center mx-2 mt-6">
<div className="flex flex-wrap justify-center gap-2 mx-2 mt-6">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Line breaking on individual characters in button text for Chinese / Japanese / Korean in settings

2 participants