mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-11 13:49:03 +00:00
762ffd9719
Multiple coordinated changes: frontend, backend (Tauri Rust), and web server.
Key points:
- Web remote unified to /remote/🆔 redirects legacy /remote-desktop, updated device actions, and removed old viewer rendering.
- Added adaptive quality to RDClient to avoid low-FPS stalls and defaulted to Balanced@30 with runtime promotion/demotion logic.
- Fixed session/tab cleanup to avoid stale tabs and made session teardown more robust.
- Improved agent startup responsiveness: get_agent_status now avoids slow SystemSnapshot::collect(); added a separate get_system_info command for expensive telemetry. Frontend invokes now use timeouts and parallel checks so the UI never hangs, and SetupWizard normalizes addresses before validation.
- Windows privilege check changed to CheckTokenMembership against Administrators group so menu items remain visible to admin users even without UAC elevation; tray menu items are always visible and checked on click.
- Registration/probing: server scheme (HTTPS vs HTTP) is probed and cached; API URL builder updated accordingly.
- UI/UX: added bottom navigation bar, help-session event handling, diagnostics feedback, locale display name support, CSS updates (including bundling Material Symbols font); included material-symbols-rounded.ttf and adjusted CSP to allow fonts.googleapis.com / fonts.gstatic.com.
- Added docs/PATCH_PLAN_2026-04-18.md with patch plan and rationale.
These changes aim to make the desktop agent snappier at startup, unify the web remote entrypoint, improve remote streaming stability, and harden privilege/UX behaviors.
3.2 KiB
3.2 KiB
Patch Plan — 2026-04-18
Problems reported
- Agent client infinite loading — after registration the GUI shows only a spinner; nothing interactive.
- Web remote client is duplicated — multiple paths/entry points. Need one canonical client at
/remote/:idreachable from the device row kebab menu (desktop icon). - Multi-connection tab close broken — X button on top-bar tab closes the session but the tab remains; hover X does nothing.
- Toolbar menu actions non-functional — Ctrl+Alt+Del, Lock screen, Restart remote, Refresh screen, Paste clipboard, Block input, quality presets, scaling modes, etc. don't send commands.
- 3–7 FPS on any connection — adaptive quality should be default, HTTPS preferred, best balance of FPS vs quality.
Phases
Phase A — Agent client loading
- Make
get_agent_statusfast: dropSystemSnapshot::collect()from the hot path, read-only fields from cached config. - Split slow sysinfo into a separate
get_system_infocommand that UI polls lazily. - Frontend: wrap
onMountinvokecalls inPromise.racewith a 3 s timeout sosetReady(true)is always reached. - Add explicit error UI when Tauri IPC fails.
Phase B — Unify remote entry
- Make
/remote/:idthe single canonical entry point. - All device-row kebab "Remote desktop" buttons route to
/remote/:id(no more legacy/web-client,/remote-client, modal launchers). - Remove/redirect any legacy routes.
Phase C — Multi-connection tab close
- Fix DOM sync between session store and top-bar tabs.
- X button should call
closeSession(id)which both terminates the session AND removes the tab from the store. - Handle already-closed sessions gracefully (remove tab on connection
closeevent too).
Phase D — Toolbar commands
Wire up each menu action through the existing RustDesk Misc protocol messages:
- Ctrl+Alt+Del →
ctrl_alt_delMisc option. - Lock screen →
lock_screenMisc option. - Restart remote →
restart_remote_deviceMisc option. - Refresh screen →
refresh_videoMisc option (keyframe request). - Paste clipboard → read navigator.clipboard, send
clipboardmessage. - Block input →
block_inputMisc option toggle. - Quality presets →
image_qualityMisc option: Best / Balanced / Performance. - Scaling modes → CSS-only: fit / fill / original / stretch.
- Show remote cursor → client-side toggle of cursor overlay.
- Disable clipboard / privacy mode / lock after session → respective Misc options.
Phase E — Adaptive quality + HTTPS
- Default imageQuality:
Balanced, customFps: 45. - Run
AdaptiveQualityloop: measure RTT + decoded FPS; if decode FPS > 25 and bandwidth headroom → promote toBest; if decode FPS < 15 or high packet loss → demote toPerformance. - When page served over HTTPS, prefer WebCodecs (VP9/AV1/H264) with
Autopreference. On HTTP, fall back to JMuxer H264-only. - Auto
refresh_videoon resize + after 5 s stall. - Trim MSE SourceBuffer above 2 s to prevent freeze (already in video.js — verify).
Phase F — Rebuild
- Build agent installer (MSI + NSIS).
Execution order
A → B → C → D → E → F
Each phase is independent and can be deployed as soon as it completes.