Commit Graph
59 Commits
Author SHA1 Message Date
科林_Cyril Pilgrim 180829eca3 feat(llm-translator): implement dynamic provider/model selection and UI improvements
Motivation:
Users needed a more convenient way to select LLM providers and models directly on the LLM Translator node without mandatory external configuration nodes, and requested clearer guidance on how to use the glossary feature.

Implementation:
- Refactored llm_translator.py to dynamically read from providers.json and support standalone configuration.
- Extended the provider_manager.js frontend extension to support the LLMTranslator node for dynamic dropdown syncing.
- Enhanced widget placeholders with detailed multi-line instructions and examples.
- Updated .gitignore to exclude session-specific documents.
2026-03-08 18:24:40 +08:00
科林_Cyril Pilgrim 11b94718a6 fix(ui): fundamentally fix ESC key listener lifecycle
Motivation:
ESC worked only on first open because the listener was registered inside the first-time DOM creation block. On close(), it was detached. On subsequent show() calls, the modal DOM already existed so the function returned early — the listener was NEVER re-attached.

Implementation:
Extracted listener management into two symmetric private methods: _attachEscListener() and _detachEscListener(). show() now calls _attachEscListener on EVERY open (both first-time and subsequent). _closeModal is stored as an instance method so it can be referenced on re-opens. closeModal() calls _detachEscListener() symmetrically. This pattern is leak-proof and correctly re-attaches on every modal activation.
2026-03-05 12:41:09 +08:00
科林_Cyril Pilgrim 46a3db8053 style(ui): refine toggle switch animation for a silkier feel
Motivation:
User feedback indicated that the strong spring animation felt rigid and 'blocking' during interactions.

Implementation:
Adjusted CSS transition cubic-bezier curves from an aggressive spring (.34,1.56,.64,1) to a smoother, faster ease-out curve (.25,1.1,.5,1). Reduced transition durations to 0.2s-0.28s to make the interaction feel instantaneous and fluid.
2026-03-05 12:27:56 +08:00
科林_Cyril Pilgrim 3e33595aa1 fix(ui): restore ESC key listener lost on UI re-rendering
Motivation:
When the UI completely re-renders (like when switching between English and Chinese), the old DOM gets destroyed but the window event listener was not properly cleared and the new modal failed to reattach the listener effectively, breaking the ESC key to close.

Implementation:
Added cleanup logic before attaching a new 'keydown' listener to the window object to ensure the _escListener stays active.
2026-03-05 12:22:53 +08:00
科林_Cyril Pilgrim 910d2792ce feat(ui): implement smooth Apple-style spring animation for toggle switch
Motivation:
The previous toggle switch animation was abrupt and rigid. The clickable area also spanned the entire row width, which led to unintentional clicks.

Implementation:
- CSS: Replaced static transitions with cubic-bezier spring physics, hardware-accelerated transforms (translate), and pressed-state squish feedback.
- JS: Wrapped the switch in a constrained flex container, replacing the full-width <label> wrapper to fix the clickable area.
2026-03-05 12:06:48 +08:00
科林_Cyril Pilgrim f6d72ef002 feat(ui): refine save button style and add ESC key listener to close manager
Motivation:
The save button's style was originally an overly bright gradient, making it feel out of place compared to the frosted glass aesthetics. Additionally, the user requested the ability to close the modal using the Escape key.

Implementation:
1. Updated '.llm-pm-actions-right button:last-child' CSS to use a restrained translucent background similar to the sidebar items, keeping it cohesive with the glassmorphism design.
2. Added a global 'keydown' listener on 'Escape' inside 'ProviderManager.show()' which correctly triggers 'closeModal()' (also checking for unsaved changes) and automatically removes itself when closed.
2026-03-05 09:34:16 +08:00
科林_Cyril Pilgrim 6f597d75f1 fix(i18n): fix language switcher bug and refine Chinese translations
Motivation:
The language switcher's change event listener was never registered because () does not support an initialization callback as its 4th argument. Additionally, the Chinese translation for 'LLM Manager' was inaccurate (模型管家).

Implementation:
1. Replaced the unsupported  callback with an IIFE to manually create the select element, set its value, and add the 'change' event listener.
2. Updated 'I18N_DICT' to change '模型管家' to 'LLM 管理器' for better accuracy.
2026-03-05 09:24:00 +08:00
科林_Cyril Pilgrim b869fefce2 fix(i18n): bind language change event using addEventListener
Motivation:
修复使用 ComfyUI 的  构建 select 元素时 onchange 属性绑定失效的问题。
2026-03-04 22:35:33 +08:00
科林_Cyril Pilgrim 3c7bea009a feat(i18n): convert language toggle to a dropdown menu 2026-03-04 22:02:15 +08:00
科林_Cyril Pilgrim 1c3f998bc1 style(i18n): replace text toggle with language icon
Motivation:
提升管理界面的视觉精致度,使用图标替代文字切换按钮。
2026-03-04 21:41:03 +08:00
科林_Cyril Pilgrim 1dc6567c46 feat(i18n): translate main menu button and fallback button
Motivation:
使 ComfyUI 顶栏按钮也能随界面语言切换而动态更新。
2026-03-04 19:50:40 +08:00
科林_Cyril Pilgrim 4825bc3c06 feat(i18n): implement language switcher (EN/ZH)
Motivation:
提高中英文用户的使用体验,使界面语言可一键切换。

