Skip to content

Conversation

@johnnyshields
Copy link
Contributor

@johnnyshields johnnyshields commented Nov 5, 2025

Summary of Complete Refactoring

We successfully refactored the HUD flow diagram system with clean separation of concerns:

Architecture:

FlowDiagramFrame (viewport management)
├── @width, @height (viewport size)
├── Pan offsets & centering logic
├── ClippedTerminal wrapper
└── Wraps FlowDiagram

ClippedTerminal (boundary enforcement)
└── Clips all writes to viewport

FlowDiagram (pure renderer)
├── No viewport state (@width/@height removed)
├── Renders in coordinate space starting at (0,0)
├── Returns content dimensions: { width:, height: }
└── Zero clipping logic

Key Improvements:

✅ FlowDiagram is completely viewport-agnostic
✅ All clipping handled by ClippedTerminal
✅ Centering/panning managed by FlowDiagramFrame
✅ Zero redundancy between classes
✅ Clean naming (width/height instead of diagram_width/diagram_height)
✅ All 635 tests passing

@johnnyshields johnnyshields merged commit b46002f into main Nov 5, 2025
7 of 36 checks passed
@johnnyshields johnnyshields deleted the hud-improvements branch November 5, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants