Skip to content

test(browser): read the widget through its shadow root, and judge a preview - #56

Merged
Ardnived merged 1 commit into
mainfrom
test/browser-shadow-root
Oct 2, 2026
Merged

Ardnived merged 1 commit into
mainfrom
test/browser-shadow-root

Conversation

@Ardnived

@Ardnived Ardnived commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The lane reads the widget through <sahaj-atlas>'s open shadow root. SahajAtlasWeb#243 moves the widget into one, and the lane read .sy-atlas from the light DOM. The day #243 deploys, every cell would have reported "no .sy-atlas". The lane still reads the current light-DOM widget.
  • Hit tests descend into shadow roots. document.elementFromPoint stops at the host, so "the search box is on top" and the overlay's close-button and drawer checks would all have failed.
  • SAHAJ_ATLAS_WIDGET_FROM=<preview origin> serves sahajatlas.com from a SahajAtlasWeb Cloudflare preview. A widget PR can now be judged in every theme before it deploys.
  • The typeface probe skips Mapbox's container. Mapbox's stylesheet sets Helvetica Neue on its own attribution link and zoom buttons. That caused 40 of main's 64 typeface findings. The remaining 24 are real h2 leaks on Enigma, Esotera, Fluida, Mesmerize, Seva Lite and Twenty Twenty-Four.
  • AGENTS.md: documents the preview override, and the trap that pnpm test deletes the network log every lane reads, so lanes must run one at a time.

Test results

Full lane, every cell:

Widget Failures Known Widget findings
Production (light DOM) 0 19 24, all h2 leaks (was 64)
#243 preview 4336c065 (shadow root) 0 19 1

Under #243 all 24 h2 leaks are gone. The one remaining finding is Enigma at laptop size: the search input and one link carry Mapbox Search JS's own system font stack, not the theme's. The overlays, stacking and hit tests pass in both builds.

A standalone probe confirmed each piece:

  • The routed preview really renders in a shadow root (shadowRoot.querySelector('.sy-atlas') is found, the light-DOM lookup is not).
  • Playwright's sahaj-atlas .sy-atlas selector pierces the shadow root.
  • The new font probe still catches a planted body h2 { font-family: Georgia } in production. It finds real widget elements in both builds, so it can't pass by finding nothing.

Notes for reviewer

Test-only change: nothing here ships in the zip.

🤖 Generated with Claude Code

…review

SahajAtlasWeb#243 renders the widget in an open shadow root on
<sahaj-atlas>. The lane read `.sy-atlas` from the light DOM and hit-tested
with document.elementFromPoint, which stops at the host, so every cell would
report "no .sy-atlas" the day it ships. `laneDom` reads through either tree
and descends shadow roots for hit tests.

SAHAJ_ATLAS_WIDGET_FROM answers sahajatlas.com from a Cloudflare preview, so
a widget PR is judged in every theme before it deploys.

The typeface probe skips Mapbox's container. Mapbox sets Helvetica Neue on
its own attribution link and zoom buttons, which made 40 of the 64 typeface
findings on main; the 24 left are real `h2` leaks on six themes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Ardnived
Ardnived merged commit be41757 into main Oct 2, 2026
7 checks passed
@Ardnived
Ardnived deleted the test/browser-shadow-root branch October 2, 2026 02:02
@sydevs-bot sydevs-bot moved this from Revising to Done in SYDevelopers Technical Roadmap Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant