Upload atoms now also report into an app-wide `uploadProgressAtom`, and `aggregateUploadProgress` turns every in-flight upload into one taskbar state: byte-weighted percentage while uploading, indeterminate until a size is known, red after a failure (held 4 s, then cleared), none when done. Cancelled uploads just disappear. `useTauriTaskbarProgress` sends it to the native `set_taskbar_progress`, at most ~4 times a second, always ending on the latest state. Verified with a throttled 6 MB upload: 0% → 99% at 250 ms steps, then cleared; with the upload request aborted: 0% → error → cleared after 4 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
30 lines
1.6 KiB
TypeScript
30 lines
1.6 KiB
TypeScript
import { useTauriCallPower } from '../hooks/useTauriCallPower';
|
|
import { useTauriJumpList } from '../hooks/useTauriJumpList';
|
|
import { useTauriThumbbar } from '../hooks/useTauriThumbbar';
|
|
import { useTauriTaskbarProgress } from '../hooks/useTauriTaskbarProgress';
|
|
import { useTauriSmtc } from '../hooks/useTauriSmtc';
|
|
import { useTauriNetwork } from '../hooks/useTauriNetwork';
|
|
import { useTauriToastActions } from '../hooks/useTauriToastActions';
|
|
import { useTauriFocusAssist } from '../hooks/useTauriFocusAssist';
|
|
import { useTauriDnd } from '../hooks/useTauriDnd';
|
|
|
|
/**
|
|
* Mounts the client-scoped native desktop feature hooks (call/room aware). Each
|
|
* `useTauri*` hook no-ops in the browser (guards on `isTauri`), so this is safe
|
|
* to render unconditionally. Rendered once by `ClientNonUIFeatures`. App-level
|
|
* desktop features (window chrome) live in `App.tsx` instead, so they work
|
|
* before login.
|
|
*/
|
|
export function TauriDesktopFeatures(): null {
|
|
useTauriCallPower(); // P5-46 no-sleep during calls
|
|
useTauriJumpList(); // P5-36 Windows jump list of recent rooms
|
|
useTauriThumbbar(); // P5-44 taskbar thumbnail toolbar (mute/deafen/end)
|
|
useTauriTaskbarProgress(); // cinny-desktop #10 upload progress on the taskbar button
|
|
useTauriSmtc(); // P5-43 system media transport controls
|
|
useTauriNetwork(); // P5-49 network-change awareness → sync retry
|
|
useTauriToastActions(); // P5-41/35 rich toast click → open room, quick reply → send
|
|
useTauriFocusAssist(); // P5-56 Windows Focus Assist → DND suppression atom
|
|
useTauriDnd(); // P6-1 tray "Do Not Disturb" → notification suppression atom
|
|
return null;
|
|
}
|