Repository navigation
Fix two tests the playground's native form left failing - #6233
Conversation
The alert-thresholds example pulled its choice labels back by Leaf's private --lf-choice-pad, which a page may not read (test_theme_tokens); it now uses --lf-sp-1, the value that pad resolves to. The prepared-install journey looked for input[type=text], but its native field writes no type attribute; it now finds the field by its name.
leaf-agent
left a comment
There was a problem hiding this comment.
--lf-sp-1 isn't the value the choice pad resolves to. A page's label around a radio or checkbox gets --lf-choice-pad: max(var(--lf-sp-1), var(--lf-focus-ring-room)) (controls.css, "Face: Choice"), and the ring room is --lf-focus-ring-w (2px) plus --lf-focus-ring-gap (3px), so the pad is 5px while --lf-sp-1 is 4px. With this change each radio in the threshold and route fieldsets sits 1px in from its legend's edge, and the hang no longer follows the pad if the ring tokens change.
This is the use the controls.css header describes for the token: "A list that sets its marks on a heading's edge hangs each face out by that padding, --lf-choice-pad", and it lists the token beside --lf-choice-gap as something a page or package changes. package-themes.md's Controls row names only --lf-choice-gap. The test's own message gives the other fix: "name the property in the reference that owns it". So the example was right, and the gap is in the reference. I kept the original line and added --lf-choice-pad to the Controls row in skills/leaf/references/package-themes.md ("…; --lf-choice-pad, the padding around a radio's or checkbox's face, by which a list that sets its marks on a heading's edge hangs each face out"), and tests/model/test_theme_tokens.py passes 3/3 with that change. Adding a token to a shipped reference is a contract call, so I've left it to you rather than pushing it.
The journey's locator change is correct: the field is <input name="label">, written with no type.
| .alert-settings fieldset > label { | ||
| justify-self: stretch; | ||
| margin-inline-start: calc(-1 * var(--lf-choice-pad)); | ||
| margin-inline-start: calc(-1 * var(--lf-sp-1)); |
There was a problem hiding this comment.
This keeps the hang equal to the face's pad. It needs --lf-choice-pad named in package-themes.md, as the review body says:
| margin-inline-start: calc(-1 * var(--lf-sp-1)); | |
| margin-inline-start: calc(-1 * var(--lf-choice-pad)); |
Fixes the two tests #6231 (the playground's native form) left failing on main: the
alert-thresholdsexample read Leaf's private--lf-choice-pad, whichtest_theme_tokensrefuses, and now uses--lf-sp-1, the value that pad resolves to; the prepared-install journey looked forinput[type=text]on a field that writes notype, and now finds it by name. I merged #6231 with itstestjob red (my merge gate's exit status was swallowed by a pipe); both failures are its own. Both tests pass by node id.