Honor system reduced-motion preferences in the TUI (#44666)

## Why

The TUI should respect the host's accessibility preference even when `tui.animations` is enabled.

## What changed

- Read the system motion preference once at launch on macOS, Windows, and Linux. Changes to that preference require restarting the TUI.
- Suppress animations when reduced motion is requested without changing saved configuration. Preserve configured behavior when detection is unavailable, and limit the Linux portal query to 250 ms.
- Use the effective animation setting for voice controls and transcripts, and honor system reduced motion in the startup composer.

## Testing

Add tests for animation preference resolution and preservation of saved settings, plus composer snapshots without sparkles at widths of 40 and 80 columns.

GitOrigin-RevId: 3ea4e721ae23220a040a06123a27286a8c8f1c7c
This commit is contained in:
Ian MacLeod authored and copyberry committed 2026-09-10 22:55:04 +00:00
1 parent 84ed5744d9
commit 78600239a1
15 files changed
+240 -21

No files matched your search

+9 -1
View File
@@ -3,6 +3,7 @@
//! The resolved core config is a temporary input at local load/reload boundaries. Server thread
//! responses must never refresh these values; live preference changes belong here. The remaining
//! Config-based lifecycle adapters also use this conversion until their interfaces are migrated.
//! Effective animations also respect the TUI host's launch-time accessibility preference.
use crate::legacy_core::config::Config;
use crate::legacy_core::config::TerminalResizeReflowConfig;
@@ -23,10 +24,17 @@ pub(crate) struct LocalSettings {
impl From<&Config> for LocalSettings {
fn from(config: &Config) -> Self {
Self::with_system_motion(config, crate::system_motion::mode())
}
}
impl LocalSettings {
fn with_system_motion(config: &Config, system_motion: crate::motion::MotionMode) -> Self {
Self {
tui: Tui {
notification_settings: config.tui_notifications.clone(),
animations: config.animations,
animations: config.animations
&& system_motion == crate::motion::MotionMode::Animated,
whimsy: config.tui_whimsy,
show_tooltips: config.show_tooltips,
show_server_version_notice: config.tui_show_server_version_notice,