From 67d64124c3ccf2c7a3ce908f4fcc9706376cfab6 Mon Sep 17 00:00:00 2001 From: Erosika Date: Wed, 8 Jul 2026 10:45:22 -0400 Subject: [PATCH] feat(desktop): autosave the inline provider panel, drop its Save button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Everything else on the settings page writes through on change; the panel hoarding edits behind a Save button meant navigation silently discarded them. Discrete controls (switch, select) commit on change, text-like fields commit on blur, each as a one-key partial save — silent on success, toast on failure, no full refresh so sibling drafts survive. A committed secret clears its draft and flips the set pill locally. The modal keeps explicit Save changes: a dialog is a transaction with Cancel semantics. --- .../src/app/settings/memory/field-control.tsx | 20 +++- .../memory/provider-config-panel.test.tsx | 37 ++++++-- .../settings/memory/provider-config-panel.tsx | 92 +++++++++++-------- 3 files changed, 97 insertions(+), 52 deletions(-) diff --git a/apps/desktop/src/app/settings/memory/field-control.tsx b/apps/desktop/src/app/settings/memory/field-control.tsx index 336fc8d1725b..62871be910ff 100644 --- a/apps/desktop/src/app/settings/memory/field-control.tsx +++ b/apps/desktop/src/app/settings/memory/field-control.tsx @@ -31,14 +31,24 @@ export function FieldTitle({ field }: { field: MemoryProviderField }) { export function FieldControl({ field, value, - onChange + onChange, + onCommit }: { field: MemoryProviderField value: string onChange: (value: string) => void + // Present on autosaving surfaces: discrete controls commit on change, text-like + // controls commit on blur. Absent (the modal), edits stay drafts until Save. + onCommit?: (value: string) => void }) { + const set = (next: string) => { + onChange(next) + onCommit?.(next) + } + const commitDraft = onCommit ? () => onCommit(value) : undefined + if (field.kind === 'bool') { - return onChange(checked ? 'true' : 'false')} /> + return set(checked ? 'true' : 'false')} /> } if (field.kind === 'number') { @@ -46,6 +56,7 @@ export function FieldControl({ onChange(event.target.value)} placeholder={field.placeholder} type="number" @@ -58,6 +69,7 @@ export function FieldControl({ return (