Files
hcie-rust-v3.05/.kilo/plans/1784456713003-iced-gui-migration-plan.md
T
phantom 2fb47520b3 feat(svg-editor): implement interactive SVG node editor with parsing and editing capabilities
feat(debug-logger): add DebugSignalLogger plugin for event logging and inspection

feat(plugins): introduce built-in plugins module and integrate debug logger

feat(plugin-integration): create integration layer for mapping Iced Messages to CoreEvents

feat(plugin-registry): establish PluginRegistry for managing plugins and event dispatching
2026-07-20 01:43:22 +03:00

223 lines
11 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ICED GUI Migration Plan — EGUI Full Parity
## Hedef
EGUI (`hcie-egui-app`) üzerindeki tüm özellik, panel, menü, dialog ve fonksiyonların ICED (`hcie-iced-app`) tarafına taşınarak %100 görsel ve işlevsel paritenin sağlanması.
## Kararlar
| Karar | Seçim |
|-------|-------|
| Panel crate yapısı | Gömülü kal (mevcut `hcie-iced-gui/src/panels/` içinde) |
| Plugin sistemi | Kapsama al — EGUI'deki PluginHost ICED'e taşınacak |
| SVG Editor | Kapsama al — yeni panel olarak eklenecek |
| Menü placeholder'ları | Tümü aktifleştirilecek (full parity) |
---
## Faz 1: Kritik Eksik Yapılar (Temel)
### 1.1 Plugin Sistemi (`hcie-iced-gui/src/plugins/`)
- [ ] **Kaynak:** `hcie-egui-app/crates/hcie-gui-egui/src/plugins/`
- [ ] **Hedef:** `hcie-iced-app/crates/hcie-iced-gui/src/plugins/`
- [ ] **Dosyalar:**
- `mod.rs` — PluginHost struct, `dispatch_app_event()`, plugin lifecycle
- `registry.rs` — PluginRegistry, kayıtlı plugin yönetimi
- `integration.rs` — EGUI plugin UI'dan EventBus olay dağıtımı
- `built_in/` — Built-in plugin örnekleri (debug_logger)
- [ ] **Bağımlılık:** PluginHost `HcieApp` yerine `IcedDocument`+`ToolState` kullanacak şekilde adapte edilmeli
- [ ] **Integration:** `app.rs` update() içinde `message` döngüsüne plugin dispatch eklenmeli
### 1.2 SVG Editor Panel
- [ ] **Kaynak:** `hcie-egui-app/crates/hcie-gui-egui/src/app/panels/svg_editor_panel.rs`
- [ ] **Hedef:** `hcie-iced-app/crates/hcie-iced-gui/src/panels/svg_editor.rs`
- [ ] **Durum:** EGUI'de `SvgEditorState` struct + `show_svg_editor()` fonksiyonu. ICED'e `SvgEditorState` + view/update olarak taşınacak
- [ ] **App state:** `HcieIcedApp` içine `svg_editor_state: Option<SvgEditorState>` eklenecek
- [ ] **Panel:** view fonksiyonu normal panel gibi `panels/mod.rs` üzerinden erişilebilir
### 1.3 Save Error Dialog
- [ ] **Kaynak:** EGUI `SaveErrorState` + error dialog render
- [ ] **Hedef:** ICED `ActiveDialog::SaveError` varyantı + dialog view
- [ ] **Özellik:** Kaydetme hatasında alternatif yol önerisi gösteren modal
### 1.4 Canvas Expand Dialog
- [ ] **Kaynak:** EGUI `show_expand_dialog` + paste overflow handling
- [ ] **Hedef:** ICED `ActiveDialog::ExpandCanvas` varyantı
- [ ] **Özellik:** Clipboard paste sırasında tuval boyutunu aşan içerik için genişletme onayı
---
## Faz 2: Menü Eksikleri (Full Parity)
### 2.1 File Menüsü Eksikleri
| EGUI Öğesi | ICED Task |
|---|---|
| Import… | `MenuCommand::ImportFile``rfd::FileDialog` ile dosya seç, engine'e yükle |
| Import SVG… | `MenuCommand::ImportSvg` — SVG dosyası aç, engine.import_svg() çağır |
| Import Brushes… | `MenuCommand::ImportBrushes` — ABR/KPP parser, brush_presets'e ekle |
| Export… | `MenuCommand::Export` — Save As ile aynı akış, farklı etiket |
### 2.2 Edit Menüsü Eksikleri
| EGUI Öğesi | ICED Task |
|---|---|
| Paste Special (Ctrl+Shift+V) | `MenuCommand::PasteSpecial` — Paste internal clipboard (transform olarak) |
| Fill… (Shift+F5) | `MenuCommand::Fill` — Primary color ile seçim/layer doldurma |
| Stroke… | `MenuCommand::Stroke` — Placeholder dialog (EGUI'de de placeholder) |
| Free Transform (Ctrl+T) | `MenuCommand::FreeTransform``TransformStart` event'i, selection transform başlatma |
| Preferences (Ctrl+K) | `MenuCommand::Preferences``ActiveDialog::Settings` dialog'u |
### 2.3 Tools Menüsü
- [ ] EGUI `tools` menüsündeki tüm tool'lar için `MenuCommand::SelectTool(Tool)` eklenecek
- [ ] **Tool listesi:** Eyedropper, Pen, Brush, Eraser, Spray, FloodFill, MagicWand, Select, Lasso, PolygonSelect, Move, Crop, Text, Gradient
- [ ] **Retouch alt menüsü:** `MenuCommand::SelectTool(Tool::RedEyeRemoval)`, `SpotRemoval`, `SmartPatch`
- [ ] **AI alt menüsü:** `MenuCommand::SelectTool(Tool::AiObjectRemoval)`, `SmartSelect`, `VisionSelect`
### 2.4 Image Menüsü Eksikleri
| EGUI Öğesi | ICED Task |
|---|---|
| Image Rotation > 90° CW | `MenuCommand::Rotate90CW` → engine.rotate_canvas(90) |
| Image Rotation > 90° CCW | `MenuCommand::Rotate90CCW` → engine.rotate_canvas(-90) |
| Image Rotation > 180° | `MenuCommand::Rotate180` → engine.rotate_canvas(180) |
| Flip Horizontal | `MenuCommand::FlipHorizontal` → engine.flip_horizontal() |
| Flip Vertical | `MenuCommand::FlipVertical` → engine.flip_vertical() |
| Crop | `MenuCommand::ImageCrop` → selection_rect varsa engine.crop() |
| Invert / Negative | `MenuCommand::InvertNegative` → apply_filter("invert") |
### 2.5 Filter Menüsü Eksikleri
- [ ] **Distort:** `MenuCommand::FilterDistort(Pinch)`, `FilterDistort(Twirl)` — parametre dialog'u
- [ ] **Noise:** `MenuCommand::FilterNoise(AddNoise)`, `FilterNoise(NoisePattern)`
- [ ] **Pixelate:** `MenuCommand::FilterPixelate(Crystallize)`, `FilterPixelate(Mosaic)`
- [ ] **Render:** `MenuCommand::FilterRender(Clouds)` — procedural texture
- [ ] **Restore:** `MenuCommand::FilterRestore(Dehaze)`
- [ ] **Stylize:** `FilterStylize(Emboss)`, `FilterStylize(FindEdges)`, `FilterStylize(OilPaint)`
- [ ] **Procedural Textures (14 tür):** `FilterTexture(Grass)`, `FilterTexture(Sand)`, `FilterTexture(Dirt)`, `FilterTexture(Water)`, `FilterTexture(Rain)`, `FilterTexture(Stone)`, `FilterTexture(Bricks)`, `FilterTexture(Oak)`, `FilterTexture(Pine)`, `FilterTexture(DarkWood)`, `FilterTexture(Steel)`, `FilterTexture(Gold)`, `FilterTexture(Copper)`, `FilterTexture(Linen)`, `FilterTexture(Glass)`, `FilterTexture(SkyReplacement)`
- [ ] **Kaynak:** EGUI `shell/menus.rs:ui_filter_menu()` fonksiyonundaki tüm filtre çağrıları
### 2.6 Select Menüsü Eksikleri
- [ ] **Erode Border:** `MenuCommand::ErodeBorder` → engine.selection_erode()
- [ ] **Fade Border:** `MenuCommand::FadeBorder` → engine.selection_fade()
### 2.7 View Menüsü Eksikleri
- [ ] **Reset Pan:** `MenuCommand::ResetPan``doc.pan_offset = Vector::ZERO`
### 2.8 Window Menüsü Eksikleri
- [ ] **Open Documents list:** Aktif doküman listesi gösterimi, seçili olana focus
- [ ] **Reset Layout:** Varsayılan dock düzenine dön
### 2.9 Layer Menüsü Eksikleri
- [ ] **Align:** `MenuCommand::AlignLayer(AlignAxis)` — tüm axis'ler için engine.align_active_layer()
### 2.10 Help Menüsü
- [ ] **About:** `ActiveDialog::About``dialogs/about.rs` mevcut, menü bağlantısı eklenecek
---
## Faz 3: Panel İçerik İyileştirmeleri
### 3.1 AI Assistant — ComfyUI Sekmesi
- [ ] EGUI'de AI paneli 2 sekme: ComfyUI + AI Chat
- [ ] ICED'de sadece AI Chat var
- [ ] **Task:** ComfyUI pipeline görüntüleyici sekmesi eklenecek
### 3.2 Title Bar Özellikleri
- [ ] **Search box:** EGUI title bar'da `title_search` alanı + TextEdit
- [ ] **Panel list popup:** EGUI'de hamburger menü ikonu ile panel list toggle
- [ ] **Window controls:** EGUI kendi minimize/maximize/close çiziyor. ICED'de `decorations(false)` ile aynı pattern
### 3.3 Thumbnails Panel
- [ ] `panels/thumbnails.rs` mevcut — EGUI layers panel içinde thumbnail gösterimi ile uyum kontrolü
- [ ] Layer thumbnail boyutları, badge'ler, efekt ikonları EGUI ile eşleştirilecek
---
## Faz 4: Dialog İyileştirmeleri
### 4.1 Filter Dialogları
- [ ] EGUI'de her filter kategorisi için ayrı dialog flag'leri: `show_blur_dialog`, `show_sharpen_dialog`, `show_distort_dialog`, `show_stylize_dialog`, `show_color_light_dialog`, `show_restore_dialog`, `show_noise_pattern_dialog`, `show_procedural_textures_dialog`
- [ ] ICED'de `ActiveDialog::FilterParams(FilterType)` ile tek dialog — yeterli mi kontrol et
- [ ] EGUI `filter_dialogs.rs` ve `modern_dialogs.rs`'deki parametre UI'ları incelenmeli
### 4.2 Selection Op Dialog
- [ ] EGUI `SelectionOpDialogState` ile Grow/Shrink/Feather/Erode/Fade için değer girişi
- [ ] ICED `ActiveDialog::SelectionOp` mevcut ama Erode/Fade eklenmeli
---
## Faz 5: Viewer Mode Parity
### 5.1 Viewer Mode (FastStone-like)
- [ ] EGUI viewer (`shell/viewer.rs`): `ViewerState`, thumbnail grid, directory tree, fullscreen
- [ ] ICED viewer (`viewer/`): Mevcut, EGUI ile karşılaştırılmalı
- [ ] **Eksik olabilir:** Önceki/Sonraki navigasyon, fullscreen toggle, thumbnail cache
---
## Faz 6: Görsel Tutarlılık
### 6.1 gui_layout.json Sistemi
- [ ] EGUI'de `shell/gui_layout.rs` ile tüm panel boyut/padding/renk override'ları
- [ ] ICED'de benzer bir sistem yok
- [ ] **Task:** ICED için basitleştirilmiş layout override mekanizması
### 6.2 Tema Paletleri
- [ ] EGUI'de 5 tema: Photoshop, PhotoshopLight, Amoled, ProDark, ProLight
- [ ] ICED'de `ThemePreset` aynı seti kapsıyor mu kontrol et
- [ ] `iced-panel-adapter` içindeki renk token'ları EGUI `ThemeColors` ile eşleştirilmeli
---
## Faz 7: Kod Temizliği ve Doğrulama
### 7.1 Dead Code Temizliği
- [ ] EGUI `_dead_code_candidates_/` klasöründeki dosyalar incelenmeli
- [ ] `panel_layout.rs`, `dock_controller.rs`, `dock_engine.rs`, `history.rs`
### 7.2 Test ve Doğrulama
- [ ] `cargo test -p hcie-iced-gui` — mevcut testler
- [ ] Görsel screenshot karşılaştırması
- [ ] Her Faz sonunda `cargo check -p hcie-iced-gui` ile derleme kontrolü
---
## Faz Sıralaması ve Bağımlılıklar
```
Faz 1 (Kritik Yapılar) ──→ Faz 2 (Menüler) ──→ Faz 3 (Paneller) ──→ Faz 4 (Dialoglar) ──→ Faz 5 (Viewer) ──→ Faz 6 (Görsel)
│ │
└── Plugin sistemi └── Tüm menü komutları aktif
└── SVG Editor └── Import/Export
└── Save Error Dialog
└── Expand Canvas Dialog
```
Her faz kendi içinde bağımsız çalışabilir. Faz 1 ön koşuldur çünkü yeni state alanları ve dialog varyantları sonraki fazlarda kullanılır.
---
## Riskler
1. **Plugin sistemi:** EGUI `EventBus` tabanlı, ICED Message tabanlı. Uyumlama sırasında event→message dönüşümü dikkatli yapılmalı
2. **SVG Editor:** EGUI'de `hcie_engine_api::SvgEditable` kullanılıyor. Aynı API ICED'de de mevcut
3. **Procedural Textures (14 adet):** Her biri ayrı filter_id + parametre seti. EGUI'deki parametre isimleri birebir korunmalı (örn. `"texture_grass"`, `"scale": 1.0, "roughness": 0.5`)
4. **ComfyUI sekmesi:** EGUI'de AI paneli içinde iki sekme var. ICED'de AI panel widget'ının tab desteği eklenmeli
---
## Implementation Notları
- **Yeni dosyalar eklenirken mevcut değiştirilmez** kuralı: Menü komutları `panels/menus.rs`'e, dialoglar `dialogs/`'a, yeni paneller `panels/`'e ek dosya olarak
- `app.rs` `update()` fonksiyonuna yeni Message varyantları eklenecek
- `app.rs` `view()` fonksiyonuna yeni panel/dialog view'ları bağlanacak
- Engine API çağrıları EGUI ile birebir aynı (`hcie_engine_api::Engine`)
- Görsel stiller `iced-panel-adapter::theme::ThemeColors` üzerinden