From 5bc516c4fe76bc9aaf127c36bc4db9c9bdf27525 Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Wed, 30 Sep 2026 19:13:10 +0200 Subject: [PATCH] revert: clicking an unbuilt asset opens the asset again, not its script Co-Authored-By: Claude Opus 5.5 (1M context) --- .../assets/AssetGraph/AssetGraphCanvas.svelte | 12 +----- .../AssetGraph/PipelineGraphEditor.svelte | 5 +-- .../(logged)/pipeline/[folder]/+page.svelte | 39 +------------------ 3 files changed, 4 insertions(+), 52 deletions(-) diff --git a/frontend/src/lib/components/assets/AssetGraph/AssetGraphCanvas.svelte b/frontend/src/lib/components/assets/AssetGraph/AssetGraphCanvas.svelte index 28dee53dd2..1e68c473f4 100644 --- a/frontend/src/lib/components/assets/AssetGraph/AssetGraphCanvas.svelte +++ b/frontend/src/lib/components/assets/AssetGraph/AssetGraphCanvas.svelte @@ -70,11 +70,7 @@ interface Props { graph: AssetGraphResponse selection?: AssetGraphSelection | undefined - /** `soleScript`: assets-only, the one script folded into a clicked asset. */ - onselect?: ( - selection: AssetGraphSelection | undefined, - opts?: { soleScript?: string } - ) => void + onselect?: (selection: AssetGraphSelection | undefined) => void // Called when the user clicks the per-asset + button (consumer-script // entry). Kept optional so the canvas stays usable outside the // pipeline editor. @@ -2009,11 +2005,7 @@ if (!onselect) return const data = node.data as any if (node.type === 'asset') { - const scripts = ((data.foldedIds ?? []) as string[]).filter((id) => id.startsWith('script:')) - onselect( - { kind: 'asset', asset_kind: data.asset_kind, path: data.path }, - scripts.length === 1 ? { soleScript: scripts[0].slice('script:'.length) } : undefined - ) + onselect({ kind: 'asset', asset_kind: data.asset_kind, path: data.path }) } else if (node.type === 'runnable') { onselect({ kind: 'runnable', runnable_kind: data.runnable_kind, path: data.path }) } else if (node.type === 'data-test') { diff --git a/frontend/src/lib/components/assets/AssetGraph/PipelineGraphEditor.svelte b/frontend/src/lib/components/assets/AssetGraph/PipelineGraphEditor.svelte index 6ec8fc4910..83b098a6f7 100644 --- a/frontend/src/lib/components/assets/AssetGraph/PipelineGraphEditor.svelte +++ b/frontend/src/lib/components/assets/AssetGraph/PipelineGraphEditor.svelte @@ -159,10 +159,7 @@ onDeleteTrigger?: (...args: any[]) => void onOpenWebhook?: (...args: any[]) => void onOpenDataUpload?: (...args: any[]) => void - onSelect: ( - selection: AssetGraphSelection | undefined, - opts?: { soleScript?: string } - ) => void + onSelect: (selection: AssetGraphSelection | undefined) => void onAddScriptForAsset?: ( asset: { kind: AssetKind; path: string }, language: ScriptLang, diff --git a/frontend/src/routes/(root)/(logged)/pipeline/[folder]/+page.svelte b/frontend/src/routes/(root)/(logged)/pipeline/[folder]/+page.svelte index 3c8c4e3542..de668da1f4 100644 --- a/frontend/src/routes/(root)/(logged)/pipeline/[folder]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/pipeline/[folder]/+page.svelte @@ -1205,44 +1205,7 @@ return false } } - // Assets a job has written, by `kind:path`. Only grows: once built, an asset - // stays built for this page's purposes. - const materialized = new Set() - async function isMaterialized(asset: { kind: AssetKind; path: string }): Promise { - const key = `${asset.kind}:${asset.path}` - if (materialized.has(key) || !$workspaceStore) return true - try { - const res = await AssetService.listAssets({ - workspace: $workspaceStore, - path: asset.path, - assetKinds: asset.kind - }) - const built = res.assets.some((a) => - a.usages.some((u) => u.kind === 'job' && (u.access_type === 'w' || u.access_type === 'rw')) - ) - if (built) materialized.add(key) - return built - } catch { - return true - } - } - // An asset nothing has built yet has no data to show: in the assets-only view, - // where its one script has no node of its own, the click opens that script. - async function handleCanvasSelect( - s: AssetGraphSelection | undefined, - opts?: { soleScript?: string } - ) { - if (s?.kind === 'asset' && opts?.soleScript) { - const asset = s - if (!(await isMaterialized({ kind: asset.asset_kind, path: asset.path }))) { - s = { kind: 'runnable', runnable_kind: 'script', path: opts.soleScript } - // Job history expires, so "no write on record" may be an asset built long - // ago: its own pane stays one click away. - sendUserToast(`No build of ${asset.path} on record: opened its script.`, false, [ - { label: 'Show the asset', callback: () => void handleCanvasSelect(asset) } - ]) - } - } + function handleCanvasSelect(s: AssetGraphSelection | undefined) { // Clicking a node while the pane is explicitly hidden is a request // to see that node — unhide. Background clicks (s == undefined) // keep the hidden state.