Repository navigation
Size the UI to its text: buttons hug their labels, long names wrap - #335
Merged
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
🟢 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/lintplus 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.
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.