Commit 0b0af2f
committed
fix(ui): Mermaid diagram rendering improvements - class arrows and mindmap parser
**Problems:**
1. Class diagram relationships rendered but arrows invisible
2. Mindmap root showed 'root((Project' instead of 'Project'
**Solutions:**
1. **Class Diagram Relationship Arrows:**
- ClassDiagramRenderer: Changed .stroke() to .fill() for RelationshipSymbol
- Arrows with .closeSubpath() need .fill() to be visible (same pattern as flowchart fix)
- Result: Inheritance/composition/association arrows now visible
2. **Mindmap Root Label Parsing:**
- MermaidParser: Fixed parseMindmap() to handle double parentheses
- Old: trimmingCharacters(in: CharacterSet(charactersIn: "()")) - removes all ( and )
- New: while loop to strip matching pairs of parentheses
- Handles: 'root', 'root(text)', 'root((text))' correctly
- Result: 'root((Project))' now displays as 'Project'
**Files Modified:**
- Sources/UserInterface/Chat/Mermaid/ClassDiagramRenderer.swift (line ~146)
- Sources/UserInterface/Chat/Mermaid/MermaidParser.swift (line ~1000)
**Testing:**
✅ Build: PASS
⏳ Class Diagram: Needs user testing with Animal/Dog example
⏳ Mindmap: Needs user testing with Project hierarchy
**Known Remaining Issues:**
- State diagram (#4) not rendering at all
- Mindmap children still not visible (layout issue, not parser)
- ER diagrams could use arrow indicators1 parent a624bdb commit 0b0af2f
2 files changed
Lines changed: 8 additions & 4 deletions
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
994 | 994 | | |
995 | 995 | | |
996 | 996 | | |
997 | | - | |
998 | | - | |
999 | | - | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
1000 | 1004 | | |
1001 | 1005 | | |
1002 | 1006 | | |
| |||
0 commit comments