Skip to content

Let popovertarget alone record each banner popover's invoker and expanded state - #2502

Merged
max-sixty merged 5 commits into
mainfrom
agent-af1dda23fe9e99b28
Oct 12, 2026
Merged

max-sixty merged 5 commits into
mainfrom
agent-af1dda23fe9e99b28

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The banner's three native popovers (status explanation, More, Versions) each stated their invoker relationship twice: once as popovertarget and again as an lfInvoker expando from popover to button, plus a hand-written aria-expanded that the status view repainted on every toggle. The attribute is now the only record.

Lit follow-up review, item 33:

  • Invoker. The lfInvoker writes are gone from banner-status-view.js, banner-toolbar.js and version-picker.js. transitionNativeAncestor (keyboard/layer-stack.js) derives the invoker it reopens a popover with from the popovertarget attribute in its tree, and bannerControlDoor names the More door directly, since .lf-banner-menu is only ever overflowMenu.
  • Expanded state. The status button, More and Versions no longer write aria-expanded. Chrome maps expanded and collapsed natively for a popovertarget invoker; I checked this in Chrome 155's accessibility tree over CDP, and a disabled Versions button (no popover target) reports neither. The status view's repaint on toggle existed only to refresh the attribute and is removed, as is the version picker's #presentDisclosure. The keyboard disclosure scope never applied to banner chrome, so the shortcut bar and aria-keyshortcuts on these buttons are unchanged (probed before and after).
  • Publication layout. A publication has no status button, so it no longer renders the explanation popover either. Removing an open popover closes it natively, so the closeNativeLayer guard in present() goes.
  • Banner leftover. banner.js names the approval wait reason once and uses it at both sites, rather than assigning it and passing it straight back in.

Line deltas, measured against main (excluding tests, vendored bundles and Markdown):

  • Hand-written source: +48 / −57 (−9).
  • Tests: +45 / −35 (+10). A new accessible_expanded helper in tests/render_harness.py reads the accessibility tree. test_banner_status_keeps_publication_links_outside_its_disclosure now asserts that tree, and that a publication shows no disclosure, rather than node identity. Attribute assertions on the three invokers are removed where an adjacent popover visibility assertion already states the user-visible result.

Behaviour change: assistive technology reads expanded state for these three buttons from the platform rather than from an attribute, and in publication mode the page no longer carries a hidden, unopenable status popover.

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

@max-sixty
max-sixty merged commit eea5920 into main Oct 12, 2026
3 checks passed
@max-sixty
max-sixty deleted the agent-af1dda23fe9e99b28 branch October 12, 2026 06:14
leaf-agent added a commit that referenced this pull request Oct 12, 2026
A website publication has no status disclosure after #2502, so the
public session reference test waited for a status detail that cannot
exist. This changes the test to assert that the detail is absent, then
keeps its checks that the reference is hidden until More opens and can
be copied.

The [failed main
run](https://github.com/max-sixty/leaf/actions/runs/38211557350) timed
out on the old locator. The focused test failed before this change and
passed afterward: `uv run pytest
tests/test_render_startup.py::test_a_website_example_shows_its_public_session_reference
-q -n0 --tb=short`.

Co-authored-by: leaf-agent <[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.

2 participants