Implementation:
1. 在 provider_manager.js 中注入 I18N_DICT 词典与 t(key) 翻译函数。
2. 将所有硬编码的 UI 字符串替换为翻译调用。
3. 在管理面板标题旁增加语言切换快按键,状态持久化至 localStorage。
2026-03-04 19:35:24 +08:00
科林_Cyril Pilgrim 7f22ab5b07 style: reduce hover glow intensity on Custom Provider button 2026-03-04 18:17:01 +08:00
科林_Cyril Pilgrim a244b74140 style: align Custom Provider button with glassmorphism active style 2026-03-04 18:15:19 +08:00
科林_Cyril Pilgrim 8d2dbdcb9e style: remove active provider left border 2026-03-04 18:09:02 +08:00
科林_Cyril Pilgrim dc653c0cf2 style: remove SYSTEM tags & redesign active sidebar item 2026-03-04 18:02:20 +08:00
科林_Cyril Pilgrim 0754a7aa85 feat(ui): refine glassmorphism details (inline eye icon, loading animations) 2026-03-04 16:41:10 +08:00
科林_Cyril Pilgrim 0590ed5d17 feat(ui): complete glassmorphism UI redesign - Apple frosted glass aesthetic 2026-03-04 16:08:03 +08:00
科林_Cyril Pilgrim d148633515 fix(ui): fix visibility of 'I' in default provider icon 2026-03-04 15:47:07 +08:00
科林_Cyril Pilgrim 159e5a4acd style(ui): update default provider icon with colorful gradient 2026-03-04 15:41:07 +08:00
科林_Cyril Pilgrim 45304d03a0 feat(ui): add default SVG icon for custom providers 2026-03-04 15:36:59 +08:00
科林_Cyril Pilgrim c64a887021 style(ui): unify font family across LLM Manager UI 2026-03-04 15:31:08 +08:00
科林_Cyril Pilgrim c94a9aa360 refactor(ui): rename panel title to 'LLMs Toolkit Manager' 2026-03-04 15:25:15 +08:00
科林_Cyril Pilgrim 95f4100a31 feat(ui): add iFlow SVG icon 2026-03-04 14:56:30 +08:00
科林_Cyril Pilgrim 4cc17d77e1 feat(ui): add ModelScope SVG icon 2026-03-04 14:49:51 +08:00
科林_Cyril Pilgrim e872ee5120 feat(ui): add icons for StepFun, SenseChat (SenseNova), MiniMax, and Baichuan 2026-03-04 14:46:19 +08:00
科林_Cyril Pilgrim f956459146 feat(ui): add Moonshot SVG icon 2026-03-04 14:43:50 +08:00
科林_Cyril Pilgrim 23864745bf feat(ui): add icons for Doubao, Spark, and GLM; fix syntax error in provider_manager.js 2026-03-04 14:39:04 +08:00
科林_Cyril Pilgrim bd59723eff feat(ui): add DeepSeek SVG icon 2026-03-04 14:27:34 +08:00
科林_Cyril Pilgrim 6a46c3dcc4 feat(ui): add infrastructure for provider specific SVG icons and add Qwen icon 2026-03-04 14:22:39 +08:00
科林_Cyril Pilgrim b7983e344b fix(ui): convert inline CSS text to style objects to avoid CSSStyleDeclaration TypeError 2026-03-03 21:59:01 +08:00
科林_Cyril Pilgrim fda6944164 fix(usage): handle 404 gracefully when route not yet loaded, prompt restart 2026-03-03 20:06:50 +08:00
科林_Cyril Pilgrim db3c46b586 fix(usage): harden usage tracking - gitignore, thread lock, rotation, error logging, summary cards 2026-03-03 19:37:05 +08:00
科林_Cyril Pilgrim a59f774c7d feat(llm): implement usage statistics tracking and dashboard UI 2026-03-03 19:14:18 +08:00
科林_Cyril Pilgrim 36c5f3028c refactor(web): extract 300+ line CSS into dedicated provider_manager.css 2026-03-03 19:06:43 +08:00
科林_Cyril Pilgrim 75de8c4f25 feat(ui): add double-click to edit model tags
Motivation:
Users found it cumbersome to delete and re-type a model name if they made a typo.

Implementation:
Added ondblclick listener and pointer cursor to model tags. Reuses the new custom showPrompt dialog for editing.
2026-03-03 18:32:17 +08:00
科林_Cyril Pilgrim 6c5f5e1934 feat(nodes): filter out disabled providers from node dropdown
Motivation:
With 12 system providers, the provider dropdown menu in ComfyUI was too cluttered. Users only configure 1-2 providers on average.

