diff --git a/.agents/logs/ai_changelog.md b/.agents/logs/ai_changelog.md index d35d764..5b03d17 100644 --- a/.agents/logs/ai_changelog.md +++ b/.agents/logs/ai_changelog.md @@ -347,3 +347,8 @@ - `python_embeded/python.exe -m py_compile api/__init__.py api/models.py api/recipes.py api/recipe_packages.py` - Advanced recipe locale-key smoke check passed - `git diff --check` + +## [2026-08-03] UI Öع¹Óë¼ܹ¹¾«¼ò +- **Recipe UI Ïִú»¯**: ºϲ¢ÁËÈßÔӵÄ Tabs£¬½« ģÐÍÓ븴ÏÖ ºÍ ²ÎÊý ºϲ¢½øÈë ¸ÅÀÀ Ãæ°壬²¢½«µײã²ÎÊýÊÕÈëÕ۵þ×é¼þ£¬¼«´ó¼õÇáÁËÐÅϢÔëÒô¡£ +- **Å䷽¿¨ƬÁбí½µÔë**: ÒƳýÁËԭÅ䷽Áбí¿¨ƬÉϵÄȫÁ¿²ÎÊýչʾ£¬½ö±£Áô·âÃæͼ¡¢±êÌ⡢±êǩÓëģÐͻÕÕ£¬²¢Öع¹Á˲Ù×÷°´ť²¼¾֡£ +- **½»»¥Â߼­Ð޸´**: ·ÏÆúÁ˼«Ò׳ö Bug µÄ Quick Queue Â߼­£¬ͳһÁˡº´򿪵½»­²¼¡»Ó롺׷¼ӵ½»­²¼¡»µÄÂ߼­·âװ¡£ diff --git a/.agents/logs/ai_lessons.md b/.agents/logs/ai_lessons.md index ac87670..a12c4b9 100644 --- a/.agents/logs/ai_lessons.md +++ b/.agents/logs/ai_lessons.md @@ -395,3 +395,9 @@ This document serves as an architectural retrospective and UX diagnostic log for (导入配方可能引用本机不存在的模型路径。若把文件名或预览命中直接当成权威依据,就会静默改写工作流模型输入,或把视觉命中错误提升为已验证身份。) **The Solution (方案)**: Keep the saved workflow path and stored identity immutable during lazy matching. Use the existing explicit hash/size/category resolver only after the user requests a match; attach the current local model descriptor transiently for preview and browser navigation, while leaving identity status and workflow content unchanged. (延迟匹配期间保持已保存工作流路径和身份记录不变。只有用户明确请求后才调用现有哈希/大小/类别解析器;本地模型描述只临时用于预览和跳转,不改变身份状态或工作流内容。) + +## 55. Recipe Detail UI Refactoring: Consolidate Information and Guard State Transitions (合并信息噪音与状态切换守卫) +**The Problem (问题)**: The Recipe Detail UI originally had too many tabs separating 'Overview', 'Models', and 'Parameters', causing unnecessary cognitive load. The Quick Queue feature was also highly prone to state bugs due to bypassing the canvas. During refactoring, removing the separate 'Models' tab and injecting them into the 'Overview' caused the preview loading mechanism (which was tied to checking `activeTab === 'models'`) to break. +(Recipe 详情页原本分了太多的 Tab(概览、模型、参数),导致信息过于分散、认知负担过重。同时 Quick Queue 功能由于绕过了画布,极易产生状态 Bug。在重构时,把模型和参数全塞进概览页后,原本绑定在“当处于模型 Tab 时才加载预览图”的机制断裂,导致模型封面无法显示。) +**The Solution (方案)**: Consolidate noisy parameters into a `
` fold inside the Overview, simplifying the UI visually. Strip out Quick Queue and standardize on Open/Append logic. Most importantly, when changing Tab semantic structures, carefully audit and update any conditional logic tying background fetching (like preview loading) to active Tab state. +(将杂乱的参数收纳进详情页的 `
` 折叠组件中,极大降低视觉噪音。彻底删除 Quick Queue 逻辑并统一为在画布中操作。最重要的是,在改变 Tab 结构时,必须仔细审计并更新那些依赖 Tab 状态的后台加载逻辑(如模型封面预加载),保证从卡片到详情面板的心流与数据流一致。) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 0df45d9..73d6a0d 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -106,9 +106,9 @@ Instead of fragmenting the class scope and losing context, we extracted all UI p * **Detail Panel (`anomalous-detail-panel`)**: Slides out when a specific model is clicked. * **Gallery Viewer (`ui_gallery.js`)**: A fullscreen modal for viewing images. * **Prompt Notes (`ui_notebooks.js`, legacy internal name)**: A specialized editor for composing prompts and drag-dropping LoRA/model nodes. Its shared user-facing surface is **Workspace / 创作工作台**, with **Prompt Notes / 提示词笔记** and **Workflow Recipes / 工作流配方** as its two sections. This presentation rename intentionally leaves notebook routes, storage, and internal property names stable for compatibility. -* **Workflow Recipes (`ui_recipes.js`, `ui_recipe_detail.js`)**: A second section inside the shared Workspace modal, not a separate top-level navigation surface. Recipes save the complete serialized graph and add two summary layers: adapters for common model/LoRA/prompt/sampling semantics, plus bounded generic widget summaries for every node (including third-party nodes). Save captures the serialized graph exactly once before the dialog; that snapshot, not a later live-canvas serialization, is the workflow sent to the API. Schema v3 introduced a canonical SHA-256 workflow fingerprint and explicit model-reference identity records; schema v4 adds optional recipe-owned model-preview snapshot descriptors. The card API stays light; the full graph and history are fetched only after edit, restore, or “View details.” The detail panel owns Overview, Models & reproducibility, Parameters, and Versions tabs with one vertical scroll region. Opening Models & reproducibility resolves current previews through `/anomalous/resolve_paths_to_previews` using `exact_only: true` and a category folder boundary, so it never launches a recursive model scan. Its availability refresh also accepts only bounded exact references and never computes a full-file hash. The save dialog may pin any safe JSON-serializable widget, restores only pins still present on a canvas update, bind an output cover, and explicitly retain bounded model-preview snapshots. The edit dialog resolves safe primitive values from the full workflow by node ID/widget index before updating the matching serialized slot; bounded summaries are never the edit source. Structural edits are explicitly loaded onto the canvas and saved back through the same update path. Every update archives the previous full recipe locally (bounded to 20 versions). Missing-node preflight also reads authoritative workflow node types. `recipe_parser.js` never mutates the live canvas; an unfamiliar custom node may have a less detailed card but must never block saving. Restoring a graph or historical version requires explicit confirmation because it replaces user state. -* **Recipe interaction extensions (`recipe_diff.js`, `recipe_actions.js`)**: Recipe cards filter only lightweight name/notes/tags metadata. Version comparison fetches one validated historical JSON and returns bounded semantic changes without instantiating or mutating either graph. Append clones serialized nodes into the live graph with collision-free IDs, transactional link remapping, placement, selection, and rollback. Card and detail actions use a shared busy/restore discipline so a network or canvas failure cannot leave a button permanently disabled or trigger duplicate mutations. Open/Append UI actions share the same exported handlers from `ui_recipe_detail.js`, including dirty-canvas confirmation, missing-node warning, error feedback, and Workspace closure after success. -* **Recipe detail presentation**: Copy actions use visible temporary success/failure feedback. Name, notes, and tags can be edited inline from the loaded detail view and are persisted through the existing full-recipe update contract, preserving the serialized workflow and history behavior. Workflow fingerprints and model SHA-256 values are advanced information shown only inside collapsed disclosure panels; card and detail surfaces use bounded glass-style cards, responsive grids, and restrained hover transitions. Model references are rendered as independent responsive cards rather than one dense shared row, so each reference keeps its preview, status, and actions together. The Overview separates base model and each LoRA into one full-width composition block; sampling values remain in a compact key-value grid. +* **Workflow Recipes (`ui_recipes.js`, `ui_recipe_detail.js`)**: A second section inside the shared Workspace modal, not a separate top-level navigation surface. Recipes save the complete serialized graph and add two summary layers: adapters for common model/LoRA/prompt/sampling semantics, plus bounded generic widget summaries for every node (including third-party nodes). Save captures the serialized graph exactly once before the dialog; that snapshot, not a later live-canvas serialization, is the workflow sent to the API. Schema v3 introduced a canonical SHA-256 workflow fingerprint and explicit model-reference identity records; schema v4 adds optional recipe-owned model-preview snapshot descriptors. The card API stays light; the full graph and history are fetched only after edit, restore, or “View details.” The detail panel owns Overview and Versions tabs. The 'Models' and 'Parameters' tabs were consolidated into the Overview (with Parameters neatly folded into `
`) to reduce cognitive load and avoid state desyncs. The save dialog may pin any safe JSON-serializable widget, restores only pins still present on a canvas update, bind an output cover, and explicitly retain bounded model-preview snapshots. The edit dialog resolves safe primitive values from the full workflow by node ID/widget index before updating the matching serialized slot; bounded summaries are never the edit source. Structural edits are explicitly loaded onto the canvas and saved back through the same update path. Every update archives the previous full recipe locally (bounded to 20 versions). Missing-node preflight also reads authoritative workflow node types. `recipe_parser.js` never mutates the live canvas. +* **Recipe interaction extensions (`recipe_diff.js`, `recipe_actions.js`)**: Recipe cards filter only lightweight name/notes/tags metadata. Version comparison fetches one validated historical JSON and returns bounded semantic changes without instantiating or mutating either graph. Append clones serialized nodes into the live graph with collision-free IDs, transactional link remapping, placement, selection, and rollback. Card and detail actions use a shared busy/restore discipline so a network or canvas failure cannot leave a button permanently disabled or trigger duplicate mutations. Open/Append UI actions share the same exported handlers from `ui_recipe_detail.js`. All Quick Queue functionality was removed to enforce a single execution path through the canvas. +* **Recipe detail presentation**: Copy actions use visible temporary success/failure feedback. Name, notes, and tags can be edited inline from the loaded detail view and are persisted through the existing full-recipe update contract, preserving the serialized workflow and history behavior. Workflow fingerprints and model SHA-256 values are advanced information shown only inside collapsed disclosure panels; card and detail surfaces use bounded glass-style cards, responsive grids, and restrained hover transitions. The Overview separates base model and each LoRA into one full-width composition block; sampling values remain in a compact key-value grid. * **Doctor Panel (`ui_doctor.js`)**: Diagnoses model health for individual nodes or the entire workflow. Includes "View Profile" functionality. ### NON-NEGOTIABLE: Recipe Presentation & Model Preview Boundaries / 配方展示与模型预览边界