From 2e6b31821ad2209bc1e30e284f974cc6db8a630c Mon Sep 17 00:00:00 2001
From: Kevin Longe <273747162+kvlonge@users.noreply.github.com>
Date: Fri, 13 Nov 2026 06:49:42 +0000
Subject: [PATCH 1/4] feat(ui): drop the plan page's side panel
The plan takes the full width. Permission problems already show next to
the Run button, so the Permissions panel only repeated them, and the
command's options now show beside the plan's summary.
---
ui/src/routes/plan/+page.svelte | 62 ++-------------------------------
1 file changed, 2 insertions(+), 60 deletions(-)
diff --git a/ui/src/routes/plan/+page.svelte b/ui/src/routes/plan/+page.svelte
index 92bf838f3b..3e3e681d63 100644
--- a/ui/src/routes/plan/+page.svelte
+++ b/ui/src/routes/plan/+page.svelte
@@ -14,7 +14,6 @@
import { kindLine } from '$lib/build-area/labels';
import { formatAgo } from '$lib/format/time';
import ScopeGraph from '$lib/lineage/scope-graph.svelte';
- import { PERMISSIONS } from '$lib/platform/permission-catalog';
import { VERBS } from '$lib/run/command-table';
import { applySuggestion, commandTokens, jobBuildTokens, jobRunProblem, parseCommand, settledJobCommand, suggest, windowOf, withFullRefresh, withVerb, withWindow, type Suggestion } from '$lib/run/command';
import DataRange from '$lib/run/data-range.svelte';
@@ -310,6 +309,7 @@
{:else}
{picked.length} node{picked.length === 1 ? '' : 's'}{#if shown.writeSet.length}· updates {shown.writeSet.length}{/if}
{/if}
+ {#each Object.entries(shown.settings) as [name, value] (name)}{value === true ? name : `${name}=${value}`}{/each}
@@ -357,25 +357,6 @@
{/if}
-
-
@@ -523,8 +504,7 @@
padding: 14px 24px;
transition: opacity 0.15s;
}
- .main.stale,
- .rail.stale {
+ .main.stale {
opacity: 0.55;
}
.problem-bar {
@@ -630,38 +610,6 @@
.right {
text-align: right;
}
- .rail {
- width: 280px;
- flex-shrink: 0;
- overflow: auto;
- padding: 14px 18px;
- border-left: 1px solid var(--border);
- }
- .rail h3 {
- margin: 16px 0 6px;
- color: var(--sb-text-faint);
- font-size: 12px;
- font-weight: 500;
- }
- .rail h3:first-child {
- margin-top: 0;
- }
- .decision {
- display: flex;
- align-items: baseline;
- gap: 8px;
- margin: 3px 0;
- font-size: 12.5px;
- }
- .reason {
- margin: 0 0 6px 18px;
- font-size: 11.5px;
- }
- .chips {
- display: flex;
- flex-wrap: wrap;
- gap: 5px;
- }
.foot {
display: flex;
align-items: center;
@@ -684,12 +632,6 @@
color: var(--sb-text-faint);
font-size: 12px;
}
- .ok-text {
- color: var(--sb-success);
- }
- .bad-text {
- color: var(--sb-error);
- }
.problem {
color: var(--sb-error);
}
From 466a2ff241a2fc8735b2379ffa0278aca51e40d5 Mon Sep 17 00:00:00 2001
From: Kevin Longe <273747162+kvlonge@users.noreply.github.com>
Date: Fri, 13 Nov 2026 07:48:11 +0000
Subject: [PATCH 2/4] feat(ui): state the plan in one sentence and list its
checks in a tab
---
ui/src/lib/run/plan-text.test.ts | 27 ++++++++++++++++--
ui/src/lib/run/plan-text.ts | 43 ++++++++++++++++++++++++----
ui/src/routes/plan/+page.svelte | 48 ++++++++++++++++++++++++++++----
3 files changed, 104 insertions(+), 14 deletions(-)
diff --git a/ui/src/lib/run/plan-text.test.ts b/ui/src/lib/run/plan-text.test.ts
index dd73c21e65..5198692770 100644
--- a/ui/src/lib/run/plan-text.test.ts
+++ b/ui/src/lib/run/plan-text.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
import type { PlanDocument, PlanModel } from '$lib/api';
-import { actionText, planSections, readySummary } from './plan-text';
+import { actionText, planSections, planSentence } from './plan-text';
const model = (name: string, over: Partial = {}): PlanModel => ({
name,
@@ -73,6 +73,29 @@ describe('plan text, as sqb plan prints it', () => {
it('collapses a plan that is all full refresh into counts by materialization', () => {
const full = plan([model('a', { reason: 'full_refresh' }), model('b', { reason: 'full_refresh' }), model('v', { reason: 'full_refresh', materialization_type: 'view' })]);
expect(planSections(full)).toEqual([{ title: 'Full refresh', changed: true, entries: [{ name: 'table', value: '2 models', detail: [] }, { name: 'view', value: '1 model', detail: [] }] }]);
- expect(readySummary(full)).toBe('full refresh, 3 selected');
+ expect(planSentence(full)).toBe('3 models build from scratch, replacing what was built.');
+ });
+});
+
+describe('plan sentence', () => {
+ const incremental = { reason: 'normal_incremental', materialization_type: 'incremental' } as const;
+
+ it('names a changed model, counts the ones taking new rows, and calls the rest usual', () => {
+ const p = plan([model('orders', { reason: 'query_changed' }), model('events', incremental), model('visits', incremental), model('a'), model('b'), model('c', { action: 'skip' })]);
+ expect(planSentence(p)).toBe('5 models build: orders changed since its last build, 2 incremental models take new rows and the other 2 are recreated as usual. 1 disabled model is skipped.');
+ });
+
+ it('counts many changes, says first builds apart, and says when nothing changed', () => {
+ const changed = ['a', 'b', 'c'].map((n) => model(n, { reason: 'config_changed' }));
+ expect(planSentence(plan([...changed, model('new', { reason: 'first_run' })]))).toBe('4 models build: 3 models changed since their last build and new builds for the first time.');
+ expect(planSentence(plan([model('a'), model('b')], { source_loads: [{ name: 'raw', kind: 'source', is_reload: false }] }))).toBe('2 models build: none changed since their last build. 1 source loads first.');
+ expect(planSentence(plan([model('a', { action: 'skip', reason: 'disabled' })]))).toBe('Nothing to build. 1 disabled model is skipped.');
+ });
+
+ it('says what runs when no model builds', () => {
+ const seeds = [{ name: 'carriers', reason: 'first_run' }, { name: 'regions', reason: 'no_change' }];
+ expect(planSentence(plan([], { seeds }))).toBe('No models build. 1 seed loads.');
+ const functions = [{ name: 'margin', language: 'sql', reason: 'definition_changed' }, { name: 'tax', language: 'sql', reason: 'no_change' }];
+ expect(planSentence(plan([], { functions }))).toBe('No models build. 1 changed function is recreated.');
});
});
diff --git a/ui/src/lib/run/plan-text.ts b/ui/src/lib/run/plan-text.ts
index 5ebd9bd18c..f999908708 100644
--- a/ui/src/lib/run/plan-text.ts
+++ b/ui/src/lib/run/plan-text.ts
@@ -132,12 +132,43 @@ export function planSections(plan: PlanDocument): PlanSection[] {
return sections;
}
-/** `N selected`, as the CLI's `Plan ready` line counts it. */
-export function readySummary(plan: PlanDocument): string {
- const parts = [isFullRefresh(plan) ? 'full refresh' : '', `${plan.selected_count} selected`];
- const loads = plan.source_loads.length;
- if (loads) parts.push(`${loads} source${loads === 1 ? '' : 's'} to load`);
- return parts.filter(Boolean).join(', ');
+const count = (n: number, one: string, many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
+
+/** Names a few models, or counts them when there are more than two. */
+const few = (models: PlanModel[], noun: string) => (models.length <= 2 ? models.map((m) => m.name).join(' and ') : count(models.length, noun));
+
+/**
+ * What the run does: how many models build, which changed since their last build, which build for the
+ * first time, which take new rows and that the rest are recreated as usual, then what else happens.
+ */
+export function planSentence(plan: PlanDocument): string {
+ const active = plan.models.filter((m) => m.action !== 'skip');
+ // The planner skips only disabled models; seeds it reports as current don't load.
+ const skipped = plan.models.length - active.length;
+ const seeds = plan.seeds.filter((s) => s.reason !== 'no_change').length;
+ const functions = plan.functions.filter((f) => f.reason && f.reason !== 'no_change').length;
+ const runs = [
+ plan.source_loads.length && count(plan.source_loads.length, 'source loads first', 'sources load first'),
+ seeds && count(seeds, 'seed loads', 'seeds load'),
+ functions && count(functions, 'changed function is recreated', 'changed functions are recreated'),
+ plan.python_nodes.length && count(plan.python_nodes.length, 'Python node runs', 'Python nodes run')
+ ].filter((p): p is string => !!p);
+ const after = [...runs, ...(skipped ? [count(skipped, 'disabled model is skipped', 'disabled models are skipped')] : [])].map((p) => ` ${p}.`).join('');
+ if (!active.length) return `${runs.length ? 'No models build.' : 'Nothing to build.'}${after}`;
+ const builds = count(active.length, 'model builds', 'models build');
+ if (isFullRefresh(plan)) return `${builds} from scratch, replacing what was built.${after}`;
+ const changed = active.filter((m) => !ROUTINE.has(m.reason) && m.reason !== 'first_run');
+ const fresh = active.filter((m) => m.reason === 'first_run');
+ const rows = active.filter((m) => m.reason === 'normal_incremental');
+ const usual = active.filter((m) => m.reason === 'no_change');
+ const parts = [
+ changed.length && `${few(changed, 'model')} changed since ${changed.length === 1 ? 'its' : 'their'} last build`,
+ fresh.length && `${few(fresh, 'model')} ${fresh.length === 1 ? 'builds' : 'build'} for the first time`,
+ rows.length && `${count(rows.length, 'incremental model takes', 'incremental models take')} new rows`
+ ].filter((p): p is string => !!p);
+ if (usual.length) parts.push(parts.length ? `the other ${usual.length} ${usual.length === 1 ? 'is' : 'are'} recreated as usual` : `none changed since ${usual.length === 1 ? 'its' : 'their'} last build`);
+ const detail = parts.length > 1 ? `${parts.slice(0, -1).join(', ')} and ${parts.at(-1)}` : parts[0];
+ return `${builds}: ${detail}.${after}`;
}
/** The models a plan changes, as catalog keys, for drawing just the part of a large selection that matters. */
diff --git a/ui/src/routes/plan/+page.svelte b/ui/src/routes/plan/+page.svelte
index 3e3e681d63..7702efb5bc 100644
--- a/ui/src/routes/plan/+page.svelte
+++ b/ui/src/routes/plan/+page.svelte
@@ -18,12 +18,15 @@
import { applySuggestion, commandTokens, jobBuildTokens, jobRunProblem, parseCommand, settledJobCommand, suggest, windowOf, withFullRefresh, withVerb, withWindow, type Suggestion } from '$lib/run/command';
import DataRange from '$lib/run/data-range.svelte';
import PlanReport from '$lib/run/plan-report.svelte';
- import { changedModelKeys, readySummary } from '$lib/run/plan-text';
+ import StatusLabel from '$lib/components/list/status-label.svelte';
+ import { checkOutcomeLabel, checkOutcomeTone } from '$lib/status';
+ import { changedModelKeys, planSentence } from '$lib/run/plan-text';
import { app } from '$lib/state/app.svelte';
import { createResource } from '$lib/state/resource.svelte';
const snapshotNodes = createResource((client, scope) => client.listSnapshotNodes(scope), ['snapshot']);
const catalog = createResource((client, scope) => client.listCatalogNodes(scope), ['snapshot', 'runs', 'node_status']);
+ const checkList = createResource((client, scope) => client.listChecks(scope), ['checks']);
let cmd = $state(page.url.searchParams.get('cmd') ?? 'sqb build');
let cmdEl = $state();
@@ -138,7 +141,15 @@
// ---- what a non-build verb picks, from the catalog ----
const byKey = $derived(new Map((catalog.data ?? []).map((n) => [n.key, n])));
const picked = $derived(shown?.selection ?? []);
- let view = $state<'plan' | 'graph'>('plan');
+ let view = $state<'plan' | 'graph' | 'checks'>('plan');
+ /** The recorded checks on the models and seeds the plan builds, which run after them. */
+ const planChecks = $derived.by(() => {
+ if (!plan) return [];
+ const built = new Set([...plan.models.filter((m) => m.action !== 'skip').map((m) => m.name), ...plan.seeds.map((s) => s.name)]);
+ return (checkList.data ?? []).filter((c) => (c.attachment === 'model' || c.attachment === 'seed') && !!c.node && built.has(c.node.slice(c.node.indexOf(':') + 1)));
+ });
+ /** The tab shown: a replan with no checks leaves the Checks tab for the plan. */
+ const tab = $derived(view === 'checks' && !(shown?.verb === 'build' && planChecks.length) ? 'plan' : view);
/** A large selection draws only what the plan changes; the whole of it would be unreadable. */
const GRAPH_LIMIT = 150;
const graphKeys = $derived(picked.length > GRAPH_LIMIT && plan ? changedModelKeys(plan) : picked);
@@ -305,27 +316,42 @@
{#if shown?.verb}
{picked.length} nodes are too many to draw, so the graph shows only the {graphKeys.length === 1 ? 'model' : `${graphKeys.length} models`} this plan changes.