Implementation:
1. Updated default_providers.json to disable most system providers out of the box (except Qwen and DeepSeek).
2. Filtered out disabled providers from INPUT_TYPES in openai_compatible.py.
3. Added equivalent filter to dynamic model dropdown logic in provider_manager.js.
2026-03-03 18:08:22 +08:00
科林_Cyril Pilgrim e90cb97eda feat(ui): replace native alerts with custom dialogs and apply English localization
Motivation:
1. Native browser alerts/confirms block the main thread and break aesthetic immersion.
2. The UI had mixed Chinese and English text, confusing international users.

Implementation:
1. Created unified showDialog, showPrompt, showAlert, and showConfirm components.
2. Migrated delete confirmation and connection checks to the new asynchronous UI dialogs.
3. Updated 'providers.json' templates to use purely English names for consistency.
2026-03-03 17:31:11 +08:00
科林_Cyril Pilgrim 74eefa17cf fix(ui): resolve critical UX issues in provider manager
Motivation:
Users faced data loss when navigating without saving, lacked visual feedback after saving, and the model dropdown logic was broken for the new LLM_CONFIG mode.

Implementation:
1. Replaced 'Custom/手动输入' with 'LLM_CONFIG (from input)' in nodeCreated event.
2. Added visual toast and temporary color change to 'Save' button.
3. Implemented hasUnsavedChanges() and canNavigateAway() pattern to warn users before discarding modified provider data.
2026-03-03 17:17:04 +08:00
科林_Cyril Pilgrim b3b776f3f9 feat(ui): add visibility toggle for API key input
Motivation:
Users need a way to verify they have entered their API keys correctly without the keys being permanently visible.

Implementation:
Added a toggle button with an eye icon next to the API key input in the Provider Manager UI. It switches the input type between 'password' and 'text'.
2026-03-03 16:28:57 +08:00
科林_Cyril Pilgrim d21b704917 style(ui): shorten 'Save Provider' button text to 'Save'
Motivation:
The button text 'Save Provider' was slightly too long and generic 'Save' is cleaner and more professional for the UI.

Implementation:
1. Updated the button innerHTML in provider_manager.js from 'Save Provider' to 'Save'.
2. Updated the corresponding references in both README.md and README_CN.md.
2026-03-02 17:23:57 +08:00
科林_Cyril Pilgrim 15e8408bec style(nodes/ui): remove redundant id suffix from provider dropdown labels
Motivation:
Labels in the provider dropdown were showing redundant internal IDs like '(iflow)', which looked cluttered and unprofessional to end users.

Implementation:
1. Modified openai_compatible.py to generate clean name-only labels.
2. Updated both backend lookup logic and frontend nodeCreated hook in provider_manager.js to align with the name-only matching scheme.
2026-03-02 17:02:24 +08:00
科林_Cyril Pilgrim cb66d43201 docs(readme): rewrite structure and remove emojis for professional tone
Motivation:
社区用户反馈原说明文档缺乏安装与快速上手指南,且带有过多的 Emoji,不够专业。需要一套包含项目架构、节点目录且无花哨表情符号的沉淀说明。

Implementation:
1. 在中英两份 README 文件中完全移除了标题和列表的 Emoji。
2. 增加 `<div align="center">` 让项目大标题 ComfyUI-LLMs-Toolkit 居中。
3. 补充了对 Provider Manager UI 的功能说明以及 JSON 工具箱列表介绍。
2026-03-02 13:41:05 +08:00
科林_Cyril Pilgrim 26ed2a055c fix(ui): move token usage display below the node's bottom boundary to prevent overlapping with existing bottom widgets 2026-03-01 17:04:41 +08:00
科林_Cyril Pilgrim 7ec2e455cb feat(ui): migrate token display to native canvas rendering on the right side to completely avoid widget serialization issues 2026-03-01 16:16:08 +08:00
科林_Cyril Pilgrim bfecfe5f81 style(ui): increase token display widget height for better readability 2026-03-01 16:06:42 +08:00
科林_Cyril Pilgrim 162d65e239 fix(ui): prevent dynamically added token display widget from corrupting node parameter serialization indices 2026-03-01 14:36:39 +08:00
科林_Cyril Pilgrim fe9a0a1721 fix(openai-adapter): resolve HTTP 403, token display, and provider routing bugs
Motivation:
- WAF拦截:urllib默认User-Agent被API网关识别为爬虫,触发1010/403
- Token显示失效:前端JS import路径层级错误、缺少OUTPUT_NODE声明
- Provider路由错误:用base_url匹配ProviderRegistry导致适配逻辑永远失效

Implementation:
- 添加浏览器User-Agent到HTTP请求头,绕过WAF反爬拦截
- 修复display_tokens.js import路径(../../→../../../),改用find-or-create widget策略
- 添加OUTPUT_NODE=True,对齐ComfyUI UI反馈节点标准
- 修正provider查找逻辑:用provider_name匹配配置,用base_url发起API调用
- max_tokens默认值从512调整为2048
2026-02-28 10:43:25 +08:00
科林_Cyril Pilgrim 73fdbf6ac0 fix(ui): use ComfyWidgets for token display compatibility 2026-02-28 00:14:24 +08:00
科林_Cyril Pilgrim 52b8e5e68a feat(ui): display Token Usage directly on nodes & enhance request size logs 2026-02-28 00:04:04 +08:00