Skip to content

docs(embed): the sizing rule inverted with #170, and four files still said the old one - #10

Merged
Ardnived merged 2 commits into
mainfrom
claude/docs-embed-element-docblock
Sep 3, 2026
Merged

Ardnived merged 2 commits into
mainfrom
claude/docs-embed-element-docblock

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Closes #9.

Three files told a maintainer to delete the thing that keeps the map off the site header. SahajAtlasWeb#170 inverted the rule — <sahaj-atlas> must be sized (display: block plus a definite height) to draw as a contained map, and unsized it is position: fixed; inset: 0 over whatever is on the page. The docblock on sahaj_atlas_render_element_once(), docs/implementation-plan.md and blocks/embed/editor.css all still carried the pre-#170 claim that the element must stay unstyled. Comment-only: no behaviour changes, 3 files, +52/−36.

The dangerous one was the plan's, because AGENTS.md sends an agent there before writing code and it named almost exactly what assets/atlas-page.css:31 ships (calc(100dvh - var(--sahaj-atlas-top, 0px))). Acting on it deletes the sizing and puts the map back over the header on the 13 self-hosted WordPress sites.

All five findings from the adversarial pass are addressed — four adopted, one taken half. Threads resolved individually.

What the second commit fixed, and why the first pass missed it

63d6986 rewrote the docblock and the plan's placement section. 829abd9 covers what a bad verification grep hid:

Was Now
docs/implementation-plan.md:206 — "Do not give <sahaj-atlas> any CSS on the atlas page… a helpful height: calc(100vh - 80px) would silently collapse the map into a card" The inverted rule, stated: sized element, both sizers named, min-height is not a height
blocks/embed/editor.css:1 — "The front end ships no CSS at all… must stay unstyled so the widget measures it as unmeasurable" Editor-only placeholder styling; the front end's element is sized, and by which path
includes/embed.php:257 attributed style="display:block;height:…" to sahaj_atlas_page_element_markup() sahaj_atlas_element_markup():353 is the emitter. The page element carries no inline style (:299, pinned by tests/run.php:173) — it is sized by assets/atlas-page.css so a host can override the height without !important. The split is now stated as the point it is
includes/embed.php:246 — "both templates call this" Both templates print after the header; only the classic one calls this function. The block template renders wp:sahaj-atlas/page → sahaj_atlas_render_page_block() (includes/page.php:95-102, includes/embed.php:416)
Four retellings of the retired pre-#170 world Three. The two that restated the whole transform-ancestor argument now point at AGENTS.md's "Traps already paid for", which owns it. The struck risk-list bullet stays — the hazard is why the old placement rule existed, and deleting it invites the rule back

Why the first pass missed the two survivors, which is the transferable part. Its verification grep was "gets no CSS\|no CSS, and that is load-bearing" — the wording the ticket had already quoted, so it could only confirm the fix already made. A grep written from a ticket's evidence cannot find what that evidence did not name. grep -rniE "no CSS|unstyled|unmeasurable|0×0" finds both in one pass, and is what this branch was verified with.

That grep now returns exactly one hit, deliberately kept: tests/run.php:158 — "Before #170 the only way to have a map was to cover the window, so this element deliberately carried no CSS at all." Framed as history, and it is the stated reason the assertion under it exists.

Gate — all three lanes, run on this head
  • pnpm lint → 12 files checked, 0 syntax errors
  • pnpm test → 122 assertions, 0 failures (WordPress 6.7 / PHP 7.4 under @wp-playground/cli)
  • pnpm test:render → 0 failures, both theme kinds — including the element is sized, with a definite height, not min-height and and display:block on both the shortcode and block paths, and the Atlas page element is sized by the stylesheet, not inline

No behaviour changed, so the suites are a guard against a comment edit breaking a file rather than evidence for the claim. The claims themselves were checked against the producer side: SahajAtlasWeb/docs/embedding.md confirms the height opt-in, the min-height trap and that a sized map embed is never asked the compact-card question.

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


🤖 Generated with Claude Code

https://claude.ai/code/session_01U7mZSzUp7up2dU252qwGBR

Closes #9.

`sahaj_atlas_render_element_once()`'s docblock described the pre-SahajAtlasWeb#170
world, 25 lines above a function that now does the reverse. Comment-only; the
whole gate is unchanged and green, which for this change is the assertion.

