Skip to content

Fix: honour reduced motion in the toolkit progress bar - #52

Merged
SandObserver merged 1 commit into
mainfrom
fix/widget-bar-reduced-motion
Aug 12, 2026
Merged

SandObserver merged 1 commit into
mainfrom
fix/widget-bar-reduced-motion

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Read prefers-reduced-motion in widget-toolbox.js and omit the width transition barFill sets inline when it is asked for.
  • Treat a missing or throwing matchMedia as no preference, so the bar still draws.
  • Note the behaviour on the barFill entry in docs/widgets.md.
  • Leave sparkline unchanged: it builds a static SVG and animates nothing.

Note on scope. No shipped widget imports barFill or sparkline; every widget draws its own bars and charts, and all thirteen widget pages already carry their own prefers-reduced-motion blocks. These two helpers are documented toolkit API for the next widget to reuse, which is why this is fixed in the helper rather than left to each page.

Testing
All green, apart from the Docker build smoke test, which needs a local Docker daemon. Added 5 tests covering both preference states, the preference being read per call, and a browser with no usable matchMedia.

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.
  • CHANGELOG.md updated under Unreleased if the change is user-visible.

barFill sets its transition as an inline style. A widget page loads no
shared stylesheet, and a rule in the page's own <style> cannot override
an inline style, so the preference could not reach it. Read the
preference in the helper instead.

sparkline animates nothing and is left alone.
@SandObserver SandObserver added the ui/ux UI, UX, and accessibility only fix label Aug 12, 2026
@SandObserver
SandObserver merged commit 04dc2f9 into main Aug 12, 2026
4 checks passed
@SandObserver
SandObserver deleted the fix/widget-bar-reduced-motion branch August 12, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui/ux UI, UX, and accessibility only fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant