Repository navigation
fix: keep code-comparison's readers and notification-playground's readings inside their boxes - #6373
Conversation
…dings inside their boxes #6231 rewrote both pages' candidate and rail CSS when playgrounds became native forms, and the nightly render gate has failed on them since. code-comparison: the page's module sets each candidate's width to the viewport slider's value (420px), and `.treatment` was a grid with an implicit `auto` column, which grew to that width, so `max-width: 100%` never held the candidate to its card. At 720-760px candidate A's reader ran under candidate B's card, and at 360-440px the page scrolled sideways by 88px. The card's one column is now `minmax(0, 1fr)`, so the reader stays inside its card at every width. notification-playground: each setting's reading was absolutely placed at the top right of its label, so at 760px it sat over "Concurrent release events" once those words wrapped. The setting is now a two-column grid with the label on a subgrid: the reading takes the second column of the words' line, and the slider below spans both columns as before. At the default 1440px window the page draws pixel-for-pixel as before. `test_page_fixture_renders[code-comparison]` and `[notification-playground]` fail before this change and pass after it. Refs #6297
|
@leaf-agent The new grid places the numeric output in the slider’s row, where it stretches over the slider’s right edge. A focused Chrome hit test on this head clicked two pixels inside that edge at the slider’s vertical center and hit the output instead of the input. Please align the output to the start of its row and verify that the maximum remains clickable on both sliders.
|
…ed (#6375) Since #6231, a playground reads every named `input`, `select` and `textarea` inside it as a field, inside the one `<form>` it draws around its rail and preview. A widget in the preview that draws named controls of its own then has them read as the page's fields. On motion-playground, `lf-motion`'s transport draws `<input name="time">` and `<select name="speed">`. The playground took both as fields and posted `tune {time: 0, speed: "1", timing: …}` while nobody touched the page. That event is the at-rest write the nightly render gate reports on `motion-playground`: `data-lf-user-override` and `childList` on `lf-playground#panel-motion`, and a `requestFrame` that ran twice. The `403` from `/api/event` in #6297's local teardown is the same post. The fix is one more condition in the playground's field membership ([`playground-view.js`](https://github.com/max-sixty/leaf/blob/c0015604d349bdb7b5f227e6e90e25bc62d279f4/packages/playground/widgets/playground-view.js#L186-L196)). A control inside an element marked `data-lf-gen` within the playground is no field. `offer`, `offerElement` and `generatedElement` write that mark on everything a widget generates, and `passages.js` reads it as "not authored". The view's header already said that an inspection setting in a form of its own is no field. A widget's generated controls now count the same way, without each widget having to drop `name` or wrap its controls in a form. The playground's own wrappers carry no such mark, so the page's fields are unaffected. A control a page script creates without the mark is still a field. **Verification** - `tests/runtime/playground-view.test.mjs` adds a generated range and select to its fixture. It fails before this change and passes after it. `pnpm run test:runtime` passes (1012). - `test_page_fixture_renders[motion-playground]` (`--run-nightly`, Linux) fails on main with the at-rest findings and passes with this change. A request listener on the served page records no `/api/event` post at rest after the change, where main posted the `tune` above. - `test_page_fixture_renders[playground|alert-thresholds|data-explorer]` and five field tests in `tests/browser/widgets/test_playgrounds.py` still pass. This leaves part of #6297. The focus-ring finding on motion-playground (`test_each_sampled_focus_ring_is_shown_whole_in_its_surface`) still fails with this change and has a separate cause, recorded on the issue. The code-comparison and notification-playground layout fixes are in #6373. Refs #6297 — automated triage Co-authored-by: leaf-agent <[email protected]>
The setting's grid placed each <output> in the row that also holds the label's slider, and the output stretched to the row's height, so it covered the slider's right edge: a click two pixels inside the edge hit the output. The output now aligns to the start of its row, above the slider.
|
Fixed in f4d928d: each setting's I ran the same check in Playwright's Chromium against a live preview, at 360, 760, 1024 and 1440px wide:
|
#6231 rewrote the candidate and rail CSS of these two pages when playgrounds became native forms. The nightly render gate has failed on both since. This fixes each page's own CSS. The change's intent, cards drawn from the page's own CSS, is kept.
widthto the viewport slider's value (420px)..treatmentwas a grid with an implicitautocolumn, which grew to that width, somax-width: 100%never held the candidate to its card. At 720–760px candidate A's reader ran under candidate B's card, and at 360–440px the page scrolled sideways by 88px. The card's one column is nowminmax(0, 1fr), so the reader stays inside its card.leaf-dev stills --authoredshows 0 changed pixels.test_page_fixture_renders[code-comparison]and[notification-playground]fail on main and pass with this change (--run-nightly, Linux).States changed on screen (
leaf-dev stills --authored, base left, head right):code-comparison at 740×900, where the two cards stand side by side:
notification-playground's rail at 760×900:
At 400px wide, code-comparison's cards stack one per row, and each reader now fits its card with no sideways page scroll.
This leaves the rest of #6297:
motion-playground's at-rest event, fixed in a separate PR, and the focus-ring finding on that page.Refs #6297 — automated triage