GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Refresh reduced-motion media query cache when matchMedia changes and sync 1.14.1 metadata by Copilot · Pull Request #117 · bQuery/bQuery

Conversation

Copilot AI commented May 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

  • Fixes a regression where reduced-motion reads could return a stale value after window.matchMedia changed during the test/runtime lifecycle.
  • Keeps motion reduced-motion reads and the reactive signal aligned with the current browser media-query implementation instead of a cached obsolete MediaQueryList.
  • Updates the package version to 1.14.1 and syncs the related release/meta guidance files so the shipped patch metadata matches the fix.
  • Cleans up the new regression test so the CI type-check step passes without changing the runtime behavior under test.

Motivation

  • The original regression was caused by cached reduced-motion state surviving a matchMedia replacement, which can happen in tests and any environment that swaps the media-query implementation.
  • Follow-up review feedback uncovered additional edge cases around matchMedia failures, including re-subscription fallback and throwing getters.
  • The remaining failing workflow was isolated to bun run test:types, where the new test cleanup used a delete expression that TypeScript rejected.
  • After landing the fix, the release metadata still reported 1.14.0, so the package version and AI-facing guidance files needed to be brought in line with the 1.14.1 patch release.

Changes included

  • Reduced-motion cache refresh

    • Track the matchMedia function used to create the active reduced-motion subscription.
    • Recreate the cached MediaQueryList when window.matchMedia changes so direct reads stop using stale state.
    • Return false and keep listeners/signals aligned when matchMedia calls or property access throw.
  • Regression coverage

    • Add a motion test that reproduces the stale-cache path with an active reducedMotionSignal() and verifies both the helper and signal refresh to the new value.
    • Add coverage for throwing matchMedia implementations, including a throwing getter.
    • Replace the test cleanup delete expression with Reflect.deleteProperty(...) so the test remains valid under bun run test:types.
  • Release metadata sync

    • Bump package.json from 1.14.0 to 1.14.1.
    • Sync the 1.14.1 release baseline across AGENT.md, llms.txt, .github/copilot-instructions.md, .cursorrules, .clinerules, and the README release callout.
  • Release documentation

    • Add a 1.14.1 entry to CHANGELOG.md and update the releases index to include the reduced-motion cache refresh fix.
  • Behavioral sketch

    const sig = reducedMotionSignal(); // initial matchMedia -> false
    
    window.matchMedia = () => ({ matches: true, media: '(prefers-reduced-motion: reduce)' }) as MediaQueryList;
    
    prefersReducedMotion(); // now reads true
    sig.value; // now also reflects true

Validation

  • bun run lint
  • bun run build
  • bun test
  • Additional focused checks (if applicable):
    • bun test tests/motion.test.ts
    • bun run test:types
    • node scripts/check-ai-guidance.mjs
    • parallel_validation

Checklist

  • I followed the contributing guidelines.
  • I added or updated tests where behavior changed.
  • I updated documentation when public behavior or developer workflow changed.
  • I confirmed the change does not introduce security-sensitive regressions.

Notes for reviewers

  • Review the cache-refresh and guarded matchMedia resolution path in /src/motion/reduced-motion.ts; that remains the only production behavior change.
  • The final follow-up on /tests/motion.test.ts is test-only and fixes the CI type-check failure without changing runtime coverage.
  • The metadata/docs work is limited to the 1.14.1 package version and synced release/guidance files.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
fix: refresh stale reduced-motion media query cache
676bebd
Copilot AI assigned Copilot and JosunLP May 28, 2026
Copilot created this pull request from a session on behalf of JosunLP May 28, 2026 14:52
View session
@JosunLP

JosunLP commented May 28, 2026

Copy link
Copy Markdown
Collaborator

@copilot update the changelog for 1.14.1

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of JosunLP May 28, 2026 14:53
View session
@github-actions github-actions Bot added motion Changes to the motion module tests Chenges to the tests labels May 28, 2026
docs: add changelog entry for 1.14.1
de3c7a9

Copilot AI commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update the changelog for 1.14.1

