Skip to content

fix(page): a theme's hero image leaves the atlas too small for the map - #35

Merged
Ardnived merged 9 commits into
mainfrom
fix/atlas-page-hero-header
Oct 1, 2026
Merged

Ardnived merged 9 commits into
mainfrom
fix/atlas-page-hero-header

Conversation

@Ardnived

@Ardnived Ardnived commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Merging this releases v0.2.1 to every site.

Summary

  • On Mesmerize and Mesmerize Pro, the Atlas page shows the theme's menu without its hero image, so the full map fits.
  • Every other theme, and every child theme, renders exactly as before.
  • The version moves to 0.2.1, so merging publishes the fix to all 13 sites.

Changes

  • includes/page.php — sahaj_atlas_header_name() returns 'small' for the mesmerize and mesmerize-pro active themes, else null.
  • templates/atlas-page.php — passes it to get_header(). Core falls back to header.php when the variant is missing.
  • sahaj-atlas.php, blocks/embed/block.json, readme.txt — 0.2.1 everywhere, with a changelog entry for volunteers.
  • tests/fixtures/mesmerize/, tests/fixture-theme.php, tests/render.mjs — the classic render run serves a hero fixture theme for one request.

Test results

  • Lean gate: ✓ pnpm test:all — syntax lint (12 files), behaviour suite (241 assertions, 0 failures), render checks (0 failures)
  • Targeted specs: the header-name group (5 assertions) and the hero-theme render check (4) — both seen to fail without the fix
  • Build: ✓ .github/scripts/package.sh — sahaj-atlas-0.2.1.zip, version declarations agree, no tests/

Manual verification

  1. After the release installs on shrimataji.org, open https://shrimataji.org/test/kn/find-a-class/ at 1280×720: no hero, the site menu, then the full map.
  2. At 390×844 the same page shows the full map, with no "compact card" warning in the console.
  3. View source: <div id="page-top" class="header-top small"> and no header-wrapper. This confirms Mesmerize Pro's own header-small.php has no hero, which only the free theme's source could show beforehand.

Notes for reviewer

  • The version bump rides with the fix at your request. The repo guide otherwise keeps a bump in its own release PR.
  • get_stylesheet(), not get_template(): a Mesmerize child theme keeps its own header.php, which may carry customisations the parent's variant would drop. The live site runs Mesmerize Pro directly (wp-theme-mesmerize-pro, no child class), and the fleet scan found no Mesmerize child theme. The adversarial review asked for get_template(); that thread stays open for you to settle.
  • Other hero themes are chore(page): check the fleet's other themes for a header hero #37: a scan of 26 fleet WordPress sites found Esotera Plus on four, whose header.php prints a header image. This release stays Mesmerize-only.
  • Companion widget fix: fix(widget): compact card's overlay opens with no interface SahajAtlasWeb#234. The two are independent. The widget fix still matters on a short screen.
  • Dismissed review findings:
    • A sahaj_atlas_header_name filter for other hero themes — rejected: AGENTS.md principles 3 and 4, and no volunteer can use a filter. One release reaches every site.
    • Always ask for header-small, relying on core's fallback — rejected: only Mesmerize defines that file as "no hero". An unknown theme's header-small.php is a guess.
    • Hide the hero with CSS — rejected: Mesmerize's nav is position: absolute over the hero, and in flow only in header-small.php.
Detail

Evidence. Measured live at 1280×720: the hero (.header-wrapper) took 435px, leaving the atlas 285px against the widget's 420px floor, so it showed the compact card. Simulated live with the hero removed and the nav .small: the atlas starts at 82px (desktop) and 73px (phone), and the full interface renders at both. header-small.php exists in Mesmerize 1.6.99 (WP.org SVN) and on the live Mesmerize Pro install (HTTP 200 vs 404 for a missing name).

The fixture switch. tests/fixture-theme.php is an mu-plugin only the classic render blueprint writes. It filters template and stylesheet for a request carrying ?sahaj_fixture_theme=mesmerize, as core's theme preview does. tests/ never ships: .distignore excludes it, and package.sh fails a zip that contains it.

Guide upkeep. AGENTS.md's line references for page.php and run.php moved under this branch. render.mjs:86 and :233 already pointed at unrelated lines on main. The @package count in docs/rules/code-comments.md read 18 against 21 on main, and 22 now.