Three claims were stale, and one of them was dangerous:

- **"The element gets no CSS, and that is load-bearing"**, warning that a height
  "would silently collapse the map into a card". That is the exact inverse of the
  current rule: `display: block` plus a *definite* height IS the opt-in for a
  contained map. `sahaj_atlas_page_element_markup()` emits
  `style="display:block;height:520px|640px"` and `assets/atlas-page.css` sizes the
  page's element. A maintainer trusting the docblock would delete the sizing and
  put the map back over the header, on 13 self-hosted sites we do not control.
- **Printed "at `wp_body_open`"**. `sahaj-atlas.php:86` hooks `wp_footer` as a
  last-resort fallback; both templates print in the flow after the header, because
  a contained map draws where its element sits.
- **The transform-ancestor argument** for `wp_body_open` — retired with the fixed
  overlay it protected. A contained map establishes its own containing block.

`docs/implementation-plan.md:193` carried the same `wp_body_open` rule, and
AGENTS.md tells an agent to read the plan *before writing code* — so the stale
version was read first by construction. Fixed there too. Its risk-list entry for
transform ancestors is struck rather than deleted: the hazard is why the original
placement rule existed, and removing it silently invites the rule back.

Kept: printing an explicit element so the loader adopts it wherever core puts the
script tag, and the loader's refusal of `<head>`.

Verified per the ticket's checklist — every surviving `wp_body_open` hit is the
template's own call, a test fixture, or text naming it as *not* the placement;
`grep "gets no CSS"` is empty; `pnpm test:all` green (lint + behaviour + both
render lanes, 0 failures).

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JrS3RGMd96BwUAM7g2g5vU

@sydevs-bot sydevs-bot 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

The shape is right and the substance is nearly all correct — but this PR does not clear its own bar. Comment-only, two files, 39/29, exactly the ticket's scope, nothing smuggled in beside the fix; and every substantive claim about SahajAtlasWeb#170 checks out against the producer side rather than being taken on trust. The problem is that a PR whose thesis is "a docblock said the opposite of the code under it" leaves the same retired claim standing in two more places, one of them eight lines below the paragraph it rewrote (docs/implementation-plan.md:206-210), and the replacement docblock attributes the inline style to a function that explicitly does not emit one.

The reason both survivors were missed is worth more than the survivors: the PR body's verification grep ("gets no CSS\|no CSS, and that is load-bearing") matches only the wording the ticket had already quoted, so it could only confirm the fix already made. A grep written from the ticket's evidence cannot find what the ticket's evidence did not already name. grep -rniE "no CSS|unstyled|unmeasurable|0×0" returns both in one pass.

None of this is dangerous today, and the fixes are four short edits — but the ticket's own risk statement is a maintainer reading a stale line and deleting the sizing, and after this PR there are still two lines that would do it.

Findings

blocker docs/implementation-plan.md:206-210 still reads "Do not give <sahaj-atlas> any CSS on the atlas page… height: calc(100vh - 80px) would silently collapse the map into a card" — the imperative form of the exact claim, in the file AGENTS.md sends an agent to before writing code, naming almost what assets/atlas-page.css:31 ships. Acceptance criterion 2 unmet. → thread on docs/implementation-plan.md:204
should-fix blocks/embed/editor.css:1-2: "The front end ships no CSS at all — the widget styles itself, and the Atlas page's element must stay unstyled so the widget measures it as unmeasurable." Same criterion; no diff line to anchor a thread to.
should-fix includes/embed.php:257 attributes style="display:block;height:520px|640px" to sahaj_atlas_page_element_markup(), which emits no inline style and says so at :299; sahaj_atlas_element_markup():353 is the emitter, and tests/run.php:173 pins the difference. → thread
should-fix includes/embed.php:246 — "both templates call this": only the classic template does. The block template renders wp:sahaj-atlas/page → sahaj_atlas_render_page_block(). → thread
consider docs/implementation-plan.md:458-462 — four retellings of the retired pre-#170 world, one of them a comment about why a comment was kept, while AGENTS.md:64-79 already owns that story. Judgement call the ticket's AC explicitly allows. → thread

What was checked

