Skip to content

Pre-review: tmp/cr-probe-prefix - #4

Closed
perlowja wants to merge 1 commit into
cr-base/tmp-cr-probe-prefix-202611232228from
tmp/cr-probe-prefix
Closed

perlowja wants to merge 1 commit into
cr-base/tmp-cr-probe-prefix-202611232228from
tmp/cr-probe-prefix

Conversation

@perlowja

Copy link
Copy Markdown
Collaborator

Internal pre-review (not for merge).

Honor the desktop animated-icons setting: IconMotion.allowed() and
IconMotion.animated() read the key through the same GLib.Settings idiom Motion
uses for reduce-motion, with a has_key guard so a missing schema or key means on.
A motion that is already playing may finish.

Assisted-by: zoder:qwen38
AI-Scope: generated the animated-icons gate in icon_motion.vala and its test in motion_test.vala with the fixture schema key; prompts: honor the animated-icons setting in IconMotion, then simplify the test.
@perlowja

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

IconMotion now checks the desktop animated-icons setting before reporting icons as animated or allowing playback. The motion test schema defines the setting, and a test verifies its default and behavior when toggled.

Changes: Animated Icon Settings Gate

Layer / File(s) Summary
Setting gate and test coverage
src/animation/icon_motion.vala, tests/fixtures/motion/dev.sinty.motiontest.gschema.xml, tests/motion_test.vala
IconMotion checks the cached desktop setting in animated() and allowed(). If the schema or key is unavailable, the check defaults to enabled. The test schema defines the setting, and the test checks its default and behavior when toggled.
Merge Risk: Moderate · up to cf5a2

The new test calls a helper that is not visible to the separately compiled test target, so the test build is likely to fail. The animated-icons setting logic itself looks sound. Make the helper reachable through a public API, or build the test so it can see internal members, before merging.

Architecture risk: Low · up to cf5a2

The change affects 2 systems.

Changed systems: tests, src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — tests (service) was modified; 2 changed files map to changed impact.
  • observed — src (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in src/animation/icon_motion.vala: Added the ANIMATED_KEY constant for the desktop setting key animated-icons.
  • observed — Modified behavior in src/animation/icon_motion.vala: animated() now returns false when animated icons are disabled before checking icon size and sibling availability.
  • observed — Modified behavior in src/animation/icon_motion.vala: allowed() now rejects disabled animated icons in addition to reduced motion and power-saver mode; the existing power-saver check remains.
  • observed — Modified behavior in src/animation/icon_motion.vala: Added cached settings lookup using the desktop settings schema. When the schema or key is unavailable, animated_icons_enabled() defaults to true; otherwise it returns the setting’s boolean value. Added an internal test-accessible wrapper for the check.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

return _animated_settings == null || _animated_settings.get_boolean(ANIMATED_KEY);
}

internal static bool animated_icons_enabled_for_test() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Functional Correctness · Quick win

Make the gate test accessible to its build target.

motion-test compiles separately against the library's public VAPI. This internal method is absent from that VAPI, so the calls in test_animated_icons_gate() fail name resolution and block the test build. Compile the test with the implementation in the same Vala package, or test through the public API. (raw.githubusercontent.com)

@perlowja perlowja closed this Nov 23, 2026
@perlowja
perlowja deleted the tmp/cr-probe-prefix branch November 23, 2026 22:33
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Action not completed

Pull request is closed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Successfully merging this pull request may close these issues.

1 participant