GUI Milestone 7

This commit is contained in:
Joey Yakimowich-Payne 2026-01-30 06:44:18 -07:00
commit 7ec61e5759
3 changed files with 513 additions and 29 deletions

View file

@ -131,35 +131,33 @@ A Qt6-based node editor GUI for warppipe using the QtNodes (nodeeditor) library.
- [x] In --debug-screenshot-dir mode, capture on: initial load, node add, node remove, node ghost/unghost, connection add, connection remove
- [x] Verify: `warppipe-gui --screenshot /tmp/test.png` produces a valid PNG with visible nodes; headless mode works with QT_QPA_PLATFORM=offscreen
- [ ] Milestone 7 - GUI Tests
- [ ] Create `tests/gui/` directory and `warppipe_gui_tests.cpp` test file
- [ ] Add `warppipe-gui-tests` CMake target linking warppipe, Qt6::Widgets, Qt6::Test, QtNodes, Catch2
- [ ] Model unit tests (no display server needed, pure logic):
- [ ] WarpGraphModel: inject nodes via WARPPIPE_TESTING helpers → verify allNodeIds(), nodeData(Caption), nodeData(Style)
- [ ] WarpGraphModel: inject ports → verify portData(PortCount), portData(Caption) for correct port labels
- [ ] WarpGraphModel: inject links → verify allConnectionIds(), connectionExists()
- [ ] WarpGraphModel: ghost state tracking — mark node ghost → verify Opacity=0.6 in style, mark unghost → verify Opacity=1.0
- [ ] WarpGraphModel: title synthesis — node with application_name="Firefox" → caption="Firefox"; node with empty application_name → caption=name
- [ ] WarpGraphModel: port orientation — is_input=true ports map to PortType::In (left); is_input=false → PortType::Out (right)
- [ ] WarpGraphModel: node removal doesn't crash when connections exist
- [ ] WarpGraphModel: duplicate node ID handling (update vs reject)
- [ ] Connection logic tests:
- [ ] addConnection() with valid ports → succeeds, stored in model
- [ ] addConnection() with mismatched types (output→output) → connectionPossible() returns false
- [ ] deleteConnection() removes from model
- [ ] Ghost connections: connection to ghost node remains in model, isGhostConnection() returns true
- [ ] Screenshot smoke tests (require QT_QPA_PLATFORM=offscreen):
- [ ] Launch warppipe-gui with --screenshot → exit code 0, PNG file exists, file size > 0
- [ ] Launch with WARPPIPE_TESTING injected nodes → screenshot contains non-trivial content (file size > 10KB as heuristic)
- [ ] Launch with --debug-screenshot-dir → directory populated after state changes
- [ ] Integration tests with warppipe test harness:
- [ ] Create Client with WARPPIPE_TESTING → inject nodes/ports/links → construct WarpGraphModel → verify graph state matches injected data
- [ ] Inject node, then remove → verify ghost state in model
- [ ] Inject node, add rule, trigger policy check → verify model reflects auto-linked connections
- [ ] Add CTest integration:
- [ ] Model tests run without display server (always)
- [ ] Screenshot tests gated behind `WARPPIPE_GUI_VISUAL_TESTS` CMake option (default OFF)
- [ ] `ctest --test-dir build` runs model tests; `ctest --test-dir build -L visual` runs screenshot tests
- [x] Milestone 7 - GUI Tests
- [x] Create `tests/gui/` directory and `warppipe_gui_tests.cpp` test file
- [x] Add `warppipe-gui-tests` CMake target linking warppipe, Qt6::Widgets, QtNodes, Catch2
- [x] Model unit tests (no display server needed, pure logic):
- [x] WarpGraphModel: inject nodes via WARPPIPE_TESTING helpers → verify allNodeIds(), nodeData(Caption), nodeData(Style)
- [x] WarpGraphModel: inject ports → verify portData(PortCount), portData(Caption) for correct port labels
- [x] WarpGraphModel: inject links → verify allConnectionIds(), connectionExists()
- [x] WarpGraphModel: ghost state tracking — mark node ghost → verify isGhost, mark unghost → verify !isGhost
- [x] WarpGraphModel: title synthesis — node with description → caption=description; node with application_name="Firefox" → caption="Firefox"; fallback to name
- [x] WarpGraphModel: port orientation — is_input=true ports map to PortType::In; is_input=false → PortType::Out
- [x] WarpGraphModel: node removal doesn't crash when connections exist
- [x] WarpGraphModel: volume meter stream filtering (empty name + app_name skipped)
- [x] Connection logic tests:
- [x] Links from client appear as connections in model
- [x] connectionPossible() rejects invalid port indices and nonexistent nodes
- [x] deleteConnection() removes from model
- [x] Screenshot smoke tests (require QT_QPA_PLATFORM=offscreen):
- [x] Gated behind `WARPPIPE_GUI_VISUAL_TESTS` CMake option (default OFF)
- [x] Launch warppipe-gui with --screenshot → CTest verifies exit code 0
- [x] Integration tests with warppipe test harness:
- [x] Create Client with WARPPIPE_TESTING → inject nodes/ports/links → construct WarpGraphModel → verify graph state matches injected data
- [x] Inject node, then remove → verify ghost state in model
- [x] Inject node, remove, re-insert with same name → verify ghost reactivation
- [x] Add CTest integration:
- [x] Model tests run without display server (always)
- [x] Screenshot tests gated behind `WARPPIPE_GUI_VISUAL_TESTS` CMake option (default OFF)
- [x] `ctest --test-dir build` runs model + GUI tests
- [ ] Milestone 8 (Optional) - Advanced Features
- [ ] Add routing rule UI (separate panel or dialog)