Skip to content

Restore the banner's active-state fill and ring on the version comparison - #447

Merged
max-sixty merged 2 commits into
mainfrom
fix/banner-active-state-paint
Sep 8, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/banner-active-state-paint

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

On main a standing version comparison is signalled by ink alone: the closed chooser's text goes from rgb(28,27,24) to rgb(47,84,128) in light and from rgb(232,228,219) to rgb(143,176,216) in dark, with the background and border transparent in both states. That is 2.16:1 and 1.77:1 against the control's own resting ink, on a two-character token, and it is the whole of what a reader sees.

Before #443 the same state wore four things — the word Δ, accent ink, an accent border and a chip fill. The commit that made the label a stable token removed the word so that the control could not resize the row and displace the addresses to its left, which is worth keeping. The other three went for a reason nobody chose: .lf-btn.on sets border-color, color and background, and two rules clear the border and the fill at the same specificity, later in the cascade — the row's resting rule so that an address cannot resize the row, and the overflow menu's so that a folded address reads as a row rather than as a chip. Either place left the class painting ink alone.

This restates the treatment the open workspace already wears in both: a chip fill and an inset accent ring, at .lf-banner-actions > .lf-btn.on and .lf-banner-menu > .lf-btn.on. The menu matters because .lf-btn.lf-workspace[aria-expanded="true"] carries three classes' worth of specificity and outranks the menu's resting rule on its own, so an open workspace survived the fold while a comparison did not — the banner's two active states diverging in the place the treatment's argument is about. banner-shelf.js states what the fold owes an address: it is "the row's own nodes moved rather than copied, so a folded address keeps its accessible name, its state paint, its title, its press and its own page key: nothing about it changes except where it stands."

Neither a fill nor an inset ring is a metric, so this does not reopen what #443 closed: the closed chooser measures 58px comparing and not comparing, in both schemes, and test_the_poll_leaves_the_banner_where_it_was stays green. The menu reserves no width at all, so the paint costs nothing there either. Focus stays on outline, so the new box-shadow displaces no ring.

test_a_folded_address_keeps_the_paint_that_says_it_is_doing_something reads the one control on the row and again inside the open menu, rather than a number in either. Without the menu rule it reads rgba(0, 0, 0, 0) with no shadow behind the fold against rgb(238,234,222) with the inset accent ring on the row.

A screen reader was never the gap here — the aria-label reads v2: comparing with v1; open versions in every one of these states. This is for the reader who has the page.

Measurements and runs, Linux

getComputedStyle on the closed .lf-version of a two-version page, comparison off then on, before and after this change:

main            light  ink rgb(28,27,24) → rgb(47,84,128)     bg transparent both, no shadow
main            dark   ink rgb(232,228,219) → rgb(143,176,216) bg transparent both, no shadow

this branch     light  bg → rgb(238,234,222)  shadow rgb(47,84,128) 0 -2px inset    width 58 → 58
this branch     dark   bg → rgb(45,41,34)     shadow rgb(143,176,216) 0 -2px inset  width 58 → 58

For contrast, the same page before #443, at 7e403108:

light  "v2 ▾"    ink rgb(28,27,24)   bg rgb(255,254,251)  border rgb(213,207,194)
     → "Δ v2 ▾"  ink rgb(47,84,128)  bg rgb(238,234,222)  border rgb(47,84,128)

Stepping a two-version suggestions page with sign-off down through the fold, comparison on, light scheme, at 6cdcb79b:

390: folded False  bg rgb(238,234,222)  shadow rgb(47,84,128) 0px -2px 0px 0px inset
340: folded True   bg rgb(238,234,222)  shadow rgb(47,84,128) 0px -2px 0px 0px inset
320: folded True   bg rgb(238,234,222)  shadow rgb(47,84,128) 0px -2px 0px 0px inset

Runs with this change:

$ uv run pytest -q -n2 --run-nightly tests/test_render_controls.py \
    tests/test_render_anchors.py::test_the_menu_compares_with_any_version_older_than_this_one
91 passed

