From 54d3ab0850c456e2ac64677fead10875c988d8d4 Mon Sep 17 00:00:00 2001 From: Alan Richardson Date: Fri, 12 Jun 2026 11:15:05 +0100 Subject: [PATCH 1/4] fix testenv webmcp and site chrome --- scripts/create-testenv.mjs | 26 ++++++++++++++------ tests/integration/create-testenv-seo.test.js | 17 +++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/scripts/create-testenv.mjs b/scripts/create-testenv.mjs index 6032a53b..d55f4651 100644 --- a/scripts/create-testenv.mjs +++ b/scripts/create-testenv.mjs @@ -495,13 +495,17 @@ const TESTENV_HIDE_HEADER_STYLE = ` } `; -async function hideTopHeaderInBuiltPage(pagePath) { - const html = await readFile(pagePath, 'utf8'); +function applyTopHeaderHideToHtml(html) { if (html.includes('data-testenv-hide-header')) { - return; + return html; } - const nextHtml = html.replace('', `${TESTENV_HIDE_HEADER_STYLE}\n `); + return html.replace('', `${TESTENV_HIDE_HEADER_STYLE}\n `); +} + +async function hideTopHeaderInBuiltPage(pagePath) { + const html = await readFile(pagePath, 'utf8'); + const nextHtml = applyTopHeaderHideToHtml(html); await writeFile(pagePath, nextHtml, 'utf8'); } @@ -573,6 +577,7 @@ async function main() { await hideTopHeaderInBuiltPage(path.join(outputDir, 'app.html')); await hideTopHeaderInBuiltPage(path.join(outputDir, 'generator.html')); await hideTopHeaderInBuiltPage(path.join(outputDir, 'combinatorial.html')); + await hideTopHeaderInBuiltPage(path.join(outputDir, 'webmcp.html')); await mkdir(fullSiteDir, { recursive: true }); await createTemporaryDocsAppPlaceholder(); @@ -595,9 +600,15 @@ async function main() { } await copyWebBuildIntoDirectory(tempWebDir, fullSiteDir); - await hideTopHeaderInBuiltPage(path.join(fullSiteDir, 'app.html')); - await hideTopHeaderInBuiltPage(path.join(fullSiteDir, 'generator.html')); - await hideTopHeaderInBuiltPage(path.join(fullSiteDir, 'combinatorial.html')); + await applySeoDirectivesToFile(path.join(fullSiteDir, 'app.html'), { + canonicalUrl: ROOT_PAGE_CANONICALS['app.html'], + }); + await applySeoDirectivesToFile(path.join(fullSiteDir, 'generator.html'), { + canonicalUrl: ROOT_PAGE_CANONICALS['generator.html'], + }); + await applySeoDirectivesToFile(path.join(fullSiteDir, 'combinatorial.html'), { + canonicalUrl: ROOT_PAGE_CANONICALS['combinatorial.html'], + }); await rm(tempWebDir, { recursive: true, force: true, @@ -624,6 +635,7 @@ export { TESTENV_CANONICAL_SITE_URL, TESTENV_ROBOTS_DIRECTIVES, applySeoDirectivesToHtml, + applyTopHeaderHideToHtml, createLlmsTxt, createSiteRobotsTxt, createTestenvRobotsTxt, diff --git a/tests/integration/create-testenv-seo.test.js b/tests/integration/create-testenv-seo.test.js index 218bd648..01a9f755 100644 --- a/tests/integration/create-testenv-seo.test.js +++ b/tests/integration/create-testenv-seo.test.js @@ -2,6 +2,7 @@ import { ROOT_CANONICAL_URL, TESTENV_CANONICAL_SITE_URL, applySeoDirectivesToHtml, + applyTopHeaderHideToHtml, createLlmsTxt, createSiteRobotsTxt, createTestenvRobotsTxt, @@ -57,4 +58,20 @@ describe('create-testenv SEO helpers', () => { expect(html).toContain('box-shadow: none;'); expect(html).toContain('font: 700 6px/1.2 Arial, Helvetica, sans-serif;'); }); + + test('adds the testenv header-hiding style for top-level published app pages', () => { + const html = applyTopHeaderHideToHtml('WebMCP
'); + + expect(html).toContain('data-testenv-hide-header'); + expect(html).toContain('.header {'); + expect(html).toContain('display: none !important;'); + }); + + test('does not duplicate the top-level header-hiding style', () => { + const html = applyTopHeaderHideToHtml( + '', + ); + + expect(html.match(/data-testenv-hide-header/g)).toHaveLength(1); + }); }); From e282d5c51e33f30fba3f0d0d94fef4c7d4cfd7ff Mon Sep 17 00:00:00 2001 From: Alan Richardson Date: Fri, 12 Jun 2026 11:37:57 +0100 Subject: [PATCH 2/4] refresh testenv hide-header style updates --- scripts/create-testenv.mjs | 6 +----- tests/integration/create-testenv-seo.test.js | 6 ++++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/create-testenv.mjs b/scripts/create-testenv.mjs index d55f4651..071bfb58 100644 --- a/scripts/create-testenv.mjs +++ b/scripts/create-testenv.mjs @@ -496,11 +496,7 @@ const TESTENV_HIDE_HEADER_STYLE = ` `; function applyTopHeaderHideToHtml(html) { - if (html.includes('data-testenv-hide-header')) { - return html; - } - - return html.replace('', `${TESTENV_HIDE_HEADER_STYLE}\n `); + return upsertHeadStyle(html, 'data-testenv-hide-header', TESTENV_HIDE_HEADER_STYLE); } async function hideTopHeaderInBuiltPage(pagePath) { diff --git a/tests/integration/create-testenv-seo.test.js b/tests/integration/create-testenv-seo.test.js index 01a9f755..67249dde 100644 --- a/tests/integration/create-testenv-seo.test.js +++ b/tests/integration/create-testenv-seo.test.js @@ -67,11 +67,13 @@ describe('create-testenv SEO helpers', () => { expect(html).toContain('display: none !important;'); }); - test('does not duplicate the top-level header-hiding style', () => { + test('updates the existing top-level header-hiding style without duplicating it', () => { const html = applyTopHeaderHideToHtml( - '', + '', ); expect(html.match(/data-testenv-hide-header/g)).toHaveLength(1); + expect(html).toContain('display: none !important;'); + expect(html).not.toContain('display:block!important;'); }); }); From 4a2f63b8d8a4266dc78c5f6e426ff21cd77bdbb8 Mon Sep 17 00:00:00 2001 From: Alan Richardson Date: Fri, 12 Jun 2026 11:50:33 +0100 Subject: [PATCH 3/4] add webmcp testenv seo rewrite --- scripts/create-testenv.mjs | 2 ++ tests/integration/create-testenv-seo.test.js | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/scripts/create-testenv.mjs b/scripts/create-testenv.mjs index 80647ef0..e36a5f62 100644 --- a/scripts/create-testenv.mjs +++ b/scripts/create-testenv.mjs @@ -25,6 +25,7 @@ const ROOT_PAGE_CANONICALS = { 'app.html': `${TESTENV_CANONICAL_SITE_URL}/app.html`, 'generator.html': `${TESTENV_CANONICAL_SITE_URL}/generator.html`, 'combinatorial.html': `${TESTENV_CANONICAL_SITE_URL}/combinatorial.html`, + 'webmcp.html': `${TESTENV_CANONICAL_SITE_URL}/webmcp.html`, }; const TESTENV_INDICATOR_STYLE = `', From e2a455bc5dfd00f4732163f69069502b7462b25f Mon Sep 17 00:00:00 2001 From: Alan Richardson Date: Fri, 12 Jun 2026 12:22:34 +0100 Subject: [PATCH 4/4] apply site seo directives to webmcp --- scripts/create-testenv.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/create-testenv.mjs b/scripts/create-testenv.mjs index e36a5f62..b2fd2cf4 100644 --- a/scripts/create-testenv.mjs +++ b/scripts/create-testenv.mjs @@ -604,6 +604,9 @@ async function main() { await applySeoDirectivesToFile(path.join(fullSiteDir, 'combinatorial.html'), { canonicalUrl: ROOT_PAGE_CANONICALS['combinatorial.html'], }); + await applySeoDirectivesToFile(path.join(fullSiteDir, 'webmcp.html'), { + canonicalUrl: ROOT_PAGE_CANONICALS['webmcp.html'], + }); await rm(tempWebDir, { recursive: true, force: true,