Scope. git diff --stat origin/main...origin/claude/docs-embed-element-docblock → 2 files, +39/−29, one commit, comment-only. Measured against #9's five acceptance criteria: 1, 3, 4 and 5 met; 2 is the blocker above. Both verification greps from the ticket re-run on the branch — wp_body_open returns only the template's own call, two fixtures, includes/page.php:82, and text naming it as not the placement; "gets no CSS" returns nothing.

The code the docblock describes, read whole rather than as a diff: includes/embed.php (all four builders and both render entry points), templates/atlas-page.php:35-56, includes/page.php:70-145, sahaj-atlas.php:83-86, assets/atlas-page.css. Traced every call site of sahaj_atlas_render_element_once / render_page_block / page_element_markup — which is what turned up findings 3 and 4. Checked the "no-ops once the flow print has happened" claim against the $GLOBALS['sahaj_atlas_printed'] guard at :292: accurate.

The gate, read rather than re-run: tests/run.php:130-173 and tests/render.mjs:100-210. The assertions the PR body cites as pinning this area (the element is sized, with a definite height, not min-height, and display:block…) are the in-content ones inside the ['shortcode', 'block'] loop at render.mjs:182-204, under a comment that says so — "An in-content embed is map-LESS, so unlike the Atlas page it needs a height". The Atlas-page path is pinned by render.mjs:125 (with the element below the header) and run.php:173 (unstyled, by the stylesheet), so the coverage claim holds, but not by the tests named for it.

