From 972398a7ad7ceaf334d69de01c7b1f41724f55c1 Mon Sep 17 00:00:00 2001 From: "Razvan M." Date: Sun, 22 Nov 2026 00:09:09 +0200 Subject: [PATCH 1/7] fix: show the cursor in the inline variable editor --- apps/web/src/lib/components/variables/reference-input.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/web/src/lib/components/variables/reference-input.svelte b/apps/web/src/lib/components/variables/reference-input.svelte index 78ce704e..b2e87b4b 100644 --- a/apps/web/src/lib/components/variables/reference-input.svelte +++ b/apps/web/src/lib/components/variables/reference-input.svelte @@ -84,6 +84,9 @@ }, ".cm-content": { padding: "0" }, ".cm-line": { padding: "0 11px" }, + ".cm-cursor": { + borderLeftColor: "var(--foreground)", + }, }), ], }), From 018fefff7dcbbed5282c11e919664fc0bf5ebf7c Mon Sep 17 00:00:00 2001 From: "Razvan M." Date: Sun, 22 Nov 2026 00:09:09 +0200 Subject: [PATCH 2/7] feat: create sandboxes from a dialog in the add palette --- .../canvas/controls/add-palette-entries.ts | 7 +- .../canvas/controls/add-palette.svelte | 26 +- .../canvas/controls/sandbox-dialog.svelte} | 382 +++++++----------- 3 files changed, 171 insertions(+), 244 deletions(-) rename apps/web/src/{routes/(app)/projects/[projectId]/create/sandbox/+page.svelte => lib/components/canvas/controls/sandbox-dialog.svelte} (60%) diff --git a/apps/web/src/lib/components/canvas/controls/add-palette-entries.ts b/apps/web/src/lib/components/canvas/controls/add-palette-entries.ts index 9028b725..ac85329a 100644 --- a/apps/web/src/lib/components/canvas/controls/add-palette-entries.ts +++ b/apps/web/src/lib/components/canvas/controls/add-palette-entries.ts @@ -70,7 +70,8 @@ export type Entry = { | { repository: GitRepository } | { template: Template } | { bucket: { connectionId: string } } - | { volumeService: VolumeTarget }; + | { volumeService: VolumeTarget } + | { dialog: "sandbox" }; }; export const pageTitles: Record = { @@ -112,7 +113,7 @@ function pageEntry(id: AddPage, label: string, icon: Component): Entry { } /** The first page. Volumes and configs need a service to attach to. */ -export function rootEntries(projectId: string, hasVolumeTargets: boolean): Entry[] { +export function rootEntries(hasVolumeTargets: boolean): Entry[] { return [ pageEntry("git", "Git Repository", GitBranch), pageEntry("database", "Database", Database), @@ -129,7 +130,7 @@ export function rootEntries(projectId: string, hasVolumeTargets: boolean): Entry logo: null, icon: Box, provider: undefined, - target: { href: `/projects/${projectId}/create/sandbox` }, + target: { dialog: "sandbox" }, }, { id: "empty", diff --git a/apps/web/src/lib/components/canvas/controls/add-palette.svelte b/apps/web/src/lib/components/canvas/controls/add-palette.svelte index 9dd4b02f..af04708d 100644 --- a/apps/web/src/lib/components/canvas/controls/add-palette.svelte +++ b/apps/web/src/lib/components/canvas/controls/add-palette.svelte @@ -31,6 +31,7 @@ keepPreviousData, } from "@tanstack/svelte-query"; import { + parseAsBoolean, parseAsString, parseAsStringLiteral, useQueryState, @@ -58,6 +59,7 @@ type GitRepository, } from "./add-palette-entries"; import AddPaletteItem from "./add-palette-item.svelte"; + import SandboxDialog from "./sandbox-dialog.svelte"; import { configNodeId, volumeNodeId, @@ -100,6 +102,12 @@ parseAsString.withOptions({ shallow: true, scroll: false }), ); + // The sandbox form, a dialog of its own: too many fields for the palette. + const sandbox = useQueryState( + "addSandbox", + parseAsBoolean.withOptions({ shallow: true, scroll: false }), + ); + // The service a new volume is being attached to, `:`: Railway then asks for // the mount path in the same palette. const volumeKey = useQueryState( @@ -267,7 +275,7 @@ current === "database", ); - return rootEntries(projectId, volumeTargets.length > 0); + return rootEntries(volumeTargets.length > 0); }); const s3Connections = $derived(s3ConnectionsQuery.data ?? []); @@ -616,7 +624,10 @@ if ("page" in target) open(target.page); else if ("href" in target) void goto(target.href); - else if ("create" in target) + else if ("dialog" in target) { + open(null); + void sandbox.set(true); + } else if ("create" in target) void createResource(target.create); else if ("repository" in target) pickRepository(target.repository, null); @@ -871,3 +882,14 @@ {/if} + +{#if sandbox.current} + { + void sandbox.set(null); + void showCreated(resourceId); + }} + onclose={() => void sandbox.set(null)} + /> +{/if} diff --git a/apps/web/src/routes/(app)/projects/[projectId]/create/sandbox/+page.svelte b/apps/web/src/lib/components/canvas/controls/sandbox-dialog.svelte similarity index 60% rename from apps/web/src/routes/(app)/projects/[projectId]/create/sandbox/+page.svelte rename to apps/web/src/lib/components/canvas/controls/sandbox-dialog.svelte index 00f5a092..ed78f14c 100644 --- a/apps/web/src/routes/(app)/projects/[projectId]/create/sandbox/+page.svelte +++ b/apps/web/src/lib/components/canvas/controls/sandbox-dialog.svelte @@ -1,14 +1,20 @@ + - - - New sandbox / {projectQuery.data?.name ?? "Project"} / Clowder - - - {#snippet select( id: string, value: string, @@ -302,101 +260,63 @@ {/snippet} -
-
-
- -
- Sandbox -
- - {#if projectQuery.data?.isInternal} - - - Clowder manages this project's internal services. New - resources can't be added here. - - - {:else if imagesQuery.isError} - - - Unable to load sandbox images: {imagesQuery.error - .message} - - - {:else if imagesQuery.isPending} - - - - -

Sandbox

-
-
-
- {#each ["Name", "Image", "Cluster", "Access"] as label (label)} - - - - - - - {/each} -
- -
- {:else if images.length === 0} - - - - - No sandbox images - - - + + + {:else} +
- Add an image - - - - {:else} - - - - -

Sandbox

-
-
-
{#if createState.isError} @@ -411,10 +331,7 @@ - (fields.name.current = - event.currentTarget.value)} + bind:value={name} class="font-mono" autocomplete="off" spellcheck="false" @@ -426,8 +343,7 @@ variant="ghost" size="icon-sm" onclick={() => - (fields.name.current = - randomName())} + (name = randomName())} aria-label="Pick another name" title="Pick another name" > @@ -446,7 +362,7 @@ "sandbox-image", imageId, imageItems, - (value) => (fields.image.current = value), + (value) => (pickedImage = value), false, )} @@ -469,11 +385,9 @@ {@render select( "sandbox-machine", - fields.machine.current, + machine, machineItems, - (value) => - (fields.machine.current = - value ?? ANY), + (value) => (machine = value ?? ANY), !clusterId, )} @@ -486,11 +400,9 @@ {@render select( "sandbox-volume", - fields.volume.current, + volume, volumeItems, - (value) => - (fields.volume.current = - value ?? ANY), + (value) => (volume = value ?? ANY), !clusterId, )} @@ -500,15 +412,9 @@ {@render select( "sandbox-ttl", - fields.ttl.current, + ttl, ttlItems, - (value) => - (fields.ttl.current = - TTL_OPTIONS.find( - (option) => - option.value === - value, - )?.value ?? "none"), + (value) => (ttl = value ?? "none"), false, )} @@ -522,14 +428,13 @@ variant="outline" size="sm" aria-label="Access" - value={[fields.access.current]} + value={[access]} onValueChange={(next) => { if ( next[0] === "key" || next[0] === "password" ) - fields.access.current = - next[0]; + access = next[0]; }} > @@ -540,11 +445,11 @@
- {#if fields.access.current === "key"} + {#if access === "key"}