From 52e774f83c3a780cc4f4dd0ef4bd3a58ad48dc32 Mon Sep 17 00:00:00 2001 From: Tenggan Zhang <38639187+TeigenZhang@users.noreply.github.com> Date: Wed, 25 Mar 2026 20:39:16 +0800 Subject: [PATCH] fix: case selection not persisting across page refresh (#49) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for the clean fix! The root cause analysis in the PR description was excellent — the strict Zod schema rejecting modelConfig during the GET-then-PUT pattern was a subtle bug. --- src/web/public/session-ui.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/web/public/session-ui.js b/src/web/public/session-ui.js index bf5e287c..260956e7 100644 --- a/src/web/public/session-ui.js +++ b/src/web/public/session-ui.js @@ -109,16 +109,10 @@ Object.assign(CodemanApp.prototype, { async saveLastUsedCase(caseName) { try { - // Get current settings - const res = await fetch('/api/settings'); - const settings = res.ok ? await res.json() : {}; - // Update lastUsedCase - settings.lastUsedCase = caseName; - // Save back await fetch('/api/settings', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(settings) + body: JSON.stringify({ lastUsedCase: caseName }) }); } catch (err) { console.error('Failed to save last used case:', err);