Skip to content

Add non-breaking space between number and unit#3449

Open
assassinaj602 wants to merge 3 commits into
lichess-org:mainfrom
assassinaj602:fix-2289-non-breaking-space
Open

Add non-breaking space between number and unit#3449
assassinaj602 wants to merge 3 commits into
lichess-org:mainfrom
assassinaj602:fix-2289-non-breaking-space

Conversation

@assassinaj602

Copy link
Copy Markdown
Contributor

Replace regular spaces with U+00A0 (non-breaking space) between numbers and their unit suffixes to prevent line-break jitter as numbers change width.

Changes

  • storm_screen.dart — combo level labels (${level} s), run stats time and time-per-move rows, stats section header (${score} puzzles solved)
  • storm_dashboard.dart — daily highscore time column (${time} s)
  • puzzle_history_screen.dart — solving time badge (${inSeconds} s)
  • engine_settings_widget.dart — search time slider label (${value} s)

Not changed (intentional)

  • .arb translation files — opponentLeftCounter, nbSecondsToPlayTheFirstMove etc. embed numbers inside full ICU plural sentences; those are the translation team's responsibility
  • Static rule text in the Storm info dialog (not live numbers)
  • toDaysHoursMinutes() — delegates to l10n.nbDays/nbHours/nbMinutes plurals

Fixes #2289

Replace regular spaces with U+00A0 in number+unit displays to prevent line-break jitter as numbers change width.

Fixes lichess-org#2289
@lsaudon

lsaudon commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Add non breaking space in red test too

- Updated test expectations to use \u00A0 between numbers and units
- Matches the implementation changes in storm_screen.dart

Fixes lichess-org#2289
@assassinaj602

Copy link
Copy Markdown
Contributor Author

@lsaudon

  • Updated storm_screen_test.dart expectations to match the new UI with non-breaking spaces
  • The StormScreen shows end run result test now correctly expects \u00A0 between numbers and units

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.

Put non-breaking space between [num] and [unit] (e.g., 23 seconds)

2 participants