Skip to content

feat(dashboard): testable Living Docs poll state machine#71

Merged
silversurfer562 merged 3 commits into
mainfrom
feat/living-docs-poller-testing
Jun 17, 2026
Merged

feat(dashboard): testable Living Docs poll state machine#71
silversurfer562 merged 3 commits into
mainfrom
feat/living-docs-poller-testing

Conversation

@silversurfer562

Copy link
Copy Markdown
Member

Extracts the Living Docs poll decision into a tested ES module (living-docs-poller.js + Vitest), with the living_docs.html template wired to it.

Rebased onto current main (the batch-panel work from #68 is already merged). Supersedes #69, which entered a broken head-ref state after the rebase force-push (GitHub failed to reconcile the rewritten head and refused reopen).

Spec: specs/living-docs-poller-testing/.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

silversurfer562 and others added 3 commits June 17, 2026 07:14
Follow-on to dashboard-js-testing. Scope: extract + Vitest-test the
Living Docs poll state machine (shouldKeepPolling / scheduling) using the
approved no-build ES-module pattern. Behavior-preserving; no API change.

The Jinja↔JS badge/action mapping duplication is noted but explicitly
deferred to its own follow-up spec (needs an API-payload decision).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Phases 1-3 approved 2026-06-14. Extract shouldKeepPolling + POLL_INTERVAL_MS
to a tested static_cw module; convert the poller block to type=module glue.
Stacks on #68 for the static_cw infra + Vitest glob.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Apply the dashboard-js-testing pattern to the Living Docs poller
(specs/living-docs-poller-testing):

- static_cw/living-docs-poller.js — pure shouldKeepPolling(rows) +
  POLL_INTERVAL_MS, DOM/timer-free; defensive over non-array / missing
  computed_state.
- static_cw/living-docs-poller.test.js — 6 cases (stop/continue/empty/
  defensive + cadence constant).
- living_docs.html — poller <script> becomes <script type="module">
  importing the module; inline .some(...) → shouldKeepPolling, 1500 →
  POLL_INTERVAL_MS. All timer/DOM/visibility glue unchanged.

Vitest: 113 passed (poller + batch-panel + editor). Verified live: module
200, page intact, batch SSE still 200, no console errors — behavior
identical. Stacks on #68.

Badge/action map de-dup remains a separate deferred spec.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@silversurfer562 silversurfer562 merged commit d946559 into main Jun 17, 2026
6 checks passed
@silversurfer562 silversurfer562 deleted the feat/living-docs-poller-testing branch June 17, 2026 11:20
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.

1 participant