Radio footer, rules page, schedules editor (System timers and Claude tasks through signed runner jobs), account usage bar, usage explorer with a streamed usage.jsonl, queue Controls tab and override, running tasks on the board, stale task prune with the generic dial, greyed card stamps, commit-tree diffs from the runner preview, VS Code path links, expired asks and decisions that stay as EXPIRED cards (asks keyed by a call digest; an async PostToolUse hook closes those answered in the terminal), the Match refresh hourglass, attachments by paste, drop and paperclip in every text field (page CSP gains img-src blob: for the thumbnails) and the limits board with profiles and a passkey to loosen. Fixes: one red accept on a red-gate commit and no release while a risk is open, the send bar footer segments share one height, the mic button survives a redraw, new Match cards queue before the release card. E2E specs were still running at commit time (operator order); their failures follow as separate fixes. 🎯 Fix: 88 % 💥 Break: 8 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 81 🚦 Gate: ⛔ fix 88 % < 90, break 8 % > 5 (committed on the operator's word) Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
74 lines
2.0 KiB
JavaScript
74 lines
2.0 KiB
JavaScript
let loadTicket = 0;
|
|
let appliedTicket = 0;
|
|
let loadsInFlight = 0;
|
|
|
|
async function load() {
|
|
loadTicket += 1;
|
|
const ticket = loadTicket;
|
|
loadsInFlight += 1;
|
|
const abort = new AbortController();
|
|
const timer = window.setTimeout(() => abort.abort(), STATE_TIMEOUT);
|
|
try {
|
|
const response = await fetch(`/api/state?${windowQuery()}`, {cache: "no-store", signal: abort.signal});
|
|
if (!response.ok) {
|
|
throw new Error(String(response.status));
|
|
}
|
|
const next = await response.json();
|
|
if (ticket < appliedTicket) {
|
|
return;
|
|
}
|
|
appliedTicket = ticket;
|
|
const previous = state.now;
|
|
const resumed = ui.offline;
|
|
state = next;
|
|
forgetRevealed();
|
|
ui.offline = false;
|
|
if (JSON.stringify(state.settings) !== settingsSig) {
|
|
adoptSettings(state.settings);
|
|
}
|
|
tuneMusic(FADE / 1000);
|
|
drawSky();
|
|
announce(resumed);
|
|
render(false);
|
|
drawTime();
|
|
drawAgent();
|
|
drawQueueJobs();
|
|
drawStream(true);
|
|
if (motion.current.size === 0 || ui.asOf !== motion.asOf) {
|
|
const first = motion.current.size === 0;
|
|
motion.asOf = ui.asOf;
|
|
relayout(first ? 0 : ui.playing ? 450 : MOVE);
|
|
}
|
|
pulses(state.radio.filter((row) => row.ts > previous));
|
|
} catch {
|
|
if (ticket > appliedTicket) {
|
|
ui.offline = true;
|
|
tick();
|
|
}
|
|
} finally {
|
|
window.clearTimeout(timer);
|
|
loadsInFlight -= 1;
|
|
}
|
|
}
|
|
|
|
function poll() {
|
|
refresh();
|
|
}
|
|
|
|
const SELECTION_HOLD = 20000;
|
|
let selectedSince = 0;
|
|
|
|
function refresh() {
|
|
const selected = String(window.getSelection()).length > 0;
|
|
selectedSince = selected ? selectedSince || Date.now() : 0;
|
|
if (!loadsInFlight && !ui.busy && !ui.playing && !document.hidden && (!selected || Date.now() - selectedSince >= SELECTION_HOLD)) {
|
|
load();
|
|
}
|
|
}
|
|
|
|
function follow() {
|
|
if (ui.screen === "stream" && live() && !document.hidden) {
|
|
fetchEvents();
|
|
}
|
|
}
|