Skip to content

feat(web): visual insights page behind the insights-visual flag - #714

Merged
dash0-dev[bot] merged 16 commits into
mainfrom
feat/insights-visual-v1
Oct 21, 2026
Merged

dash0-dev[bot] merged 16 commits into
mainfrom
feat/insights-visual-v1

Conversation

@dash0-dev

@dash0-dev dash0-dev Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Why

/insights reads as a stack of sentences, and over the last 30 days the only section anyone interacted with was the utility grid. This is the first visual version — the learning loop plus when memory moves — behind insights-visual (default off), so it can ship without changing what anyone sees.

What changed

  • insights-visual flag and an InsightsView copy-and-suffix resolver: off renders the original InsightsPage untouched, on renders InsightsVisualPage.
  • The visual page, on ONE window: cost line first, a Learn → Recall → Promote → Prune strip, Pulse (written / chosen / bulk as small multiples on a shared axis), a recall flow (client → read tool → scope type), and runs as a weekday × hour rhythm plus swimlanes; the utility grid, runs list, scope leaderboard and health diagnostics stay.
  • Pure, spec-covered models (insights-loop, flow-layout, recall-flow, runs-rhythm) over existing REST routes only — no backend change.
  • Series that reach PostgREST's 1000-row max_rows are shown as lower bounds rather than drawn as a cliff; the rhythm uses paginated runs for the same reason.
  • Bounded load: the cost line, utility grid and strip share ONE hour-aligned /memories/utility request — this also changes the flag-off page (one request instead of two, no all-history cost) — and below-the-fold sections fetch on scroll; /utility hit statement timeouts under the old fan-out.

How to verify

  • cd packages/web && npx vitest run src/lib/{insights-loop,flow-layout,recall-flow,runs-rhythm}.spec.ts
  • Storybook Pages/Insights/Visual (+ /Tests) and Pages/Insights/InsightsView/Tests; or flip the flag on /settings/developer.

Notes for reviewers

The two new visual stories need /update-baselines (Chromium was not reachable where this was authored). User-facing docs and llms.txt are untouched on purpose — nothing changes for users until the flag flips (docs/otel.md lists the new insights.* analytics: the page range section and insights.recall_flow_view_changed) — and the lifecycle flow and prune trend wait on an audit-log aggregate endpoint.

mthines and others added 6 commits October 21, 2026 07:08
…pulse views

Registers the insights-visual flag (default off) and adds the pure,
tested models the flag-gated Insights page renders: the loop stage
figures and pulse buckets, a layered flow layout, the recall flow,
and the runs rhythm and swimlanes.

Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
Adds the InsightsView resolver (off: the original page, unchanged;
on: the visual page) and the visual page itself: the learn/recall/
promote/prune strip, the pulse timeline, the recall flow, and runs
as a weekday x hour rhythm plus swimlanes, with the utility grid,
runs list, scope leaderboard and operational health kept on one
page-wide window.

Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
…ghts page

Adds deterministic MSW fixtures, visual stories (Default, Empty) and
interaction tests for InsightsVisualPage; gives the pulse section an
explicit empty state; removes non-null assertions from the new
modules.

Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
…ify pass

The flow chart scaled through a fixed viewBox, shrinking its 11px labels
to ~5px on a phone; it now lays out at the container's measured width
(callback ref, so it survives the table toggle). Column names align to
the node columns, the rhythm grid's labels share a fixed gutter, and the
recall-flow interaction test scopes its table query to its section.

Simplify: drop the cursor hook's unused setter, rename cryptic locals,
reuse the shared time constants in the story fixtures.

Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
- Lead with the cost line, per the decision that /insights leads with
  the bill; the utility grid stays in its own section.
- Draw every grid from the window the data was fetched for, and dim the
  page (aria-busy) while a new range loads, instead of re-gridding the
  previous window's rows onto the new axis.
- Treat a row-capped series in either window as a lower bound: the
  strip says so and drops the Learn/Recall deltas.
