Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .lane/reports/fix-homepage-managed-service-h2-h3-lane1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Lane report: fix/homepage-managed-service-h2-h3-lane1

## Item

Homepage managed-service section skips H2->H4 and is missing from the public heading-hierarchy.

## What was wrong

`public/index.html` line 298: the `#managed-service` section's feature heading was an H4 directly
under the H2 section title, skipping H3. The public heading-hierarchy test
(`scripts/test-public-heading-hierarchy.mjs`) covered every other page but not the homepage.

## Fix

- `public/index.html`: H4 -> H3 for the managed-service feature heading (outline H2 -> H3,
matching the sibling `#teams` block).
- `public/styles.css`: `.team-feature h4` became `.team-feature :is(h3, h4)` (keeps margin) plus
`.team-feature h3 { font-size: clamp(1.55rem, 1.8vw, 2rem) }` so the block renders at the
former h4 scale.
- `scripts/test-public-heading-hierarchy.mjs`: added homepage coverage (outline has no jump > 1,
managed-service section opens H2 then H3, CSS pairing asserted). Sections renamed D/E/F.

## Verification

- `node scripts/test-public-heading-hierarchy.mjs` -> 89 checks, 0 failures (was 81 before; 8 new
homepage checks).
- All public-site tests pass (conversion-signal, structured-data, brand-disambiguation,
heading-hierarchy, link-targets, social-preview, soft-404, deploy-bundle, pages-release).
- `npm test` failure in `check-retention-automation.mjs` is pre-existing: verified identical
failure on clean origin/main (service-decisions parity + stale checkout at
/home/nish/workspaces/products/tinystudio-in). Unrelated to this change.
- Note: the deploy-bundle test still filters the managed-service section for the public bundle,
and still passes.

## Notes

- Existing remote branches `fix/homepage-managed-service-heading-hierarchy` and
`fix/lane1-homepage-managed-service-heading-hierarchy` already contained an equivalent fix
(never merged). This lane rebuilt the fix cleanly on fresh origin/main under a new branch name
`fix/homepage-managed-service-h2-h3-lane1` to avoid the stale merge-tangle in the old ones.
- PR: https://github.com/nish3451/tinystudio-in/pull/143
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ <h2 id="managed-service-title">The Website Correction.</h2>

<div class="team-feature">
<p class="team-mark">Website Correction</p>
<h4>Fit and scope are reviewed by a human first.</h4>
<h3>Fit and scope are reviewed by a human first.</h3>
<p>
Apply through the contact page's application route, share your
site and the page that matters most, and a person reviews
Expand Down
9 changes: 8 additions & 1 deletion public/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,17 @@ h4 {
box-shadow: var(--shadow);
}

.team-feature h4 {
/* The managed-service feature heading is a semantic H3 (section outline is
H2 -> H3), kept at the former h4 scale and margin so the block renders
identically to before the hierarchy repair. */
.team-feature :is(h3, h4) {
margin-top: 12px;
}

.team-feature h3 {
font-size: clamp(1.55rem, 1.8vw, 2rem);
}

.team-feature p {
margin: 16px 0 0;
max-width: 30rem;
Expand Down
41 changes: 39 additions & 2 deletions scripts/test-public-heading-hierarchy.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const ok = (cond, msg) => {
}
}

// The exact public pages covered by the heading-hierarchy finding.
// The exact public pages covered by the card-heading finding. The homepage
// (public/index.html) is covered separately in section D below, including
// the managed-service section's H2 -> H3 outline.
const AFFECTED_PAGES = [
"public/contact/index.html",
"public/promptly/index.html",
Expand Down Expand Up @@ -87,7 +89,42 @@ ok(
"the old .info-card h3-only rule is replaced by the shared :is(h2, h3) rule"
)

console.log("C. npm test/ci wiring")
console.log("D. homepage managed-service heading hierarchy")
const home = read("public/index.html")
const homeLevels = headingLevelsOf(home)
ok(homeLevels.filter((l) => l === 1).length === 1, "homepage has exactly one H1")
ok(homeLevels[0] === 1, "the H1 is the first heading in the homepage outline")
let homeJumps = 0
for (let i = 1; i < homeLevels.length; i++) {
if (homeLevels[i] - homeLevels[i - 1] > 1) {
homeJumps++
console.error(` bad transition H${homeLevels[i - 1]} -> H${homeLevels[i]}`)
}
}
ok(homeJumps === 0, "homepage outline has no heading-level jump greater than one")
const serviceStart = home.indexOf('<section class="shape" id="managed-service"')
ok(serviceStart !== -1, "homepage contains the #managed-service section")
if (serviceStart !== -1) {
const serviceEnd = home.indexOf("</section>", serviceStart)
const serviceLevels = headingLevelsOf(home.slice(serviceStart, serviceEnd))
ok(
serviceLevels.length >= 2 && serviceLevels[0] === 2 && serviceLevels[1] === 3,
`managed-service section starts H2 then H3 (got H${serviceLevels.join(" -> H")})`
)
}

console.log("E. managed-service heading CSS pairing")
const teamRuleStart = css.indexOf(".team-feature :is(h3, h4) {")
ok(teamRuleStart !== -1, "styles.css defines .team-feature :is(h3, h4) {")
const teamRuleEnd = css.indexOf("}", teamRuleStart)
const teamRuleBody = teamRuleStart === -1 ? "" : css.slice(teamRuleStart, teamRuleEnd)
ok(teamRuleBody.includes("margin-top: 12px"), "team-feature rule keeps margin-top: 12px")
ok(
/\.team-feature h3\s*{[^}]*font-size: clamp\(1\.55rem, 1\.8vw, 2rem\)/.test(css),
".team-feature h3 keeps the former h4 heading scale"
)

console.log("F. npm test/ci wiring")
const pkg = JSON.parse(read("package.json"))
ok(
pkg.scripts.test.includes("test-public-heading-hierarchy.mjs"),
Expand Down