style: graph controls top-right, lift minimap, hide Save when unchanged

Controls -> top-right horizontal, no lock toggle; MiniMap !mb-10 so
it clears the activity bar; hide the per-script Save button when the
script is already at its latest save point (drafts still show Create).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-05-16 12:16:35 +00:00
co-authored by Claude Opus 4.7
parent 1db26581ec
commit 27cde6ecb1
2 changed files with 20 additions and 3 deletions
@@ -598,11 +598,11 @@
--background-color={false}
>
<div class="absolute inset-0 !bg-surface-secondary h-full"></div>
<Controls />
<Controls position="top-right" orientation="horizontal" showLock={false} />
<MiniMap
pannable
zoomable
class="!bg-surface"
class="!bg-surface !mb-10"
nodeColor={(n) =>
n.type === 'asset'
? 'rgb(96 165 250 / 0.5)'
@@ -448,6 +448,23 @@
isDraft || (selection?.kind === 'runnable' && selection.runnable_kind === 'script')
)
// A persisted script with no edits vs its loaded version is already at
// its latest save point — hide Save for it. Drafts are never "saved"
// (always show Create). Unknown/loading → treat as dirty so Save isn't
// hidden when there might be changes.
let atLatestSavePoint = $derived.by(() => {
if (isDraft || !script) return false
const orig = scriptRes.current
if (!orig) return false
return (
script.content === orig.content &&
(script.tag ?? '') === (orig.tag ?? '') &&
(script.summary ?? '') === (orig.summary ?? '') &&
(script.description ?? '') === (orig.description ?? '') &&
JSON.stringify(script.schema ?? null) === JSON.stringify(orig.schema ?? null)
)
})
// Suffix editor for the draft-path popover. Seeded from the current
// path each time the popover opens so the user starts with what they
// see, not stale state from an earlier rename.
@@ -663,7 +680,7 @@
title="Open in full editor"
/>
{/if}
{#if isScriptView && script}
{#if isScriptView && script && !atLatestSavePoint}
<Button
variant="accent"
unifiedSize="sm"