Repository navigation
fix(page): a fixed header covers the map on the Atlas page - #47
Conversation
A `position: fixed` or `absolute` header takes no space in the flow, so the atlas element's own top measured 0 and the map drew underneath it. On the browser lane's `fixed-header` cell the header covered the search box and the top of the panel at all four viewports, and clicks there landed on the header. Astra's and OceanWP's transparent headers, Elementor's sticky one, and any theme that fixes its nav all land here. assets/atlas-page.js now reads the first `header`, `#masthead` or `.site-header` above the atlas and, only when that header is out of flow, offsets the element by its bottom edge through a second custom property. The stylesheet spends it as a top margin, never padding: the widget draws across the whole padding box, so padding would put the map straight back under the header. The offset is additive against the element's current top rather than a remembered in-flow one, so a parent margin that collapses with ours cannot double-count, and a header that shrinks on a narrow viewport walks it back down. Settling needs the frames the ResizeObserver supplies, and that observer never attached: `wp_enqueue_script()` puts this file in `<head>`, where `document.body` is still null. It attaches on DOMContentLoaded now. An in-flow or sticky header measures exactly as before. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KJWrF9kGT7ak48jskbfWCQ
`pnpm lint` parses PHP, `pnpm test` runs PHP, and `pnpm test:render` matches returned HTML, so no lane ever executed `assets/atlas-page.js`. The header overlap it mismeasured (#40) had to be found in a browser, and the body observer it never attached had been dead on every page view. `pnpm test:measure` runs the real file in `node:vm` against a stubbed geometry, over the production lifecycle: head execution with no element and no body, then DOMContentLoaded, then load, then observer frames. It proves what the script decides, never what a browser lays out — real overlap in a real theme stays the browser lane's job (#38). Every assertion fails against the file before this branch. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KJWrF9kGT7ak48jskbfWCQ
Three defects in the offset, all found by review. An unclamped sum climbed by the header's height on every frame whenever the element did not move — a theme whose own CSS beats the margin — so the offset reached 1400px in twelve frames and kept going for the life of the tab. It is clamped at the header's bottom edge, which is the most it can ever need. A header band reaching past half the screen is now refused outright. Clearing a 420px transparent header on a 720px screen left a 300px atlas, under the floor the widget needs to draw a map, so the visitor got the compact card instead — the defect #35 fixed for an in-flow hero, by another route. A covered but full-height map is the better failure. The same test rejects a `position: fixed; bottom: 0` toolbar, which is what the old guard on the element's top edge was for, and that guard refused a header floating a few pixels below the top edge. A responsive theme prints its mobile header first and hides it above the breakpoint. That candidate reports an empty box, and deciding from it left the visible header below it unmeasured. It is skipped instead. The lane gained a scene per defect, a second scroll scene for an absolute header, and an exact count of the body observers attached. Each one fails when its guard is removed. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KJWrF9kGT7ak48jskbfWCQ
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The offset fix matches #40, and its arithmetic holds — I could not break it. But two of the three commits do not belong here. The observer fix duplicates open PR #45 and conflicts with it. And 69% of the additions are a harness whose own ⚠ says to delete it, on a plan that does not hold.
- blocker
assets/atlas-page.js:151— duplicates and conflicts with PR #45, which also reverses this ⚠'s premise. - should-fix
tests/measure.mjs:76— the fixture pins and asserts the<head>load that #45 changes. - should-fix
tests/measure.mjs:9— #38 is PR #44, local-only, so it cannot retire this lane. - consider
assets/atlas-page.js:35— three selectors, unverified against the themes #40 names.
Checked. #40, both assets and the new lane whole. pnpm test:measure → 22 ok. Removing the clamp, the half-screen refusal or the zero-height skip each failed a named assertion, so the guards are real. Five scenes the lane misses all settle in ≤2 passes. Trial-merged #45: conflicts in assets/atlas-page.js and AGENTS.md.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
PR #45 already adds `observing`, `start()` and the three entry points, and moves the enqueue to the footer, which reverses the premise the ⚠ here stated. Keeping a second copy conflicted with it in `assets/atlas-page.js` and in `AGENTS.md`, so the lifecycle goes back to what `main` has and #41 owns it. The offset still needs frames to walk its additive sum to the header's bottom edge, and it now asks for them itself. Nothing else supplies them: no resize event fires for a margin this script wrote, and the body observer is exactly the thing that is not reliably attached. The clamp already ends the walk, so the loop is bounded by the same guard as before. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015QGDLmYDuvjPYCqBRejoAz
#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
The fixture modelled a `<head>` load and asserted it. PR #45 moves this script to the footer, after which the lane would have kept passing while modelling a page the plugin no longer serves, and nothing would have said so. The position now comes out of `includes/embed.php`, so every scene follows the enqueue, and both positions are run explicitly. A rename of the handle, or an enqueue the regex cannot read, exits 2 rather than falling back to a guess. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015QGDLmYDuvjPYCqBRejoAz
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
|
Four threads, four commits, pushed as Adopted
I did not rebase on #45. The handler may not rewrite a pushed branch. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
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
|
One for you, not resolved. #44's 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
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
|
One thread, one commit, pushed as Adopted
The PR body now records both browser criteria as met. It also names what stays unverified: a real Astra, OceanWP or Elementor install with its own transparent-header option on. Nothing rebutted, nothing to ask. The conflict scan that fired this run found no conflict — the branch merges 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Two text conflicts, both from #45. Each side keeps its own behaviour. assets/atlas-page.js, the file's doc comment. This branch reads two offsets rather than one; #45 widened what re-triggers a measure. The merged sentence states both. The lifecycle below it is #45's unchanged: this branch reverted its own entry-point rewrite before pushing, so start() and the observing flag arrive only from main, and measure() is this branch's. AGENTS.md, two traps both numbered 21. Both are real and unrelated, so both stay. Main's footer-enqueue trap keeps 21, since nothing cites either number and main's is already published; the out-of-flow header trap becomes 22. Line citations in both are recomputed against the merged files. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NaktyxKC7XZbRVbDNjsS86
|
Merged
No behaviour conflicted. This branch had already reverted its own entry-point rewrite, so One for you, not resolved. The ⚠ at atlas-page.js:138 still calls the body observer "not guaranteed to be attached". #45 attaches it on the first call that finds a body, so that now holds only where 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#47 added a trap 22 of its own to AGENTS.md and re-aimed trap 21's `atlas-page.js` pointer at the line its rewrite moved. This branch had added a different trap 22. Both traps are kept: #47's header-offset entry stays at 22, and this branch's `<title>` ownership entry becomes 23. Trap 21's pointer is #47's, since it owns the file it names. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LobknhBZRAtpDEZQYC7XPJ
Summary
position: fixedorabsoluteno longer covers the map, the search box or the top of the panel on the Atlas page.0pxand nothing moves.assets/atlas-page.jsgets a lane. No lane executed it before, which is why this bug had to be found in a browser.Changes
assets/atlas-page.js— reads the firstheader,#masthead,.site-headeror[data-elementor-type="header"]above the atlas and, only when it is out of flow, writes its bottom edge to--sahaj-atlas-offset. An offset write asks for the next frame, so the sum walks to its answer without help.assets/atlas-page.css— spends that offset as a top margin on<sahaj-atlas>.tests/measure.mjs,package.json,.github/workflows/ci.yml— the newpnpm test:measurelane, insidepnpm test:alland CI.tests/browser.mjs— thefixed-headercell drops itsknownmark, now that it passes.AGENTS.md— trap 21, the lane table, and the gate's step list.Test results
pnpm test:all— syntax, the measure lane, the PHP suite (241 assertions), both render runs. 0 failures.tests/measure.mjs.scrollYterm, the offset clamp, or the frame an offset write asks for each fails a named assertion. Without the clamp the offset climbs past 1400px and is still climbing when the harness's frame budget runs out. Renaming the enqueue handle exits the lane 2 instead of guessing a load position..github/scripts/package.shversion checks: ✓ (itsrsyncstep needs CI; no version declaration changed).securityReview.triggerPattern.Browser verification
Both of the ticket's browser criteria are met. @Ardnived ran the local
pnpm test:browserlane on this branch at86e796dmerged withmain, WordPress 6.7.9, and reported 0 failures at all four viewports:fixed-headerwith the cell'sknownmark removed. The header now ends where the element begins, and the search box is hit-testable.astra,oceanwp,mesmerize,twentytwenty,twentytwentyfiveandelementorstill passing.e957113takes theknownmark off the cell, so a regression of #40 fails the lane instead of being waived. The lane itself stays local-only — not inpnpm test:all, not in CI, and it needs a key and the network.Still unverified, and not reachable from any lane: a real Astra, OceanWP or Elementor install with the theme's own transparent-header option enabled. The
fixed-headercell is a synthetic mu-plugin over Twenty Twenty.Notes for reviewer
chore(release):. For that entry:* Fixed: on themes with a fixed or transparent header — Astra, OceanWP, Elementor headers — the map no longer sits underneath the header.100dvh − offsetalone would shrink a 720px screen to a 300px atlas under a 420px transparent header, which is under the widget's map floor — so the visitor would get the compact card instead of a map. That is the defect fix(page): a theme's hero image leaves the atlas too small for the map #35 fixed for an in-flow hero, and it would have reopened through this path.observingflag, which duplicated fix(page): a header that grows after load is never re-measured #45 and conflicted with it, on a ⚠ whose premise fix(page): a header that grows after load is never re-measured #45 reverses. That is dropped: fix(page): a header that grows after load is never re-measured #41 owns the observer and the footer move. A trial merge with fix(page): a header that grows after load is never re-measured #45 is now two text hunks — this file's doc comment, and two traps both numbered 21.includes/embed.php. A fixture that hard-codes one keeps passing after the enqueue moves — which fix(page): a header that grows after load is never re-measured #45 does — while modelling a page the plugin no longer serves. Both positions also run explicitly.⚠that called a fixed header "rare and visible right away" is rewritten, not dropped — its substance about the admin bar, notices and breadcrumb strips now sits oncoveredTo().Detail
Why guess which element is the header at all. The old script deliberately did not, and measuring the element's own box covers everything in flow above it at once. An out-of-flow header is the one case that box cannot see, so the guess is scoped to exactly that case and to four selectors, and the first header with a box decides. A first match that is in flow returns 0 — today's behaviour — rather than hunting for a second candidate that some other theme calls a header.
Why Elementor needs a selector of its own. A theme-builder header renders inside
<div data-elementor-type="header" …>, not a<header>,#mastheador.site-header, so the other three never reach it — and a transparent Elementor header is one of the cases #40 reports. The attribute is the hook PR #44's browser lane already uses, so the two agree. The stub cannot tell selectors apart, so this rides on the guards the other scenes pin: out of flow only, above the atlas, inside the top half.Rejected: a pure-CSS fix. There is none. No theme states its header height, and
position: fixedremoves the header from every box the stylesheet could measure against.Rejected:
padding-topon the element. The ticket allows either. Padding loses, because the widget fills this element and a contained map draws across the padding box, so the map would return to where it started.Rejected: computing the offset in one shot — zero the offset, read the element's in-flow top, write
covered − inflowToponce. It is simpler and it would delete the clamp and half the harness, but it is defeated by the case the additive form exists for: when a parent's top margin collapses with ours and is the larger of the two, the element does not move at all, and a one-shot answer leaves it still under the header. It also needs a deliberate write-then-read reflow on every pass.Rejected: leaning on the body observer for the frames. That is what the first draft did, and it is why this PR carried #45's change. The observer is the one thing on the page that is not reliably attached, so the walk now asks for its own frames and the two PRs stay independent.
One threshold does three jobs. A header band is accepted only if it ends within the top half of the viewport. That refuses a
position: fixed; bottom: 0toolbar, refuses a header too tall to clear (above), and keeps the rule to one number instead of three guards. The number is the plugin's own, not the widget's floor quoted across repos.Scroll independence. Nothing re-measures on scroll, so the answer must not depend on
scrollY. Afixedheader's viewport rect already is its document band; anabsoluteone needs+ scrollY. Two assertions pin the result atscrollY: 500, one per kind.A responsive theme's hidden mobile header reports an empty box while it is above its breakpoint. Such a candidate is skipped rather than decided from, or the visible header below it never gets measured.
One pass is one frame, in the harness. A re-measure the script asks for now runs on the next pass rather than inside the current drain, so a script that never stops asking spends the frame budget and fails an assertion instead of hanging the lane.
Why a fourth lane rather than an assertion in the render lane. The render lane matches returned HTML, so the only thing it could assert about this change is that our own stylesheet contains our own property name. That passes whatever the script decides.
A follow-up worth considering, not filed: the general shape here is "host chrome overlays the widget", which the widget could answer with a top-inset parameter. It would not remove this script — the plugin still has to measure the header — and an inset alone would still leave clicks in the covered band landing on the header, so it is not a substitute for this fix.
Closes #40
🤖 Generated with Claude Code
https://claude.ai/code/session_01263tuCiYUDFZ5sNT3evNeg