- Count only successful calls in the recall flow; correct its comment.
- Say the Pulse text alternative is window totals; centre ticks under
  their bars; add legends to the rhythm grid and swimlanes; show a
  census failure instead of loading forever; caption the run list's
  own window and the most-recent-first truncation.
- Add resolver tests for the off, on and unknown-variant arms.

Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
@dash0-dev

dash0-dev Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/update-baselines

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

The dashboard preview for this PR — redeployed on each push that changes the web app.

Project Deployment Actions Updated
lorekit Ready Ready Preview Oct 21, 2026 1:14pm UTC

Preview always points at this PR's latest commit; Deployment is the immutable build of 05bb828. · Comment /web-preview to force a redeploy. · Workflow logs

…d load on the visual insights page

- Swimlanes: overlapping runs stack into sub-rows (greedy interval
  packing, capped at six per lane, instant runs reserve their drawn
  width), so concurrent sessions read as separate bars.
- Recall flow: outer labels move into gutters, middle labels get a
  background halo; tool->scope bands are coloured by tool in a blue
  family no client uses; client colours no longer repeat amber.
- A call with no scope type is 'unattributed' (never folded into
  'other'); 'other' is only unknown types and the top-N fold.
- Stage deltas use a new neutral TrendChip tone.
- Load: the cost line, utility grid and loop strip share ONE
  /memories/utility request on an hour-aligned 30-day window (both
  flag arms; quadrant rows no longer ask for the all-history cost),
  and runs, the run list and the scope leaderboard mount only when
  scrolled near.

Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
@mthines
mthines marked this pull request as ready for review October 21, 2026 11:08
@mthines
mthines self-requested a review as a code owner October 21, 2026 11:08
@dash0-dev

dash0-dev Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ No issues found

Adds the visual /insights page behind the default-off insights-visual flag: pure spec-covered models over existing REST routes, one shared hour-aligned /memories/utility request, and below-the-fold sections fetched on scroll.

Progress: open review threads 2 → 1 → 2 → 0 → 0 across the last 5 reviews

Fix all with Agent0

Review details
Gate Details
Description vs. code ✅ The description matches what the diff does.
Prior review feedback ✅ Earlier review comments are resolved.
Documentation ✅ The change is documented well enough to follow.
Self-review signals ✅ No debug logs, leftover TODOs, or unreviewed stubs.
Code review ✅ The multi-lens review found no blocking issues.
Run Details
Mode incremental · 0 lines in delta · tier deep · depth checkout · no finder ran (zero delta) — Gates 1, 4, 5 and 6 carried from the full review of e9ab8ec; description and code unchanged
Reach 54 changed exports · 28 dependent files · 0 checked · 28 not checked · 4 changed files imported by 28 files, not traced
TrendChip — 3 consumer files · 0 checked
InsightsRangeSection — 2 consumer files · 0 checked
FlagKey — 1 consumer file · 0 checked
MemoryArchiveAction — 1 consumer file · 0 checked
useLoreUtilityRows — 1 consumer file · 0 checked
+49 more
packages/web/src/lib/analytics/track.ts — imported by 21 files
packages/feature-flags/src/registry.ts — imported by 4 files
packages/web/src/components/lore/LoreUtilityGrid.tsx — imported by 4 files
packages/web/src/components/lore/LoreCostHeadline.tsx — imported by 3 files
Found produced 0 → posted inline 0 · cleared 0 · carried forward 0 · deferred 0 · below-bar 0
CI red: CI Summary, Web — Storybook interaction + visual tests (changed) · 10 passed
Memories skipped (zero-delta fast path)

Nothing to report — standards (skipped), measurability (skipped), integrations (skipped), severity, 0 files skipped.

pr-reviewer · commit e9ab8ec · no code changes since e9ab8ec, gate checks only · how these findings are produced · updated Oct 21, 2026 12:36pm UTC

Comment thread packages/web/src/components/insights/visual/InsightsVisualPage.tsx Outdated
Comment thread packages/web/src/components/insights/visual/RecallFlowChart.tsx Outdated
mthines and others added 3 commits October 21, 2026 11:26
…ll as lower bounds

Addresses the pr-reviewer comment: #714 (comment)

