GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
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
|
There was an error while loading. Please reload this page.
|
@copilot update the changelog for 1.14.1 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Updated in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@copilot update also the version to 1.14.1 and also all meta files where it is needet |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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:
matchMedia function used by the reduced-motion subscription.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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Done in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@copilot the tests are still failing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Fixed in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…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]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.