Skip to content

Size the UI to its text: buttons hug their labels, long names wrap - #335

Merged
kcjonson merged 1 commit into
mainfrom
kj/text-overflow-ui-sizing-0cc1f6
Nov 2, 2026
Merged

kcjonson merged 1 commit into
mainfrom
kj/text-overflow-ui-sizing-0cc1f6

Conversation

@kcjonson

@kcjonson kcjonson commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Text was running out of its boxes in a few places. The bottom bar's buttons were a fixed 100 px, so PRODUCTION ran into FURNITURE, and WOR-568 had the asset-manager's top bar collapsing to 25 px. I swept every scene with /api/ui/lint plus a check of each text's measured size against its box (lint misses text that eats its parent's padding), and fixed what turned up.

Layout shifts a little in places; nothing overflows.

  • Gameplay bar: dropdowns and Rooms size to their labels.
  • Tasks panel: the description wraps, position and distance sit at the row's end, the status line wraps. The old version padded with spaces to fake a column in a proportional font.
  • Colonist panel: the current task reads above a thin bar with its percent at the end, since the inline pill it used can't wrap. DRAFT / GO TO / PRIORITIES start from their labels instead of splitting the row from zero.
  • Colonist roster: 208 to 224 px, so DECONSTRUCTING 100% fits the activity meter (it needed about 146 px of the 138 it had).
  • Build strip: material and thickness cards keep their old widths as a minimum and grow for longer names.
  • Landing panel: the biome title wraps.
  • WOR-568: the asset-manager's top bar no longer flex-shrinks, and the body may be shorter than its content, so a long XML definition scrolls in its well instead of squeezing the bar. It was losing 5 px even with nothing selected.

Clean on lint for text: main menu, settings, scenario and party select, world creator (before and after generating), the game HUD, the dossier's eight tabs, crafting and storage dialogs, the pause menu, the build strip, the asset-manager and the ui-sandbox gallery.

Regression pass: scenarios 06, 07 and the new 08 (HUD text fits) all pass. Scenario 06 gained a long-XML step.

Not in this PR: the build strip's "2.0 /m²" draws as "/m??", a glyph problem rather than a sizing one, filed separately.

The gameplay bar's buttons were a fixed 100 px, so PRODUCTION ran into
FURNITURE; they size to their labels now, Rooms included. A lint and tree
sweep of every scene turned up the rest:

- Tasks panel rows padded the description with spaces to a column, which
  a proportional font can't do, and ran past the panel. The description
  wraps, with the position and distance at the row's end, and the status
  line wraps too.
- The colonist panel's task sat in an inline progress pill that can't
  wrap, so CUTTING REED FOR PLANT FIBER ran out of the panel. The task
  reads above a thin bar now, its percent at the end.
- DRAFT / GO TO / PRIORITIES split the row equally from zero, so
  PRIORITIES ate its button's padding. They start from their labels.
- The colonist card's activity meter had 138 px for text and
  DECONSTRUCTING 100% needs about 146; the roster is 224 wide.
- Build strip cards grow past their old widths for a longer material.
- The landing panel's biome title wraps.

WOR-568: the asset-manager's top bar could flex-shrink, and the body's
minimum height followed its content, so a long XML definition squeezed
the bar to 25 px. The bar keeps its height and the body may be shorter
than its content, so the XML scrolls in its well.

Scenario 06 checks the long-XML case; new scenario 08 checks the HUD.
@kcjonson
kcjonson marked this pull request as ready for review November 2, 2026 18:57
Copilot AI balanced review requested due to automatic review settings November 2, 2026 18:57

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.

🟢 Approval recommended

No active review issues were identified for the UI text-fitting and toolbar layout changes.

No open issues 🎉

What changed in this PR

This PR adjusts World-sim’s UI layouts to fit their text, improving HUD readability and preventing long asset definitions from compressing the asset-manager toolbar.

Changes:

  • Size buttons and construction cards around their labels, and wrap long task descriptions and biome names.
  • Rework colonist task progress layout and widen roster cards to accommodate activity text.
  • Preserve the asset-manager toolbar height and extend manual regression scenarios for text fitting and long XML content.
File Description
docs/​testing/​scenarios/​08-hud-text-fits.md Adds a HUD text-fitting regression scenario.
docs/​testing/​scenarios/​06-asset-manager-browse.md Adds a long-XML toolbar layout check.
docs/​testing/​README.md Registers the HUD text-fitting scenario.
apps/​world-sim/​scenes/​landing/​LandingSiteDetailsPanel.cpp Wraps biome titles within the panel width.
apps/​world-sim/​scenes/​game/​ui/​views/​GameplayBar.cpp Sizes dropdowns and Rooms to their labels.
apps/​world-sim/​scenes/​game/​ui/​views/​EntityInfoView.h Adds references for the separate task text and percentage.
apps/​world-sim/​scenes/​game/​ui/​views/​EntityInfoView.cpp Separates wrapping task text from progress and uses label-based action widths.
apps/​world-sim/​scenes/​game/​ui/​views/​ConstructionConfigStrip.cpp Allows cards to grow beyond their minimum widths.
apps/​world-sim/​scenes/​game/​ui/​views/​ColonistListView.h Widens roster cards for activity labels.
apps/​world-sim/​scenes/​game/​ui/​components/​GlobalTaskRow.h Splits description and location references; updates layout comments.
apps/​world-sim/​scenes/​game/​ui/​components/​GlobalTaskRow.cpp Replaces space-padded columns with flex layout and wrapping text.
apps/​asset-manager/​scenes/​BrowserScene.cpp Prevents toolbar shrinking and lets the body fit the available height.

Review effort: Balanced

@kcjonson
kcjonson merged commit 8c3a141 into main Nov 2, 2026
7 checks passed
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.

2 participants