Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teams animations setting - spike how to support in motion components #33113

Closed
1 task
robertpenner opened this issue Oct 22, 2024 · 0 comments
Closed
1 task
Assignees

Comments

@robertpenner
Copy link
Collaborator

robertpenner commented Oct 22, 2024

Tasks:

  • Validation with Fluent UI developers

Problem Background

  • Our motion components read the preference for reduced motion from the browser, which is automatically in sync with the OS setting (e.g. "Animation effects" in Windows):

Image

  • However, Teams has its own setting to "Turn off animations", and this Teams setting is not connected to the OS setting:

Image

  • Thus, our motion components currently do not respond to the Teams settings to turn off animations.

Solution to Investigate

  • Teams has a useDisableAnimations hook for consuming the Teams motion toggle.
  • However, the motion components should not consume this Teams hook directly:
    • Architecturally, our components are in Fluent, so they need to be app-agnostic, not reach out to look for specific app settings.
    • Instead, Teams code should read the setting and configure the motion components from the outside-in.
  • Lingfan added a new mechanism MotionBehaviourContext which can tell all motion components within it to disable motions, via React context.
  • Lingfan's immediate use case (for Simple Collab Left Rail) was to temporarily disable motion in Tree, during drag and drop. However, we would like to use the same mechanism at the app level to disable motion for any motion component within Teams.
  • Prior art: there is a place in Teams code where the Animation component from Fluent v0 (Stardust) is configured to disable animations from the outside in, using a context provider:

Image

  • We can follow this precedent to try a spike, to feed the Teams setting for disabling motions into a new MotionBehaviourContext, wrapping around Teams at its base.

Testing Considerations

  • We should confirm with Teams Engineering the intended behavior: whether the Teams motion toggle should completely ignore the OS setting, and override it.
  • MotionBehaviourContext inside a MotionBehaviourContext: we should check that overriding works as desired, e.g. that the app-level setting and the drag-and-drop use case (see above) work in harmony.

Future Work

  • Shift and Lingfan would like to see this Teams motion toggle removed, in favor of relying solely on the OS setting.
  • Shift mentioned the Teams PM for Accessibility is Brett Humphrey, who would be involved in a decision to remove the Teams motion toggle to rely on the OS setting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants