oliver-zehentleitner / keepthewhy

Docs: the dashboard views are a library — say so everywhere, and add a tested embed quick start

Sign in to report

tsk-1kvxwvzddv18 Review KTW Coder 001

Oliver's go (Maity chat, seq 109528): "the full programme", including how to embed the library, plus a blog article.

Problem. Only the docs nav ("Dashboard views for another host") and the CHANGELOG say that the dashboard views are a library. README, docs/dashboard.md, dashboard/README.md (= the PyPI page) and llms.txt do not. docs/dashboard-views.md is the full host contract, but it has no quick start: nothing says where to get the files or what the smallest working page looks like.

Scope, one docs PR off main (independent of the #769–#772 stack):

  1. `docs/dashboard-views.md`: a "Quick start" section at the top, before "The files".
  • Getting the files: from the installed wheel (ktw_dashboard/web/, with the one-liner that prints the path) or from the dashboard-vX.Y.Z tag. The manifest names the load order. Pin a version; api in ktw-views.json says when a host must change.
  • A complete minimal host page: the scripts in manifest order, the three stylesheets in cascade order, a ktw-root container, a provider with only state() (fetching a published state.json), a hash-based nav, a localStorage prefs, one scene, and two views mounted (overview and graph).
  • Three tokens mapped onto a host theme, as an example.
  • A pointer to dashboard/tests/web/host/ as the next step (two hosts, path routes, CSP).
  1. That snippet must be tested and must not be prose-only. Either it is the content of a fixture file that a jsdom test loads, mounts and checks (overview heading + graph canvas present, no console error), or the docs quote it from such a file, and a test fails when they diverge. No untested code in the docs.
  2. `README.md`: at the end of the dashboard paragraph (around line 256), one or two sentences. The views are also a library any page can mount: a provider, routes and --ktw-* tokens, read-only. Maity is the first outside host. Link to the quick start.
  3. `docs/dashboard.md`: a short "Embedding the views" section with the same message, linking the quick start.
  4. `dashboard/README.md`: the same sentence, so it is on PyPI with the next dashboard release.
  5. `llms.txt`: a line in the Dashboard section, plus the dashboard-views link if it is missing.
  6. `CHANGELOG.md`: a docs line. A context/ entry only if a real decision falls out (for example, where the files are officially fetched from).

Not in scope: the landing page (docs/index.md) stays on the core.

After merge: ktw-head writes a hands-on blog tutorial ("Mount Keep the Why's views in your own page") from the tested quick start. The announcement post from 2026-11-06 already exists; this one is the how-to.

Review: the usual three reviewers; ≥2 approvals on the exact head, CI green.