Updated in de3c7a9. The changelog now includes a 1.14.1 release entry for the reduced-motion cache refresh fix and the releases index was updated to link to it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot finished work on behalf of JosunLP May 28, 2026 14:56
Copilot AI requested a review from JosunLP May 28, 2026 14:56
@JosunLP
JosunLP marked this pull request as ready for review May 28, 2026 14:59
Copilot AI review requested due to automatic review settings May 28, 2026 14:59
@github-actions github-actions Bot added the docs Changes to the documentation label May 28, 2026
Copilot started reviewing on behalf of JosunLP May 28, 2026 14:59
View session
@JosunLP

JosunLP commented May 28, 2026

Copy link
Copy Markdown
Collaborator

@copilot update also the version to 1.14.1 and also all meta files where it is needet

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of JosunLP May 28, 2026 15:01
View session
Copilot AI reviewed May 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes reduced-motion preference caching so motion helpers react correctly when window.matchMedia is replaced, and documents the fix for the 1.14.1 release.

Changes:

  • Adds tracking for the matchMedia function used by the reduced-motion subscription.
  • Adds regression coverage for stale reduced-motion cache behavior with an active signal.
  • Adds a 1.14.1 changelog entry for the fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/motion/reduced-motion.ts Refreshes cached reduced-motion media query subscriptions when matchMedia changes.
tests/motion.test.ts Adds regression coverage for helper/signal alignment after matchMedia replacement.
CHANGELOG.md Documents the reduced-motion cache refresh fix in 1.14.1.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/motion/reduced-motion.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

chore: sync 1.14.1 release metadata
14da2ca
Copilot started work on behalf of JosunLP May 28, 2026 15:06
View session

Copilot AI commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update also the version to 1.14.1 and also all meta files where it is needet

Done in 14da2ca. package.json is now 1.14.1, and the synced release/meta guidance files were updated to match, including AGENT.md, llms.txt, .github/copilot-instructions.md, .cursorrules, .clinerules, and the README release callout.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI changed the title Refresh reduced-motion media query cache when matchMedia changes Refresh reduced-motion media query cache when matchMedia changes and sync 1.14.1 metadata May 28, 2026
Copilot finished work on behalf of JosunLP May 28, 2026 15:07
@github-actions github-actions Bot added build Changes to the build and meta files github Changes to the github meta data files labels May 28, 2026
fix reduced motion resubscribe fallback
7f6b29c
Copilot AI requested review from Copilot and removed request for Copilot May 28, 2026 15:09
Copilot finished work on behalf of JosunLP May 28, 2026 15:11
@JosunLP
JosunLP requested a review from Copilot May 28, 2026 15:25
Copilot started reviewing on behalf of JosunLP May 28, 2026 15:25
View session
Copilot AI reviewed May 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/motion/reduced-motion.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of JosunLP May 28, 2026 15:29
View session
Copilot AI added 2 commits May 28, 2026 15:37
fix reduced motion matchMedia getter fallback
4714933
fix reduced motion getter handling
9fda8c5
Copilot AI requested review from Copilot and removed request for Copilot May 28, 2026 15:39
@JosunLP
JosunLP requested a review from Copilot May 28, 2026 15:40
Copilot started reviewing on behalf of JosunLP May 28, 2026 15:40
View session
Copilot finished work on behalf of JosunLP May 28, 2026 15:41
Copilot AI reviewed May 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JosunLP

JosunLP commented May 28, 2026

Copy link
Copy Markdown
Collaborator

@copilot the tests are still failing

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of JosunLP May 28, 2026 15:43
View session
Fix motion test cleanup typing
b9759e7

Copilot AI commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the tests are still failing