Refs: #714
Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
…flow's chart/table toggle

Addresses the pr-reviewer comment: #714 (comment)

Refs: #714
Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
Drop the swimlane builder's intermediate packed-lane map (pack while
building lanes) and rename packRows' cryptic local.

Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
Comment thread packages/web/src/components/insights/visual/LoopStageStrip.tsx Outdated
mthines and others added 2 commits October 21, 2026 11:49
Addresses the pr-reviewer comment: #714 (comment)

Refs: #714
Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
…side the swimlane track

Addresses the pr-reviewer comment: #714 (comment)

Refs: #714
Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
Comment thread packages/web/src/lib/analytics/track.ts
Comment thread packages/web/src/components/insights/visual/RecallFlowChart.tsx Outdated
mthines and others added 2 commits October 21, 2026 12:11
…d the page range section in docs/otel.md

Addresses the pr-reviewer comment: #714 (comment)

Refs: #714
Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
…et before the scope-type nodes

Addresses the pr-reviewer comment: #714 (comment)

Refs: #714
Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
@mthines

mthines commented Oct 21, 2026

Copy link
Copy Markdown
Owner

/update-baselines

Regenerated by the Update visual baselines workflow for PR #714.
@github-actions

Copy link
Copy Markdown
Contributor

✅ Update visual baselines: committed 41 updated baseline(s) as 332d493283de0f41c5982988c9c55c57af68b61e.

ℹ️ This commit was pushed with GITHUB_TOKEN, so web-test will not re-run automatically — push a follow-up commit if you need CI to re-verify.

Resolved conflicts in (took origin/main's baseline: these stories are not
touched by this PR, and main's images were rendered from the code the merged
branch runs):
packages/web/src/app/(dashboard)/lore/__screenshots__/LorePage.stories.tsx/Default-1-chromium-linux.png
packages/web/src/components/blog/__screenshots__/TocList.stories.tsx/Playground-1-chromium-linux.png
packages/web/src/components/lore/__screenshots__/LessonDetailSheet.stories.tsx/Playground-1-chromium-linux.png
@dash0-dev

dash0-dev Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Darkplane Automerge did not approve this pull request. Score 60.76 of 100, threshold 75. Blast radius 70, Evidence quality 82, Change footprint 30.

Darkplane Automerge did not approve this pull request. It scored 60.76 of 100, and 75 was required.

  • 🔴 Change footprint scored 30.
    This is a large hand-written feature of about 3,400 lines across 45 files. It adds a new insights-visual flag in registry.ts (default off) and a new visual page with layout and data-derivation logic in flow-layout.ts, recall-flow.ts and runs-rhythm.ts. Mitigating: the flag gates the page body and most of it is new files with specs and stories. It also edits shared code, including StatCard.tsx, the query cache key in lore-utility.ts, and the analytics types in track.ts.
The other 2 criteria
  • 🟢 Blast radius scored 70.
    The new page sits behind the insights-visual flag (defaultVariant: 'off'), is added through the InsightsView resolver, and uses only existing read routes, so reverting is clean. It is not fully isolated, though. It also edits shared code that runs with the flag off: LoreCostHeadline.tsx and lore-utility.ts (the shared query key and since window), StatCard.tsx, track.ts, and Badge screenshots.
  • 🟢 Evidence quality scored 82.
    On the evaluated head, CI Summary, Storybook interaction and visual tests, Typecheck/Test/Lint, Playwright e2e and the Vercel preview all pass. The PR adds specs for insights-loop, flow-layout, recall-flow, runs-rhythm, lore-cost and track, plus Storybook interaction tests, and the review threads were addressed. Remaining gaps: the automated reviewer's last report listed Storybook and CI Summary as red before baselines were regenerated, no human approval is visible, and the new UI is behind a default-off flag.

An AI evaluator produced these scores from the diff, the repository history, and the pull request text. The pull request text is author-controlled, so treat the scores as signals rather than proof. Reviewed for commit 05bb828.

Was this decision right? Give feedback

@dash0-dev
dash0-dev Bot merged commit 1abfc30 into main Oct 21, 2026
20 checks passed
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