From 82edc151292d7c3b576b6f8e0eaf66e306389ce9 Mon Sep 17 00:00:00 2001 From: Jeffrey Smith Date: Fri, 27 Mar 2026 13:13:56 +0000 Subject: [PATCH] UI bug pass: fix settings crash and rename dead heading - Rename "Chat Defaults" heading to "Defaults" in settings general - Guard sw.api.models.enabled() call (crashes when no providers are configured since models API returns undefined) - Verified: admin, settings, login surfaces render correctly in both light and dark themes at desktop viewport Co-Authored-By: Claude Opus 4.6 (1M context) --- src/js/sw/surfaces/settings/general.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/js/sw/surfaces/settings/general.js b/src/js/sw/surfaces/settings/general.js index caafb19..d648116 100644 --- a/src/js/sw/surfaces/settings/general.js +++ b/src/js/sw/surfaces/settings/general.js @@ -1,5 +1,5 @@ /** - * GeneralSection — chat defaults: model, system prompt, max tokens, temperature, thinking + * GeneralSection — user preferences (model, system prompt, max tokens, temperature) */ const { html } = window; const { useState, useEffect, useCallback, useRef } = hooks; @@ -15,10 +15,8 @@ export function GeneralSection() { useEffect(() => { (async () => { try { - const [s, m] = await Promise.all([ - sw.api.profile.settings(), - sw.api.models.enabled(), - ]); + const s = await sw.api.profile.settings(); + const m = sw.api.models?.enabled ? await sw.api.models.enabled() : null; const sObj = s || {}; setSettings({ model: sObj.model || '', @@ -27,7 +25,7 @@ export function GeneralSection() { temperature: sObj.temperature ?? 0.7, show_thinking: sObj.show_thinking || false, }); - const modelList = (m.data || []).filter(x => !x.hidden); + const modelList = (m?.data || []).filter(x => !x.hidden); setModels(modelList); // Set initial max hint @@ -74,7 +72,7 @@ export function GeneralSection() { return html`
-

Chat Defaults

+

Defaults