Fixed in b9759e7. The failing job was bun run test:types in tests/motion.test.ts; I replaced the cleanup delete with Reflect.deleteProperty, and local validation is now green (bun run test:types, bun test tests/motion.test.ts, bun run lint, bun run build, bun test).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot finished work on behalf of JosunLP May 28, 2026 15:49
@JosunLP
JosunLP merged commit d018337 into dev May 28, 2026
8 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@JosunLP
JosunLP deleted the copilot/fix-reduced-motion-detection branch May 28, 2026 15:51
JosunLP pushed a commit that referenced this pull request May 28, 2026
@JosunLP
Refresh reduced-motion media query cache when matchMedia changes and …
7aba54f
…sync 1.14.1 metadata (#117)

## Summary

- Fixes a regression where reduced-motion reads could return a stale
value after `window.matchMedia` changed during the test/runtime
lifecycle.
- Keeps motion reduced-motion reads and the reactive signal aligned with
the current browser media-query implementation instead of a cached
obsolete `MediaQueryList`.
- Updates the package version to `1.14.1` and syncs the related
release/meta guidance files so the shipped patch metadata matches the
fix.
- Cleans up the new regression test so the CI type-check step passes
without changing the runtime behavior under test.

## Motivation

- The original regression was caused by cached reduced-motion state
surviving a `matchMedia` replacement, which can happen in tests and any
environment that swaps the media-query implementation.
- Follow-up review feedback uncovered additional edge cases around
`matchMedia` failures, including re-subscription fallback and throwing
getters.
- The remaining failing workflow was isolated to `bun run test:types`,
where the new test cleanup used a `delete` expression that TypeScript
rejected.
- After landing the fix, the release metadata still reported `1.14.0`,
so the package version and AI-facing guidance files needed to be brought
in line with the `1.14.1` patch release.

## Changes included

- **Reduced-motion cache refresh**
- Track the `matchMedia` function used to create the active
reduced-motion subscription.
- Recreate the cached `MediaQueryList` when `window.matchMedia` changes
so direct reads stop using stale state.
- Return `false` and keep listeners/signals aligned when `matchMedia`
calls or property access throw.

- **Regression coverage**
- Add a motion test that reproduces the stale-cache path with an active
`reducedMotionSignal()` and verifies both the helper and signal refresh
to the new value.
- Add coverage for throwing `matchMedia` implementations, including a
throwing getter.
- Replace the test cleanup `delete` expression with
`Reflect.deleteProperty(...)` so the test remains valid under `bun run
test:types`.

- **Release metadata sync**
  - Bump `package.json` from `1.14.0` to `1.14.1`.
- Sync the `1.14.1` release baseline across `AGENT.md`, `llms.txt`,
`.github/copilot-instructions.md`, `.cursorrules`, `.clinerules`, and
the README release callout.

- **Release documentation**
- Add a `1.14.1` entry to `CHANGELOG.md` and update the releases index
to include the reduced-motion cache refresh fix.

- **Behavioral sketch**
  ```ts
  const sig = reducedMotionSignal(); // initial matchMedia -> false

window.matchMedia = () => ({ matches: true, media:
'(prefers-reduced-motion: reduce)' }) as MediaQueryList;

  prefersReducedMotion(); // now reads true
  sig.value; // now also reflects true
  ```

## Validation

- [x] `bun run lint`
- [x] `bun run build`
- [x] `bun test`
- [x] Additional focused checks (if applicable):
  - `bun test tests/motion.test.ts`
  - `bun run test:types`
  - `node scripts/check-ai-guidance.mjs`
  - `parallel_validation`

## Checklist

- [x] I followed the contributing guidelines.
- [x] I added or updated tests where behavior changed.
- [x] I updated documentation when public behavior or developer workflow
changed.
- [x] I confirmed the change does not introduce security-sensitive
regressions.

## Notes for reviewers

- Review the cache-refresh and guarded `matchMedia` resolution path in
`/src/motion/reduced-motion.ts`; that remains the only production
behavior change.
- The final follow-up on `/tests/motion.test.ts` is test-only and fixes
the CI type-check failure without changing runtime coverage.
- The metadata/docs work is limited to the `1.14.1` package version and
synced release/guidance files.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@JosunLP JosunLP Awaiting requested review from JosunLP

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@JosunLP JosunLP

Copilot code review Copilot

Labels

build Changes to the build and meta files docs Changes to the documentation github Changes to the github meta data files motion Changes to the motion module tests Chenges to the tests

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@JosunLP
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.