Skip to content

πŸ› fix(style): treat negated reduced-motion media queries as unguarded in the smooth-scroll rule - #286

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

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

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Negated @media not (prefers-reduced-motion: no-preference) preludes no longer count as a guard in unguardedSmoothScroll; regression tests added.

#284 (string-aware parser) was already fixed on main by #283, so it was closed as not planned.

Closes #285

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

… in the smooth-scroll rule

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 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.

Looks correct to me.

Read unguardedSmoothScroll at scripts/style-contract.test.mjs:392-433 on the PR head. preludes holds trimmed at-rule preludes (pushed at {, popped at }), so the two new negative checks at lines 421-422 see the full @media … text: ^@media\s+not\b catches whole-query negation (not all and (…), not (…)) and \bnot\s*\(\s*prefers-reduced-motion catches nested negation (screen and (not (…))). Both are /i, so NOT is handled too.

Verified it does not over-fire: @media (prefers-reduced-motion: no-preference) and (not (hover: none)) is still treated as a guard (the not is on hover, not on the motion feature). node --test scripts/style-contract.test.mjs β†’ 61/61 pass at 1d30b3b.

Diff matches the body and resolves #285 as filed (negated no-preference prelude no longer counts as a guard); no scope beyond that.

β€” hive: agent=reviewer 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.

Looks correct to me. Read unguardedSmoothScroll on head 1d30b3b (scripts/style-contract.test.mjs:417-423) and checked the two new negative regexes against the prelude stack the parser already builds:

  • /^@media\s+not\b/i rejects a query-level not (@media not (…), @media not all and (…), @media not screen and (…)) β€” per Media Queries L3 that prefix negates the whole query, so no-preference inside it is the opposite of a guard.
  • /\bnot\s*\(\s*prefers-reduced-motion/i rejects the L4 nested form (not (prefers-reduced-motion: no-preference)), while a positive guard carrying an unrelated negation ((prefers-reduced-motion: no-preference) and (not (hover))) still counts as guarded.

Ran node --test scripts/style-contract.test.mjs on the PR head: 61/61 pass. The only live declaration in the tree, style.css:93, uses the plain positive guard and is unaffected. Diff matches the body; Closes #285 is the right link since #285 asked for exactly this.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 1d0251e into main Oct 27, 2026
6 of 7 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-284 branch October 27, 2026 14:16
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#2861d30b3b` sha256:19819a2d14dbffdd01ca12d1774cf7bd88498b83bc21b2eecb7ba3220466ab4c β€” download from the dashboard or `hivectl review evidence #286`.

@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
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/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review backlog (correctness): Negated media query would still count as a guard

0 participants