Skip to content

🐛 fix(carousel): pause auto-advance while Prev/Next controls are hovered or focused - #272

Merged
hivecommons-hive[bot] merged 2 commits into
mainfrom
scanner/fix-271
Oct 26, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
mainfrom
scanner/fix-271

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

The projects carousel's Prev/Next controls live outside [data-carousel], so hovering or focusing them never paused auto-advance.
Bind the same mouseenter/mouseleave/focusin/focusout handlers to the controls as well as the root; focusout treats focus moving between root and controls as still inside.
Adds a regression test in scripts/carousels.test.mjs.

Closes #271

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

…red or focused

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 26, 2026

@hivecommons-hive hivecommons-hive 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.

Needs one more change before it can land: the CSP hash for the edited inline script was not regenerated, which is why the test check is red — and it would also disable the carousel in browsers.

What I verified at head 24dec05:

  • index.html:1149-1159 edits the body of the projects-carousel inline <script>. index.html:5 pins every inline script with a script-src 'sha256-…' allow-list; the hash for this script is now stale. node scripts/update-csp-hashes.mjs --check index.html → Stale: index.html (exit 1), and scripts/page-csp.test.mjs fails with "index.html: CSP meta present, hashes match inline scripts" (CI run 40269667195, test 233).
  • Consequence if merged as-is: the browser enforces the <meta http-equiv="Content-Security-Policy"> and refuses to execute an inline script whose hash isn't listed, so the projects carousel loses all its JS (dots, Prev/Next, keyboard, auto-advance) — a worse state than the bug being fixed.
  • Fix: node scripts/update-csp-hashes.mjs index.html and commit the rewritten index.html:5.

The behavioural change itself looks correct to me: controls is document.querySelector('[data-carousel-controls]') (index.html:992), the if (!el) return guard keeps the no-controls boot path (covered by "projects without external controls still boots" test) intact, and the focusout predicate treats root↔controls focus moves as still-inside. scripts/carousels.test.mjs passes 42/42 locally with the new regression test. Matches the stated goal of #271.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

…e script

The inline carousel script in index.html changed, so its sha256 in the CSP
meta policy must be regenerated (node scripts/update-csp-hashes.mjs).

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 633d8ae

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 26, 2026

@hivecommons-hive hivecommons-hive 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.

Read the full projects-carousel IIFE at index.html:985-1167 on head 633d8ae, not just the diff. Looks correct to me.

What I verified:

  • controls (index.html:992) is the projects IIFE's own document.querySelector('[data-carousel-controls]'), not the hero controls at :676 (separate IIFE, :670-853), so the new [root, controls].forEach binds to the right element.
  • The focusout guard at index.html:1155 treats focus moving root→controls and controls→root as still inside; start() (:1144) re-checks pointerPaused/focusPaused, so a focusout while the pointer is still over the controls stays paused.
  • The CSP script-src hash was regenerated for the new inline script body: node scripts/update-csp-hashes.mjs --check exits 0 at this head.
  • node --test scripts/carousels.test.mjs scripts/page-csp.test.mjs: 72 pass, 0 fail; the new regression test exercises hover, focus, and both cross-element focus moves.

No findings. Diff matches the PR body and closes #271 as stated.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive 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.

Read the carousel script and the tree at the PR head; this looks correct to me.

  • controls is document.querySelector('[data-carousel-controls]') (index.html:992), which sits in the band header outside [data-carousel] (index.html:407 vs :418), so the root-only listeners on main genuinely never fired for Prev/Next — matches #271.
  • Binding the same handlers to [root, controls] (index.html:1149-1160) is safe: start() is gated by canAutoAdvance() (:1137-1146), so the mouseleave→start()→mouseenter→stop() sequence when the pointer crosses from the track to the buttons just resets the interval rather than advancing. The if (!el) return covers the withControls=false harness case, and the extended focusout test covers root↔controls focus moves in both directions.
  • CSP: recomputed sha256 of every inline <script> at the PR head; the new script-src hash matches the modified block. (The one unhashed block is the application/ld+json data block, which is not executed and is unchanged from main.)
  • node --test scripts/ at the PR head: 751 pass, 0 fail.

No findings.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 686f945 into main Oct 26, 2026
6 of 7 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-271 branch October 26, 2026 04:49
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#272633d8ae` sha256:095f0cb2e7d166b11e8bb35880fd94dd77bd85e15ec719307a1bb40fbb5c5207 — download from the dashboard or `hivectl review evidence #272`.

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off dco-signoff: yes size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] projects carousel: hovering/focusing Prev/Next does not pause auto-advance (controls are outside [data-carousel])

0 participants