Skip to content

🐛 fix(style): honour prefers-reduced-motion for in-page smooth scrolling - #281

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-280
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-280

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #280

top-level html { scroll-behavior: smooth } animated every skip-link / nav-anchor / hash jump even for reduced-motion users while the carousel JS and the other CSS already honour the preference. Now scoped to @media (prefers-reduced-motion: no-preference) so users who opt out of motion are respected. Regression test added to style-contract.test.mjs.

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

@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

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@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 labels Oct 27, 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 tree at 33e4e52, not just the diff. This looks correct to me.

  • style.css:92-93: scroll-behavior: smooth is now the only declaration inside @media (prefers-reduced-motion: no-preference); -webkit-text-size-adjust stays unconditional, so nothing else changed for either audience.
  • Consistent with the rest of the sheet, which already gates motion on the same query (style.css:267, :275, :508, :579) and with the carousel JS (index.html:1077, scrollBehavior()), so this was the one remaining unguarded animation.
  • The new test in scripts/style-contract.test.mjs uses the existing stripComments/stylesheets helpers (lines 63, 603). Ran node --test scripts/style-contract.test.mjs: 45/45 pass at this head; reverting line 92 to the old html { scroll-behavior: smooth; … } makes exactly that test fail with scroll-behavior: smooth at line 92 is not inside @media (prefers-reduced-motion: no-preference), so it is a real regression guard.

Body matches the diff (Closes #280). Only tide is pending; all other checks green.

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

@hivecommons-hive
hivecommons-hive Bot merged commit b649779 into main Oct 27, 2026
6 of 7 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-280 branch October 27, 2026 10:52
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#28133e4e52` sha256:26fc57d16a3f544f561449ff362acb0b23cada9f3e925692d71bdff629134e78 — download from the dashboard or `hivectl review evidence #281`.

@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 27, 2026
hivecommons-hive Bot added a commit that referenced this pull request Oct 27, 2026
…r rule (#283)

* test(style): fixture self-tests for the reduced-motion scroll-behavior rule

Extract the rule #281 added inline into unguardedSmoothScroll(css, label),
matching the exported-helper-plus-fixture shape of every other rule in
style-contract.test.mjs. The helper now also catches smooth !important,
a block-final declaration without a trailing semicolon and upper-case
values, and runs over every page's inline <style> as the sibling rules do.

Closes #282

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>

* test(style): string-aware reduced-motion parser and tidy helper placement

- Move unguardedSmoothScroll above the fixture self-tests banner so it
  sits with the other rule helpers.
- Skip string contents while scanning so a "{" or ";" inside one cannot
  leave a guarding @media prelude on the stack.
- Stop the value scan at "{" so a prelude such as
  @supports (scroll-behavior: smooth) still records its block and the
  nested declarations are examined.
- Assert the clean CSS fixture against unguardedSmoothScroll and add
  fixtures for both parser cases.

Hive-Fix-Attempt: 1/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>

---------

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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] html scroll-behavior: smooth ignores prefers-reduced-motion

0 participants