Validate the target and operation before removing a live capture prompt. Verify the prompt survives both mismatches using the runtime command queue and decouple the disposable profile from Cargo output.
3.4 KiB
Windows native capture selection cancellation
Worktree work/stream-setup, based on 6ab51d5fb061889259cc5b850078b995dd6abc04. This records the device-free Slint portion of preload:cancelCaptureSelection and command:stream_setup; neither compatibility entry is changed.
Shipped path
The desktop Go Live button (native/ui/shell.slint:713) invokes CaptureChoose. The runtime enumerates a source catalog and the shared Slint ShellDialog renders the source selector and Cancel button (native/ui/dialogs.slint:199, :229). Windows uses libwebrtc screen/window enumeration in a worker MTA and adds camera descriptors. The macOS and Linux Wayland desktop path instead lists a system-picker entry without starting a desktop capturer; the OS picker is deferred to Preview (native/src/media/stream/capture.rs:401, :440, :476). Windows and non-Wayland Linux choose a listed screen/window directly. Mobile uses separate platform capture adapters.
Confirming a source only exposes Preview; submitting Preview configuration is the first acquisition boundary. Start requires a private preview and is a separate publication step. A cancelled chooser now removes its exact session/flow and discards its catalog. Cancelling Preview configuration also drops the selected source and removes its detail actions. A retired prompt cannot fall through to a new chooser or acquisition and a mismatched Cancel cannot dismiss a newer capture prompt.
Observed
cargo test --quiet --locked --offline -p teamspeach-native --lib --no-default-features --features webrtc,test-harness slint_capture_selection_cancel_revokes_only_its_flow -- --nocapture
1 passed, 0 failed (Windows x64, 2.12 s test body). The test ran in the isolated worktree with its own Cargo target and a fresh disposable profile. It used the real Slint app and runtime, pointer events over visible Go Live and footer buttons, and pointer/keyboard input on the real source selector. Two synthetic rosters supplied session state without connecting to a server. The test confirmed open/Cancel/reopen, a fresh unselected chooser, explicit source confirmation without Start, a second tab's Cancel preserving the first selection, Preview configuration Cancel removing the first selection/actions, and rejection of stale runtime intents. The capture adapter returned only an inert catalog, counted four enumerations and zero acquisition/Start attempts, and the actual stream hub had no publisher on either tab. Audio input/output starts were both zero.
Follow-up on base f1455937413ba336dff39a579886126d897ba34e: the same targeted test passed again (1 passed, 0 failed, 2.30 s test body). With the replacement chooser open, it submitted its current editor ID first with the retired flow target, then with the current target but the wrong operation. After each submission, a navigation action on the same runtime queue confirmed command processing before the test asserted that the same Slint prompt was still open. The subsequent visible Submit still completed the correct selection. The disposable profile now uses the OS temporary directory and does not depend on the workspace Cargo target layout.
This does not exercise OS enumeration, picker/consent success or refusal, release of a live physical preview, actual Start/setup acknowledgement, or a server refusal presented in Slint. No real screen, camera, audio device, beta14 fixture, external server, or owner profile was used.