fix: accommodate longer texts in translated wordings - #1375
gloria2807 wants to merge 6 commits into
Conversation
Greptile SummaryThis PR addresses an i18n layout bug where button labels in longer-language locales (German, French, etc.) would overflow or collide inside fixed-size buttons. The fix replaces rigid sizing with flex-based layouts and enables text wrapping across two UI components.
Confidence Score: 5/5Safe to merge — the changes are purely CSS layout adjustments with no logic or data-flow modifications. Both component changes are scoped to styled-component CSS: PaymentButtons correctly moves to a flex-based layout, and ConnectTab's nested src/components/designer/lightning/ConnectTab.tsx — the gap property interaction with Ant Design's connected-button borders is worth a visual check before merging.
|
| Filename | Overview |
|---|---|
| src/components/designer/lightning/ConnectTab.tsx | Adds flex-wrap, gap, and .ant-radio-button-wrapper overrides to RadioGroup; the nested CSS block is now properly closed (previous issue resolved), but gap: 8px can visually break Ant Design's connected-button border styling. |
| src/components/designer/lightning/actions/PaymentButtons.tsx | Replaces rigid width: 50% with flex: 1 + min-width: 0 + white-space: normal + height: auto to allow button text to wrap in longer translations; change is logically correct within the inline-flex Button.Group. |
| yarn.lock | Consolidates two caniuse-lite version entries into a single updated entry (1.0.30001793) and changes the resolved URL from registry.yarnpkg.com to registry.npmjs.org; routine dependency update with no code impact. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Radio.Group / Button.Group] -->|flex container| B{Label fits on one line?}
B -->|Yes - short locale e.g. English| C[Renders inline, single row]
B -->|No - long locale e.g. German/French| D[flex-wrap kicks in]
D --> E[Radio.Button: white-space: normal + height: auto\ntext wraps inside button]
D --> F[Button: flex: 1 + min-width: 0 + white-space: normal\ntext wraps inside button]
E --> G[ConnectTab RadioGroup wraps to new row]
F --> H[PaymentButtons split width evenly]
Reviews (2): Last reviewed commit: "fix(connect-tab): improve radio button l..." | Re-trigger Greptile
There was a problem hiding this comment.
@gloria2807 thank you for this fix! I tested this across locales (Korean short labels, longer German/French) and it holds up well. Great work. Some feedback :
- The
yarn.lockchanges are unrelated to this fix and look like local-env churn. Could you revert that file so the PR stays scoped to the two components? - Tiny nit: since this closes a bug,
fix:fits the title better thanfeat:
the pr also needs a rebase
|
Thanks for testing and for the feedback! I'll revert the unrelated yarn.lock changes, update the PR title to use fix: instead of feat:, and rebase the branch on the latest base branch. |
|
I've addressed the feedback by:
Let me know if there's anything else you'd like me to adjust. |
|
LGTM Tested on Linux and Windows. cc @Abdulkbk |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1375 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 211 211
Lines 7012 7012
Branches 1399 1349 -50
=========================================
Hits 7012 7012 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@Abdulkbk Are You Still Reviewing This PR? |
Thanks for reminding me. I'll take a look soon. |
Abdulkbk
left a comment
There was a problem hiding this comment.
Thanks, @gloria2807, for working on this.
I have a few pieces of feedback:
- Whenever you want to sync your branch with
master, userebaserather thanmerge. - Since the changes are minor, I think one commit is enough.
- For any unrelated change you want to reverse, do so by editing the commit that introduced it, rather than introducing a new commit to reverse the change.
| @@ -5731,15 +5731,10 @@ caniuse-api@^3.0.0: | |||
| lodash.memoize "^4.1.2" | |||
There was a problem hiding this comment.
Revert this. It's unrelated.
| version "1.0.30001793" | ||
| resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001793.tgz" | ||
| integrity sha512-iwSsYWaCOoh26cV8NwNRViHlrfUvYsHDfRVcbtmw0Kg6PJIZZXwMkj1442FYLBGkeUf1juAsU3DTfxW579mrPA== | ||
| caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000929, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001565: |
There was a problem hiding this comment.
You should drop this commit entirely. Updating yarn.lock is out of scope of this PR.
| .ant-radio-button-wrapper { | ||
| white-space: normal; | ||
| height: auto; | ||
| padding: 4px 10px; | ||
| text-align: center; | ||
| line-height: 1.2; |
There was a problem hiding this comment.
The design looks very similar even without this block
| version "1.0.30001793" | ||
| resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001793.tgz" | ||
| integrity sha512-iwSsYWaCOoh26cV8NwNRViHlrfUvYsHDfRVcbtmw0Kg6PJIZZXwMkj1442FYLBGkeUf1juAsU3DTfxW579mrPA== | ||
| caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000929, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001565: |
There was a problem hiding this comment.
drop this commit entirely.
Closes #1032
### Description
This PR fixes an i18n layout issue where some buttons did not have enough space for translated text, causing overflow or text collision in non-English languages (e.g. German, French, etc.).
Casual explanation
In some languages, button labels become longer than English (like “Zahlungen” or “Creer une facture”), which caused the text to overflow or overlap inside UI buttons. This update makes the buttons flexible so translations fit properly without breaking the layout.
Technical explanation
Button.Grouplayout with a flex-based containerflex-wrapsupport for better responsivenessmin-width: 0andwhite-space: normalto allow proper text wrappingRadio.Groupstyling to support multi-line translated labels### Steps to Test
Start the application locally
Navigate to the Lightning node connection / payment UI section
Switch language to a longer translation (e.g. German or French)
Verify that:
Repeat for different node implementations (LND / litd / etc.)
### Screenshots