Repository navigation
#102 — explore view toggle (CTE ⇄ model) + tests.html unit-test viewer - #221
Conversation
…viewer via shared test-card partial (#102) dag.html gains a two-arm view toggle: the lineage view (boot) and the highlighted model's CTE DAG, rendered by the same vendored Cytoscape + dagre engine (templates/explore-cte.js). The carrier's new cte_dags map ships one DagPayload per CTE-bearing compiled model — the exact role-classified, join-typed graph the report renders (build_payload reuse seam, parsed once). An uncompiled model ships no entry and renders the labeled fail-open degraded view, never an error; PreflightError stays four variants. The lineage instance is never rebuilt, so its pan/zoom/highlight persist across toggles (local state, same page). tests.html now serves the unit-test viewer through a SHARED askama partial (templates/partials/test-card.html) extracted from report.html output-preservingly (the report goldens stay byte-identical) and filled client-side by templates/explore-tests.js from the embedded cute-dbt-data payload — no jQuery, no DataTables, no graph engine on the page; createElement+textContent only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ts-viewer gates (#102) features/explore_view_toggle.feature + its step module assert the render-time surface: the gated toggle DOM, the per-model cte_dags carrier (present for CTE-bearing models, absent for uncompiled — the fail-open contract), the shared test-card partial on tests.html, the index-row viewer wiring, the no-Cytoscape posture and the resource-ref zero-egress scan. ExploreModelDecl grows compiled_sql so scenarios can author a WITH clause. The headless suite gains two real-Chromium file:// tests: the CTE/model toggle (disabled-until-highlight, CTE render off the carrier, lineage state persistence across the round trip, the labeled degraded view, console-clean + zero external requests) and the tests.html viewer (selector population, FixtureTable grid with the NULL-cell vocabulary, expected row count, index jump wiring, no cytoscape global). The committed-pages liveness oracle now also asserts the viewer booted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Both mirrors move atomically: the ci.yml feature-count job and the lefthook.yml pre-push hook (expected=18), with the history comments extended. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reached
More reviews will be available in 7 minutes and 12 seconds. Learn how PR review limits work. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (20)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Ready to review this PR? Stage has broken it down into 9 individual chapters for you: Chapters generated by Stage for commit d794d6a on Jun 11, 2026 5:38am UTC. |
📄 Rendered report previewAll golden examples regenerated cleanly. 🟡 Golden examplesCommitted to
🐶 Live dogfood previewThis PR doesn't touch ▶ Open ↗ opens the report in your browser in one click — The Pages preview may take ~1 min to update after this comment Alternative: GitHub CLI# gh CLI >= 2.63 extracts into ./report-preview-playground/.
gh run download 27326277741 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.htmlPosted by |
#222) A Coverage intelligence switch in the report settings panel (default ON, keyboard-operable checkbox per the #146 a11y discipline). OFF sets html[data-coverage=off] and ONE report.css rule hides the .model-findings panel — the only check-engine-derived surface in the report (checklist, tier chips, suppressed-count reveal all live inside it). Purely a DISPLAY toggle: the payload and rendered DOM stay untouched, so ON restores in place with zero re-render. Wired + persisted by theme.js as the coverage field of cute-dbt.appearance.v1 ("on"/"off", absent = "on") — the same mechanism as theme/density/the engine picker, and the cross-page contract the explorer arm (#103/#104) adopts when check-derived content lands there. Distinct from the producer-side [checks] selection/suppression (#171): checks stay computed; an individual viewer hides the surface. Headless guard: default-ON boot, focus + REAL Space keypress toggles OFF (findings hidden, checklist rows stay in the DOM), click restores ON, persistence across reload. Goldens regenerated (delta = settings markup + theme.js + css only; explore pages untouched); insta snapshots accepted intended-only. Part of #219 (explorer arm deferred — no check-derived content renders on the explore pages yet, and #221 owns their templates this cycle). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Summary
Epic #99 V3. Closes #102
explore-dag-data) gains acte_dagsmap — full model node id → the sameDagPayloadthe report renders for that model (role-classified nodes, join-typed edges; thebuild_payloadreuse seam, parsed once in Rust). A new first-party engine (templates/explore-cte.js, banner-pinnedcute-dbt explore CTE engine v1) owns the toggle + CTE render.templates/partials/test-card.html) extracted fromreport.htmland included by both pages — not a fork. A new light engine (templates/explore-tests.js,cute-dbt explore tests viewer v1) fills the card from the embeddedcute-dbt-datapayload: selector optgrouped by model, Given/Expected grids off the RustFixtureTablePOD (NULL/absent cell vocabulary preserved), sql-format code blocks, external-fixture provenance notes, and index-row jump buttons. The page embeds no Cytoscape, no dagre, no Mermaid, no DataTables, no jQuery and passes the zero-egress gate on its own.features/explore_view_toggle.feature+tests/steps/explore_view_toggle.rs; feature-count mirror bumped 17 → 18 in BOTHci.ymlandlefthook.ymlatomically (verified 18 in tree).CTE-view binding decision (documented per the slice brief)
The CTE view binds to the highlighted model — the same in-page selection that click / fuzzy-search-select drives (a Space focus commit implies a highlight, so a committed model is always viewable). With no highlight the CTE arm is disabled (the hint says so); while the CTE view is active a search-select retargets it in place, and a cleared highlight falls back to the lineage view. Chrome + selection persist: the lineage Cytoscape instance is never rebuilt — only
cy.resize()runs after un-hiding, so pan/zoom/highlight survive the round trip (proven headlessly). The CTE instance rebuilds only on model retarget (thecyto-dag.jsmodel-switch precedent).data-selected-modelstays Space-commit-only —explore-cte.jsnever writes it (pinned by an asset_embed test).Fail-open contract
An uncompiled model (
dbt parse) ships nocte_dagsentry; the client renders a labeled degraded CTE view (" has no compiled SQL in this manifest (dbt parse) — run dbt compile…"), never an error. A compiled CTE-less model renders the "no CTE structure" sparse state.PreflightErrorkeeps its four variants.Discovery answer — what extracted cleanly vs stayed report-specific
report.html's unit-test rendering is split across static skeleton markup and JS-driven payload rendering (interaction.js):.test-sectioncard (test selector, scope toggle, badges row, description, details body) plus the.panel-rowGiven/Expected panel pair. It contains zero askama expressions, so one partial serves both template contexts verbatim. The include is output-preserving: askama strips the included file's final newline, so the parent restores the separating blank line — all three report goldens regenerate byte-identical (verified, and gated byexample-report-check).interaction.js— selector population tied to the model-select/scope state, diff toggles/tints (explore is full-manifest: no changed-set, no PR diff), DataTables enhancement, the YAML drawer, copy buttons, settings wiring. Per the lane boundary,interaction.jsandreport.cssare untouched; tests.html gets a NEW explore-specificexplore-tests.js(no jQuery/DataTables) and styles the shared markup with explore-local CSS. The partial's scope toggle (Updated only / All tests) is meaningless on a full-manifest page — it is hidden via explore-page CSS, not forked out of the shared markup.FixtureTablePOD cell contract ({display, key}, diff: show authored cell values — split cell IR into display/equality axes + POD-render fixture tables #138) and thecte_dagsmap reusesDagPayloaddirectly (no parallel type).Invariants held
file://network-block gates pass for dag.html and tests.html (and the report).rg "root_path|/Users/|/home/"overexamples/explore/→ clean); synthetic-only fixtures (no new fixtures).PreflightError= 4 variants; oneselectedModelwrite site (pinned).templates/interaction.jsandtemplates/report.cssuntouched (sibling lane on feature: design-2 integration PR-5 — rich hover cards: ref()/Expected model pills, format-badge fixture reconstruction, overrides badge, info tips #202).Gate evidence (run directly in the worktree — lefthook skips in fresh worktrees)
cargo fmt --all --checkcargo clippy --all-targets --locked -- -D warningscargo nextest run --all-targets --lockedcargo test --test bddcargo test --test headless_zero_egress -- --ignoredcargo test --test headless_toggle -- --ignoredRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --document-private-items --lockedcargo deny checkgit diff -- examples/audited (onlyexamples/explore/*changed)--config crap4rs.toml --coverage lcov.info)🤖 Generated with Claude Code