Journal

· guides

Accessibility preferences are a live signal

A Reduce Motion preference needs race-safe initialization, live updates, and cleanup because an old lookup can arrive after a new choice.

A verdigris live signal passes through a mechanical latch while a delayed black signal stops before it.

An accessibility preference is live application state. Our Muniment Mobile implementation protects a new Reduce Motion value from an older asynchronous lookup. That race matters because honoring a preference once is weaker than honoring the preference the system reports now.

Initialization can lose a newer choice

React Native exposes Reduce Motion through an asynchronous query and a change-event subscription. Those two paths can report in either order from the application’s point of view.

Consider an initial lookup that remains unresolved. The system then reports that Reduce Motion is enabled. If the old lookup later resolves to false, a direct state assignment restores stale information and permits motion against the newer signal.

Our shared hook starts with motion reduced. It subscribes to changes and records whether an event arrives before the initial lookup resolves. Once an event has arrived, the old result cannot replace it.

This conservative default has a clear cost. An animation may stay absent while the app waits for the lookup. We prefer that brief stillness to motion shown before the preference is known.

One hook gives five surfaces the same rule

Muniment Mobile uses the hook across two screens with animated state and three modal sheets. The shared boundary keeps preference timing out of each component.

The implementation gives every surface three rules:

  • Start with motion reduced while the initial value remains unknown.
  • Apply live preference changes as they arrive.
  • Remove the subscription when the consumer unmounts.

For the three modal sheets, an enabled Reduce Motion preference changes the configured presentation animation to none. This is our component configuration, covered by deterministic tests.

The race test holds time open

The focused regression test controls the order that production cannot promise. It holds the initial promise open, emits a newer true value, then resolves the old lookup as false. The hook stays true.

Other tests verify that the hook removes its subscription and that all three modal sheets select none. Together, these checks cover initialization, live changes, cleanup, and reduced modal presentation configuration.

This evidence comes from the Muniment Mobile note pinned to commit 31d8e28dbd249088e4b6209612128d895d3afa17. It proves deterministic JavaScript behavior and component configuration under tests.

It does not prove native transitions on physical iOS or Android devices. It also does not prove rendering performance. A test can pin the race without pretending to be a device lab.

Sources

  1. React Native — AccessibilityInfo reactnative.dev

Continue reading

All publications

Early access

One governed workspace for every model

See which work produced each model bill, with grants, routing, and records in one place.