From a3afb3a94b362da3eb0d144497bdd9eba2e39760 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Fri, 30 Oct 2026 23:32:18 -0700 Subject: [PATCH] refactor(bar): GroupingConfig.transparency_alpha has one spelling in render.rs The two render.rs differed in two places. The Windows bar documented transparency_alpha with '(default: 200)' in its text; the macOS bar documented it without and put the default into the schema (schemars extend default 200), so the macOS nix options file gets default = 200. The macOS spelling is taken for both, because a change to the macOS schema.bar.json would also change the generated nix/komorebi-bar-options.nix, which cannot be regenerated here. Windows: the description loses the '(default: 200)' text and the property gains "default": 200 (reviewed diff of schema.bar.json below, pin updated in tests/schema_oracle.rs); the one comment on RenderConfig that only Windows had ('/// Render configuration') is added to the macOS copy. The two render.rs are then byte-identical. The schema diff is the two lines of the property: description 'Alpha value for the color transparency [[0-255]] (default: 200)' -> 'Alpha value for the color transparency [[0-255]]', and one added "default": 200. macOS schema.bar.json is untouched (its harness regeneration is byte-identical). Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; native cargo test -p komorebi-bar-core: 3 unit + 2 oracle passed, 0 failed; harness regeneration: macOS byte-identical (3,774 lines), Windows byte-identical to the updated schema.bar.json (9,091 lines, diff exactly the two lines above). Not verified: rendering. --- crates/komorebi-bar-core/tests/schema_oracle.rs | 6 +++--- komorebi-bar/src/render.rs | 3 ++- komorebi-for-mac/komorebi-bar/src/render.rs | 1 + schema.bar.json | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/komorebi-bar-core/tests/schema_oracle.rs b/crates/komorebi-bar-core/tests/schema_oracle.rs index 48380b84..510057e8 100644 --- a/crates/komorebi-bar-core/tests/schema_oracle.rs +++ b/crates/komorebi-bar-core/tests/schema_oracle.rs @@ -21,9 +21,9 @@ struct Pin { const PINS: [Pin; 2] = [ Pin { file: "schema.bar.json", - lines: 9_090, - bytes: 248_529, - fnv1a: 0x5573_0134_1968_bff9, + lines: 9_091, + bytes: 248_540, + fnv1a: 0x83d6_6fd4_9ae8_3766, }, Pin { file: "komorebi-for-mac/schema.bar.json", diff --git a/komorebi-bar/src/render.rs b/komorebi-bar/src/render.rs index 482e3b74..bdcfd815 100644 --- a/komorebi-bar/src/render.rs +++ b/komorebi-bar/src/render.rs @@ -367,7 +367,8 @@ impl RenderConfig { pub struct GroupingConfig { /// Styles for the grouping pub style: Option, - /// Alpha value for the color transparency [[0-255]] (default: 200) + /// Alpha value for the color transparency [[0-255]] + #[cfg_attr(feature = "schemars", schemars(extend("default" = 200)))] pub transparency_alpha: Option, /// Rounding values for the 4 corners. Can be a single or 4 values. pub rounding: Option, diff --git a/komorebi-for-mac/komorebi-bar/src/render.rs b/komorebi-for-mac/komorebi-bar/src/render.rs index 1840daa2..bdcfd815 100644 --- a/komorebi-for-mac/komorebi-bar/src/render.rs +++ b/komorebi-for-mac/komorebi-bar/src/render.rs @@ -44,6 +44,7 @@ pub enum Grouping { } #[derive(Clone)] +/// Render configuration pub struct RenderConfig { /// Komorebi monitor index of the monitor on which to render the bar pub monitor_idx: usize, diff --git a/schema.bar.json b/schema.bar.json index f8bd8d58..e832d2fe 100644 --- a/schema.bar.json +++ b/schema.bar.json @@ -2807,12 +2807,13 @@ ] }, "transparency_alpha": { - "description": "Alpha value for the color transparency [[0-255]] (default: 200)", + "description": "Alpha value for the color transparency [[0-255]]", "type": [ "integer", "null" ], "format": "uint8", + "default": 200, "maximum": 255, "minimum": 0 }