From 82ee9dd13afd7e6cb7ccc47ddd06bc4020232c1b Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Fri, 30 Oct 2026 23:05:41 -0700 Subject: [PATCH] refactor(kde): print the KDE view of the schema of komorebi-config komorebic static-config-schema and the daemon's StaticConfigSchema answer print schema::view::(Platform::CURRENT) of the shared crate instead of the schema derived from the daemon's own StaticConfig. Verified: KDE cargo check --workspace --all-targets: no warnings; cargo test -p komorebi --lib: 289 passed, 0 failed; --test schemas: 5 passed; komorebic static-config-schema and application-specific-configuration-schema: byte-identical to the checked-in schema.json and schema.asc.json (no diff). --- komorebi-for-kde/komorebi/src/process_command.rs | 6 ++++-- komorebi-for-kde/komorebic/src/main.rs | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/komorebi-for-kde/komorebi/src/process_command.rs b/komorebi-for-kde/komorebi/src/process_command.rs index 9cbd8c11..49c18960 100644 --- a/komorebi-for-kde/komorebi/src/process_command.rs +++ b/komorebi-for-kde/komorebi/src/process_command.rs @@ -1887,8 +1887,10 @@ impl WindowManager { SocketMessage::StaticConfigSchema => { #[cfg(feature = "schemars")] { - let static_config = schemars::schema_for!(StaticConfig); - let schema = serde_json::to_string_pretty(&static_config)?; + let schema = komorebi_config::schema::view::< + komorebi_config::static_config::StaticConfig, + >(komorebi_config::schema::Platform::CURRENT); + let schema = schema.trim_end(); reply.write_all(schema.as_bytes())?; } diff --git a/komorebi-for-kde/komorebic/src/main.rs b/komorebi-for-kde/komorebic/src/main.rs index e2260916..2329af69 100644 --- a/komorebi-for-kde/komorebic/src/main.rs +++ b/komorebi-for-kde/komorebic/src/main.rs @@ -2204,9 +2204,10 @@ fn main() -> eyre::Result<()> { SubCommand::StaticConfigSchema => { #[cfg(feature = "schemars")] { - let socket_message = schemars::schema_for!(komorebi_client::StaticConfig); - let schema = serde_json::to_string_pretty(&socket_message)?; - println!("{schema}"); + let schema = komorebi_config::schema::view::< + komorebi_config::static_config::StaticConfig, + >(komorebi_config::schema::Platform::CURRENT); + print!("{schema}"); } } SubCommand::SubscribeSocket(args) => {