From 2ee14ecc962fa1fe382244ffe838b69eb98c1ac2 Mon Sep 17 00:00:00 2001 From: DemonGatanjieu <1027066412@qq.com> Date: Fri, 7 Aug 2026 16:31:30 +0800 Subject: [PATCH] style: clarify hierarchy in node assistant parameter presets UI --- .agents/logs/ai_changelog.md | 10 ++++++++++ web/modules/ui_doctor.js | 14 +++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.agents/logs/ai_changelog.md b/.agents/logs/ai_changelog.md index 6842653..bf3b19d 100644 --- a/.agents/logs/ai_changelog.md +++ b/.agents/logs/ai_changelog.md @@ -1,5 +1,15 @@ # AI Changelog +## [Snapshot] 2026-08-07 - Node Assistant Preset Hierarchy Clarity Update + +**Implemented** + +- **UI Hierarchy Clarification**: Fixed a UX issue in the Node Assistant's "Parameter Presets" tab where users confused Recipe Group folders with Notebooks. Added explicit prefixes `🍱 配方:` (Recipe Group) and `📓 笔记本:` (Notebook) to clarify the data structure. +- **Graceful Fallbacks for Deleted/Unbound Recipes**: + - Parameter notebooks that belong to a deleted recipe (previously showing raw `recipe_xxx.json` filenames) now correctly display as `⚠️ 已删除配方 (Deleted)`. + - Notebooks without a specific recipe (`unbound`) are now labeled as `🌍 全局无绑定 (Global/Unbound)`. +- **Apply Button Clarity**: Added the `✨ 应用到 -> (Apply To)` prefix on the terminal buttons that inject parameters to the selected node, clarifying their function. + ## [Snapshot] 2026-08-07 - Node Assistant Layout & Bug Fixes **Implemented** diff --git a/web/modules/ui_doctor.js b/web/modules/ui_doctor.js index 0e57e9f..90ab643 100644 --- a/web/modules/ui_doctor.js +++ b/web/modules/ui_doctor.js @@ -1508,7 +1508,15 @@ export function renderParameterPresets(node, container) { const recipeHeader = document.createElement('div'); recipeHeader.style.cssText = 'padding:10px 12px; font-size:12px; font-weight:bold; color:#c9d6ff; cursor:pointer; display:flex; align-items:center; gap:8px; background:rgba(0,0,0,0.2);'; - recipeHeader.innerHTML = `📁 ${escapeHtml(group.recipe_name || group.recipe_filename)} ▼`; + + let displayName = group.recipe_name || group.recipe_filename; + if (displayName === 'Unbound' || displayName === 'unbound') { + displayName = t('assistantUnboundRecipe') || '🌍 全局无绑定 (Global/Unbound)'; + } else if (displayName.endsWith('.json')) { + displayName = '⚠️ ' + (t('assistantDeletedRecipe') || '已删除配方 (Deleted)') + ' - ' + displayName.substring(0, 15) + '...'; + } + + recipeHeader.innerHTML = `🍱 ${t('assistantRecipeGroup') || '配方'}: ${escapeHtml(displayName)} ▼`; const notebookList = document.createElement('div'); notebookList.style.cssText = 'display:flex; flex-direction:column; gap:6px; padding:8px;'; @@ -1534,7 +1542,7 @@ export function renderParameterPresets(node, container) { const nbTitle = document.createElement('div'); nbTitle.style.cssText = 'font-size:11px; color:#aaa; font-weight:bold; display:flex; align-items:center; gap:6px;'; - nbTitle.innerHTML = `📄 ${escapeHtml(nb.name || 'Untitled')}`; + nbTitle.innerHTML = `📓 ${t('assistantNotebook') || '笔记本'}: ${escapeHtml(nb.name || 'Untitled')}`; nbBox.appendChild(nbTitle); for (const n of nb.nodes) { @@ -1548,7 +1556,7 @@ export function renderParameterPresets(node, container) { summary += ` (${val.length > 15 ? val.substring(0,15)+'...' : val})`; } - applyBtn.innerHTML = `✨ ${escapeHtml(summary)}`; + applyBtn.innerHTML = `✨ ${t('assistantApplyTo') || '应用到'} -> ${escapeHtml(summary)}`; applyBtn.onmouseover = () => { applyBtn.style.background = 'rgba(25,118,210,0.4)'; }; applyBtn.onmouseout = () => { applyBtn.style.background = 'rgba(255,255,255,0.05)'; }; applyBtn.onclick = () => {