The cross-repo contract, from the consumer side. SahajAtlasWeb/docs/embedding.md confirms all four load-bearing claims independently: :336-348 (a height is the contained-map opt-in; no height → position: fixed; inset: 0), :378-386 (display:block matters as much; min-height is not a height), :444-450 (a map embed given a height "is not asked that question at all"), :478-486 (a transform ancestor confines an unsized map's overlay, "A contained map is unaffected: it establishes that containing block"). The retirement of the transform-ancestor bullet is therefore correct on the producer's own terms, and its "every embed this plugin prints now is sized" premise holds for both paths — in-content inline at embed.php:353, the page via atlas-page.css enqueued gated on sahaj_atlas_is_atlas_page().

Reviewer profile read and applied (workflow/skills/adversarial-review/reviewer-profile.md). Nothing raised on style, naming, test volume or defensive edge cases. The consider above is the profile's "comments that over-explain, narrate history, or describe removed systems" line, and is filed as a question rather than a verdict because the ticket sanctioned the choice.

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


Generated by Claude Code

Comment thread docs/implementation-plan.md Resolved
Comment thread includes/embed.php Resolved
Comment thread includes/embed.php Resolved
Comment thread docs/implementation-plan.md Resolved
…d it

The PR's own thesis is that a docblock said the opposite of the code under
it. The adversarial pass found the same retired claim still standing in two
more places — one of them eight lines below the paragraph the first commit
rewrote — plus two misattributions inside the replacement docblock.

Why the first pass missed them: its verification grep was
`"gets no CSS\|no CSS, and that is load-bearing"`, which is the wording the
ticket had already quoted, so it could only confirm the fix already made. A
grep written from the ticket's evidence cannot find what that evidence did
not name. `grep -rniE "no CSS|unstyled|unmeasurable|0×0"` finds both in one
pass, and is what this commit was verified with.

- docs/implementation-plan.md:206 carried the claim in its imperative form
  ("Do not give <sahaj-atlas> any CSS on the atlas page"), naming almost
  exactly what assets/atlas-page.css:31 now ships, in the file AGENTS.md
  sends an agent to before writing code. A maintainer acting on it deletes
  the sizing and puts the map back over the header on 13 self-hosted sites.
  It now states the inverted rule.
- blocks/embed/editor.css:1 said the front end ships no CSS and the element
  "must stay unstyled". Same claim, rewritten to name both sizers.
- includes/embed.php attributed style="display:block;height:…" to
  sahaj_atlas_page_element_markup(), which emits no inline style and says so
  at :299; sahaj_atlas_element_markup():353 is the emitter, and
  tests/run.php:173 pins the difference. The split is now stated as the
  interesting fact it is: the page element is sized by a stylesheet so a
  host can override the height without !important.
- includes/embed.php said "both templates call this" — only the classic one
  does; the block template renders wp:sahaj-atlas/page, whose callback is
  sahaj_atlas_render_page_block(). Both templates *print* after the header,
  which is the claim that was meant.
- Two of the four retellings of the pre-#170 world now point at AGENTS.md's
  "Traps already paid for", which already owns that inversion, instead of
  restating it. The struck risk-list bullet stays: the hazard is why the old
  placement rule existed, and deleting it invites the rule back.

tests/run.php:158 keeps the phrase deliberately — it frames it as history
("Before #170 … this element deliberately carried no CSS at all"), which is
true and is the assertion's reason for existing.

Gate: pnpm lint (12 files, 0 errors), pnpm test (122 assertions, 0
failures), pnpm test:render (0 failures) — all three lanes green.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01U7mZSzUp7up2dU252qwGBR
@sydevs-bot sydevs-bot changed the title docs(embed): the element docblock said the opposite of the code under it docs(embed): the sizing rule inverted with #170, and four files still said the old one Sep 3, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

The blocker is fixed and the PR is back with you — 829abd9, all five review threads answered and resolved, all three lanes green.

The retired "keep the element unstyled" claim survived in two more files, one of them eight lines below the paragraph the first commit rewrote. Both now state the inverted rule. The two misattributions inside the replacement docblock (wrong sizing function, "both templates call this") are corrected against the call graph, and two of the four retellings of the pre-#170 world now point at AGENTS.md instead of restating it — the struck risk-list bullet stays, deliberately.

Acceptance criterion 2 — "No file claims the element takes no CSS, or that giving it a height collapses it to a compact card" — now holds: grep -rniE "no CSS|unstyled|unmeasurable|0×0" returns one hit, and it is tests/run.php:158 stating it as history, which is true.

pnpm lint 12/0 · pnpm test 122 assertions, 0 failures · pnpm test:render 0 failures. Title and body refreshed from the current diff.

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


Generated by Claude Code

@Ardnived
Ardnived merged commit 6289242 into main Sep 3, 2026
2 checks passed
@sydevs-bot sydevs-bot mentioned this pull request Sep 18, 2026
Ardnived pushed a commit that referenced this pull request Sep 18, 2026
* chore(release): v0.2.0

Three merged changes ship in the plugin zip since v0.1.0, and a volunteer sees
none of them until a tag builds one: #21, #23 and #24. Everything else merged
since c1fec89 is CI, docs or tests, all of which `.distignore` keeps out of the
zip, and #10 and #13 touched shipping files in comments only.

Minor, not patch, and pre-1.0 either way: #23 adds a capability and a second
site setting, so the version has to move more than a fix would.

Four declarations, not two. `release.yml` compares the tag against the plugin
header alone, so it would have passed with `SAHAJ_ATLAS_VERSION` left at 0.1.0
— and that constant is the cache-buster on `atlas-page.css`, `atlas-page.js`
and the editor assets. Every updated site would have kept serving the 0.1.0
copies. `blocks/embed/block.json` declares the same version to the editor.
`package.json` declares none: it is dev tooling, and `.distignore` excludes it.

The changelog is written for the one non-technical volunteer who runs each
site, so it names what they will see rather than what changed in the code.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QNEAgEV5tDoLsB9nyLUv26

* fix(readme): the 0.1.0 entry claimed a 0.2.0 row

#23 edited the shipped `= 0.1.0 =` changelog entry, adding "and which
side describes the Atlas page" to the status-panel bullet. That row did
not exist at v0.1.0 — `git show v0.1.0:readme.txt` has the panel covering
four things, not five.

Plugin Update Checker merges readme.txt's sections into the WordPress
update modal, so a volunteer on 0.1.0 deciding whether to update reads
the fifth row credited to the version they already run. The 0.2.0 entry
announcing that same row then reads as a repeat, and the release that
actually ships it loses the credit.

A shipped release's entry describes what that release shipped.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jg5XawkJdwdSyhgVGdkvQu

---------

Co-authored-by: Claude <[email protected]>
@Ardnived
Ardnived deleted the claude/docs-embed-element-docblock branch November 13, 2026 03:49
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.

docs(embed): the element docblock states the opposite of the code below it

3 participants