$ uv run pytest -q -n2 --run-nightly tests/test_interact_layer.py
164 passed, 6 skipped

skills/leaf/mcp-app/page-app.html carries no banner chrome — lf-banner-actions, lf-banner-menu and lf-version-menu are all absent from it — so this needs no rebuild there.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The row is fixed; the fold is not. .lf-banner-menu > .lf-btn clears border-color and background for exactly the same reason the row's resting rule does, so once the chooser folds into the overflow menu a standing comparison is back to ink alone — the state this PR just took off ink.

Measured on this branch, Linux, light scheme, on a two-version suggestions page with sign-off and a panel comment, stepping the window down:

ON  390: folded False  bg rgb(238,234,222)  shadow rgb(47,84,128) 0 -2px inset
ON  340: folded True   bg rgba(0,0,0,0)     shadow none
ON  300: folded True   bg rgba(0,0,0,0)     shadow none

The menu is where the two active states diverge rather than read alike, which is the treatment's argument. .lf-btn.lf-workspace[aria-expanded="true"] carries three classes' worth of specificity, so it outranks the menu's resting rule and keeps its fill and ring in there; probing both inside an open .lf-banner-menu on this branch: lf-btn lf-workspace[aria-expanded=true] → bg rgb(238,234,222), shadow rgb(47,84,128) 0 -2px inset; lf-btn on → bg rgba(0,0,0,0), shadow none. An open workspace survives the fold; a standing comparison does not.

banner-shelf.js states the invariant this breaks — folded addresses are "the row's own nodes moved rather than copied, so a folded address keeps its accessible name, its state paint, its title, its press and its own page key: nothing about it changes except where it stands."

The same two declarations beside .lf-banner-menu > .lf-btn close it, and the menu row has no reserved width to protect, so the fill and ring cost nothing there either.

Everything else checks out: the row's width is unchanged with the comparison on (58px at 1440, 50px at 390, both states), focus stays on outline so the new box-shadow displaces no ring, and uv run pytest -q -n2 --run-nightly tests/test_render_controls.py is 89 passed.

.lf-banner-menu > .lf-btn clears border-color and background for the same
reason the row's resting rule does, so a standing comparison folded into
the overflow menu was back to ink alone — the state the row's rule had just
taken off ink. The banner's other active state survives the fold on its own
specificity (.lf-btn.lf-workspace[aria-expanded="true"] carries three
classes), so the two diverged in exactly the place the treatment's argument
is about.

The menu reserves no width, so the fill and ring cost nothing there.

The test reads the one control in both places rather than a number in
either, which is what banner-shelf.js promises of a folded address: nothing
about it changes except where it stands. Without the rule it reads
rgba(0,0,0,0) with no shadow in the menu against rgb(238,234,222) with the
inset accent ring on the row.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Fixed in 6cdcb79: .lf-banner-menu > .lf-btn.on now carries the same fill and inset ring beside the menu's resting rule, so the two active states read alike on both sides of the fold.

The finding is pinned rather than just corrected. test_a_folded_address_keeps_the_paint_that_says_it_is_doing_something turns the comparison on at 1440, reads the closed chooser's paint on the row, steps to 320 and reads the same control inside the open menu — one control in two places rather than a number in either, which is the form banner-shelf.js promises. Reverting the new rule fails it on the exact divergence measured above: rgba(0, 0, 0, 0) with shadow: none behind the fold against rgb(238,234,222) with rgb(47,84,128) 0px -2px inset on the row. Its fixture needs the sign-off address to crowd the row into folding at all — a plain two-version suggestions page still holds the chooser at 320.

uv run pytest -q -n2 --run-nightly tests/test_render_controls.py tests/test_render_anchors.py::test_the_menu_compares_with_any_version_older_than_this_one is 91 passed. The PR description now covers both rules rather than the row alone.

@max-sixty
max-sixty merged commit 6617e38 into main Sep 8, 2026
4 checks passed
@max-sixty
max-sixty deleted the fix/banner-active-state-paint branch September 8, 2026 19:25
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