Skip to content

fix(page): a fixed header covers the map on the Atlas page - #47

Merged
sydevs-bot merged 10 commits into
mainfrom
claude/fix-40-fixed-header
Oct 1, 2026
Merged

sydevs-bot merged 10 commits into
mainfrom
claude/fix-40-fixed-header

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • A theme header that is position: fixed or absolute no longer covers the map, the search box or the top of the panel on the Atlas page.
  • An in-flow or sticky header measures exactly as before — the offset stays 0px and nothing moves.
  • assets/atlas-page.js gets 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 first header, #masthead, .site-header or [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 new pnpm test:measure lane, inside pnpm test:all and CI.
  • tests/browser.mjs — the fixed-header cell drops its known mark, now that it passes.
  • AGENTS.md — trap 21, the lane table, and the gate's step list.

Test results

  • Lean gate: ✓ pnpm test:all — syntax, the measure lane, the PHP suite (241 assertions), both render runs. 0 failures.
  • Targeted specs: 24 assertions in tests/measure.mjs.
  • Mutation-checked: removing the zero-height skip, the half-screen refusal, the scrollY term, 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.sh version checks: ✓ (its rsync step needs CI; no version declaration changed).
  • Security review: skipped — no path matches securityReview.triggerPattern.
  • Build: N/A.

Browser verification

Both of the ticket's browser criteria are met. @Ardnived ran the local pnpm test:browser lane on this branch at 86e796d merged with main, WordPress 6.7.9, and reported 0 failures at all four viewports:

  1. ✓ fixed-header with the cell's known mark removed. The header now ends where the element begins, and the search box is hit-testable.
  2. ✓ astra, oceanwp, mesmerize, twentytwenty, twentytwentyfive and elementor still passing.

e957113 takes the known mark off the cell, so a regression of #40 fails the lane instead of being waived. The lane itself stays local-only — not in pnpm 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-header cell is a synthetic mu-plugin over Twenty Twenty.

Notes for reviewer

  • No version bump, so merging this releases nothing. The fix reaches the 13 sites on the next 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.
  • One deliberate deviation from the ticket's approach. A header reaching past half the screen is refused, and the page keeps the full-height covered map it has today. The ticket's 100dvh − offset alone 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.
  • This PR no longer touches the observer. The first draft rewrote the entry points and added an observing flag, 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.
  • The offset is additive against the element's current top, not a remembered in-flow top, clamped at the header's bottom edge, and it drives its own next frame. Please check that reasoning. The additive form survives a parent margin collapsing with ours; the clamp stops a theme that refuses the margin from spinning the loop at 60fps for the life of the tab; and the self-scheduled frame is what supplies the passes, since no resize event fires for a margin this script wrote.
  • Margin, not padding. A contained map draws across the whole padding box, so padding would put the map straight back under the header.
  • The lane reads its load position out of 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.
  • The lane stubs the geometry on purpose, and says so at the top of the file. It proves what the script decides, never what a browser lays out. It is not interim: it is the only CI coverage the one shipped script has, and it retires on a condition — a browser lane in CI, covering the same decisions.
  • The ⚠ 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 on coveredTo().
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>, #masthead or .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: fixed removes the header from every box the stylesheet could measure against.

Rejected: padding-top on 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 − inflowTop once. 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: 0 toolbar, 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. A fixed header's viewport rect already is its document band; an absolute one needs + scrollY. Two assertions pin the result at scrollY: 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

claude added 3 commits October 1, 2026 17:11
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
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 1, 2026
@sydevs-bot

sydevs-bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 20:51Z resolve-conflicts · attempt 1 · session · done
  • 20:51Z resolve-conflicts · attempt 1 · session
  • 18:56Z address-review · attempt 1 · session · done
  • 18:56Z address-review · attempt 1 · session
  • 18:38Z resolve-conflicts · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

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

Comment thread assets/atlas-page.js Resolved
Comment thread tests/measure.mjs Resolved
Comment thread tests/measure.mjs Resolved
Comment thread assets/atlas-page.js Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 1, 2026
claude added 4 commits October 1, 2026 18:01
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
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Four threads, four commits, pushed as c3fad21. pnpm test:all green: 24 measure assertions, 241 PHP, both render runs.

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

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 1, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review October 1, 2026 18:10
@sydevs-bot
sydevs-bot requested a review from Ardnived October 1, 2026 18:10
@sydevs-bot
sydevs-bot enabled auto-merge October 1, 2026 18:10
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels 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

Copy link
Copy Markdown
Contributor Author

Merged main (#44, #48).

package.json keeps both lanes: test:browser from main, test:measure inside test:all from here.

AGENTS.md keeps every trap from both sides. I rewrote the lane counts rather than taking a side, because neither side was right after the merge: four lanes on wp-playground, a fifth in plain node, and test:all running the first four. The measure lane's ⚠ no longer says PR #44 fails to retire it — the reason is now that the browser lane is local-only.

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

One for you, not resolved. #44's fixed-header cell is marked known: … (#40). This PR closes #40, so the mark is stale. Clearing it is this ticket's criterion 1 and needs the local browser lane with a key, which this run cannot run.

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


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. awaiting labels 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
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

One thread, one commit, pushed as e957113. pnpm test:all green: 24 measure assertions, 241 PHP, both render runs.

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 main at b22dc25 clean.

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


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 1, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 1, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 1, 2026
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
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Merged main (#45). Two text conflicts, each kept from both sides.

No behaviour conflicted. This branch had already reverted its own entry-point rewrite, so start() and the observing flag arrive from #45 untouched.

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 ResizeObserver is missing. The self-scheduled frames stay load-bearing anyway: no resize event fires for a margin this script wrote.

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


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 1, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit e41f147 Oct 1, 2026
12 checks passed
@sydevs-bot
sydevs-bot deleted the claude/fix-40-fixed-header branch October 1, 2026 21:02
sydevs-bot pushed a commit that referenced this pull request Oct 1, 2026
#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
@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.

fix(page): a fixed header covers the map on the Atlas page

3 participants