From 3f19554cfabe55b88b638fc1d16fdb90afab1407 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Wed, 11 Feb 2026 15:33:10 -0700 Subject: [PATCH] Improve live input indicator visibility --- src/stream.h | 6 +-- .../common/assets/web/troubleshooting.html | 40 +++++++++++++++++-- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/src/stream.h b/src/stream.h index 5126acaf..3335ea78 100644 --- a/src/stream.h +++ b/src/stream.h @@ -23,9 +23,9 @@ namespace stream { constexpr auto CONTROL_PORT = 10; constexpr auto AUDIO_STREAM_PORT = 11; - constexpr uint64_t KB_ACTIVE_WINDOW_MS = 500; - constexpr uint64_t MOUSE_ACTIVE_WINDOW_MS = 500; - constexpr uint64_t GAMEPAD_ACTIVE_WINDOW_MS = 500; + constexpr uint64_t KB_ACTIVE_WINDOW_MS = 1500; + constexpr uint64_t MOUSE_ACTIVE_WINDOW_MS = 1500; + constexpr uint64_t GAMEPAD_ACTIVE_WINDOW_MS = 1500; struct session_t; diff --git a/src_assets/common/assets/web/troubleshooting.html b/src_assets/common/assets/web/troubleshooting.html index 96efa5d1..e75e7de6 100644 --- a/src_assets/common/assets/web/troubleshooting.html +++ b/src_assets/common/assets/web/troubleshooting.html @@ -151,7 +151,7 @@

Live Input Status

-

Per-session input activity and policy. Indicators update every second.

+

Per-session input activity and policy. Indicators update twice per second.

No active streaming sessions. @@ -170,6 +170,9 @@ {{ s.policy.allow_keyboard ? 'ON' : 'OFF' }} + + {{ activityStateLabel(s.activity.keyboard_active, s.activity.last_keyboard_ms_ago) }} + @@ -177,6 +180,9 @@ {{ s.policy.allow_mouse ? 'ON' : 'OFF' }} + + {{ activityStateLabel(s.activity.mouse_active, s.activity.last_mouse_ms_ago) }} + @@ -184,6 +190,9 @@ {{ s.policy.allow_gamepad ? 'ON' : 'OFF' }} + + {{ activityStateLabel(s.activity.gamepad_active, s.activity.last_gamepad_ms_ago) }} +
@@ -436,7 +445,7 @@ }, 5000); this.sessionInterval = setInterval(() => { this.refreshActiveSessions(); - }, 1000); + }, 500); this.refreshLogs(); this.refreshClients(); this.refreshActiveSessions(); @@ -446,6 +455,21 @@ clearInterval(this.sessionInterval); }, methods: { + activityStateLabel(active, msAgo) { + if (active) { + return 'LIVE'; + } + + if (msAgo < 0) { + return 'never'; + } + + if (msAgo < 1000) { + return `${msAgo}ms`; + } + + return `${(msAgo / 1000).toFixed(1)}s`; + }, refreshActiveSessions() { fetch("./api/sessions/active") .then((r) => r.json()) @@ -677,18 +701,26 @@