GUI Milestone 8a

This commit is contained in:
Joey Yakimowich-Payne 2026-01-30 07:04:40 -07:00
commit a52f82d67b
7 changed files with 586 additions and 31 deletions

View file

@ -159,37 +159,37 @@ A Qt6-based node editor GUI for warppipe using the QtNodes (nodeeditor) library.
- [x] Screenshot tests gated behind `WARPPIPE_GUI_VISUAL_TESTS` CMake option (default OFF)
- [x] `ctest --test-dir build` runs model + GUI tests
- [ ] Milestone 8a - Undo/Redo, Clipboard, and Keyboard Shortcuts
- [ ] Integrate `QUndoStack` via `BasicGraphicsScene::undoStack()`
- [ ] Undo/Redo already works for connection create/delete (built-in QtNodes `ConnectCommand`/`DisconnectCommand`)
- [ ] Verify Ctrl+Z / Ctrl+Shift+Z (or Ctrl+Y) work out of the box for connections
- [ ] Implement `DeleteVirtualNodeCommand : QUndoCommand`
- [ ] `redo()`: destroy virtual node via `Client::RemoveNode()`
- [ ] `undo()`: re-create virtual node via `Client::CreateVirtualSink/Source()` with same name/channels/rate
- [ ] Store node position and restore on undo
- [ ] Implement `deleteSelection()` for Del key
- [ ] Collect selected `NodeGraphicsObject` items from `m_scene->selectedItems()`
- [ ] Virtual nodes → push `DeleteVirtualNodeCommand` onto undo stack
- [ ] Non-virtual nodes → push `QtNodes::DeleteCommand` (removes from graph only, not PipeWire)
- [ ] Connection-only selection → push `QtNodes::DeleteCommand`
- [ ] Implement `copySelection()` (Ctrl+C)
- [ ] Serialize selected virtual nodes to JSON: stable_id, name, media_class, channels, rate, position
- [ ] Include links between selected nodes (source stable_id:port_name → target stable_id:port_name)
- [ ] Set `QClipboard` with custom MIME type `application/warppipe-virtual-graph`
- [ ] Implement `pasteSelection()` (Ctrl+V)
- [ ] Parse clipboard JSON, create new virtual nodes with " Copy" name suffix
- [ ] Position pasted nodes at offset from originals
- [ ] Deferred link resolution via `PendingPasteLink` queue (nodes may not exist yet)
- [ ] `tryResolvePendingLinks()` called on node add to wire up deferred links
- [ ] Implement `duplicateSelection()` (Ctrl+D) — copy + paste with (40, 40) offset
- [ ] Register keyboard shortcuts on `m_view`:
- [ ] Del → `deleteSelection()`
- [ ] Ctrl+C → `copySelection()`
- [ ] Ctrl+V → `pasteSelection()`
- [ ] Ctrl+D → `duplicateSelection()`
- [ ] Ctrl+L → auto-arrange + zoom fit
- [ ] Remove default QtNodes copy/paste actions to avoid conflicts
- [ ] Add tests for undo/redo command state (push command → undo → verify node re-created → redo → verify deleted)
- [x] Milestone 8a - Undo/Redo, Clipboard, and Keyboard Shortcuts
- [x] Integrate `QUndoStack` via `BasicGraphicsScene::undoStack()`
- [x] Undo/Redo already works for connection create/delete (built-in QtNodes `ConnectCommand`/`DisconnectCommand`)
- [x] Verify Ctrl+Z / Ctrl+Shift+Z (or Ctrl+Y) work out of the box for connections
- [x] Implement `DeleteVirtualNodeCommand : QUndoCommand`
- [x] `redo()`: destroy virtual node via `Client::RemoveNode()`
- [x] `undo()`: re-create virtual node via `Client::CreateVirtualSink/Source()` with same name/channels/rate
- [x] Store node position and restore on undo
- [x] Implement `deleteSelection()` for Del key
- [x] Collect selected `NodeGraphicsObject` items from `m_scene->selectedItems()`
- [x] Virtual nodes → push `DeleteVirtualNodeCommand` onto undo stack
- [x] Non-virtual nodes → push `QtNodes::DeleteCommand` (removes from graph only, not PipeWire)
- [x] Connection-only selection → push `QtNodes::DeleteCommand`
- [x] Implement `copySelection()` (Ctrl+C)
- [x] Serialize selected virtual nodes to JSON: stable_id, name, media_class, channels, rate, position
- [x] Include links between selected nodes (source stable_id:port_name → target stable_id:port_name)
- [x] Set `QClipboard` with custom MIME type `application/warppipe-virtual-graph`
- [x] Implement `pasteSelection()` (Ctrl+V)
- [x] Parse clipboard JSON, create new virtual nodes with " Copy" name suffix
- [x] Position pasted nodes at offset from originals
- [x] Deferred link resolution via `PendingPasteLink` queue (nodes may not exist yet)
- [x] `tryResolvePendingLinks()` called on node add to wire up deferred links
- [x] Implement `duplicateSelection()` (Ctrl+D) — copy + paste with (40, 40) offset
- [x] Register keyboard shortcuts on `m_view`:
- [x] Del → `deleteSelection()`
- [x] Ctrl+C → `copySelection()`
- [x] Ctrl+V → `pasteSelection()`
- [x] Ctrl+D → `duplicateSelection()`
- [x] Ctrl+L → auto-arrange + zoom fit
- [x] Remove default QtNodes copy/paste actions to avoid conflicts
- [x] Add tests for undo/redo command state (push command → undo → verify node re-created → redo → verify deleted)
- [ ] Milestone 8b - View and Layout Enhancements
- [ ] Add "Zoom Fit All" context menu action → `m_view->zoomFitAll()`
- [ ] Add "Zoom Fit Selected" context menu action → `m_view->zoomFitSelected()`