Skip to content

Pre-review: feat/animated-icons-gate - #3

Closed
perlowja wants to merge 1 commit into
cr-base/feat-animated-icons-gate-202611232140from
feat/animated-icons-gate
Closed

perlowja wants to merge 1 commit into
cr-base/feat-animated-icons-gate-202611232140from
feat/animated-icons-gate

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.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

IconMotion now checks the animated-icons setting before reporting or allowing animation. The setting defaults to enabled when its schema or key is unavailable. The test fixture defines the setting, and a test checks its enabled and disabled states.

Changes: Animated Icon Settings Gate

Layer / File(s) Summary
Setting gate and test
src/animation/icon_motion.vala, tests/fixtures/motion/dev.sinty.motiontest.gschema.xml, tests/motion_test.vala
IconMotion checks the animated-icons setting before reporting or allowing animation. The test schema defines the setting with a true default. The test checks the setting when enabled and disabled.
Merge Risk: Moderate · up to cf5a2

The new animated-icons test calls an internal method that the separately built motion-test target cannot see, so that target will fail to compile and block the test workflow. Runtime behavior of the animation gate is not shown to be affected. Fix the test accessibility 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: Adds the animated-icons settings key constant.
  • observed — Modified behavior in src/animation/icon_motion.vala: animated() now returns false when animated icons are disabled before checking the image size and sibling animation file.
  • observed — Modified behavior in src/animation/icon_motion.vala: allowed() now also rejects playback when animated icons are disabled; it still rejects reduced-motion and power-saver modes. Adds a cached settings lookup using the desktop schema, defaulting to enabled when the schema or key is unavailable, and an internal test accessor for that result.
  • observed — Modified behavior in tests/fixtures/motion/dev.sinty.motiontest.gschema.xml: Adds the animated-icons boolean key with a true default and the summary “Animated Icons.”

@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

Comment thread tests/motion_test.vala
fresh_clock();
var settings = new GLib.Settings("dev.sinty.motiontest");
assert(settings.get_boolean("animated-icons") == true);
assert(IconMotion.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 test accessor available to the test target.

motion-test compiles separately and consumes the library’s public VAPI. animated_icons_enabled_for_test() is internal, so that VAPI excludes it and this call prevents the test target from compiling. Provide test-only internal bindings, or test through the public API. (raw.githubusercontent.com)

@perlowja perlowja closed this Nov 23, 2026
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