{% extends "components/_cc_shell.html" %} {% block title %}fs-report · Builder{% endblock %} {% block head %} {% endblock %} {% block content %} {# ── Builder authoring shell (PR1.5) ──────────────────────────────── ONE Alpine component (x-data="builder()") owns the doc model. model.kind ∈ {workflow, compound, comparison} gates which canvas/rail panels render. Shared shell: top-bar name field, Save/Run buttons, saved-docs picker. Layout: a left rail (shared header + kind-gated options + library) and a canvas (kind-gated pipeline or stub). The inspector exists for workflows. #}

{# Step count — workflow-only (compound/comparison have sections, not steps). #} {# Folder targeting (design §6): the readout shows the project, else the folder NAME (resolved by globalScopeLabel from the #g-folder select), else "Portfolio". A folder target uses a folder icon and hides the "@ version" suffix (folders have no single version). Workflow-only. #} {# C2: the pill title is conditional — a target-bound workflow with a concrete target reads "Pinned scope"; a GENERAL/portfolio workflow has no pinned scope (target picked at run time) so it must not claim one (globalScopePillTitle()). #} {# Run banner — live status pill while a workflow run streams (§6.3). Workflow-only. #}
{# Edit returns from run-view to authoring (§6.3). Workflow-only. #} {# Hand off to the standalone Run canvas once a run is live (§9). SAME-TAB navigation (openRunCanvas → location.href) — NOT target=_blank: the SSE stream is single-consumer per run, so a second tab would split it. Workflow-only. #} {# Export modal — workflow-only (compound/comparison don't have this yet). #} {# Run flips to Stop while a run is in flight (§6.3). Task D (T5): kind-aware label/title — "Run workflow" | "Run compound" | "Run comparison" (compound/comparison open the inline run drawer). #}
{# ── Workflow pipeline (gated to workflow kind) ── #}
Portfolio snapshot
{# Sortable receiver: ONLY the step cards live here. The model is the single source of truth; indices/edges re-render from it. In run-view each card carries a run-* state class driven by the `step` SSE event. #}
Drag a report or tool here to add a step
{# ── Compound report editor (gated to compound kind) ── PR2.2a #}
{# Section count badge #}
{# Ordered, drag-to-reorder section list. Task C: sections are objects ({recipe, overrides}); each row is click-to-select (parallel to step selection) so the per-section override inspector opens for it. #}
{# Empty state when no sections #}
No sections yet
Click a recipe in the Add section panel on the left to add one.
{# ── Comparison report editor (PR3.1) — Left/Right scope + "vs" divider ── #} {# Two scope cascades — left/right scope pickers (folder → project → version). Center canvas: Left panel | vs | Right panel; scopes baked at Save. Rail: Diff facets + Title + Output (in the left rail above). #}
{# Scope baking banner #}
Scope is baked at Save — project/folder/version names are resolved and stored in the recipe. Finding types are set at Run.
{# ── Left / Right scope panels ── #}
{# Left scope #}
Left
{# vs divider #}
vs
{# Right scope #}
Right
{# /.wfb-cmp-scopes #}
{# /#comparison-editor #} {# ── Task D: inline RUN drawer (compound + comparison) ── Rebuilds the prerun modal INLINE as a right-side drawer that slides in OVER the editor. The fragment is fetched + wired by window.__openInlineRun (command-center.js) into #cpd-run-panel; the runTriggers (_recipeKindCfg) flip cpdRunOpen and call it. Gated to the two recipe-doc kinds so a workflow never shows it (workflows keep the in-canvas run-view). Backdrop scrim closes on click; the panel slides from the right. Re-inject is fresh each open (innerHTML) so handlers don't stack. #}
{# All element lookups inside are subtree-scoped (#inspector / data-inspector root) so each scope cascade binds only to the selected card/section (#117 lesson). The workflow body re-renders from the selected STEP; fields default to "inherit from global" and write into step.overrides (recipe)/step.params (mcp). Task C adds the COMPOUND section body below it (gated separately) — the leaner {recipe, overrides} section shape gets ONLY the whitelisted fields and its own helpers (sec*), so it never derefs step-only fields. Comparison still has no inspector (its own rail). #}