From d4cc469173068ae44acf117b993f2d99465eacbc Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Thu, 16 Apr 2026 21:36:16 -0300 Subject: [PATCH] lesavka: stabilize preview probes and bump semver --- client/Cargo.toml | 2 +- client/src/launcher/ui.rs | 27 ++++++++++++++++++++------- client/src/lib.rs | 4 +++- common/Cargo.toml | 2 +- common/src/cli.rs | 2 +- server/Cargo.toml | 2 +- server/src/lib.rs | 4 +++- 7 files changed, 30 insertions(+), 13 deletions(-) diff --git a/client/Cargo.toml b/client/Cargo.toml index 8dd28aa..cac7809 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -4,7 +4,7 @@ path = "src/main.rs" [package] name = "lesavka_client" -version = "0.6.0" +version = "0.7.0" edition = "2024" [dependencies] diff --git a/client/src/launcher/ui.rs b/client/src/launcher/ui.rs index b5b5501..f604f60 100644 --- a/client/src/launcher/ui.rs +++ b/client/src/launcher/ui.rs @@ -216,6 +216,16 @@ fn refresh_eye_feed_controls( } } +#[cfg(not(coverage))] +fn eye_caps_changed(state: &LauncherState, caps: &crate::handshake::PeerCaps) -> bool { + let next_width = caps.eye_width.unwrap_or(state.preview_source.width); + let next_height = caps.eye_height.unwrap_or(state.preview_source.height); + let next_fps = caps.eye_fps.unwrap_or(state.preview_source.fps); + state.preview_source.width != next_width + || state.preview_source.height != next_height + || state.preview_source.fps != next_fps +} + #[cfg(not(coverage))] fn record_diagnostics_sample( widgets: &super::ui_components::LauncherWidgets, @@ -1589,6 +1599,7 @@ pub fn run_gui_launcher(server_addr: String) -> Result<()> { CapsMessage::Refresh(probe_result) => { diagnostics_network.borrow_mut().record(&probe_result); let caps = probe_result.caps; + let rebind_preview = eye_caps_changed(&state.borrow(), &caps); { let mut state = state.borrow_mut(); if probe_result.reachable { @@ -1602,14 +1613,16 @@ pub fn run_gui_launcher(server_addr: String) -> Result<()> { (caps.eye_width, caps.eye_height) { let fps = caps.eye_fps.unwrap_or(30); - { - let mut state = state.borrow_mut(); - state.set_preview_source_profile(width, height, fps); - } - if let Some(preview) = preview.as_ref() { + { + let mut state = state.borrow_mut(); + state.set_preview_source_profile(width, height, fps); + } + if rebind_preview && let Some(preview) = preview.as_ref() { for monitor_id in 0..2 { - let capture = state.borrow().capture_size_choice(monitor_id); - let breakout = state.borrow().breakout_size_choice(monitor_id); + let capture = + state.borrow().capture_size_choice(monitor_id); + let breakout = + state.borrow().breakout_size_choice(monitor_id); preview.set_capture_profile( monitor_id, capture.width, diff --git a/client/src/lib.rs b/client/src/lib.rs index 0e7dffe..2b5ebdb 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -2,7 +2,9 @@ #![forbid(unsafe_code)] -pub const VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), "+", env!("LESAVKA_GIT_SHA")); +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const BUILD_ID: &str = env!("LESAVKA_GIT_SHA"); +pub const FULL_VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), "+", env!("LESAVKA_GIT_SHA")); pub mod app; mod app_support; diff --git a/common/Cargo.toml b/common/Cargo.toml index 3c3bfd6..a6a89ee 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lesavka_common" -version = "0.6.0" +version = "0.7.0" edition = "2024" build = "build.rs" diff --git a/common/src/cli.rs b/common/src/cli.rs index 3ed2ea8..4e3995b 100644 --- a/common/src/cli.rs +++ b/common/src/cli.rs @@ -17,6 +17,6 @@ mod tests { #[test] fn banner_includes_version() { - assert_eq!(banner("0.6.0"), "lesavka-common CLI (v0.6.0)"); + assert_eq!(banner("0.7.0"), "lesavka-common CLI (v0.7.0)"); } } diff --git a/server/Cargo.toml b/server/Cargo.toml index 513b9d1..c71edea 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -10,7 +10,7 @@ bench = false [package] name = "lesavka_server" -version = "0.6.0" +version = "0.7.0" edition = "2024" autobins = false diff --git a/server/src/lib.rs b/server/src/lib.rs index 5ce9f1b..2e312bb 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -1,6 +1,8 @@ // server/src/lib.rs -pub const VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), "+", env!("LESAVKA_GIT_SHA")); +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const BUILD_ID: &str = env!("LESAVKA_GIT_SHA"); +pub const FULL_VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), "+", env!("LESAVKA_GIT_SHA")); pub mod audio; pub mod camera;