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

@sreecharan-desu sreecharan-desu commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Because

This pull request

  • Apply shrink-0 and whitespace-nowrap to shared CTA styles (with specificity high enough to override flex-1 on modal buttons).
  • Prevent CTA buttons/links inside unit-row actions from shrinking and wrapping.
  • Allow paired modal/sub-row action buttons to wrap as a group when horizontal space is limited.
  • Remove gap-2 from modal button containers; rely on existing child mx-2 margins for spacing.

Issue that this pull request solves

Closes: #18683

Checklist

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate). — N/A: change targets CJK line-breaking in LTR button labels; no RTL layout changes.
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on: packages/fxa-react/styles/ctas.css, packages/fxa-settings/src/styles/unit-row.css, Modal/index.tsx, SubRow/index.tsx
  • Suggested review order: shared CTA CSS → unit-row CSS → modal/sub-row JSX
  • Risky or complex parts: ensure English/German button layouts still work on mobile and landscape widths

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.

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.

Comment thread packages/fxa-settings/src/components/Settings/Modal/index.tsx Outdated
Comment thread packages/fxa-settings/src/components/Settings/SubRow/index.tsx Outdated
@sreecharan-desu sreecharan-desu force-pushed the fix/fxa-11485-cjk-button-line-breaking branch from b691a7c to 4bdef08 Compare June 21, 2026 07:36
…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.

Use child mx-2 margins for modal button spacing instead of gap-2 to avoid
doubled horizontal spacing that caused premature wrapping.

Fixes mozilla#18683
@sreecharan-desu sreecharan-desu force-pushed the fix/fxa-11485-cjk-button-line-breaking branch from 4bdef08 to 341d0df Compare June 28, 2026 08:14
@sreecharan-desu

sreecharan-desu commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the Copilot review feedback and refreshed the branch:

  • Removed gap-2 from modal button containers (child buttons already use mx-2) in Modal/index.tsx and SubRow/index.tsx.
  • Rebased onto latest main so CI runs against current base.

Ready for another look when you have a moment.

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