Skip to content

UI suite: a convenient background entry and reactive layout containers (ME-84, ME-85) - #634

Merged
Exoridus merged 2 commits into
mainfrom
ui/convenient-entry-and-reactive-layout
Aug 28, 2026
Merged

UI suite: a convenient background entry and reactive layout containers (ME-84, ME-85)#634
Exoridus merged 2 commits into
mainfrom
ui/convenient-entry-and-reactive-layout

Conversation

@Exoridus

Copy link
Copy Markdown
Owner

Group E, packages E1 and E2.

ME-84 - the convenient entry

background now takes the form a caller has it in: Color | Texture | TextureRegion | UIBackground, in options and setters on Panel, Button (a skin entry per state) and ProgressBar (track and bar). Getters and the theme keep returning normalised descriptors.

  • createUIBackground normalises a texture into a nine-slice, defaulting its slices to a third of the source per axis (a side under 3 px degenerates to a plain stretch).
  • New sprite background variant for flat art, stretched or tiled, painted by RepeatingSprite.
  • A colour routes to the widget's fill override, so the skin's corner radius and border survive it.
  • ProgressBar.fillMode: 'scale' | 'clip', default 'clip': the bar's art is cut to the value instead of squashed. A fill has nothing to distort and is painted at the value's width in either mode, which keeps the stock bar clear of the render barrier a clip imposes.

ME-85 - reactive layout

Stack re-flows itself when a child is added, removed, reordered or resized, and when direction, spacing, padding or align is set - no manual layout() call. align places items on the cross axis ('stretch' resizes them to it), and setGrow(child, factor) distributes the leftover main-axis space once the stack has an explicit box.

New DockContainer pins children to top/right/bottom/left and gives the rest to center; bands are taken in docking order.

Two internal seams this needed: a protected Container._onChildListChanged hook and a Widget layout-request bubble, since neither the child list nor a descendant's size change was observable from outside.

Validation

test/ui (169) and test/core (1355) green, gates typecheck / lint / sync / site green, typecheck:guides and typecheck:examples green, git diff --check clean. API reference regenerated, root-index snapshots updated, guide extended with "Textured skins" and "Docking to the edges".

Exoridus added 2 commits August 28, 2026 07:08
Options and setters on Panel, Button and ProgressBar now take a colour, a
texture, an atlas region or a full descriptor. A texture becomes a nine-slice
whose slices default to a third of the source per axis; a colour becomes a fill
override, so the skin's corner radius and border survive it. A new sprite
background variant stretches or tiles flat art, and ProgressBar.fillMode decides
whether the bar's art is cut to the value ('clip', the default) or squashed with
it ('scale') - a fill is painted at the value's width either way, which keeps the
stock bar clear of the render barrier a clip imposes.
Stack re-flows itself when a child is added, removed, reordered or resized and
when direction, spacing, padding or align is set, so a caller never has to pull
layout() after a change the container can observe. Alignment places items on the
cross axis (stretch resizes them to it), and setGrow hands the leftover space
along the flow direction to the growing children once the stack has an explicit
box. The new DockContainer pins children to top, right, bottom or left and gives
the rest to the centre.

Containers gained a protected _onChildListChanged hook and widgets a
_requestParentLayout bubble, since neither the child list nor a descendant's
size change was observable from outside before.
@Exoridus
Exoridus enabled auto-merge (squash) August 28, 2026 05:52
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 76.03kB (0.25%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
exo-esm-esm 1.09MB 6.79kB (0.62%) ⬆️
exo-esm-modules-esm 3.13MB 18.48kB (0.59%) ⬆️
exo-iife-min-Exo-iife 1.09MB 6.78kB (0.62%) ⬆️
exo-full-iife-Exo-iife 4.77MB 18.77kB (0.39%) ⬆️
exo-iife-Exo-iife 3.03MB 18.24kB (0.61%) ⬆️
exo-full-iife-min-Exo-iife 1.75MB 6.96kB (0.4%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: exo-full-iife-min-Exo-iife

Assets Changed:

Asset Name Size Change Total Size Change (%)
exo.full.iife.min.js 6.96kB 1.75MB 0.4%
view changes for bundle: exo-esm-modules-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.js 110 bytes 19.94kB 0.55%
rendering/Container.js 500 bytes 18.37kB 2.8%
ui/Widget.js 528 bytes 9.8kB 5.69% ⚠️
core/serialization/uiSerializers.js 1.42kB 9.13kB 18.47% ⚠️
ui/Button.js 1.08kB 8.54kB 14.55% ⚠️
ui/Stack.js 5.0kB 6.93kB 259.05% ⚠️
ui/ProgressBar.js 2.44kB 6.37kB 62.25% ⚠️
ui/theme.js 1.66kB 5.0kB 49.81% ⚠️
ui/Panel.js 702 bytes 4.2kB 20.06% ⚠️
ui/WidgetBackground.js 595 bytes 3.46kB 20.8% ⚠️
ui/DockContainer.js (New) 3.23kB 3.23kB 100.0% 🚀
ui/UIClipBox.js (New) 1.21kB 1.21kB 100.0% 🚀
view changes for bundle: exo-iife-Exo-iife

Assets Changed:

Asset Name Size Change Total Size Change (%)
exo.iife.js 18.24kB 3.03MB 0.61%
view changes for bundle: exo-iife-min-Exo-iife

Assets Changed:

Asset Name Size Change Total Size Change (%)
exo.iife.min.js 6.78kB 1.09MB 0.62%
view changes for bundle: exo-esm-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
exo.esm.js 6.79kB 1.09MB 0.62%
view changes for bundle: exo-full-iife-Exo-iife

Assets Changed:

Asset Name Size Change Total Size Change (%)
exo.full.iife.js 18.77kB 4.77MB 0.39%

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.36842% with 36 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/ui/ProgressBar.ts 62.16% 14 Missing ⚠️
src/ui/Button.ts 66.66% 6 Missing ⚠️
src/ui/UIClipBox.ts 61.53% 5 Missing ⚠️
src/ui/theme.ts 73.33% 0 Missing and 4 partials ⚠️
src/ui/DockContainer.ts 94.54% 3 Missing ⚠️
src/core/serialization/uiSerializers.ts 91.66% 0 Missing and 2 partials ⚠️
src/ui/Stack.ts 98.95% 1 Missing ⚠️
src/ui/WidgetBackground.ts 85.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Exoridus
Exoridus merged commit 37d67ce into main Aug 28, 2026
21 checks passed
@Exoridus
Exoridus deleted the ui/convenient-entry-and-reactive-layout branch August 28, 2026 06:05
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.

1 participant