Repository navigation
Take Leaf's buttons and fields from Web Awesome's native styles - #5340
Merged
Merged
Conversation
…tion wears the band
… neutral chevron, listboxes
…me, one disabled hand
leaf-agent
reviewed
Nov 4, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
This PR and #5329 change the same face rules in opposite directions, so merge order is a decision for you, and merging this one under yolo would make it for you:
- #5329 makes a role's look come only from its role's rules in
controls.css. Its check,test_a_press_wears_its_role_s_face_alone, refuses any rule outsidecontrols.cssthat setsbackground/color/border/box-shadowon a role's control. This PR moves the word, symbol and commit faces into the generatedvendor/webawesome-native.css. The check passes that sheet only because it skips every path undervendor, so after both land, much of a role's face sits in a sheet the check never reads. - #5329 deletes the
.lf-msg-edit-actions > .lf-msg-control:is(:hover, [data-lf-focus])fill inresponse.css. This PR rewrites that rule to abackground-colorthat falls back to the library's tokens. Under #5329 it is the kind of rule the check refuses.
Whichever lands second has to reconcile both points, and the first needs a decision: either the generated sheet joins #5329's face check as a declared source of role faces, or the check states that the vendor map owns them. Apart from this overlap I found nothing to change. node build/browser/build.mjs --check reproduces the committed sheet, and the ring, tapped-button and spent-control tests pass locally (30 passed).
…et is a second home of the role faces
…hout Leaf; take the theme's tokens only
leaf-agent
approved these changes
Nov 4, 2026
max-sixty
pushed a commit
that referenced
this pull request
Nov 7, 2026
…he shift watch hear it (#5675) Since #5340 took Leaf's buttons from Web Awesome's native styles, a pressed `.lf-btn` carries `transform: scale(.9875)` while it is `:active`. After a touch tap, Chromium keeps that press on a timer for about 100 ms past the pointer's last event. Two readings in `test_on_a_phone_turning_on_s_tabs_moves_nothing` caught that window: - **The assertion.** `panel_settled` returns inside the press window, so the tab geometry the test reads can include the press's scale. The failing reading is exactly that: the first tab's width goes 44.92 → 44.36 (× 0.9875), and x and y move by half the lost width and height. Whether a read lands in the window depends on timing, which is why CI's onset couldn't be bisected: the runtime speedups in `b3c9842e8..6cd5093` let `panel_settled` return sooner. The test now reads once no control in the panel's foot, where its tabs stand, is `:active`. No tab actually moves when the views change. - **The teardown error.** `shift_watch.js` only re-reads the page when something announces a change. When the press lets go on that timer, no event fires, so the verdict read found an unannounced change to the tab's text (`shift watch missed a change to #text in span.lf-fp-tab-words`). The watch now remembers the node a pointer released on and announces the frame where its `:active` match changes, which costs one `matches()` per frame. The header's "Unchanged frames" list names the new source. No product behavior changes; the press feedback stays. Verification: on main, the floating-panel test fails locally every run with the same numbers CI reports, and with this change it passed three runs in a row. Each half fails without the other. The new `test_a_tap_s_press_letting_go_is_heard` reports `shift-watch-missed` without the watch change and passes with it. The shift-watch tests matching press, tap, verdict and complete-readings (42) and the floating panel's phone/tap/touch tests pass. Closes #5653 — automated triage Co-authored-by: leaf-agent <[email protected]>
This was referenced Nov 7, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 7, 2026
…y's button padding (#5689) #5340 moved Leaf's word buttons onto Web Awesome's side padding, `--wa-form-control-padding-inline` (1em, so 12.5–14px), replacing a fixed 10px. Two widgets reserve their room before they upgrade, and both reservations still added a hard-coded 10px per side: lf-tally's invisible "Next on me" placeholder, and the inset on lf-dial's measure of its three radio labels. So each widget got wider once it upgraded (the dial by 24px in a column page), and the widget-quality `keeps-first-box` check failed. Both reservations now use the token. The token is resolved in the same font as the control each one stands in for, so the reserved box follows the library's padding and doesn't hard-code a second copy of it. The upgraded widgets look exactly as they did. Only the invisible box before upgrade changes: it is now as wide as the control that replaces it, so the widget no longer moves the content that follows it. For that reason this PR has no before/after screenshots. `tests/journeys/test_widget_quality.py::test_bundled_widgets_meet_the_widget_quality_checks[default]` and `[detail]` (run with `--run-nightly`) fail on main `76c9c08fd` with the messages in #5680 and pass with this change. `known_widget_findings.py` is unchanged. No other `:not(:defined)` reservation in `packages/` or `browser/styles` hard-codes the button padding. Closes #5680 — automated triage --------- Co-authored-by: leaf-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Leaf's word, symbol and committing presses, and its text fields and selects, now take Web Awesome's design from the installed library, as its radios and checkboxes already did. The build generates the rules from Web Awesome's
native.css, so Leaf no longer draws these faces itself.The user asked for a reasonable design from a UI library rather than looks of Leaf's own, and asked why Leaf copied the library's rules rather than referencing them. After seeing previews, they asked that words keep Leaf's quiet look, through the library's own tokens.
What changes on screen
.lf-btn, authored.button) keep Leaf's muted ink and regular weight. Their side padding becomes the library's 1em, 12.5–14px, up from 10px. Under a hovering pointer they take the library's quiet fill, Leaf's field colour, where they took the chip and turned ink; the words stay muted. Symbols take the same fill..lf-btn.lf-commit, authored.button.primary) is the library's outlined button in the brand variant: accent words under the softened accent hairline, with the tint under the pointer, on a clear ground rather than the card's.aria-disabled. surfaces.css's cue for every disabled control a widget offers moves to the same pair from 0.55 and the default cursor, and Send and Dictate, which keep their own muted face, take the same not-allowed hand. A disabled commit used to have a grey face of its own..field, and inputs and selects with.lf-ui) keep their height. Their inner padding becomes 1em, up from 8px, and a select shows the library's chevron instead of Leaf's small drawn arrow, set in a neutral grey (the library's own grey turned violet on Leaf's warm grounds). An authoredtextarea.fieldtakes the library's text box; Leaf's own text boxes, which grow with their words, keep theirs.How the rules are generated
build/styles.mjstakes the "Checkboxes + Radios", "Buttons" and "Text Fields + Textareas + Selects" regions ofnative.cssinto one generated sheet,browser/styles/vendor/webawesome-native.css. That sheet replaceswebawesome-choice.css. For each region, a map names the Leaf faces that the library's element types, classes and states stand for. For example,buttonbecomes:is(.lf-btn, .button, .lf-icon-action),.wa-plainbecomes:not(.lf-commit, .primary),.wa-outlinedbecomes:is(.lf-commit, .primary)and:disabledalso matches[aria-disabled="true"].lightningcss, already in the lock through Vite and now a pinned dev dependency, lowers the library's nesting and rewrites each selector through the map. The rewrite drops:
input[type=file]orwa-icon, and a single-choice listbox (sizeover 1), which the library would draw as a closed select, so it keeps the browser's face;LEAF_SETS), since the library's grey blended to violet on Leaf's warm grounds. The build fails if the library stops writing that value.Every generated rule weighs nothing (
:where()), as the library's own sheet sits in its lowest cascade layer. shadow.css imports it after Leaf's defaults for every control and before controls.css, which now states only where Leaf departs from the library:--lf-line), at their own width, on the card ground;The radio region moves from
@scope (.lf-choice, .choice)to the same map (input→:is(.lf-choice, .choice) > input). Leaf's[type]workaround against scope proximity goes with it.#5329, which landed first, draws each role's face only in its role's rules and checks that no other sheet does (
test_a_press_wears_its_role_s_face_alone). The generated sheet is now the second place a role's rules stand (FACE_HOMES): it holds the library's part of the word, symbol and commit faces, named by their face classes and narrowed only by states. #5329's variants (tones, discs, an open menu's chip, a pressed commit) stay in controls.css on top of the library's faces.The library's tokens off Leaf
The generated rules read Web Awesome's tokens, so a page without Leaf that links
portable.cssdrew its widgets' presses without a frame or padding (test_a_host_draws_each_widget_as_a_leaf_page_does).portable.cssnow carries Web Awesome's tokens and Leaf's values for them at the host's root, as it carries Leaf's tokens:build/styles.mjskeeps only the theme's custom properties, its tokens. Its root colour, colour scheme and sans and its page-frame rules go, so base.css's rule reverting the first three goes too.components/webawesome.cssinto their own sheet,styles/webawesome-tokens.css, which shadow.css imports where the rule stood andportable.cssplaces at the root.Testing
leaf-dev stillsagainst main for release-draft, trace-controls, notification-playground, hub-choice, command-hub, plan-panel, visual-review-gallery and command-reference-search, and trace-controls in the dark scheme. The differences are the ones listed above. The floating panel's filter tabs keep their one-line wrap, and plan-panel shows no pixel change.--lf-line, two disabled looks, the violet chevron, a build guard for selector arguments it can't rewrite, and stale comments. It confirmed the fixes and that a fresh build matches the committed sheets byte for byte.test_a_pressed_quiet_action_looks_like_its_neighbournow compares the band as well as the ground, since visible focus no longer lays a fill, andtest_a_control_a_widget_built_is_told_from_a_label_it_wroteexpects the not-allowed hand on a spent control. Both pass, withtest_a_tapped_button_looks_like_its_neighbourand the choice ring tests; the ring tests run in Chromium and Firefox.test_plain_choices_stand_one_per_line_until_the_author_sets_columns,test_an_ordinary_page_is_drawn_as_writtenfor every plain page, andtest_each_control_archetype_holds_its_neighbours_stillfor playground-actions, shot-view and both visual-review archetypes.test_a_host_draws_each_widget_as_a_leaf_page_does, the face checks intest_interact_layer.py(with the generated sheet as a home), and the Web Awesome typography and menu tests.pnpm run check:tools,pnpm run check:browser(the generated sheets match the build) and the dependency-bundle publisher's tests. Stills after taking the theme's tokens only show no change of colour, colour scheme or font anywhere.Known weaknesses
nulland refuses them back, so the build strips nulls before returning a rule.button { … }in its defaults.css, which comes after Leaf's sheet in the same layer) now restyles Leaf's presses in the page, where Leaf's class-weight faces used to win. No bundled or installed theme has such a rule.LEAF_SETSswaps one literal colour in the library's output; a library update that redraws the chevron in another grey fails the build until the entry is updated.