Skip to main content

Module bubble_ipc

Module bubble_ipc 

Source
Expand description

JS bridge for the webcam-bubble toggle command (M-BUBBLE.0 / AUT-273).

One-function module mirroring crate::camera_ipc’s shape — wraps a __screen* helper declared inline in index.html, which in turn calls window.__TAURI__.core.invoke("toggle_webcam_bubble").

Async + ignores the return value — toggling the bubble cannot fail in any way the UI needs to react to. If the window can’t be found the Rust-side command logs via tracing::warn! (see crate::commands::toggle_webcam_bubble in the screen-app crate) and the click is a no-op.

Functions§

set_bubble_clickthrough
Fire-and-forget click-through toggle. enabled = true makes the bubble pass mouse events through; false restores normal interaction (drag works again). Failures log to the JS console; the Rust side also logs via tracing::warn!. M-BUBBLE.1 v0 / AUT-274.
set_bubble_clickthrough_js
__screenSetBubbleClickthrough(enabled) in index.html — returns Promise<void>. M-BUBBLE.1 v0 / AUT-274.
set_webcam_bubble_visibility
Fire-and-forget setter. Use when the UI owns the source of truth for the bubble’s desired state (e.g. the recorder’s camera_enabled signal). Idempotent on the Rust side, so safe to call on every toggle click + on page mount for initial alignment. ISS-05.
set_webcam_bubble_visibility_js
__screenSetBubbleVisibility(visible) in index.html — returns Promise<void>. ISS-05 fix; explicit setter so the recorder’s camera_enabled signal can drive the bubble’s visibility without the toggle-drift the always-flip path had.
toggle_webcam_bubble
Fire-and-forget toggle. Spawns the IPC call as a wasm-bindgen future so the click handler returns immediately; failures are logged to the JS console via web_sys::console::warn_1 rather than surfaced to the user (the Rust side warns via tracing).
toggle_webcam_bubble_js
__screenToggleBubble() in index.html — returns Promise<void>.