{% extends "base.html" %} {% block title %}DBSprout — Studio{% endblock %} {% block head_extra %} {# ── S-117: vendored Alpine.js for light interactivity (NOT a Python dep). ── #} {# ``defer`` so Alpine attaches after the DOM is parsed; the static file is served from dbsprout/web/static/alpine.min.js. #} {# ── S-125: live progress console JS factory ── Loaded BEFORE Alpine so window.studioConsole exists when Alpine processes ``x-data="studioConsole()"``. The submit form (S-124 / S-127 wires this fully) dispatches a ``studio:job-start`` window CustomEvent carrying ``{jobId}`` once POST /api/generate returns, and the factory opens the S-109 /ws/jobs/{job_id} WebSocket from there. #} {# ── S-132: per-column method-swap → instant re-preview pipeline ── Listens for ``studio:row-rerendered`` window events (dispatched by the S-120 method picker on successful row swap), debounces per column (~150 ms), POSTs ``/api/regenerate``, then GETs ``/api/preview/{table}`` and dispatches ``studio:preview-updated`` / ``studio:preview-error`` so any preview-grid UI can subscribe. ``defer`` so the file is parsed before DOMContentLoaded; the bootstrap below attaches the listener once the global is ready. #} {% endblock %} {% block content %} {# ── S-117 Studio shell ───────────────────────────────────────────────────── Four-panel layout: tree (left) · grid (centre) · context (right) · console (bottom). Each panel carries: * a stable element id (#studio-tree, #studio-grid, #studio-context, #studio-console) so later Phase-C stories can target it directly via HTMX hx-target / Alpine x-ref. * a ``data-panel`` attribute mirroring the slot name (for CSS / JS hooks). * a named Jinja block (tree/grid/context/console) so later stories can override the *default* content without forking this shell template. * an ARIA landmark role + aria-label for keyboard-navigable navigation. Desktop-first responsive grid: at md+ the three top panels sit side-by-side (tree 1fr · grid 3fr · context 1fr) with the console docked underneath; below md they stack vertically for narrower viewports. ── #}
{% block grid %}{% include "_studio_grid.html" %}{% endblock %}
{# ── S-120 method picker ─────────────────────────────────────────────── Alpine component mounted once at page level. Listens for ``studio:open-method-picker`` window events dispatched by the column method pill (see ``spec_row.html``) and PUTs the selection via the S-119 column-edit endpoint, swapping the returned ``spec_row.html`` fragment in place via outerHTML. ── #} {% include "studio/method_picker.html" %} {# ── S-137 write-guard modal ──────────────────────────────────────────── Confirmation step before any live INSERT — shows the redacted target DSN + the per-table scope, requires explicit Confirm. Listens for ``studio:open-write-guard`` window events dispatched by the Insert button after a successful ``POST /api/insert/preview`` response. ── #} {% include "studio/write_guard_modal.html" %} {% endblock %}