From 975f007af2f3ab8aad0eed36d309a6d14c628820 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Fri, 30 Oct 2026 21:10:31 -0700 Subject: [PATCH] refactor(mac): converge animation/prefix.rs to the shared AnimationPrefix macOS's AnimationPrefix gains Transparency (it had movement and workspace), so all three trees share the union {movement, transparency, workspace} (D15/D16); the macOS daemon ignores Transparency as before in practice. prefix.rs is now the Windows text plus module docs (this adds new_animation_key to macOS). Intentional schema change: komorebi-for-mac/schema.json gets the same shape change as the KDE one (per-prefix animation settings become additionalProperties of the value type). Because a macOS komorebic cannot run here, the three PerAnimationPrefixConfig definitions were copied from the schema that the KDE komorebic generated from identical code (jq, the file round-trips byte-identically through jq --indent 2); not regenerated on macOS. The animation CLI docs list the three values. Verified: fast-check macOS (fake CC) cargo check --workspace --all-targets: PASS. macOS tests and schema generation not run (cannot). --- .../docs/cli/animation-duration.md | 2 +- komorebi-for-mac/docs/cli/animation-style.md | 2 +- komorebi-for-mac/docs/cli/animation.md | 2 +- .../komorebi/src/animation/prefix.rs | 7 +++- komorebi-for-mac/schema.json | 42 +++++-------------- 5 files changed, 20 insertions(+), 35 deletions(-) diff --git a/komorebi-for-mac/docs/cli/animation-duration.md b/komorebi-for-mac/docs/cli/animation-duration.md index 91b1ff54..7e710d28 100644 --- a/komorebi-for-mac/docs/cli/animation-duration.md +++ b/komorebi-for-mac/docs/cli/animation-duration.md @@ -13,7 +13,7 @@ Options: -a, --animation-type Animation type to apply the duration to. If not specified, sets global duration - [possible values: movement, workspace] + [possible values: movement, transparency, workspace] -h, --help Print help diff --git a/komorebi-for-mac/docs/cli/animation-style.md b/komorebi-for-mac/docs/cli/animation-style.md index f2dc783d..a2b08abd 100644 --- a/komorebi-for-mac/docs/cli/animation-style.md +++ b/komorebi-for-mac/docs/cli/animation-style.md @@ -47,7 +47,7 @@ Options: -a, --animation-type Animation type to apply the style to. If not specified, sets global style - [possible values: movement, workspace] + [possible values: movement, transparency, workspace] -h, --help Print help (see a summary with '-h') diff --git a/komorebi-for-mac/docs/cli/animation.md b/komorebi-for-mac/docs/cli/animation.md index a4b34981..ca327b21 100644 --- a/komorebi-for-mac/docs/cli/animation.md +++ b/komorebi-for-mac/docs/cli/animation.md @@ -13,7 +13,7 @@ Options: -a, --animation-type Animation type to apply the state to. If not specified, sets global state - [possible values: movement, workspace] + [possible values: movement, transparency, workspace] -h, --help Print help diff --git a/komorebi-for-mac/komorebi/src/animation/prefix.rs b/komorebi-for-mac/komorebi/src/animation/prefix.rs index 23dcf0bc..e9d0eedb 100644 --- a/komorebi-for-mac/komorebi/src/animation/prefix.rs +++ b/komorebi-for-mac/komorebi/src/animation/prefix.rs @@ -15,6 +15,11 @@ use strum::EnumString; #[serde(rename_all = "snake_case")] pub enum AnimationPrefix { Movement, + Transparency, + /// A workspace sliding in and out of a monitor when it is switched to Workspace, - // Note: Transparency is not supported on macOS as there's no equivalent to Win32 layered windows +} + +pub fn new_animation_key(prefix: AnimationPrefix, key: String) -> String { + format!("{prefix}:{key}") } diff --git a/komorebi-for-mac/schema.json b/komorebi-for-mac/schema.json index f6a07c48..2f8ecfca 100644 --- a/komorebi-for-mac/schema.json +++ b/komorebi-for-mac/schema.json @@ -3239,15 +3239,9 @@ { "description": "Animation configuration prefixed for a specific animation kind", "type": "object", - "properties": { - "movement": { - "type": "boolean" - }, - "workspace": { - "type": "boolean" - } - }, - "additionalProperties": false + "additionalProperties": { + "type": "boolean" + } }, { "description": "Animation configuration for all animation kinds", @@ -3261,19 +3255,11 @@ { "description": "Animation configuration prefixed for a specific animation kind", "type": "object", - "properties": { - "movement": { - "type": "integer", - "format": "uint64", - "minimum": 0 - }, - "workspace": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } - }, - "additionalProperties": false + "additionalProperties": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } }, { "description": "Animation configuration for all animation kinds", @@ -3289,15 +3275,9 @@ { "description": "Animation configuration prefixed for a specific animation kind", "type": "object", - "properties": { - "movement": { - "$ref": "#/$defs/AnimationStyle" - }, - "workspace": { - "$ref": "#/$defs/AnimationStyle" - } - }, - "additionalProperties": false + "additionalProperties": { + "$ref": "#/$defs/AnimationStyle" + } }, { "description": "Animation configuration for all animation kinds",