Review passes. /simplify (four lenses) and /code-review high ran; the pr-review-toolkit plugin is not installed. /security-review ran (triggered by includes/ and templates/): no findings. comment-lint covers only JS/TS, so it saw no changed file here.

Closes #36

🤖 Generated with Claude Code

The classic template called get_header(), and Mesmerize's header.php prints a
hero image. On shrimataji.org it took 435px of a 720px screen, leaving the
atlas under the widget's 420px floor, so visitors got the compact card's
button instead of the map on most laptops and every phone.

sahaj_atlas_header_name() maps verified themes to their own hero-less
variant, and the template passes it to get_header(). Mesmerize and Mesmerize
Pro both ship header-small.php, which is header.php without the hero. Core
falls back to header.php when the variant is missing, and every other theme
gets null, so nothing else changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ardnived and others added 6 commits September 30, 2026 13:24
Merging this releases the Mesmerize hero fix to every site.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
One in_array() over the two Mesmerize slugs reads get_template() once, and
the docblock no longer quotes the widget's floor from another repo or claims
a wrong entry is free.

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

The behaviour suite pins sahaj_atlas_header_name(), but reverting the
template's get_header() call left it green. The classic run now serves a
`mesmerize` fixture theme for one request, through an mu-plugin that filters
`template` and `stylesheet` as core's theme preview does. It asserts the
fixture's header rendered and its `.header-wrapper` hero did not. Verified
to fail with the template's plain get_header() restored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
get_template() matched a Mesmerize child theme too, and get_header('small')
would then load the parent's variant in place of the child's customised
header.php. get_stylesheet() limits the swap to the theme itself. The suite
now pins both a direct theme and its child.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The run carries its hero theme as a field, and the request now asserts a 200,
one document, one element below the theme's header, and no hero.

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

page.php and run.php moved under this branch. render.mjs:86 and :233 already
pointed at unrelated lines on main. The @Package count was 21 before the new
test file and 18 in the rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Ardnived Ardnived changed the title fix(page): ask Mesmerize for its hero-less header on the Atlas page fix(page): a theme's hero image leaves the atlas too small for the map Sep 30, 2026

@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

This PR is the size of #36: one get_header() argument, a one-line theme match, and a patch release. It drops the hero through core's own header-variant mechanism, with core's fallback to header.php, not through CSS or a setting. The release half is right: all four version declarations read 0.2.1, a grep finds no fifth, v0.2.0 published its zip, and main holds nothing unreleased, so this merge ships exactly this fix, with a changelog a volunteer can read. The test fixture earns its ~60 lines: it is the only check that fails when the template's call reverts, and the behaviour group alone missed that. The open questions are about reach, not shape. The allowlist comes from the one site anyone measured, and the child-theme rule turns the fix off for a child theme that does not override header.php.

Findings

  • consider — includes/page.php:152 — a Mesmerize child theme with no header.php of its own gets the parent's hero header back. The guard defends against a harm nobody has counted. See the thread.
  • consider — includes/page.php:161 — the list comes from 1 of 13 sites. Has anyone checked the other twelve for a hero header? See the thread.
  • consider — tests/render.mjs:42 — heroTheme is a knob with one possible value. The mu-plugin and the assertions hard-code Mesmerize anyway. See the thread.

