From 9c39afa3521bb2abcc87ce08f959a71e02dfb8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 4 Jun 2026 13:26:00 +0200 Subject: [PATCH] fix(settings): per-fact pending state on coach-memory forget A single shared forgetOne mutation meant forgetOne.isPending disabled every per-fact forget button during one delete, so the whole list read as frozen. Track the in-flight fact id via the mutation variables so only the row being deleted disables and shows the spinner. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../settings/coach-memory-section.tsx | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/settings/coach-memory-section.tsx b/src/components/settings/coach-memory-section.tsx index 81f7a2f1a..dde6912bf 100644 --- a/src/components/settings/coach-memory-section.tsx +++ b/src/components/settings/coach-memory-section.tsx @@ -251,10 +251,26 @@ export function CoachMemorySection({ size="sm" data-testid="settings-coach-memory-forget" aria-label={t("settings.ai.coachMemory.forgetAria")} - disabled={!isAuthenticated || forgetOne.isPending} + // v1.11.2 — per-id pending: only the row being + // deleted disables/spins. `forgetOne.variables` holds + // the id passed to the in-flight `mutate()`, so a + // single shared mutation no longer greys out every + // other row's forget button during one delete. + disabled={ + !isAuthenticated || + (forgetOne.isPending && forgetOne.variables === fact.id) + } onClick={() => forgetOne.mutate(fact.id)} > - + {forgetOne.isPending && + forgetOne.variables === fact.id ? ( + + ) : ( + + )} {t("settings.ai.coachMemory.forget")}