From ce8a20a8f129ee50f61fc6ec07511f71bb07ddca Mon Sep 17 00:00:00 2001 From: Bob Lee Date: Sun, 19 Jul 2026 09:26:14 +0800 Subject: [PATCH] fix(settings): prevent Subagent model gear click from freezing UI ConfigPageRow labels used

, so embedding IconButton created invalid button-in-p nesting that could hang React's event path. Also add the Subagent default model description and stabilize SessionTitleConfig notification deps. --- .../app/scenes/settings/settingsTabSearchContent.ts | 1 + .../config/components/SessionTitleConfig.tsx | 10 +++++----- .../config/components/SubagentModelConfig.tsx | 5 ++++- .../config/components/common/ConfigPageLayout.tsx | 9 +++++---- src/web-ui/src/locales/en-US/settings/ai-model.json | 1 + src/web-ui/src/locales/zh-CN/settings/ai-model.json | 1 + src/web-ui/src/locales/zh-TW/settings/ai-model.json | 1 + 7 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/web-ui/src/app/scenes/settings/settingsTabSearchContent.ts b/src/web-ui/src/app/scenes/settings/settingsTabSearchContent.ts index 27885d52ca..481de97f04 100644 --- a/src/web-ui/src/app/scenes/settings/settingsTabSearchContent.ts +++ b/src/web-ui/src/app/scenes/settings/settingsTabSearchContent.ts @@ -42,6 +42,7 @@ export const SETTINGS_TAB_SEARCH_CONTENT: Record { const { t } = useTranslation('settings/ai-model'); - const notification = useNotification(); + const { success: notifySuccess, error: notifyError } = useNotification(); const [isLoading, setIsLoading] = useState(true); const [settings, setSettings] = useState(null); const [models, setModels] = useState([]); @@ -35,11 +35,11 @@ export const SessionTitleConfig: React.FC = () => { setFuncAgentModels(funcAgentModelsData ?? {}); } catch (error) { log.error('Failed to load session title config', error); - notification.error(t('sessionTitle.loadFailed')); + notifyError(t('sessionTitle.loadFailed')); } finally { setIsLoading(false); } - }, [notification, t]); + }, [notifyError, t]); useEffect(() => { void loadData(); @@ -65,10 +65,10 @@ export const SessionTitleConfig: React.FC = () => { setSettings(next); try { await aiExperienceConfigService.saveSettings(next); - notification.success(t('sessionTitle.messages.saveSuccess')); + notifySuccess(t('sessionTitle.messages.saveSuccess')); } catch (error) { log.error('Failed to save session title enable setting', error); - notification.error(t('sessionTitle.messages.saveFailed')); + notifyError(t('sessionTitle.messages.saveFailed')); setSettings(previous); } }; diff --git a/src/web-ui/src/infrastructure/config/components/SubagentModelConfig.tsx b/src/web-ui/src/infrastructure/config/components/SubagentModelConfig.tsx index 2e26b3de11..da856c33df 100644 --- a/src/web-ui/src/infrastructure/config/components/SubagentModelConfig.tsx +++ b/src/web-ui/src/infrastructure/config/components/SubagentModelConfig.tsx @@ -92,7 +92,9 @@ export const SubagentModelConfig: React.FC = () => { } }, [notifyError, t]); - const openSubagentCustomization = useCallback(() => { + const openSubagentCustomization = useCallback((event: React.MouseEvent) => { + event.preventDefault(); + event.stopPropagation(); openScene('agents'); }, [openScene]); @@ -117,6 +119,7 @@ export const SubagentModelConfig: React.FC = () => { )} + description={t('subagentModels.default.description')} align="center" >