Repository navigation
fix(linux): honor desktop Reduce Motion - #34
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Linux frontend always runs the CSS pulse attached to an agent-status glyph requested with
session.status --blink, even when the desktop asks applications to reduce or disable animation.This PR closes parity-audit gap Б5: Reduce Motion. It reads GTK's dedicated
gtk-interface-reduced-motionpreference when available (GTK 4.22+) and retainsgtk-enable-animationsas the fallback used by the currently supported GTK 4.14 stack. Either preference replaces the decorative pulse withanimation: none; the status glyph, color, tooltip, control state, and read-back remain unchanged.The app CSS provider is now reloadable. Changes to either GTK setting take effect immediately on every existing status glyph without restarting agterm or rebuilding widgets.
Cause
agterm-linux/Sources/AgtermLinux/App.swiftinstalled one unconditional rule:The only observed
GtkSettingsproperties were sidebar metrics (gtk-xft-dpi,gtk-font-name, andgtk-overlay-scrolling). No code readgtk-interface-reduced-motionorgtk-enable-animations, and no callback could reload the CSS when either desktop preference changed.This confirms the audit finding directly in the current
linux-portsource: a caller-set blink always pulsed, independent of the desktop accessibility preference.Minimal reproduction
agtermctl session status active --blink --target <session>.GtkSettings:gtk-enable-animations; GTK 4.22+ also exposes the dedicated reduced-motion preference).Expected: the glyph remains visible and stops pulsing while reduced motion is requested. Actual before this PR:
.agterm-blinkcontinues its infinite opacity animation.Change
Commit
fix(linux): honor desktop reduce motion:Sources/AgtermLinux/LinuxReduceMotionPolicy.swift— resolves the dedicated GTK preference plus the legacy animation switch and produces the one gated blink rule.Sources/CGtk/shim.h— adds typed, property-existence-checked GObject readers. This avoids querying the GTK 4.22-only enum on GTK 4.14 and avoids hard-coding a future enumGTypein Swift.Sources/AgtermLinux/App.swift— keeps the app-wide CSS provider, reloads it on both relevantGtkSettingsnotifications, and composes the blink rule from the resolved preference. Existing labels update through the shared provider; there is no widget traversal, polling, timer, or per-glyph state.Tests/AgtermLinuxTests/LinuxReduceMotionPolicyTests.swift— covers the dedicated preference, the legacy fallback, normal motion, and the exact composed CSS for both states.Tests/AgtermLinuxTests/LinuxPolicyTests.swift— keeps the existing composed-CSS integration pin against the new function shape.README.md— documents Linux Reduce Motion behavior and the visible-glyph invariant.No
agtermCorechange: GTK preference discovery, CSS policy, and provider reload stay inside the Linux target.Scope note
Decorative agent-status pulse only. The
AgentIndicator.blinkmodel and control protocol remain intact, sotreeand event read-back still report the caller's requested blink state even while the desktop suppresses its animation. Re-enabling motion restores the pulse without requiring another control command.Terminal rendering, libghostty animation, GTK/libadwaita native transitions, persisted settings, the keymap, and the window/workspace/session/pane model are unchanged.
Keep-in-sync
Control API exempt: this is accessibility rendering of the existing
session.status --blinkcapability, not a new user action or mutable setting. The caller's requested state and existing read-back remain unchanged.The keymap format, control catalog, window/workspace/session/pane model, and bundled agent skill are unchanged, so no plugin or command-reference update is required.
README.mdcarries the user-visible Linux behavior.CHANGELOG.mdis intentionally unchanged outside release flow.Testing
All verification ran inside a purpose-built Docker image based on
swift:6.3.2-noble; no tests or builds were run on the host. The image installed GTK4/libadwaita development packages, libepoxy, software GL, AT-SPI/Xvfb/Openbox, zsh, Zig 0.16.0, and SwiftLint 0.65.0, then built the pinned vendored libghostty throughscripts/setup-linux.sh.swift testinagterm-linux: 336 tests / 48 suites passed, including all four new Reduce Motion policy/CSS tests.swift testinagtermCore: 2570 tests / 97 suites passed.swiftlint lint --strict --quiet: clean.scripts/check-linux-core-boundary.sh 834b74a7f78de06e1c4f66c5e24eafccd047ec64: passed.scripts/check-linux-cli-drift.sh: passed.scripts/test-linux-architecture.sh: passed.swift build: passed.swift build -c release: passed.scripts/test-linux-ui.sh: all GTK AT-SPI scenarios passed, including the app-CSS parser guard on Ubuntu 24.04's GTK 4.14.5.git diff --check: clean.The focused behavioral contract is RED → GREEN coverage: reduced motion or disabled animations emits
.agterm-blink { animation: none; }; normal preferences retain the existingagterm-blink-pulserule. The full GTK smoke confirms the resulting stylesheet parses and the application surface remains healthy on the oldest supported GTK runtime.