mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-22 02:56:52 +03:00
Restore reduced-motion animation guidance (#540)
* Restore reduced-motion build guidance Restores the accessibility requirement and verification step to the animation playbook, with a regression test that keeps it on the build path. Implemented and validated with OpenAI Codex assistance under standing maintainer authorization. * Harden reduced-motion guidance regression Normalizes CRLF input and accepts either reduced-motion spelling so the contract stays portable and intent-focused. Implemented and validated with OpenAI Codex assistance under standing maintainer authorization. * Anchor skill reference test to its module Resolve the repository fixture path from the test module so the regression test is independent of the caller's working directory. This change was prepared with AI assistance under maintainer authorization. * Clarify reduced-motion guidance Replace the double negative in the canonical animation guidance and keep the source contract aligned with the clearer wording. This change was prepared with AI assistance under maintainer authorization.
This commit is contained in:
@@ -68,6 +68,7 @@ export const SUITES = {
|
||||
'tests/release.test.mjs',
|
||||
'tests/doctor.test.mjs',
|
||||
'tests/staleness.test.mjs',
|
||||
'tests/skill-reference.test.mjs',
|
||||
'tests/target-args.test.mjs',
|
||||
'tests/surface-brief.test.mjs',
|
||||
'tests/template-extensions.test.mjs',
|
||||
|
||||
@@ -74,12 +74,15 @@ Keep content visible in the default state so failed scripts do not hide the page
|
||||
|
||||
Respect autoplay and sound preferences. Any nonessential loop must stop when offscreen or hidden.
|
||||
|
||||
Every web animation needs a `prefers-reduced-motion` path with an intentional alternative. Remove or reduce spatial movement while preserving opacity, color, and state transitions that carry meaning. Reduced motion means fewer and gentler animations, not disabling all motion; feedback that confirms an action should remain legible.
|
||||
|
||||
## Verify
|
||||
|
||||
- The focal motion is specific to the selected world and surface.
|
||||
- Every supporting animation explains feedback, state, or relationship.
|
||||
- Interruption and repeated use behave correctly.
|
||||
- Desktop, mobile, and keyboard paths remain usable.
|
||||
- The `prefers-reduced-motion` path reduces movement without erasing meaningful feedback or state changes.
|
||||
- Expensive effects stay smooth on the target device.
|
||||
- Removing an animation would lose meaning or authored character, not merely decoration.
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const ROOT = fileURLToPath(new URL('..', import.meta.url));
|
||||
|
||||
describe('skill reference authoring contracts', () => {
|
||||
it('keeps reduced-motion guidance on the animation build path', () => {
|
||||
const animate = readFileSync(join(ROOT, 'skill/reference/animate.md'), 'utf-8').replace(/\r\n?/g, '\n');
|
||||
const accessibility = animate.match(/## Accessibility and control\n([\s\S]*?)\n## Verify/)?.[1] ?? '';
|
||||
const verify = animate.match(/## Verify\n([\s\S]*?)(?:\n## |$)/)?.[1] ?? '';
|
||||
|
||||
assert.match(accessibility, /prefers-reduced-motion/);
|
||||
assert.match(accessibility, /intentional alternative/);
|
||||
assert.match(accessibility, /not disabling all motion/);
|
||||
assert.match(verify, /reduced[- ]motion/i);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user