fix: account for proxy pipeline latency in switch overlay duration
All checks were successful
Publish / backend (push) Has been skipped
CI / fmt (push) Successful in 31s
Publish / frontend (push) Successful in 45s
CI / check (push) Successful in 1m29s
CI / clippy (push) Successful in 1m27s

Add 4s for the WS-to-Belkin-to-Avocent pipeline delay before the key
sequence starts executing, plus 1s settle time after for the video
stream to stabilize. Total overlay = 4s + (pauses * pause_duration) + 1s.

[deploy: frontend]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-07 13:39:40 +03:00
parent a57247cb46
commit 8c2ea95723

View File

@@ -199,9 +199,11 @@ function switchToPort(port: number) {
const hotkey = portHotkeys[port] const hotkey = portHotkeys[port]
if (!hotkey || ws?.readyState !== WebSocket.OPEN) return if (!hotkey || ws?.readyState !== WebSocket.OPEN) return
// Count pause tokens to calculate total switch duration // Total duration: proxy round-trip + key sequence execution + settle time
const pauseCount = (hotkey.match(/\*/g) || []).length const pauseCount = (hotkey.match(/\*/g) || []).length
const duration = Math.max((pauseCount * keyPauseDuration) + 500, 1000) const proxyLatency = 4000 // WS → proxy → Belkin → Avocent pipeline delay
const settleTime = 1000 // wait for video stream to stabilize after switch
const duration = proxyLatency + (pauseCount * keyPauseDuration) + settleTime
// Suspend input and show overlay // Suspend input and show overlay
inputSuspended = true inputSuspended = true