From 177eda93d095da27137a95b7535c2a687561859c Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Sun, 12 Jul 2026 14:35:27 -0700 Subject: [PATCH] script nits: slider hover/visibility pause + silent autoplay + iframe amp guard ContentSlider: autoplay's setInterval now pauses on mouseenter and on document visibilitychange (tab hidden), resumes on mouseleave/visible, and is always clearable (timer var + clearInterval). The aria-live region is "off" while autoplay is silently auto-rotating and only flips to "polite" on manual next/prev/dot navigation, so screen readers aren't spammed with an announcement every `interval` ms (F-export review Minor). Updates the one existing test that hard-coded aria-live="polite" as always-on to match this intentional behavior change. (Countdown's ticking-interval-stops-at-zero nit shipped in the previous commit alongside its node-id migration, since both touched the same inline script.) Adds regression tests locking in that MapEmbed/VideoBlock iframe src attributes (built by string concatenation with literal `&` query params) are HTML-entity-encoded via the existing escapeAttr(safeUrl()) pipeline -- verified already correct, no source change needed there. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../components/media/MapEmbed.toHtml.test.ts | 13 ++++ .../media/VideoBlock.toHtml.test.ts | 15 +++++ .../sections/ContentSlider.toHtml.test.ts | 61 ++++++++++++++++++- .../src/components/sections/ContentSlider.tsx | 46 +++++++++++--- 4 files changed, 124 insertions(+), 11 deletions(-) diff --git a/craft/src/components/media/MapEmbed.toHtml.test.ts b/craft/src/components/media/MapEmbed.toHtml.test.ts index f5b3814..4143836 100644 --- a/craft/src/components/media/MapEmbed.toHtml.test.ts +++ b/craft/src/components/media/MapEmbed.toHtml.test.ts @@ -14,3 +14,16 @@ describe('MapEmbed.toHtml iframe accessibility (F2.4)', () => { expect(html).toContain('title="Map of Golden Gate Bridge"'); }); }); + +describe('MapEmbed.toHtml iframe src ampersand encoding (F-export review Minor)', () => { + test('the iframe src (built by string concatenation with literal &) emits & in the attribute, not a raw &', () => { + const { html } = toHtml({ address: 'New York, NY', zoom: 14 }, ''); + const srcMatch = html.match(/