From d16cfab0eab3b40b9696cd22dfc6856bf3c8326e Mon Sep 17 00:00:00 2001 From: Christopher Bays Date: Sun, 14 Jun 2026 12:06:58 -0400 Subject: [PATCH 1/2] =?UTF-8?q?#345=20=E2=80=94=20feat(explore):=20macro?= =?UTF-8?q?=20view=20filtered=20directory=20+=20dimmed=20impacted-model=20?= =?UTF-8?q?DAG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Finishes the explore macro view (cute-dbt#345, epic #99) — the two remaining ACs after Slices 1–3 (#362/#364/#369): - AC1 — filtered artifact directory: for the focused macro, a folder-grouped, collapsible directory (native
/, zero JS/egress) of ONLY the models + tests whose transitive depends_on.macros reaches it, mirroring project folders. - AC3 — models and tests surfaced as SEPARATE partitions (never merged — the get_where_subquery non-merge rule), each grouped independently by the directory portion of original_file_path; pathless nodes bucket under "(no path)". AC2 (impacted-model subgraph complement dimmed) shipped in Slice 3 (#369) as the .macro-downstream role-dim; AC4 (one shared domain authority) is completed here — macro_blast_radius (models) and the new macro_test_consumers (tests) both route through one macro_resource_consumers walk, differing only in the resource-type predicate. AC5 (EXPERIMENTAL-gated) holds — the explore page is already experimental (#290). Domain stays POD (the new fn is a pure reverse-walk); the folder grouping is presentation in the explore adapter. render_explore takes a new MacroFocus bundle (focus set + test consumers) so the renderer never performs a domain walk (the explore-lane pure-renderer posture). The explore-macro golden is regenerated byte-identical and now shows the directory (3 callers across 2 folders, empty tests partition). Tests: 8 new domain tests (macro_test_consumers — direct/transitive/ unit_test/vendor-exclude/null-package/unknown), 5 adapter tests (folder grouping, partition separation, no-path sentinel, empty sets, end-to-end render), 1 BDD scenario + 3 steps, 1 headless test (live-DOM directory render + real collapse). Co-Authored-By: Claude Opus 4.8 (1M context) --- examples/explore-macro/macro.html | 51 ++++ features/explore_macro_view.feature | 21 ++ src/adapters/explore.rs | 382 ++++++++++++++++++++++++++-- src/cli/mod.rs | 47 ++-- src/domain/macro_lens.rs | 252 +++++++++++++++++- src/domain/mod.rs | 2 +- templates/explore-macro.html | 59 +++++ tests/headless_toggle.rs | 61 +++++ tests/headless_zero_egress.rs | 12 +- tests/steps/explore_macro_view.rs | 53 +++- 10 files changed, 886 insertions(+), 54 deletions(-) diff --git a/examples/explore-macro/macro.html b/examples/explore-macro/macro.html index 5eff1691..ab426923 100644 --- a/examples/explore-macro/macro.html +++ b/examples/explore-macro/macro.html @@ -740,6 +740,25 @@ .model-detail-card .detail-type { display: inline-block; margin-right: 0.35rem; padding: 0 0.4rem; border: 1.5px solid var(--dag-import-stroke); border-radius: 4px; color: var(--dag-node-text); font-size: 0.8rem; } .model-detail-card .detail-changed { display: inline-block; margin-left: 0.35rem; padding: 0 0.4rem; border: 1.5px solid var(--dag-import-stroke); border-radius: 4px; background: var(--dag-import-fill); color: var(--dag-node-text); box-shadow: 0 0 0 2px rgba(230, 159, 0, 0.55); font-size: 0.8rem; } .model-detail-card .detail-section-title { margin: 0.5rem 0 0.15rem; font-size: 0.85rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; } +/* cute-dbt#345 (AC1 + AC3) — the filtered artifact directory: the + folder-grouped models + tests that call the macro, surfaced as TWO + separate partitions (the get_where_subquery non-merge rule). Native +
/ collapse (zero JS, zero egress); themed via the + shared semantic tokens. */ +.macro-directory { margin-top: 1.25rem; } +.macro-directory > h2 { margin-bottom: 0.25rem; } +.macro-directory-hint { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 0.75rem; } +.macro-partition { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); padding: 0.5rem 0.85rem 0.75rem; margin-bottom: 0.75rem; } +.macro-partition > h3 { font-size: 1rem; margin: 0.25rem 0 0.1rem; } +.macro-partition-count { color: var(--text-muted); font-weight: 400; font-size: 0.85rem; } +.macro-partition-empty { color: var(--text-faint); font-style: italic; font-size: 0.9rem; margin: 0.3rem 0 0; } +.macro-folder { margin: 0.35rem 0 0; } +.macro-folder > summary { cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; color: var(--text-muted); padding: 0.1rem 0; } +.macro-folder > summary:hover, .macro-folder > summary:focus { color: var(--text); } +.macro-folder-files { list-style: none; margin: 0.2rem 0 0.3rem; padding-left: 1.2rem; } +.macro-folder-files li { margin: 0.1rem 0; font-size: 0.9rem; overflow-wrap: anywhere; } +.macro-entry-name { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; } +.macro-entry-file { color: var(--text-muted); font-size: 0.85rem; } @@ -782,6 +801,38 @@

Macro focus

+
+

What calls this macro

+

Only the models and tests whose depends_on.macros reaches the macro — grouped by project folder, the two kinds kept separate.

+ +
+

Models (3)

+
+ models/intermediate/healthcare +
    +
  • int_encounters__enriched int_encounters__enriched.sql
  • + +
+
+
+ models/marts/core +
    +
  • fct_clinical_events fct_clinical_events.sql
  • +
  • fct_encounters fct_encounters.sql
  • + +
+
+ +
+ +
+

Tests (0)

+

No root-project tests call this macro.

+ +
+
+ +