Skip to content

feat(bolt): support two rows of text with word splitting in buttons#7039

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/buttons-support-two-rows-text
Draft

feat(bolt): support two rows of text with word splitting in buttons#7039
Copilot wants to merge 2 commits into
mainfrom
copilot/buttons-support-two-rows-text

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 1, 2026

Buttons in Bolt layout render text on a single line, causing overflow or requiring heavy abbreviations for longer localized strings (e.g., "APPUYEZ PR CONF" for "Hold to confirm").

Modified render_content in the Bolt Button component to automatically wrap text to two centered lines when it exceeds the button width:

  • Text that fits on one line renders as before (no behavior change)
  • Overflowing text splits at word boundaries via Font::longest_prefix
  • Falls back to Font::longest_prefix_break_words for single long words with no space to split on
  • Second line is truncated to available width if still too long
  • Both lines are vertically and horizontally centered within the button area

When button text is too wide to fit on a single line, the text is now
split into two lines. The splitting first tries word boundaries, and
falls back to breaking words if no boundary is found. Both lines are
centered horizontally within the button area.
Copilot AI changed the title [WIP] Fix button text overflow in Bolt layout feat(bolt): support two rows of text with word splitting in buttons Jun 1, 2026
Copilot AI requested a review from Hannsek June 1, 2026 11:08
@Hannsek Hannsek assigned obrusvit and unassigned Hannsek Jun 1, 2026
@Hannsek Hannsek added this to Firmware Jun 1, 2026
@github-project-automation github-project-automation Bot moved this to 🔎 Needs review in Firmware Jun 1, 2026
@Hannsek Hannsek moved this from 🔎 Needs review to 🏃‍♀️ In progress in Firmware Jun 1, 2026
@Hannsek Hannsek removed the status in Firmware Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Buttons in Bolt layout should support two rows of text and word splitting

3 participants