Skip to content

test(browser): run the real widget in real themes, in a browser - #44

Merged
Ardnived merged 6 commits into
mainfrom
test/browser-lane
Oct 1, 2026
Merged

Ardnived merged 6 commits into
mainfrom
test/browser-lane

Conversation

@Ardnived

@Ardnived Ardnived commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Changes

  • tests/browser.mjs — the lane. One Playground server per cell (WordPress 6.7.9 / PHP 7.4, theme from wordpress.org, PHP offline through tests/no-network.php), one Chromium, clients/me and clients/report stubbed, every other widget read real.
  • package.json — [email protected] (dev only; the zip ships no package.json or node_modules) and the test:browser script.
  • AGENTS.md — the lane in the Testing table, its three verdicts, its setup, and two corrected traps.
  • tests/render.mjs — the corrected preferredVersions comment. No behaviour change.

Test results

Manual verification

  1. Run pnpm exec playwright-core install chromium once, and keep SAHAJ_ATLAS_TEST_KEY in .env.claude.local.
  2. pnpm test:browser --list, then pnpm test:browser --only astra,esotera. Astra passes (its WIDGET lines are SahajAtlasWeb's), Esotera reports KNOWN, and screenshots appear in tests/screenshots/.

Notes for reviewer

Detail

Cells. Free fleet themes: astra, oceanwp, mesmerize, esotera, fluida, popularfx, seva-lite, enigma, twentytwenty, twentytwentyfour, twentytwentyfive. Builders on WordPress 6.8: Elementor, Beaver Builder Lite. Hostile conditions, as mu-plugins: async CSS, a fixed header, a 62.5% root font, a z-index content wrapper, the admin bar, a stripped module tag. Paid themes (Mesmerize Pro, Esotera Plus, Uncode, JupiterX, Themify Ultra) and builders (WPBakery, Divi) are out by decision; a gitignored mount can add them later.

Measured per cell and viewport (1280×720, 1366×650, 390×844, 844×390): whether the interface or the compact card rendered and the widget's own console reason; the element against the 360×420 floors; the header's bottom against the element's top; elementFromPoint at the search box; every drawer or Radix dialog inside .sy-atlas; nothing on <html>; font, list-style and icon-fill probes; the side panel's width. A landscape phone is allowed the card by the widget's own rule; the lane then opens it and judges the overlay.

The version finding. Every cell first ran WordPress 7.1.2 on PHP 8.5.8 despite --php 7.4 --wp 6.7. Measured: render-classic.json with --php 8.3 --wp 7.1 serves 6.7.9 on 7.4.33; without preferredVersions, with --php 7.4 --wp 6.7, it serves 7.1.2 on 8.5.8. The render lane was right only because its blueprints carry the key.

Runtime. About 20s to boot a cell (theme download included), 40–50s per cell with four viewports.

Closes #38

🤖 Generated with Claude Code

Ardnived and others added 4 commits October 1, 2026 09:32
The guide said `server` ignores a blueprint's `preferredVersions` and to pass
`--php`/`--wp` instead. Under @wp-playground/cli 3.1 the reverse holds:
given a blueprint, the flags are ignored, and a blueprint without the key
boots WordPress 7.1 on PHP 8.5. Measured: render-classic.json with
`--php 8.3 --wp 7.1` serves WordPress 6.7.9 on PHP 7.4.33; the same
blueprint without the key, with `--php 7.4 --wp 6.7`, serves 7.1.2 on 8.5.8.
The render lane was right only because both blueprints carry the key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A fourth lane, `pnpm test:browser`, local only. Each cell boots a Playground
WordPress 6.7 / PHP 7.4 with a theme from wordpress.org, loads the Atlas page
in Chromium with the production widget (clients/me and clients/report
stubbed, PHP still offline), and measures at four viewports: whether the
interface or the compact card rendered and why, the slot against the
widget's floors, the header against the element, hit-testing of the search
box and the compact overlay's chrome, portal placement, and probes for host
CSS reaching the widget. Screenshots go to a gitignored directory.

Cells: the eleven free themes the fleet runs, Elementor and Beaver Builder
Lite on WordPress 6.8, and hostile conditions (async CSS, a fixed header,
a 62.5% root font, a z-index wrapper, the admin bar, a stripped module tag).

Verdicts: FAIL is the plugin's and fails the run; KNOWN is an exposure
already ticketed (#35, #37, #40); WIDGET is a production-widget finding
(sydevs/SahajAtlasWeb#234, #236, #238 and #239 in that repo). First full
run: 0 failures, 47 known, 109 widget findings.

Closes #38

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A `known` cell no longer waives invariants. Checks split into `ok`
  (served, PHP never reached SahajCloud, no error panel — fail everywhere),
  `fit` (how the page fits the theme — KNOWN in a ticketed cell) and
  `widget`. Verified: a known cell whose PHP calls SahajCloud now fails.
- Chromium launches once, before any server, and a failed launch names the
  install command instead of orphaning a server. AGENTS.md documents
  `pnpm exec playwright-core install chromium` and states the GL trap
  correctly: headless Chromium needs the software-GL flags.
- The header probe ignores headers inside the widget.
- `--only` refuses an empty or unknown cell name instead of a green no-op.
- Escape closing the overlay is the widget's verdict, not the plugin's.
- The sidebar check confirms the card is the card, not any unlabelled
  button in a full interface.
- A server that exits fails its cell at once, with its output saved.
- The two API stubs live in one helper.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@Ardnived Ardnived left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🧐 Adversarial review

Holistic assessment. The size and scope match #38. The PR is one self-contained lane script, one dev dependency and a row in the guide, inside the owner's limits: free themes, the production widget with its API stubbed, and local only. The preferredVersions correction rides along with a measurement behind it, and it belongs here. The shape problem is in how the lane decides what the widget did. It reads vaul, Radix and data-sy-* internals, and it re-derives embed-slot.ts's floors, when the embed contract already publishes that verdict as a [sahaj-atlas] console warning. As a result, a production widget deploy can raise a plugin FAIL, and one viewport can fail the plugin on the best page it can produce. Fixing that makes the lane smaller. Separately, the branch is stale. #35 merged under four minutes before this PR opened. The PR conflicts with main, CI's Lint & test has never run on its head, and the Mesmerize cell still mutes the regression this lane exists to catch.

Findings

  1. should-fix — tests/browser.mjs:123: Mesmerize's known outlived #35. Rebase (the conflict is in AGENTS.md, where render.mjs:102 becomes :105), drop the known, and put the evidence for acceptance criterion 2 in the PR body. strip-module (:141) cites no ticket either.
  2. should-fix — tests/browser.mjs:447: the plugin's interface/compact FAIL is keyed on undocumented widget DOM. Read the compact console warning the contract publishes instead.
  3. should-fix — tests/browser.mjs:455: the floor check re-derives embed-slot.ts with a bare 0.8 and a + 100. At 844×390, with less than 78px above the element, it fails the plugin exactly where the widget correctly keeps the interface.
  4. consider — tests/browser.mjs:544: "the overlay opens" is an ok invariant that no known can mute, keyed on [data-sy-expanded]. It is not one of the guide's invariants.
  5. consider — tests/browser.mjs:271: allowedDomains: 'localhost' is what keeps Fathom off, and nothing says so. locale is dead, and no doc names the key's client record.
  6. consider — tests/browser.mjs:633: --php/--wp flags that the line above them says are ignored.
  7. consider — tests/browser.mjs:717: "to file in SahajAtlasWeb" asks for duplicate tickets from the second run on.

What was checked

  • Ticket and PR. I read #38 in full (approach, the four acceptance criteria, the verification checklist and the owner's decisions), then the PR body and the full diff origin/main...1b96582: 6 files, 4 commits, merge-base a147091.
  • Read whole. tests/browser.mjs (all 718 lines), tests/render.mjs, tests/no-network.php, tests/render-classic.json, AGENTS.md (Testing, traps), docs/rules/code-comments.md, package.json, .gitignore, .distignore, .github/scripts/package.sh, .github/workflows/ci.yml and assets/atlas-page.{css,js}. I checked the handles the hostile mu-plugins target against includes/embed.php:56,370. Module sahaj-atlas gives the id sahaj-atlas-js-module, and the style handle is sahaj-atlas-page. Both match.
  • Contract side, SahajAtlasWeb origin/main.
    • src/lib/embed-slot.ts: floors 360/420 and SLOT_GAIN 0.8. embedLayout degrades only when there is a destination.
    • src/lib/slot-decision.ts: the viewport is innerWidth/innerHeight, the slot is the element's box, and the warning is COMPACT_MESSAGE. src/lib/report.ts:627 prints it with the [sahaj-atlas] prefix.
    • src/types/client.ts (ClientSchema, which has no locale) and src/config/api/fetch.ts (getClient).
    • src/lib/shape/routing.ts: mountPrefix accepts the stub's 127.0.0.1:<port>/find-a-class.
    • src/views/FullInterface.tsx:61: the localhost gate on analytics.
    • docs/embedding.md documents .sy-atlas, data-sahaj-atlas-ready, Atlas Rethink Sans and the compact console warning. It does not document data-vaul-drawer, data-sy-frame, data-sy-expanded or Radix ids.
    • SahajAtlasWeb has no browser lane of its own (vitest only), so the widget probes have no other home. That is why finding 7 is about wording, not existence.
  • Queries.
    • gh pr view 44: CONFLICTING.
    • git merge-tree origin/main origin/test/browser-lane: the only conflict is AGENTS.md, and the merged render.mjs puts the trap comment at :105.
    • Check runs on 1b96582: dispatch and Workflow state only, with no Lint & test.
    • #35 merged at 16:58Z, and this PR opened at 17:01Z. #37 and #39–#43 are open. SahajAtlasWeb #235, #236, #238 and #239 are open.
  • Ran, read-only. pnpm test:browser --list lists 19 cells, 6 of them known. --only nope exits 2 with a usage line. node --check tests/browser.mjs passes. I did not run the full lane, since it needs the key and takes about 15 minutes.
  • Looked at and not flagged, on purpose.
    • The owner's three decisions.
    • The ticket's 80%-of-height assertion, downgraded to info. That is right, because 80% alone never degrades the widget.
    • 1366×650 in place of the ticket's 1366×768. It is harsher, not weaker.
    • What ships: .distignore already drops tests/, package.json and the lockfile, so nothing new reaches the zip.
    • .env.claude.local, which is the workspace's existing credential file (SahajCloud docs/environment.md).
    • Unpinned wordpress.org themes, which is consistent with "test what sites get".
    • The pnpm-lock.yaml entries, which are consistent.
  • Profile. I read reviewer-profile.md from claude-workflow origin/main. It records no SahajAtlasWordpress sensitivities, so values 1, 2 and 4 and the 2026-09-12 and 2026-09-20 refinements steered this review.

🤖 Written by the sydevs autonomous loop — see what this is

Comment thread tests/browser.mjs Resolved
Comment thread tests/browser.mjs Resolved
Comment thread tests/browser.mjs Resolved
Comment thread tests/browser.mjs Resolved
Comment thread tests/browser.mjs Resolved
Comment thread tests/browser.mjs Resolved
Comment thread tests/browser.mjs Resolved
Ardnived and others added 2 commits October 1, 2026 10:14
From the adversarial review of #44:
- The plugin's verdicts no longer read widget internals. The compact-card
  decision comes from the warning the embed guide documents; the size check
  is the plugin's own contract — the element runs to the viewport's bottom —
  instead of a copy of the widget's floors. A landscape phone at 844×390 can
  no longer fail the plugin for a decision the widget made correctly.
- Every overlay verdict, including opening it, is the widget's.
- Mesmerize is no longer `known`: #35 shipped, and the cell now passes.
  `strip-module` cites SahajAtlasWeb#239.
- The client stub says why `allowedDomains: 'localhost'` matters (it keeps
  the widget's analytics off), drops the unread `locale`, and names the
  SahajCloud client the test key belongs to.
- The ignored `--php`/`--wp` flags are gone; the summary no longer asks for
  duplicate tickets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Ardnived

Ardnived commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the adversarial review: all seven threads adopted in 4e86657 (after merging main in 53c4637), replied and resolved. Plugin verdicts now read only the widget's documented surface; the compact decision comes from its documented warning; overlay verdicts are all the widget's; Mesmerize passes since #35.

The new "runs to the bottom of the screen" check then caught a real defect on four themes: #46, fixed in #48. Lint & test: green.

🤖 Written by the sydevs autonomous loop — see what this is

@Ardnived
Ardnived marked this pull request as ready for review October 1, 2026 17:45
sydevs-bot pushed a commit that referenced this pull request Oct 1, 2026
#40 names Astra, OceanWP and Elementor transparent headers. Elementor's theme
builder prints its header into a plain `div` with `data-elementor-type="header"`,
which none of the three existing selectors reach, so that case was left under
the header. The selector matches the one PR #44's browser lane already uses.

The stubbed lane cannot tell the selectors apart, so this rides on the guards
the other scenes pin: out of flow only, above the atlas, inside the top half.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015QGDLmYDuvjPYCqBRejoAz
sydevs-bot pushed a commit that referenced this pull request Oct 1, 2026
The ⚠ said #38 retires the file. #38 is PR #44, which adds `pnpm test:browser`
to `package.json` alone — not to `pnpm test:all`, not to CI, and it needs a key
and the network. So this lane is the only CI coverage the one shipped script
has, and "do not grow it" was the wrong instruction for it.

It now retires on a condition rather than on a ticket: a browser lane in CI,
covering the same decisions.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015QGDLmYDuvjPYCqBRejoAz
@Ardnived
Ardnived merged commit 3e45fd5 into main Oct 1, 2026
72 of 82 checks passed
@Ardnived
Ardnived deleted the test/browser-lane branch October 1, 2026 18:38
@sydevs-bot sydevs-bot moved this from Revising to Done in SYDevelopers Technical Roadmap Oct 1, 2026
sydevs-bot pushed a commit that referenced this pull request Oct 1, 2026
PR #44 landed the browser lane and PR #48 changed the Atlas element's display,
so `package.json` and `AGENTS.md` both conflicted.

`package.json` keeps both lanes: `test:browser` from main, and `test:measure`
inside `test:all` from this branch. The browser lane stays out of `test:all` —
it needs a key and the network.

`AGENTS.md` keeps every trap from both sides. The lane counts are rewritten
rather than taken from either side, because neither was right after the merge:
four lanes run on wp-playground and the fifth runs in plain node, and
`test:all` runs the first four, not the first three. The measure lane's ⚠ no
longer says PR #44 fails to retire it; the reason is now that the browser lane
is local-only, which is what the ⚠ has to say once #44 is merged.

`assets/atlas-page.css` merged clean, and its two changes are independent:
`flow-root` stops a child margin escaping, while this branch's `margin-top` on
the same element still collapses with a parent's, which is the case the
additive offset walk exists for.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AhtySqkGuL4p924YTbLZZh
sydevs-bot pushed a commit that referenced this pull request Oct 1, 2026
The cell was marked `known: … (#40)`, so a header covering the map was
reported and waived. This branch fixes #40, and the cell now passes with
the mark off — verified in the browser lane on 86e796d merged with main,
WordPress 6.7.9, at all four viewports, alongside astra, oceanwp,
mesmerize, twentytwenty, twentytwentyfive and elementor.

Leaving the mark would waive the regression it was raised for, the day
after the fix shipped. The same precedent is mesmerize in #44, unmarked
once #35 shipped.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01263tuCiYUDFZ5sNT3evNeg
@Ardnived Ardnived mentioned this pull request Oct 2, 2026
3 tasks done
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.

test(browser): run the real widget in real themes, in a browser

2 participants