From 91c221c8b0d7fa3d8df1d9129ce2f8c2a6f5e854 Mon Sep 17 00:00:00 2001 From: selikhov Date: Sat, 3 Oct 2026 11:40:07 +0300 Subject: [PATCH] voelin-ui: end screenshot runs that have the studio's window open A screenshot run hid the main window and waited for the event loop to end, which it does not while another window is visible: with the studio detached the run never finished. It now quits the event loop itself. The stream chat keeps scrolling to its end for a moment after a change: rows are measured as they come into view, so the end moves while the first scroll reaches it. Co-Authored-By: Claude Opus 5.5 --- crates/voelin-ui/src/dev.rs | 2 ++ crates/voelin-ui/ui/screens/studio-parts.slint | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/voelin-ui/src/dev.rs b/crates/voelin-ui/src/dev.rs index 37ac95f..8ae1142 100644 --- a/crates/voelin-ui/src/dev.rs +++ b/crates/voelin-ui/src/dev.rs @@ -216,6 +216,8 @@ pub(crate) fn start(ui: &MainWindow, switches: &Switches) -> Running { eprintln!("screenshot failed: {e}"); } let _ = ui.hide(); + // Also when the studio's own window is open. + let _ = slint::quit_event_loop(); } }, ); diff --git a/crates/voelin-ui/ui/screens/studio-parts.slint b/crates/voelin-ui/ui/screens/studio-parts.slint index 0345a98..45df2c9 100644 --- a/crates/voelin-ui/ui/screens/studio-parts.slint +++ b/crates/voelin-ui/ui/screens/studio-parts.slint @@ -979,14 +979,15 @@ export component StudioChat inherits StudioPanel { to-end := Timer { interval: 50ms; running: false; - // Twice: the rows at the end are measured after the first scroll. + // Again for a moment: rows are measured as they come into view, so + // the end moves while it is reached. triggered => { root.tries += 1; if chat-list.content-height > 0 { chat-list.content-y = min(0px, chat-list.visible-height - chat-list.content-height); root.passes += 1; } - if root.passes >= 2 || root.tries > 20 { + if root.passes >= 6 || root.tries > 30 { self.running = false; } }