Skip to content

site: refresh "currently tending" on a 30s timer - #549

Merged
max-sixty merged 1 commit into
mainfrom
currently-tending
May 17, 2026
Merged

max-sixty merged 1 commit into
mainfrom
currently-tending

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

liveData was fetch-once, so every runtime-fetched section froze as of page load. For "currently tending" that meant the pulse animation (now-pulse … infinite) kept running for hours after the underlying jobs finished — leave the tab open at 2pm with three jobs running and at 8pm it still says ● Currently tending worktrunk, cli, and tend with the dot pulsing. The idle line had the mirror problem: "Last tended 3 min ago" stayed "3 min ago" indefinitely.

liveData now takes an optional intervalMs. When set, it refetches on a timer and re-runs render, so the section transitions between live and idle states over the page's lifetime. CurrentlyTending opts in at 30s; a refresh that finds no in-flight runs falls through to the idle path, which flips data-pulse to idle and the CSS stops the pulse.

Left for separate follow-ups (each has its own wrinkle):

  • Activity feed has the same staleness plus a worse variant — its setInterval(updateTendingTimes, 1000) keeps incrementing a finished job's elapsed timer. Naive refresh would also stack a new interval per tick; the interval needs guarding first.
  • Stats goes stale slowly and has no pulse, so lower urgency — could opt into the same intervalMs with a longer period.

Verification: tsc --noEmit and npm run build clean. Not visually confirmed in a running browser (Chrome extension disconnected mid-session) — worth an eyeball of an actual live→idle tick.

liveData was fetch-once, so the panel froze as of page load — a "live"
pulse kept animating for hours after the underlying jobs finished, and
"Last tended N min ago" never advanced. liveData now takes an optional
intervalMs; CurrentlyTending passes 30s. On refresh the render re-runs,
so the section transitions live→idle (or idle→live) over the page's
lifetime and the pulse stops when nothing is in flight.

Stats and Activity have the same staleness but are left for separate
follow-ups: Activity also stacks a per-second timer interval that would
double up under naive refresh, and Stats moves slowly with no pulse.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit 368b947 into main May 17, 2026
6 checks passed
@max-sixty
max-sixty deleted the currently-tending branch May 17, 2026 00:12
max-sixty added a commit that referenced this pull request May 17, 2026
Follow-up to #549, which taught `liveData` to refetch on a timer but
only opted in `CurrentlyTending`. `Stats` and the `Activity` feed had
the same fetch-once staleness:

- "to date" totals froze at page load and never moved while the tab
stayed open.
- A finished tending job's elapsed timer in the Activity feed kept
incrementing forever, because the row was never refetched and replaced
by its settled representation.

## Changes

- **Stats** — opt into `intervalMs` at 5 min. Render is already
idempotent (`replaceChildren`), no structural change needed. Slow-moving
and no pulse, so a long period is fine.
- **Activity** — opt in at 60s, and hoist
`setInterval(updateTendingTimes, 1000)` out of the render callback to a
single module-level ticker. The old per-render `setInterval` would stack
a new 1s interval on every refresh; the hoisted ticker no-ops when no
tending rows exist, so always-on is trivially cheap. The 60s refetch is
what actually fixes the forever-ticking timer — a completed job drops
out of `/currently-tending` and re-renders as a settled `pr`/`review`
row (or ages out).

## Transient-outage note

Covered by #547: the worker's stale-while-revalidate path preserves the
last good cached entry on a GitHub fanout failure, so a client refetch
during a blip gets stale-but-valid data (HTTP 200, real numbers), not
`null`. Only a true worker-down returns `null` and hides the section —
and there the refresh self-heals on the next tick, whereas fetch-once
stayed hidden until manual reload. Strictly better, not a regression.

## Verification

`tsc --noEmit` and `npm run build` clean. Not visually confirmed in a
running browser (Chrome extension disconnected this session) — worth an
eyeball of an actual feed refresh settling a finished job, alongside the
same outstanding check for #549.

Co-authored-by: Claude <[email protected]>
@max-sixty max-sixty mentioned this pull request May 17, 2026
3 tasks
max-sixty added a commit that referenced this pull request May 17, 2026
## Summary

Release 0.0.24. 11 PRs since 0.0.23:

- #545 Rewrite the workflow generator on Jinja2 templates
- #546 generator: switch build backend to uv_build
- #544 generator: route install-test through `_apply_extras`
- #535 install-tend: unify on the chain model (admin-gated refs + env
policy pin)
- #537 review-reviewers: migrate to the Codex harness
- #551 debug-tend-run: support Codex session logs; instruct Codex to
read skills in full
- #552 review: stop re-posting "prior thread still applies" on every
push
- #547 fix(stats): stop blacking out the section on transient worker
outage
- #548 site: simplify "currently tending" to a prose repo list
- #549 site: refresh "currently tending" on a 30s timer
- #550 site: refresh Stats and Activity on a timer

#551 and #552 are the reason for cutting now: together they stop the
Codex harness re-posting near-identical "the prior thread still applies"
reviews on every push. The behavior is release-gated, so it only reaches
tend's own dogfooded workflows once 0.0.24 is published and the nightly
regen repins the action ref.

No new breaking changes since 0.0.23 (the `TEND_BOT_TOKEN` rename
shipped in 0.0.23).

## Test plan

- [ ] CI green (test, test-worker, lint)
- [ ] After merge: tag `0.0.24`, PyPI publish (`pypi-release.yaml` on
the tag push), `uvx [email protected] --help` works
- [ ] Regenerate tend's own workflows to `@0.0.24` (separate `chore:
regenerate` PR, after the tag exists)

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants