Skip to content

Playground: demo the H-K salience, flex, and scroll-anchor capabilities#513

Merged
DROOdotFOO merged 5 commits into
DROOdotFOO:masterfrom
merklebonsai:pr/playground-capability-demos
Jul 13, 2026
Merged

Playground: demo the H-K salience, flex, and scroll-anchor capabilities#513
DROOdotFOO merged 5 commits into
DROOdotFOO:masterfrom
merklebonsai:pr/playground-capability-demos

Conversation

@merklebonsai

Copy link
Copy Markdown
Collaborator

Three shipped capabilities had no representation in the playground, so the work was effectively invisible to anyone browsing it. Each demo is interactive, so the rule is visible rather than merely rendered.

  • Salience Palette — the H-K (Helmholtz-Kohlrausch) colour solver. Palettes are (hue, chroma, tier) and lightness is solved against the terminal background detected via OSC 11. Cycle hue/tier and the assumed ground to see the same semantic colour resolve differently against different grounds — which is the entire point of the solver.
  • Flex Layout — the spec-9.7 engine: toggle flex_wrap, align_content: :stretch vs :flex_start, gap, and flex: 1 growth, with the automatic min-content minimum visibly flooring a column at its content width.
  • Scroll AnchorViewport's overflow_anchor: :auto: a growing log stays pinned to the tail; scrolling up releases the pin; :none freezes it.

Widget-count assertions move 30 → 33 (catalog_test, app_test, sidebar_scroll_test).

Playground suite: 301/301 pass. Compile clean (--warnings-as-errors), format clean.

Note: #509 also adds a demo (OSC Ambient) and bumps the same counts, so a trivial conflict on those assertions is expected whichever merges second.

Three shipped capabilities had no representation in the playground, so the
work was invisible to anyone browsing it:

  Salience Palette  the H-K colour solver -- palettes are (hue, chroma, tier)
                    and lightness is *solved* against the terminal background
                    detected via OSC 11, so the same semantic colour resolves
                    differently against different grounds.
  Flex Layout       the spec-9.7 engine: flex_wrap, align_content :stretch vs
                    :flex_start, gap, flex: 1 growth, and the automatic
                    min-content minimum flooring a column at its content width.
  Scroll Anchor     Viewport overflow_anchor :auto -- a growing log stays
                    pinned to the tail, scrolling up releases the pin, :none
                    freezes it.

Each is interactive, so the rule is visible rather than merely rendered.
Widget-count assertions move 30 -> 33.
@merklebonsai
merklebonsai force-pushed the pr/playground-capability-demos branch from 222ae88 to e28c4ce Compare July 13, 2026 14:59
merklebonsai and others added 3 commits July 13, 2026 22:29
Viewport returned a `:row`. A `:row`/`:column` dissolves into its children's
positions and never becomes a positioned element, so it cannot carry identity,
cannot bound its own height, and cannot stamp `:clip_bounds`. Windowed content
was therefore free to paint straight through the enclosing border and over
whatever followed it.

Only `:box` produces a positioned element. Render as one: it carries `:id`,
defaults `height` to `visible_height` and `overflow` to `:hidden` (both
`put_new`, so callers keep the last word), and passes `overflow_anchor` through
for the LiveView surface to key its `overflow-anchor` CSS off.

The inner content column also pinned `gap: 0`. It is a literal `:column`, which
routes through the Containers compat map, whose historical default is gap 1 --
it was silently double-spacing every windowed row.

Viewport render output gains one nesting level (box > row > [content,
scrollbar]); the tests that walked the old shape descend accordingly.
The windowed rows were double-spaced: the content column is a literal `:column`,
which routes through `containers_compat_to_flex/2`, and that reads gap from
`:attrs` or the top level -- never from `:style` -- defaulting it to 1 in layout
mode. Declaring `style: %{gap: 0}` therefore did nothing.

With a 2-row stride, twelve windowed rows spanned twenty-four rows while the
viewport clipped at twelve, so half of them were clipped away and the demo
looked broken.
@DROOdotFOO
DROOdotFOO merged commit ebf7893 into DROOdotFOO:master Jul 13, 2026
27 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