feat(native): taskbar progress bar during uploads (#10)
Build Lotus Chat Desktop / prepare (push) Successful in 8s
Build Lotus Chat Desktop / build-windows (push) Canceled after 4m46s
Build Lotus Chat Desktop / build-linux (push) Canceled after 0s
Build Lotus Chat Desktop / build-arch (push) Canceled after 0s
Build Lotus Chat Desktop / update-manifest (push) Canceled after 0s
Build Lotus Chat Desktop / prepare (push) Successful in 8s
Build Lotus Chat Desktop / build-windows (push) Canceled after 4m46s
Build Lotus Chat Desktop / build-linux (push) Canceled after 0s
Build Lotus Chat Desktop / build-arch (push) Canceled after 0s
Build Lotus Chat Desktop / update-manifest (push) Canceled after 0s
`set_taskbar_progress(status, progress)` drives Tauri's window progress bar (Windows taskbar button; launcher/dock elsewhere where supported): none / normal (0-100) / indeterminate / error. Uses Tauri's built-in ITaskbarList3 wrapper rather than more hand-written COM. Bump cinny (the aggregation, throttling and error hold). Closes #10 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
33d8871ac8
commit
9e320fa326
+1
-1
Submodule cinny updated: 25fa0f6ef9...146ba4d2ff
@@ -701,6 +701,34 @@ fn set_tray_update_ready(app: tauri::AppHandle, version: Option<String>) -> Resu
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// cinny-desktop #10: upload progress on the taskbar button (Windows taskbar;
|
||||
/// the launcher/dock elsewhere, where Tauri supports it). `status` is `none`,
|
||||
/// `normal`, `indeterminate` or `error`; `progress` is 0-100. The web side
|
||||
/// aggregates every upload and throttles calls to ~4 Hz.
|
||||
#[tauri::command]
|
||||
fn set_taskbar_progress(
|
||||
app: tauri::AppHandle,
|
||||
status: String,
|
||||
progress: Option<u64>,
|
||||
) -> Result<(), String> {
|
||||
use tauri::window::{ProgressBarState, ProgressBarStatus};
|
||||
let status = match status.as_str() {
|
||||
"normal" => ProgressBarStatus::Normal,
|
||||
"indeterminate" => ProgressBarStatus::Indeterminate,
|
||||
"error" => ProgressBarStatus::Error,
|
||||
_ => ProgressBarStatus::None,
|
||||
};
|
||||
let window = app
|
||||
.get_webview_window("main")
|
||||
.ok_or_else(|| "no main window".to_string())?;
|
||||
window
|
||||
.set_progress_bar(ProgressBarState {
|
||||
status: Some(status),
|
||||
progress: progress.map(|p| p.min(100)),
|
||||
})
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
/// Flash the taskbar button to draw attention (e.g. a new mention while the
|
||||
/// window is unfocused). Clears automatically once the window is focused.
|
||||
#[tauri::command]
|
||||
@@ -750,6 +778,7 @@ pub fn run() {
|
||||
get_tray_dnd,
|
||||
set_tray_update_ready,
|
||||
set_tray_call_state,
|
||||
set_taskbar_progress,
|
||||
flash_window,
|
||||
focus_main_window,
|
||||
send_notification,
|
||||
|
||||
Reference in New Issue
Block a user