Files
BetterDesk/docs/PATCH_PLAN_2026-04-18.md
UNITRONIX 762ffd9719 Unify web remote, improve agent UI & telemetry
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.
2026-04-18 02:30:25 +02:00

3.2 KiB
Raw Permalink Blame History

Patch Plan — 2026-04-18

Problems reported

  1. Agent client infinite loading — after registration the GUI shows only a spinner; nothing interactive.
  2. Web remote client is duplicated — multiple paths/entry points. Need one canonical client at /remote/:id reachable from the device row kebab menu (desktop icon).
  3. Multi-connection tab close broken — X button on top-bar tab closes the session but the tab remains; hover X does nothing.
  4. 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.
  5. 37 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_status fast: drop SystemSnapshot::collect() from the hot path, read-only fields from cached config.
  • Split slow sysinfo into a separate get_system_info command that UI polls lazily.
  • Frontend: wrap onMount invoke calls in Promise.race with a 3 s timeout so setReady(true) is always reached.
  • Add explicit error UI when Tauri IPC fails.

Phase B — Unify remote entry

  • Make /remote/:id the 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 close event too).

Phase D — Toolbar commands

Wire up each menu action through the existing RustDesk Misc protocol messages:

  • Ctrl+Alt+Delctrl_alt_del Misc option.
  • Lock screenlock_screen Misc option.
  • Restart remoterestart_remote_device Misc option.
  • Refresh screenrefresh_video Misc option (keyframe request).
  • Paste clipboard → read navigator.clipboard, send clipboard message.
  • Block inputblock_input Misc option toggle.
  • Quality presetsimage_quality Misc 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 AdaptiveQuality loop: measure RTT + decoded FPS; if decode FPS > 25 and bandwidth headroom → promote to Best; if decode FPS < 15 or high packet loss → demote to Performance.
  • When page served over HTTPS, prefer WebCodecs (VP9/AV1/H264) with Auto preference. On HTTP, fall back to JMuxer H264-only.
  • Auto refresh_video on 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.