From 9c670f9b6b8ccd9d6f54665b9154ea5ea0012c87 Mon Sep 17 00:00:00 2001 From: iamdoubz <> Date: Mon, 6 Jul 2026 11:10:46 -0500 Subject: [PATCH] feat(settings): Nextcloud server-URL hint + edit-mode test uses stored password Provider-aware Server URL placeholder/hint (Nextcloud/ownCloud: enter just the server URL); Test in edit mode passes the target id so the backend reuses the stored credential. --- src/lib/views/Settings.svelte | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/lib/views/Settings.svelte b/src/lib/views/Settings.svelte index a3727b2..3b71e3d 100644 --- a/src/lib/views/Settings.svelte +++ b/src/lib/views/Settings.svelte @@ -345,6 +345,10 @@ let form = $state(blankForm("webdav")); // When set, the form is editing an existing target rather than adding one. let editingId = $state(null); + // Nextcloud/ownCloud only need the server URL — the app builds the DAV path. + let davAutoPath = $derived( + form.provider_hint === "nextcloud" || form.provider_hint === "owncloud", + ); function blankForm(kind: SyncKind): SyncTargetConfig { return { @@ -370,7 +374,9 @@ testResult = null; } async function testConnection() { - const r = await settings.test(form); + // In edit mode, pass the id so the backend reuses the stored password + // (unless a new one was typed) while still testing the edited URL/fields. + const r = await settings.test(editingId ? { ...form, id: editingId } : form); testResult = { ok: r.ok, message: r.message }; } // Load an existing target into the form for editing. The secret is never @@ -786,9 +792,17 @@ + placeholder={davAutoPath + ? "https://cloud.example.com" + : "https://host/remote.php/dav/… (or /seafdav, /dav)"} + /> + {#if davAutoPath} + Just your server URL — WhispAssist adds + /remote.php/dav/files/<username>/ automatically. + {/if} +