tabs.js: drop #406 module-split + #408 forward-looking cookies (#712 batch 7)

#406 (split app.js → tabs/flow/common) closed; the migration is
done — the 'moved to ./flow.js' / 'pre-step-2 this wiring lived
in the broker-terminal IIFE' commentary is git-history, not
present-state docs. #408 (split flow messages from main sse) also
closed; the 'will give /index.html its own stream' line was
forward-looking design that didn't ship that way. Comments
tightened to describe what the code does today; the section
headers, behaviour notes, and reconnect-rationale all stay
intact.
This commit is contained in:
iris 2026-05-31 13:35:18 +02:00
commit 3c2fffabdf

View file

@ -1210,9 +1210,7 @@ window.marked = marked;
function renderQuestions() { function renderQuestions() {
const root = $('questions-section'); const root = $('questions-section');
// #questions-section only lives on /index.html (Y3R C4LL tab); // #questions-section only lives on /index.html (Y3R C4LL tab);
// no-op when missing (#406 step 3 — only /index.html loads // no-op when the section is missing. `question_added` /
// tabs.js, but kept as belt-and-suspenders for any future page
// adding it without that section). `question_added` /
// `question_resolved` SSE events route through here. // `question_resolved` SSE events route through here.
if (!root) return; if (!root) return;
root.innerHTML = ''; root.innerHTML = '';
@ -1423,8 +1421,6 @@ window.marked = marked;
}); });
}, 1000); }, 1000);
// Operator-inbox derived store moved to ./flow.js (#406 step 2).
const APPROVAL_TAB_KEY = 'hyperhive:approvals:tab'; const APPROVAL_TAB_KEY = 'hyperhive:approvals:tab';
// Derived approval state — cold-loaded from /api/state, then mutated // Derived approval state — cold-loaded from /api/state, then mutated
// live by `approval_added` / `approval_resolved` dashboard events. // live by `approval_added` / `approval_resolved` dashboard events.
@ -3166,13 +3162,10 @@ window.marked = marked;
NOTIF.bind(); NOTIF.bind();
Panel.bind(); Panel.bind();
// ─── live updates: dashboard event stream (#406 step 3) ──────────────── // ─── live updates: dashboard event stream ──────────────────────────────
// The dashboard subscribes to /dashboard/stream for live mutation // The dashboard subscribes to /dashboard/stream for live mutation
// events so the SW4RM / Y3R C4LL / SYST3M panes update without an // events so the SW4RM / Y3R C4LL / SYST3M panes update without an
// operator action triggering a refreshState. Pre-step-2 this wiring // operator action triggering a refreshState.
// lived inside the broker-terminal IIFE which only fired on /flow.html
// — meaning /index.html only updated on cold load + after async-form
// submits.
// //
// Bare `EventSource` (no terminal infrastructure needed — the // Bare `EventSource` (no terminal infrastructure needed — the
// dashboard doesn't render broker rows). Each event's `kind` is // dashboard doesn't render broker rows). Each event's `kind` is
@ -3182,9 +3175,9 @@ window.marked = marked;
// lost during the disconnect window (same pattern as flow.js's // lost during the disconnect window (same pattern as flow.js's
// onStreamOpen). // onStreamOpen).
// //
// `#408` will give /index.html its own stream that omits the // Both /index.html and /flow.html subscribe to `/dashboard/stream`
// broker traffic the dashboard never uses; for now both pages // and filter client-side — the dashboard ignores broker traffic
// subscribe to `/dashboard/stream` and filter client-side. // and the inbox ignores mutation events.
const MUTATION_HANDLERS = { const MUTATION_HANDLERS = {
approval_added: applyApprovalAdded, approval_added: applyApprovalAdded,
approval_resolved: applyApprovalResolved, approval_resolved: applyApprovalResolved,
@ -3315,7 +3308,6 @@ window.marked = marked;
refreshTabCounts(); refreshTabCounts();
setInterval(refreshTabCounts, 1000); setInterval(refreshTabCounts, 1000);
// Flow-specific IIFEs moved to ./flow.js (#406 step 2): inbox-pill // Flow-specific code (inbox-pill wiring, broker terminal init, the
// wiring, the broker terminal init, and the @-mention composer. // @-mention composer) lives in ./flow.js — loaded only by /flow.html.
// /index.html no longer loads them — only /flow.html does.
})(); })();