From 732463b36e69e9287510e3326c7fbaa1e5832363 Mon Sep 17 00:00:00 2001 From: arkon Date: Wed, 10 Jun 2026 03:19:51 +0200 Subject: [PATCH] fix(web): loadQuickStartCases expected enveloped settings from the already-unwrapped shared settingsPromise app.js resolves settingsPromise to the unwrapped settings object (env?.data ?? null), matching loadAppSettingsFromServer. The loadQuickStartCases consumer still read settings.data.lastUsedCase, which silently dropped the last-used-case preselection; its fallback fetch also missed the envelope unwrap. Align both with the unwrapped shape. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/web/public/session-ui.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/web/public/session-ui.js b/src/web/public/session-ui.js index 0bfcd24e..3896d9a6 100644 --- a/src/web/public/session-ui.js +++ b/src/web/public/session-ui.js @@ -49,9 +49,9 @@ Object.assign(CodemanApp.prototype, { // Load settings to get lastUsedCase (reuse shared promise if provided) let lastUsedCase = null; try { - const settings = settingsPromise ? await settingsPromise : await fetch('/api/settings').then(r => r.ok ? r.json() : null); - if (settings && settings.data) { - lastUsedCase = settings.data.lastUsedCase || null; + const settings = settingsPromise ? await settingsPromise : await fetch('/api/settings').then(r => r.ok ? r.json() : null).then(env => env?.data ?? null); + if (settings) { + lastUsedCase = settings.lastUsedCase || null; } } catch { // Ignore settings load errors