From 865834a8aecf57f81c9bb0ba61de7dcfe9c2cd84 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 30 Jun 2026 05:55:33 +0000 Subject: [PATCH] feat: hide stack quick-logger unless a poker session is live Poll /session/data on load, every 10s, and on foreground; show the stack box only when session.is_live, hide it otherwise (logging with no live session just errors). Hidden by default until confirmed. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01G796GsLCvJQKVN7hwV2cDx --- lyra/web/static/index.html | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lyra/web/static/index.html b/lyra/web/static/index.html index df4682b..cc525fc 100644 --- a/lyra/web/static/index.html +++ b/lyra/web/static/index.html @@ -3,7 +3,7 @@ Lyra Core Chat - + @@ -252,13 +252,33 @@ } }); } + // Only show the stack quick-logger when a poker session is actually live — + // otherwise logging just errors ("no live session"). + function updateStackQuickVisibility() { + const box = document.getElementById("stackQuick"); + if (!box) return; + fetch("/session/data", { cache: "no-store" }) + .then(function (r) { return r.json(); }) + .then(function (data) { + const live = !!(data && data.session && data.session.is_live); + box.style.display = live ? "flex" : "none"; + }) + .catch(function () { box.style.display = "none"; }); + } (function wireStackQuick() { + const box = document.getElementById("stackQuick"); const btn = document.getElementById("stackQuickBtn"); const inp = document.getElementById("stackQuickInput"); + if (box) box.style.display = "none"; // hidden until a live session is confirmed if (btn) btn.addEventListener("click", stackQuickLog); if (inp) inp.addEventListener("keydown", function (e) { if (e.key === "Enter") { e.preventDefault(); stackQuickLog(); } }); + updateStackQuickVisibility(); + setInterval(updateStackQuickVisibility, 10000); + document.addEventListener("visibilitychange", function () { + if (!document.hidden) updateStackQuickVisibility(); + }); })(); function generateSessionId() {