What was checked

  • Ticket and PR. I read #36 (its approach, three acceptance criteria and verification list) against the PR body and the diff at 0553244 (7 commits, 15 files, +129/−12). Every code and test file maps to a line of the ticket. The guide upkeep follows from the branch's own line shifts: each new reference in AGENTS.md (page.php:211, render.mjs:107 and :298, run.php:270) lands on the ⚠ comment it names, and 22 @package headers is the right count.
  • Code, read whole. includes/page.php, templates/atlas-page.php, includes/embed.php, assets/atlas-page.css, assets/atlas-page.js, tests/render.mjs, tests/render-classic.json, the new tests/fixture-theme.php and tests/fixtures/mesmerize/*, tests/fixtures/sahaj-classic/*, and the header group in tests/run.php. The block-theme path never reaches the changed call, because sahaj_atlas_template_include() returns early there. A theme outside the list gets get_header( null ), which is the old call exactly.
  • Contract side. I read SahajAtlasWeb/docs/embedding.md, "Sizing the element" and "When the slot is too small". A sized map is measured against the 360×420 floors, once, on mount, so #36's diagnosis (285px of height left) matches the contract. This PR changes no surface a host can observe: no script parameter, no sizing rule, no URL. Neither consumer needs a check. The changelog's button copy matches src/config/translations.en.json:81 ("Find a class near you").
  • Mesmerize 1.6.99 source (WP.org SVN). header.php prints the .header-wrapper hero. header-small.php is the same file without it, with .header-top small. No free-theme template asks for small. The theme's own loader, mesmerize_get_header() (inc/templates-functions.php:123), applies a mesmerize_header filter and prefers pro/header-{name}.php, and core's get_header( 'small' ) skips both. The PR's live probe covered only the root header-small.php. I have not flagged it, because manual step 3 (view source after the release) checks what the one Mesmerize Pro site actually renders.
  • Release (the cut-release checklist). The Version: header, SAHAJ_ATLAS_VERSION, Stable tag and block.json all read 0.2.1. git grep 0.2.0 finds only the previous changelog heading, a release.yml comment and pnpm-lock.yaml dependencies. v0.2.0 is published with sahaj-atlas-0.2.0.zip, so the last bump did publish. git log v0.2.0..origin/main is empty. A patch bump is right for a fix, and no other PR is open. tests/ stays out of the zip: .distignore lists it, and package.sh fails a zip that leaks it. The bump rides in this PR at the owner's request, and the body opens with the release line.
  • CI. "Lint & test" and "URL contract in sync" pass on head 0553244. I ran no suites locally and probed no live site.
  • Profile. I read it from origin/main. It has no learned sensitivities for this repo, so values 1 and 3 and the 2026-09-12 rule on protective machinery guided the judgement calls. The PR had no existing review or bot comment.

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

Comment thread includes/page.php
*
* ⚠ Ask for the theme's own hero-less variant. Do not hide the hero with CSS: the rest of the
* header is laid out for its variant. Core falls back to `header.php` when the variant is missing.
* `get_stylesheet()`, not `get_template()`: a child theme's own `header.php` may carry changes the

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.

consider — A child theme with no header.php of its own gets the hero back. get_header() resolves through locate_template(), which tries the child's folder, then the parent's. A Mesmerize child that carries only style.css and functions.php gets null here, so core loads the parent's header.php, and the compact card returns. #36's criterion, and the label at tests/run.php:236, say "keeps its own header.php". That assumes the child has one.

The guard protects against a harm nobody has counted: a customised child header.php lost on one page. Does any site in the fleet run a Mesmerize child theme? If none does, get_template() is the same one line, and it covers a CSS-only child. locate_template() would still prefer a child's own header-small.php. If one does, check whether it overrides header.php before you choose.

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

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.

Adopted the wording in aa90780: the label now reads "keeps today's header", and #36's criterion matches. Kept get_stylesheet(). A body-class scan of 26 fleet WordPress sites (#37) finds no Mesmerize child theme, so both lines behave the same today. For a future child, get_stylesheet() fails to today's page: the hero, and a working compact card after SahajAtlasWeb#234. get_template() fails by silently swapping a customised header.

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

Comment thread includes/page.php Resolved
Comment thread tests/render.mjs Resolved
Ardnived and others added 2 commits September 30, 2026 14:25
A child with no header.php of its own loads the parent's, so "its own"
assumed a file the child may not have.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fixture-theme.php accepts only mesmerize and the assertions match its
markup, so a heroTheme field could not vary without breaking the check.

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

Copy link
Copy Markdown
Contributor Author

Addressed the adversarial review:

Lean gate: pnpm test:all — 241 assertions, 0 render failures.

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

@Ardnived
Ardnived marked this pull request as ready for review September 30, 2026 21:35
@Ardnived
Ardnived merged commit b0ee950 into main Oct 1, 2026
43 of 47 checks passed
@Ardnived
Ardnived deleted the fix/atlas-page-hero-header branch October 1, 2026 16:58
Ardnived added a commit that referenced this pull request Oct 1, 2026
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 added a commit that referenced this pull request Oct 1, 2026
* fix(test): pin Playground versions with preferredVersions, not flags

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

* test(browser): run the production widget in real themes, in Chromium

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

* docs(test): rewrap the browser lane's header

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

* fix(test): address the code review of the browser lane

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

* fix(test): judge the plugin by the widget's documented surface

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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
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 theme's hero image leaves the atlas too small for the map

2 participants