Watch
0
0
Fork
You've already forked hyperhive
0

Trim negative-space comments per mara's review

Don't state what a function/module doesn't do and where that
happens instead — just describe what it does. Cut the "not
something this function decides" / "not affected by this" /
"not a placeholder for a later commit" asides from the doc
comments touched in the last two commits.
This commit is contained in:
iris 2026-08-30 21:31:33 +02:00
commit 5930efc29b
4 changed files with 5 additions and 28 deletions

View file

@ -1,13 +1,5 @@
// useAgentState — polls `GET /api/state` and exposes the latest
// snapshot + loading/error status. Mirrors app.js's old `refreshState`
// data fetch, not its exact re-poll cadence: the old page re-polled on a
// timer only while a login was in flight, and otherwise waited for an
// SSE `turn_end` event to trigger one-shot refreshes. That SSE-triggered
// model is permanently off the table now — the terminal stream's `kind`
// tag (what let a client single out a turn-boundary event) is gone by
// design, see `useLiveStream.ts`'s module doc — so this hook's flat 4s
// interval is the only refresh path, not a placeholder for a later
// commit.
// useAgentState — polls `GET /api/state` every 4s and exposes the latest
// snapshot + loading/error status.
import { useEffect, useRef, useState } from 'preact/hooks';
import type { AgentState } from '../types.js';