Skip to content

fix: follow lf-options' shadow roots in the page reading, the group's redraw and focus keys - #7517

Merged
max-sixty merged 2 commits into
mainfrom
fix/issue-7494
Nov 28, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/issue-7494

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

#7417 moved lf-options' controls into shadow roots. Eight browser tests have failed on every push to main since. Three only read light-DOM nodes the port moved. The other four caught real regressions, and this PR fixes those in the code while keeping #7417's design. Each of the eight fails on main and passes here; the Back test passes in both Chromium and Firefox.

Regressions fixed

  • A quote landed in the half of a suggestion the user accepted away (test_a_label_in_a_retired_slot_leaves_the_page_with_the_slot). The page reading reset silenced at every declared shadow root (crossed in readings/passages.ts). A retired slot therefore stopped silencing words that a widget inside it draws in its own root. Port lf-options to Effect UI as the first decorating widget #7417 moved the settled group's "Settled: …" label into such a root, so a comment on those words found them again and painted a mark there. Silence now carries across a declared root, and settledAway climbs out of shadow roots (upFrom) to find the slot. This rule predates Port lf-options to Effect UI as the first decorating widget #7417, which only exposed it.
  • An option that a revision rewrote lost its mark and its pick (test_ideas_shortlist_survives_revision_and_can_reopen). A revision replaces an option element whose words changed. The group's arguments stay the same, so GroupLight.show never reached the new node, which was left with no face, no mark and no selected. The group's state still held the pick. The group now draws again on its slot's slotchange. It also declares its key rows again, because their closures held the old option node.
  • Back returned focus to the option rather than to its mark (test_back_returns_to_a_named_control_in_a_message_the_agent_rewrote). Before the port, the mark was a light child of the option, and a focus key named it by its place inside the option. Now the mark is in the option's shadow root, and nameIn collapsed it into the option itself. records/carry.ts now looks for that place in the named element's shadow root after its light tree. On the page, such a place still counts only within the revision it was read in. So test_a_restated_obligation_returns_a_user_to_the_question_not_to_a_control still hands the obligation back after a revision. I first tried a data-lf-carry key on the mark, which broke that test, so I dropped it.

Already correct; the probes now reach the shadow roots

  • test_a_pin_keeps_clear_only_of_controls_the_user_can_see: its last button was Add's submit, which is now in the group's shadow root.
  • test_one_key_keeps_one_keyboard_face_across_the_page: it reads the option's key badge through the locator. The badge's key face still matches the sequence chip's and the target picker's.
  • test_a_wide_widget_stays_inside_a_box_that_frames_it: the row's mark is read through its option's shadow root.
  • test_an_obligations_digits_are_drawn_whole: CLIPPED_BY and INSIDE_ITS_OPTION (tests/render_cases_navigation.py) now climb from the badge to the option that hosts its root. The digits are still unclipped, off the words and on one seat per form.
Other checks
  • pnpm run test:runtime passes, and so does pnpm run check.
  • tests/browser -k "option or obligation or pick" passes, as does -k "back or forward or carry or history", apart from test_design_mode_reads_each_shape_of_control_into_the_anchor_its_routes_carry. That one fails the same way on main at this run's base, which predates fix: keep the panel tab's preview on its list's name, and follow #7403's names in five tests #7493's repair of it.
  • -k "retired or settled or suggestion or revision" shows two teardown errors (unchanged write: aria-expanded on the margin's More face, in test_suggestion_actions_stay_reachable_through_a_decision_and_its_undo and test_a_decision_undone_leaves_every_suggestion_pin_where_it_stood). Both also fail on main without this change.

Closes #7494 — automated triage

…aw and focus keys

#7417 moved lf-options' controls into shadow roots. Eight browser tests have
failed on main since. Three only read light-DOM nodes that moved, and four
caught behavior that changed:

- A retired suggestion slot no longer silenced words a widget inside it draws
  in its shadow root, so a quote matched the settled label in the half the
  user accepted away. The reading now keeps silence across a declared root,
  and settledAway climbs out of shadow roots to find the slot.
- A revision that replaced an option node left the new node with no face,
  mark or `selected`, since the group's args didn't change. The group now
  draws again on its slot's slotchange and declares its key rows again.
- Back named a mark in an option's shadow root as the option, so focus came
  back to the option rather than its mark. A focus key now names a control by
  its place in the named element's shadow root as well as its light tree. A
  page revision still hands back the obligation, as before.

The three probes now reach Add's submit, a key badge and a row's mark
through their shadow roots.

Closes #7494

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping silenced: false from crossed makes the reading-context header above NO_CONTEXT in browser/runtime/readings/passages.ts false. It still says "Three of the facts stop at a shadow boundary … closest for chrome, silence and the generated marks". Silence now crosses a declared root, and settledAway and retiredSlot both climb with upFrom. That header is the module's statement of which facts start over at a root, so a later change to crossed would read the old rule there. I'll push a commit that moves silence to the facts that cross, beside blocks and cells, in both passages.ts and the built passages.js.

…hadow root

The change to `crossed` carries silence into a declared root; the header above
NO_CONTEXT still listed it with chrome and the generated marks as stopping there.
@max-sixty
max-sixty merged commit 7801e46 into main Nov 28, 2026
8 checks passed
@max-sixty
max-sixty deleted the fix/issue-7494 branch November 28, 2026 08:42
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.

Eight browser tests fail since #7417 ported lf-options to Effect UI

2 participants