refactor: strategy pattern + editor modularization#1
Open
SRjoeee wants to merge 6 commits intoglazes-pitfall:mainfrom
Open
refactor: strategy pattern + editor modularization#1SRjoeee wants to merge 6 commits intoglazes-pitfall:mainfrom
SRjoeee wants to merge 6 commits intoglazes-pitfall:mainfrom
Conversation
Strategy pattern refactoring plan covering Python backend deduplication, editor.html modularization, and code rot cleanup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9-task plan covering Python backend deduplication, editor.html modularization, web_app.py cleanup, and ComfyUI integration fixes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ble ops - Create ImageOps protocol (ops.py) with to_gray/sobel/normalize_1d/kmeans_2 - Create CV2Ops (backend_cv2.py) and NumpyOps (backend_numpy.py) adapters - Move 350+ lines of shared algorithms to core.py - Replace 14 print() calls with logging - Remove grid_layout() debug visualization - Rewire legacy files as backward-compatible thin wrappers - Bump version to 0.2.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ctory Split the monolithic 4954-line editor.html into: - editor/shared.css: CSS variables + button styles (shared with web_ui) - editor/editor.css: editor-specific styles - editor/js/color-utils.js: rgbToHex, hexToRgb, hslToRgb, rgbToHsl - editor/js/state.js: EditorState object + setActiveTool - editor/js/history.js: undo/redo stack - editor/js/selection.js: selection mask + marching ants - editor/js/canvas-render.js: canvas init, zoom/pan, brush, flood fill - editor/js/palette.js: color picker, palette panel, download - editor/js/rotsprite.js: RotSprite rotation algorithm - editor/js/canvas-size.js: canvas resize tool - editor/js/tools.js: all tool implementations + transform system - editor/js/main.js: DOMContentLoaded init + keyboard shortcuts No ES modules — plain <script> tags, all functions remain global. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Link editor/shared.css (removes duplicated :root vars + .btn styles) - Link editor/js/color-utils.js (removes inline rgbToHex/hexToRgb) - Add /editor/<path> Flask route for serving editor/ static assets - Remove stale comment from Phase 4 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
core.py(310 行)+ 可插拔ImageOps适配器(CV2/NumPy),旧文件保留为 12 行薄包装,API 完全向后兼容editor.html拆分为 454 行 HTML 骨架 + 10 个独立 JS 模块 + 2 个 CSS 文件,零构建工具print()→logging,提取 Flask 共享 helper,统一错误码,修复 ComfyUI bare exceptTest plan
python3 web_app.py启动无报错from perfect_pixel import get_perfect_pixel向后兼容🤖 Generated with Claude Code