From 0b33bb67c618cac31e4aba87bac640ae2f4793ee Mon Sep 17 00:00:00 2001 From: Guilhem Lemouel Date: Tue, 18 Aug 2026 10:31:21 +0200 Subject: [PATCH] fix(frontend): confine the modal restyle to the wizard, and trim the comments The wider side padding and lighter dialog heading were changing all 17 Modal2 dialogs to suit this one flow. They move behind an opt-in `formStyling`, taken by the three dialogs this branch owns; every other Modal2 renders as it did. Also drops two comments that cited a design approval rather than a constraint, and shortens the blocks that had grown past the four lines AGENTS.md asks for. Co-Authored-By: Claude Opus 5 (1M context) --- .../lib/components/common/modal/Modal2.svelte | 9 +++- .../AddDataTableWizard.svelte | 28 ++++------ .../CustomInstanceDbWizardModal.svelte | 1 + .../SupabaseConnectionMode.svelte | 3 +- .../SupabaseProjectStep.svelte | 6 +-- .../SupabaseResourceConnect.svelte | 1 + .../workspaceSettings/addDataTableModel.ts | 52 ++++++------------- .../workspaceSettings/datatableProbe.ts | 6 +-- .../workspaceSettings/supabaseProvisioning.ts | 10 ++-- .../src/lib/utils/postgresConnectionString.ts | 12 ++--- 10 files changed, 51 insertions(+), 77 deletions(-) diff --git a/frontend/src/lib/components/common/modal/Modal2.svelte b/frontend/src/lib/components/common/modal/Modal2.svelte index 367512b118..f33b1dec04 100644 --- a/frontend/src/lib/components/common/modal/Modal2.svelte +++ b/frontend/src/lib/components/common/modal/Modal2.svelte @@ -26,6 +26,9 @@ * and clicks "outside" the child would otherwise propagate * here and close the underlying modal. */ closeOnOutsideClick?: boolean + /** Wider side padding and a lighter title, for a dialog whose body is a form rather + * than a list. Opt-in: every other Modal2 keeps the padding and heading it had. */ + formStyling?: boolean headerLeft?: import('svelte').Snippet headerRight?: import('svelte').Snippet children?: import('svelte').Snippet @@ -43,6 +46,7 @@ fixedHeight = 'md', contentClasses = '', closeOnOutsideClick = true, + formStyling = false, headerLeft, headerRight, children @@ -111,7 +115,8 @@ heightMap[fixedHeight] ? `height: ${heightMap[fixedHeight]}; ` : '' }${css?.popup?.style || ''}`} class={twMerge( - 'max-h-screen-80 max-w-screen-80 rounded-lg relative bg-surface py-4 px-6', + 'max-h-screen-80 max-w-screen-80 rounded-lg relative bg-surface', + formStyling ? 'py-4 px-6' : 'p-4', css?.popup?.class, 'wm-modal-form-popup' )} @@ -122,7 +127,7 @@
-

{title}

+

{title}

diff --git a/frontend/src/lib/components/workspaceSettings/AddDataTableWizard.svelte b/frontend/src/lib/components/workspaceSettings/AddDataTableWizard.svelte index 410ef41f21..3783141849 100644 --- a/frontend/src/lib/components/workspaceSettings/AddDataTableWizard.svelte +++ b/frontend/src/lib/components/workspaceSettings/AddDataTableWizard.svelte @@ -468,13 +468,11 @@ } /** - * Proves the typed connection works before the wizard writes anything. The Supabase branch - * has to read the pooler first: which host a project answers on is assigned by Supabase, - * so the value under test has to be the value that will be saved. + * Proves the connection before anything is written. Supabase reads the pooler first: the + * value under test has to be the value that will be saved. */ - // The fields stay editable while a check is out, and editing clears the verdict. Without a - // token the older answer lands afterwards and marks the edited connection as tested, so - // Continue unlocks for something nobody proved. + // Fields stay editable while a check is out. Without a token the older answer lands after + // an edit and unlocks Continue for a connection nobody proved. let probeToken = 0 async function probe() { const token = ++probeToken @@ -539,12 +537,9 @@ /** The instance database this session asked for, which is registered even when it failed. */ let claimedInstanceDb = $state(undefined) /** - * The name this run has already claimed. `writeRow` merges into whatever the server holds - * under the name, so a name that is free in the table on screen but taken on the server -- - * an unsaved rename here, or another admin since the page loaded -- would repoint someone - * else's data table at this database. Checked against the server before the run starts, then - * remembered only if the run got as far as writing the row, so Try again can overwrite what - * it wrote itself. + * What this run created and may write over again. `writeRow` merges into whatever the + * server holds under the name, so a name free in the table on screen but taken on the + * server would repoint someone else's data table at this database. */ let claims = $state(noClaims) /** The path whose secret and resource this run holds, for the gates that ask by path. */ @@ -694,11 +689,9 @@ } /** - * Whether closing would throw away work. Until Finish the loss is only what was typed -- - * but that includes a pasted database password and a project about to be created, and a - * backdrop click is easy to do by accident. A failed run counts too: its inputs are still - * editable and it may have left something behind, which is the case most worth confirming. - * A run cannot be closed while it is going, and one that succeeded has nothing left to lose. + * Whether closing would throw away work. A failed run counts: its inputs are still editable + * and it may have left something behind. A run in flight cannot be closed at all, and one + * that succeeded has nothing left to lose. */ function hasUnfinishedIntent(): boolean { return wiz.provider !== undefined && !run.running && !run.result?.ok @@ -828,6 +821,7 @@ } } target="#content" + formStyling title="Add a data table" contentClasses="flex flex-col" fixedWidth="md" diff --git a/frontend/src/lib/components/workspaceSettings/CustomInstanceDbWizardModal.svelte b/frontend/src/lib/components/workspaceSettings/CustomInstanceDbWizardModal.svelte index 0327f29f42..8246118c49 100644 --- a/frontend/src/lib/components/workspaceSettings/CustomInstanceDbWizardModal.svelte +++ b/frontend/src/lib/components/workspaceSettings/CustomInstanceDbWizardModal.svelte @@ -46,6 +46,7 @@ !!opened, (v) => !v && !preventClose && (opened = undefined)} target="#content" + formStyling title={'Custom Instance Database Setup'} contentClasses="flex flex-col" fixedWidth="md" diff --git a/frontend/src/lib/components/workspaceSettings/SupabaseConnectionMode.svelte b/frontend/src/lib/components/workspaceSettings/SupabaseConnectionMode.svelte index 5ec944526e..6f2523a729 100644 --- a/frontend/src/lib/components/workspaceSettings/SupabaseConnectionMode.svelte +++ b/frontend/src/lib/components/workspaceSettings/SupabaseConnectionMode.svelte @@ -42,8 +42,7 @@ {#if open}
- + {#each OPTIONS as option (option.value)} {@const selected = mode === option.value}