hopefully done refining

This commit is contained in:
2026-03-06 16:14:31 -05:00
parent 88e27ae414
commit 1294104f7f
20 changed files with 1736 additions and 734 deletions

View File

@@ -1,29 +1,102 @@
# Implementation Plan: Visual DAG Ticket Editing (visual_dag_ticket_editing_20260306)
> **Reference:** [Spec](./spec.md) | [Architecture Guide](../../../docs/guide_architecture.md)
## Phase 1: Node Editor Setup
- [ ] Task: Initialize MMA Environment
- [ ] Task: Verify ImGui Bundle node editor available
- WHERE: requirements.txt
- WHAT: Ensure imgui-bundle with node editor
- HOW: pip install
Focus: Verify ImGui Bundle node editor
## Phase 2: Implementation
- [ ] Task: Implement ticket node rendering
- WHERE: src/gui_2.py
- WHAT: Render tickets as nodes
- HOW: imgui.node_editor with custom drawing
- SAFETY: 60fps target
- [ ] Task: Implement drag-drop
- WHERE: src/gui_2.py
- WHAT: Handle node drag and dependency lines
- HOW: Node editor callbacks
- SAFETY: Validate DAG after edit
- [ ] Task: Implement status display
- WHERE: src/gui_2.py
- WHAT: Color-coded status per node
- HOW: Node colors based on ticket status
- SAFETY: Sync with backend state
- [ ] Task 1.1: Initialize MMA Environment
- [ ] Task 1.2: Verify imgui_bundle node editor available
- WHERE: Check imports
- HOW: `import imgui_bundle.node_editor as ed`
## Phase 3: Tests & Verification
- [ ] Task: Write node editor tests
- [ ] Task: Conductor - Phase Verification
## Phase 2: Basic Node Rendering
Focus: Render tickets as nodes
- [ ] Task 2.1: Create node editor context
- WHERE: `src/gui_2.py` MMA dashboard
- WHAT: Begin/end node editor
- HOW:
```python
ed.begin("Ticket DAG")
for ticket in self.track.tickets:
ed.begin_node(ticket.id)
imgui.text(ticket.id)
imgui.text(ticket.status)
ed.end_node()
ed.end()
```
- [ ] Task 2.2: Set node positions
- WHERE: `src/gui_2.py`
- WHAT: Position nodes in grid
- HOW:
```python
# Auto-layout: grid positions
col = i % 4
row = i // 4
ed.set_node_position(ticket.id, col * 200, row * 150)
```
- [ ] Task 2.3: Add status colors
- WHERE: `src/gui_2.py`
- WHAT: Color nodes by status
- HOW:
```python
status_colors = {"todo": vec4(150, 150, 150, 255), "in_progress": vec4(255, 200, 100, 255),
"completed": vec4(100, 255, 100, 255), "blocked": vec4(255, 100, 100, 255)}
color = status_colors.get(ticket.status, vec4(200, 200, 200, 255))
ed.push_style_color(ed.StyleColor.node_bg, color)
```
## Phase 3: Dependency Links
Focus: Draw lines between nodes
- [ ] Task 3.1: Create links for dependencies
- WHERE: `src/gui_2.py`
- WHAT: Draw lines from dependency to dependent
- HOW:
```python
for ticket in self.track.tickets:
for dep_id in ticket.depends_on:
# Create link: dep_id -> ticket.id
ed.link(f"link_{dep_id}_{ticket.id}", dep_id, ticket.id)
```
## Phase 4: Interactive Editing
Focus: Allow creating/removing dependencies
- [ ] Task 4.1: Handle link creation
- WHERE: `src/gui_2.py`
- WHAT: Detect new links and update Ticket
- HOW:
```python
# Check for new links
if ed.begin_create():
created = ed.get_created_link()
if created:
# Add dependency to ticket
pass
ed.end_create()
```
- [ ] Task 4.2: Handle link deletion
- WHERE: `src/gui_2.py`
- WHAT: Detect deleted links
- HOW: `ed.begin_delete()`, `ed.get_deleted_link()`
- [ ] Task 4.3: Validate DAG after edit
- WHERE: `src/gui_2.py`
- WHAT: Check for cycles
- HOW:
```python
from src.dag_engine import TrackDAG
temp_dag = TrackDAG(updated_tickets)
if temp_dag.has_cycle():
imgui.open_popup("Cycle Detected!")
# Revert change
```
## Phase 5: Testing
- [ ] Task 5.1: Write unit tests
- [ ] Task 5.2: Conductor - Phase Verification