Repository navigation
Restore the banner's active-state fill and ring on the version comparison - #447
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
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.
|
Fixed in 6cdcb79: The finding is pinned rather than just corrected.
|
On
maina standing version comparison is signalled by ink alone: the closed chooser's text goes fromrgb(28,27,24)torgb(47,84,128)in light and fromrgb(232,228,219)torgb(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.onsetsborder-color,colorandbackground, 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.onand.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.jsstates 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_wasstays green. The menu reserves no width at all, so the paint costs nothing there either. Focus stays onoutline, so the newbox-shadowdisplaces no ring.test_a_folded_address_keeps_the_paint_that_says_it_is_doing_somethingreads the one control on the row and again inside the open menu, rather than a number in either. Without the menu rule it readsrgba(0, 0, 0, 0)with no shadow behind the fold againstrgb(238,234,222)with the inset accent ring on the row.A screen reader was never the gap here — the
aria-labelreadsv2: comparing with v1; open versionsin every one of these states. This is for the reader who has the page.Measurements and runs, Linux
getComputedStyleon the closed.lf-versionof a two-version page, comparison off then on, before and after this change:For contrast, the same page before #443, at
7e403108:Stepping a two-version suggestions page with sign-off down through the fold, comparison on, light scheme, at
6cdcb79b:Runs with this change:
skills/leaf/mcp-app/page-app.htmlcarries no banner chrome —lf-banner-actions,lf-banner-menuandlf-version-menuare all absent from it — so this needs no rebuild there.