fix: account for proxy pipeline latency in switch overlay duration
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user