Skip to content

Follow #7417's lf-options port in the comparison and a layout test - #7450

Merged
max-sixty merged 1 commit into
mainfrom
effect-ui-core-options-followups
Nov 27, 2026
Merged

max-sixty merged 1 commit into
mainfrom
effect-ui-core-options-followups

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Requested by Maximilian · project thread

Two tests have failed on main since #7417 moved lf-options' drawn controls into the group's shadow root. This PR fixes the code behind one and updates the other test.

  • The comparison's settled-options view (test_a_change_ends_where_a_disclosure_does[settled-options]). version.ts found a disclosure's view through its control's aria-controls ids, and searched only the light DOM. The settled row now stands in the shadow root and names its options through ariaControlsElements. That left a settled group's options with no view, so a change ran past them. viewOf now maps each controlled element to its control and searches shadow roots too (queryAllUnder).
  • The bare-labels layout test (test_a_group_of_bare_labels_reads_as_a_question_about_the_page). It counted the group's light children, which no longer include the "another" cell the group draws in its shadow root. It now counts the shadow cell parts too.

Checks: both tests pass, in both params of the disclosure test.

🤖 Generated with Claude Code

https://claude.ai/code/session_01V22NWd3erndyoj2G9LEP7y

This was written by Claude Code on behalf of max-sixty


Generated by Claude Code

The comparison found a disclosure's view by its control's `aria-controls` ids in
the light DOM. Since #7417 the settled options row stands in the group's shadow
root and names its options through `ariaControlsElements`, so a settled group's
options were no view and a change ran past them. `viewOf` now maps each
controlled element to its control, searching shadow roots too.

The bare-labels layout test counted only the group's light children, which no
longer hold the "another" cell the group draws in its shadow root.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V22NWd3erndyoj2G9LEP7y
@max-sixty
max-sixty merged commit f14a305 into main Nov 27, 2026
6 checks passed
@max-sixty
max-sixty deleted the effect-ui-core-options-followups branch November 27, 2026 22:16
max-sixty added a commit that referenced this pull request Nov 27, 2026
…ent, TypeScript (#7448)

<!-- claude-projects-attribution: {"github_login":"max-sixty"} -->
_Requested by **Maximilian** · [project
thread](https://claude.ai/code/project/chan_01HAT2svakg1fTA5kitqhX9w?thread=cmsg_01HAT2svakg1fTA5kitqhX9wAWrHoDSUn5ogNyh9ijmSrr)_

Part of the Effect UI core pass: `defineWidget` settles into one
contract, stated in `effect-widget.ts`'s header, before the next widgets
(lf-tabs, lf-board, lf-code, lf-toc, lf-draft, lf-call-diff) build
against it.

**What changed in the contract**

- **`declare(node, {lfCommands, lfParts})`** is now the one way an
Effect widget states what Leaf reads off its element. A widget calls it
from a Mount, passing its element or any node its view drew. Each call
says the declarations (`lf-commands`, or `lf-layout` for parts), and the
adapter withdraws both when the root closes. Effect UI gives a root's
owner no hook on a flush, so the adapter hears only the draws it starts.
It says `lf-commands` after each of those, and `lf-layout` too when the
widget declares parts. A draw that the component's own messages start,
such as a timeline step or motion's play/pause, is said by the widget:
it passes what its rows and parts read as the Mount's args and declares
on each change. lf-timeline, lf-motion and lf-options use `declare` and
dispatch nothing themselves. A key scope that belongs to one control
node, such as lf-option's mark or lf-file-tree's rows, stays that node's
own `lfCommands`.
- **Failure keeps the authored content visible.** When a root fails or
its inputs throw, the adapter places Leaf's failure box beside the
authored children (`placesFailure`), and a failed shadow root draws a
bare `<slot>`. Before this, `failSoft` replaced the element's children
with the box, so a failed lf-timeline lost its lanes. A failure from the
inputs clears once they read cleanly again. A failed root stays failed
until the element connects again.
- A member's `get` and `set` are both required, since every caller gives
both.
- `properties` and `members` both capture a value the page set before
the tag was defined, as before. The capture now runs in one loop.
- The header records the three Effect UI limits behind the design:
- Each element mounts its own root, because `defineElement` shares its
document host only through an internal argument, clears the element's
children, and has no `lf-connect`, `inputs` or `members`.
- A root has no hook on its flushes (`Renderer.Root` has `model`, `send`
and `setProps`), which is why a widget declares on its own Model-driven
draws.
- `patchAttrs` removes dropped attributes before it sets new ones.
lf-activity's `tabindex` workaround stays for this.

`effect-widget` is now written in TypeScript. No option was removed:
every one has a caller.

**Checks**: `pnpm run test:runtime`, with new tests for failure in a
light and a shadow root, for failing inputs, and for `declare`,
including a row whose availability an in-widget message changes. Also
the timeline, motion, options, command-reference and key-scope browser
tests, and `leaf-dev stills --base origin/main` over the timeline,
motion, options, activity, tally, file-tree and failed-widget states: no
visible difference. Two lf-options tests already fail on main and fail
the same way here:
`test_a_group_of_bare_labels_reads_as_a_question_about_the_page` and
`test_a_change_ends_where_a_disclosure_does[settled-options]`. #7450
fixes both.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01V22NWd3erndyoj2G9LEP7y

> _This was written by Claude Code on behalf of max-sixty_


---
_Generated by [Claude Code](https://claude.ai/code)_

---------

Co-authored-by: Claude <[email protected]>
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.

3 participants