Skip to content

Commit 09138ff

Browse files
committed
v1.4.0 – A7 Preact Migration (5A–5C)
1 parent 1ca5456 commit 09138ff

20 files changed

+5645
-80
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
# ComfyUI-Doctor
22

3-
[繁體中文](README.zh-TW.md) | English | [Roadmap & Development Status](ROADMAP.md)
3+
[繁體中文](readme/README.zh-TW.md) | [简体中文](readme/README.zh-CN.md) | [日本語](readme/README.ja.md) | [한국어](readme/README.ko.md) | [Deutsch](readme/README.de.md) | [Français](readme/README.fr.md) | [Italiano](readme/README.it.md) | [Español](readme/README.es.md) | English | [Roadmap & Development Status](ROADMAP.md)
44

55
A continuous, real-time runtime diagnostics suite for ComfyUI featuring **LLM-powered analysis**, **interactive debugging chat**, and **50+ fix patterns**. Automatically intercepts all terminal output from startup, captures complete Python tracebacks, and delivers prioritized fix suggestions with node-level context extraction. Now supports **JSON-based pattern management** with hot-reload and **full i18n support** for 9 languages (en, zh_TW, zh_CN, ja, de, fr, it, es, ko).
66

7+
<details>
8+
<summary><strong>Update (v1.4.0, Jan 2026)</strong> - Click to expand</summary>
9+
10+
- A7 Preact migration completed across Phases 5A–5C (Chat/Stats islands, fallbacks, registry, shared rendering).
11+
- Integration hardening: improved lifecycle handling and expanded E2E coverage.
12+
- UI fixes: Locate Node button persistence and sidebar tooltip timing.
13+
14+
</details>
15+
716
---
817

918
## Latest Updates (Jan 2026)

ROADMAP.md

