Add reduce motion accessibility setting - #2
Conversation
Add a user-configurable setting to control UI animations based on accessibility preferences. The setting supports three modes: - "system": Follows OS accessibility preferences (default) - "on": Always reduces motion (disables animations) - "off": Always enables animations Platform support includes macOS via NSWorkspace accessibility API, with a default implementation for other platforms. The setting is exposed in the Settings UI under Appearance > Motion and currently applies to toast notification animations. Additional animations can be updated to respect this setting in future changes.
Shorten the description from "Controls whether animations are reduced. When set to System, follows your OS accessibility preference." to "Reduce or disable animations. System uses your OS preference." for better readability and consistency with other setting descriptions in the UI.
Remove unwrap_or_default() fallback to enforce explicit setting configuration. The reduce_motion setting must now always be present in workspace settings.
Simplify test coverage by consolidating overlapping tests into data-driven test cases: - Merge 3 should_reduce_motion variant tests into single test - Combine 2 deserialization tests into data-driven approach - Consolidate 3 settings store parsing tests with cases array - Remove redundant default value test (covered elsewhere) - Fix alphabetical ordering of pub use statements Reduces line count from 242 to 167 while maintaining identical test coverage. Each consolidated test includes context messages for easier failure diagnosis.
PR Review Summary: Add reduce motion accessibility settingFiles changed: 11 (+305/-36) Critical Issues (0 found)No critical issues were identified. The PR is well-structured and follows established codebase patterns. Important Issues (1 found)1. Misleading "System" description on non-macOS platforms[error-handling] The settings UI description says:
However, the Recommendation: Update the description to mention macOS-only support for the "system" mode, or add platform-specific implementations for Linux ( Suggestions (2 found)1. Consider making
|
Replace ambiguous "Reduce or disable animations" with "Control UI animations" and specify that System mode reads from macOS preferences, making the platform scope clear.
Make the inner ReduceMotion field private and add a public value() accessor method. This provides better encapsulation and allows for future changes to the internal representation without breaking the public API. Update all test assertions to use the new accessor method instead of direct field access.
…stries#51059) Extract data table modules into separate files This PR extracts the `tests` and `table_row` modules from `data_table.rs` into separate files to improve code organization. This is preparatory work for the upcoming column width API rework (#2 in the series), where separating mechanical changes from logical changes will make the review easier. The extraction was performed using rust-analyzer's "Extract module to file" command. **Context:** This is part 1 of a 3-PR series improving data table column width handling: 1. **This PR**: Extract modules into separate files (mechanical change) 2. [zed-industries#51060](zed-industries#51060) - Introduce width config enum for redistributable column widths (API rework) 3. Implement independently resizable column widths (new feature) The series builds on previously merged infrastructure: - [zed-industries#46341](zed-industries#46341) - Data table dynamic column support - [zed-industries#46190](zed-industries#46190) - Variable row height mode for data tables Primary beneficiary: CSV preview feature ([zed-industries#48207](zed-industries#48207)) Release Notes: - N/A
Follows up on zed-industries/zed#48295, scoped down per feedback to ship one primitive at a time.
Summary
reduce_motionsetting ("system"|"on"|"off", default:"system")accessibilityDisplayShouldReduceMotionwhen set to"system"Next steps
gtk-enable-animations/ portal) and Windows (SPI_GETCLIENTAREAANIMATION)with_animationis used in ~15 other places: cursor blink, edit predictions, agent panel, spinners, etc.)animate_intrait itself so all callers get it for freeTest plan
should_reduce_motionwith each variant"reduce_motion": "on"and verify toast appears without animation"reduce_motion": "system"and toggle macOS System Settings > Accessibility > Display > Reduce motion