Lines changed: 49 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ graph TD
7575
AU --> AV[test-harness.html]
7676
AU --> AW[mocks/comfyui-app.js]
7777
AU --> AX[specs/settings.spec.js - 12 tests]
78-
AU --> AY[specs/sidebar.spec.js - 13 tests]
79-
AU --> AZ[specs/statistics.spec.js - 14 tests]
80-
AU --> BA[specs/preact-loader.spec.js - 12 tests]
78+
AU --> AY[specs/sidebar.spec.js - 10 tests]
79+
AU --> AZ[specs/statistics.spec.js - 18 tests]
80+
AU --> BA[specs/preact-loader.spec.js - 8 tests]
8181
AV --> AH
8282
AV --> AJ
8383
```
@@ -109,9 +109,9 @@ graph TD
109109
| `tests/e2e/test-harness.html` | 104 | Isolated test environment for Doctor UI (loads full extension without ComfyUI) |
110110
| `tests/e2e/mocks/comfyui-app.js` | 155 | Mock ComfyUI app/api objects for testing |
111111
| `tests/e2e/specs/settings.spec.js` | 217 | Settings panel tests (12 tests): toggle, selectors, inputs, persistence |
112-
| `tests/e2e/specs/sidebar.spec.js` | 266 | Chat interface tests (12 tests): messages, input, buttons, error context, fallback, Analyze |
113-
| `tests/e2e/specs/statistics.spec.js` | 381 | Statistics dashboard tests (14 tests): panel, cards, patterns, categories, i18n |
114-
| `tests/e2e/specs/preact-loader.spec.js` | 215 | Preact loader tests (10 tests): module loading, flags, error handling |
112+
| `tests/e2e/specs/sidebar.spec.js` | 190 | Chat interface tests (10 tests): messages, input, buttons, error context, sanitization status |
113+
| `tests/e2e/specs/statistics.spec.js` | 470+ | Statistics dashboard tests (18 tests): panel, cards, patterns, categories, i18n |
114+
| `tests/e2e/specs/preact-loader.spec.js` | 200+ | Preact loader tests (8 tests): module loading, flags, error handling |
115115
| `playwright.config.js` | 89 | Playwright configuration for E2E tests |
116116

117117
---
@@ -174,8 +174,6 @@ graph TD
174174

175175
## 3. Extension Todo-List
176176

177-
**Priority Order**: Security → Robustness → Features
178-
179177
### 3.1 Security (in progress)
180178

181179
*Sorted by priority (High → Low):*
@@ -246,12 +244,28 @@ graph TD
246244

247245
*Sorted by priority (High → Low):*
248246

249-
- [ ] **F14**: Proactive Diagnostics (Lint / Health Check) - 🔴 High ⚠️ *Use dev branch*
247+
- [ ] **F14**: Proactive Diagnostics (Lint / Health Check + Intent Signature) - 🔴 High ⚠️ *Use dev branch*
250248
- **Goal**: Prevent failures before execution; Health Score is a core KPI
249+
- **Intent Signature (ISS)**: deterministic intent inference (signals + scoring), top intents with evidence
251250
- **Checks**: Workflow lint, environment/deps, model assets, runtime, privacy
252-
- **Outputs**: Actionable issues + node navigation; health report history
251+
- **Outputs**: Actionable issues + node navigation; intent banner; health history
252+
- **i18n**: Health tab + intent banner strings across 9 languages
253+
- **Stats**: Top intents and intent-to-error correlation
253254
- **APIs**: `/doctor/health_check`, `/doctor/health_report`, `/doctor/health_history`, `/doctor/health_ack`
254255
- **Plan**: `.planning/260108-PROACTIVE_DIAGNOSTICS_PLAN.md`
256+
- [ ] **F15**: Resolution Marking UI (Resolved / Unresolved / Ignored) - 🟡 Medium
257+
- **Goal**: Let users update resolution status directly from UI
258+
- **Scope**: Statistics tab first; optional Chat tab parity
259+
- **Flow**: `POST /doctor/mark_resolved` → refresh stats
260+
- **i18n**: Status labels and "Mark as" strings
261+
- **Tests**: Playwright mock API + UI state assertions
262+
- **Plan**: `.planning/260108-F15_RESOLUTION_MARKING_UI_PLAN.md`
263+
- [ ] **F16**: Quick Community Feedback (GitHub PR) - 🔴 High
264+
- **Goal**: One-click PR with sanitized pattern + verified suggestion + optional stats snapshot
265+
- **Repo**: `rookiestar28/ComfyUI-Doctor`
266+
- **Conflict avoidance**: Append-only JSON files under `feedback/`
267+
- **Auth**: Server-side token (env var) or future device flow
268+
- **Plan**: `.planning/260108-F16_GITHUB_FEEDBACK_PR_PLAN.md`
255269
- [x] **F7**: Enhanced Error Analysis (Multi-Language + Categorization) - 🔴 High ✅ *Completed (2026-01-01)*
256270
- **Phase 1**: Enhanced Error Context Collection
257271
- Python stack traces, execution logs (last 50 lines)
@@ -300,6 +314,7 @@ graph TD
300314
- **New Files**: `doctor_tabs.js`, `tabs/chat_tab.js`, `tabs/stats_tab.js`, `tabs/settings_tab.js`
301315
- **Implementation Record**: `.planning/260106-F13_SIDEBAR_TAB_REFACTORING_IMPLEMENTATION_RECORD.md`
302316
- **Prerequisite**: Before A7 Phase 5A component migration
317+
- [ ] **F5**: Node health scoring - 🟢 Low
303318
- [x] **F2**: Hot-reload error patterns from external JSON/YAML - 🟡 Medium ✅ *Completed (2026-01-03)*
304319
- **Priority upgraded** from Low → Medium (enables community ecosystem)
305320
- ✅ Load patterns from JSON files: builtin.json, community.json, custom.json
@@ -316,7 +331,6 @@ graph TD
316331
- Support `/v1/messages` endpoint with `x-api-key` authentication
317332
- Handle streaming with event types (`content_block_delta`, `message_stop`)
318333
- 9+ LLM providers now supported
319-
- [ ] **F5**: Node health scoring - 🟢 Low
320334

321335
### 3.4 Architecture Improvements (in progress)
322336

@@ -366,9 +380,6 @@ graph TD
366380
- **Trigger**: BEFORE v2.0 Chat Interface expansion begins
367381
- **Foundation for**: v2.0 advanced chat features, v3.0 multi-workspace features
368382
- **Design Reference**: See `.planning/ComfyUI-Doctor Architecture In-Depth Analysis and Optimization Blueprint.md`
369-
- **Phase Status**: Phase 5A completed ✅; Phase 5B completed ✅; Phase 5C (extensibility) planned
370-
- **Plans**: `.planning/260106-A7_PHASE_5B_INTEGRATION_HARDENING_PLAN.md`, `.planning/260106-A7_PHASE_5C_EXTENSIBILITY_PLAN.md`
371-
- **Implementation Records**: `.planning/260106-A7_PHASE_5A_IMPLEMENTATION_RECORD.md`, `.planning/260107-A7_PHASE_5B_IMPLEMENTATION_RECORD.md`
372383
- [ ] **A5**: Create `LLMProvider` Protocol for unified LLM interface - 🟡 Medium ⚠️ *Use dev branch*
373384
- [ ] **A4**: Convert `NodeContext` to `@dataclass(frozen=True)` + validation - 🟡 Medium ⚠️ *Use dev branch*
374385
- [x] **A1**: Add `py.typed` marker + mypy config in pyproject.toml - 🟢 Low ✅ *Completed (Phase 3A)*
@@ -402,12 +413,12 @@ graph TD
402413
- Test harness loads full Doctor UI without ComfyUI ✅
403414
- Mock ComfyUI environment (app, api, extensionManager) ✅
404415
- Settings panel tests (12 tests): toggle, language selector, provider selector, inputs ✅
405-
- Chat interface tests (13 tests): messages area, input/send/clear buttons, fallback, Analyze
406-
- Statistics dashboard tests (16 tests): panel, cards, patterns, categories, i18n ✅
407-
- Preact loader tests (10 tests): module loading, flags, error handling, UI fallback
416+
- Chat interface tests (8 tests): messages area, input/send/clear buttons, error context
417+
- Statistics dashboard tests (18 tests): panel, cards, patterns, categories, i18n ✅
418+
- Preact loader tests (8 tests): module loading, flags, error handling ✅
408419
- API endpoint mocks for backend calls ✅
409-
- **Test Results**: 100% pass rate (51/51 tests)
410-
- **Execution time**: Varies by environment; baseline ~18.3s total with preflight
420+
- **Test Results**: 100% pass rate (46/46 tests)
421+
- **Execution time**: ~16 seconds for full test suite (Chromium, 10 workers)
411422
- **How to Run Tests**:
412423
<details>
413424
<summary>Click to expand test commands</summary>
@@ -429,6 +440,16 @@ graph TD
429440
</details>
430441
- **Implementation Record**: `.planning/260103-T2_playwright_test_infrastructure.md`
431442
- **Foundation for**: CI/CD integration, UI regression detection
443+
- [ ] **T9**: External Environment Test Coverage Expansion (Non-ComfyUI) - 🟡 Medium
444+
- **Goal**: Cover pipeline integration, SSE/REST contracts, and UI contracts without a live ComfyUI runtime
445+
- **Phases**:
446+
- **Phase 1**: Fixture library (tracebacks, workflows, history)
447+
- **Phase 2**: Python integration tests (pipeline end-to-end, statistics)
448+
- **Phase 3**: SSE stub server + JS contract tests
449+
- **Phase 4**: Playwright harness extensions (execution_error/polling sequences)
450+
- **Phase 5**: SOP + optional CI updates
451+
- **Out of Scope**: Real ComfyUI runtime interception and live node execution
452+
- **Plan**: `.planning/260108-TEST_COVERAGE_EXPANSION_PLAN.md`
432453
- [ ] **T5**: Online API integration tests (OpenAI, DeepSeek, Anthropic) - 🟡 Medium
433454
- [ ] **T3**: End-to-end integration tests - 🟢 Low
434455
- [ ] **T4**: Stress tests - 🟢 Low
@@ -502,7 +523,7 @@ graph TD
502523

503524
#### Phase 4A: Security & UX (Quick Wins)
504525

505-
**Priority**: Security → Robustness → Features
526+
**Priority**: Security → Features
506527

507528
- [x] **S6** PII Sanitization ✅ *Completed (2025-12-31)*
508529
- ✅ Critical for enterprise adoption (blocks B2B market)
@@ -605,7 +626,7 @@ graph TD
605626
- API: `/doctor/statistics` (GET) and `/doctor/mark_resolved` (POST)
606627
- Frontend: Collapsible statistics panel in sidebar with error trends, top patterns, category breakdown, and resolution tracking
607628
- Features: 24h/7d/30d time ranges, Top 5 error patterns, resolution rate tracking (resolved/unresolved/ignored)
608-
- Testing: 17/17 backend unit tests passed; statistics E2E tests 18/18 passed; full Playwright suite 51/51 passed (post-5B additions)
629+
- Testing: 17/17 backend unit tests passed; statistics E2E tests 18/18 passed; full Playwright suite 46/46 passed
609630
- i18n: Fully translated across all 9 languages
610631
- See `.planning/260104-F4_STATISTICS_RECORD.md` for implementation details
611632
- [ ] **R6-R7** Network reliability improvements
@@ -632,7 +653,7 @@ graph TD
632653
- ✅ Added `chat-island.js` example component with fallback UI
633654
- ✅ Vendor files bundled in `web/lib/` (preact, hooks, signals, htm)
634655
- **Implementation**: `.planning/260105-A7_IMPLEMENTATION_RECORD.md`
635-
- **Next Phase**: Phase 5B integration hardening + Phase 5C extensibility scaffolding
656+
- **Next Phase**: ✅ Completed Phase 5A–5C Preact migration (2026-01-08)
636657
637658
### Phase 5: Major Refactoring (Future)
638659
@@ -651,47 +672,14 @@ graph TD
651672
- Foundation for S6, R12, F7 integration
652673
- Enables community plugin ecosystem
653674
- **Status**: Merged to main after verification
654-
- [x] **A7** Preact Migration (Phase 5A) ✅ *Completed (2026-01-06)*
675+
- [x] **A7** Preact Migration (Phase 5A–5C) ✅ *Completed (2026-01-08)*
655676
- **Prerequisite**: F13 (Sidebar Tab Refactoring) completed
656-
- ✅ Migrated Chat tab to Preact `ChatIsland` component (SSE streaming, Markdown, dynamic asset loading)
657-
- ✅ Migrated Stats tab to Preact `StatisticsIsland` component (data fetching, charts, categories)
658-
- ✅ Implemented Vanilla JS fallback for both islands
659-
- ✅ E2E Test Results: `sidebar.spec.js` (13/13), `statistics.spec.js` (16/16)
660-
- Settings tab remains Vanilla JS (per A7 non-goals)
661-
- **Implementation Record**: `.planning/260106-A7_PHASE_5A_IMPLEMENTATION_RECORD.md`
662-
663-
#### Phase 5B: A7 Integration & Hardening ✅ COMPLETED
664-
665-
**Priority**: Medium
666-
**Branch**: `dev` → merged to `main`
667-
**Completion Date**: 2026-01-07
668-
669-
- [x] **A7** Integration & hardening (Phase 5B) ✅ *Completed (2026-01-07)*
670-
- ✅ **5B.1 Mode Gating**: Added `chatIslandActive`/`statsIslandActive` flags to `DoctorUI`
671-
- ✅ **5B.2 Fallback Robustness**: Preact disabled → vanilla renders (E2E verified)
672-
- ✅ **5B.3 Lifecycle Safety**: Added stream abort cleanup on component unmount
673-
- ✅ **5B.4 Preflight Validation**: Created `scripts/preflight-js.mjs` (13/13 files pass)
674-
- ✅ **5B.5 E2E Coverage**: Fallback, Analyze button, vendor failure → UI tests
675-
- ✅ **5B.6 Documentation**: Performance baselines documented (timing varies; see record)
676-
- ✅ Fixed vendor module bare specifiers for browser ESM compatibility
677-
- ✅ **Final E2E Result: 55/55 tests passed**
678-
- **Implementation Record**: `.planning/260107-A7_PHASE_5B_IMPLEMENTATION_RECORD.md`
679-
680-
#### Phase 5C: A7 Extensibility ✅ COMPLETED
681-
682-
**Priority**: Medium
683-
**Branch**: `dev` (REQUIRED)
684-
685-
- [x] **A7** Extensibility scaffolding (Phase 5C) ✅ *Completed (2026-01-07)*
686-
- Island registry/contract and unified mount/fallback
687-
- doctorContext selectors to reduce coupling
688-
- Shared render pipeline utilities
689-
- Error boundary + auto fallback
690-
- E2E helper scaffolding
691-
- **Plan**: `.planning/260106-A7_PHASE_5C_EXTENSIBILITY_PLAN.md`
692-
- **Implementation Record**: `.planning/260107-A7_PHASE_5C_IMPLEMENTATION_RECORD.md`
677+
- **5A**: Chat/Stats islands migrated to Preact with vanilla fallback
678+
- **5B**: Integration hardening (fallbacks, E2E coverage, lifecycle checks)
679+
- **5C**: Extensibility layer (island registry, selectors, shared rendering, error boundary, E2E helpers)
680+
- **Records**: `.planning/260106-A7_PHASE_5A_IMPLEMENTATION_RECORD.md`, `.planning/260107-A7_PHASE_5B_IMPLEMENTATION_RECORD.md`, `.planning/260107-A7_PHASE_5C_IMPLEMENTATION_RECORD.md`
693681
694-
#### Phase 5D: Type Safety & Advanced Features
682+
#### Phase 5B: Type Safety & Advanced Features
695683
696684
**Priority**: Medium
697685

assets/chat-ui.png

-101 KB
Loading

assets/doctor-side-bar.png

-45.9 KB
Loading

assets/settings.png

8.21 KB
Loading

assets/statistics_panel.png

19.1 KB
Loading

playwright.config.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// @ts-check
22
const { defineConfig, devices } = require('@playwright/test');
33

4+
const webServerPort = Number(process.env.PW_WEB_SERVER_PORT) || 3000;
5+
const baseURL = process.env.PW_BASE_URL || `http://127.0.0.1:${webServerPort}/tests/e2e/`;
6+
47
/**
58
* Playwright Configuration for ComfyUI-Doctor
69
*
@@ -44,7 +47,7 @@ module.exports = defineConfig({
4447
use: {
4548
// Base URL for test harness
4649
// Server runs from project root, so we need the full path to test-harness.html
47-
baseURL: 'http://127.0.0.1:3000/tests/e2e/',
50+
baseURL,
4851

4952
// Collect trace when retrying the failed test
5053
trace: 'on-first-retry',
@@ -80,8 +83,8 @@ module.exports = defineConfig({
8083
// Run local web server before starting tests
8184
// Serve from project root so that /web/doctor_ui.js paths work correctly
8285
webServer: {
83-
command: 'python -m http.server 3000',
84-
port: 3000,
86+
command: `python -m http.server ${webServerPort}`,
87+
port: webServerPort,
8588
timeout: 120 * 1000,
8689
reuseExistingServer: !process.env.CI,
8790
stdout: 'ignore',

0 commit comments

Comments
 (0)