ノード操作とスクロール可能なキャンバスを追加 - #18
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
There is a confirmed re-entrancy bug risk in the resize-grip pointer release path (pointer capture release ordering) that can lead to double-execution of resize completion logic.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR extends Plotree’s editor UX by adding in-app copy/paste of selected nodes (including internal edges and referenced metadata), and by making the plot canvas scrollable in both axes with zoom/pan improvements.
Changes:
- Add
MainPageViewModelclipboard support (copy/paste with deep snapshots, ID remapping, metadata reconciliation, and undo/redo grouping). - Replace the canvas transform-based pan/zoom approach with a
ScrollViewer-backed world extent model (supports negative coordinates and stable zoom anchoring). - Add UI affordances (Edit menu items, toolbar buttons, context-menu actions, and keyboard accelerators) plus new tests/docs and a package version bump.
File summaries
| File | Description |
|---|---|
| tests/Plotree.Tests/MainPageViewModelTests.cs | Adds coverage for clipboard copy/paste behavior, undo/redo, deep snapshotting, and metadata remapping. |
| tests/Plotree.Tests/CanvasExtentCalculatorTests.cs | Adds tests for extent calculation with padding, negative coordinates, and viewport anchoring. |
| src/Plotree/Views/PlotCanvas.xaml.cs | Implements scrollable/zoomable canvas extents, updated gestures, zoom commands, and handle hit targets. |
| src/Plotree/Views/PlotCanvas.xaml | Wraps the world canvas in a ScrollViewer to enable horizontal/vertical scrolling. |
| src/Plotree/Views/EdgeVisual.cs | Updates edge geometry to account for zoom and world-origin translation. |
| src/Plotree/ViewModels/MainPageViewModel.cs | Implements in-process clipboard snapshot + paste mutation logic and command enablement. |
| src/Plotree/Strings/ja-JP/Resources.resw | Adds localized strings for Edit/Copy/Paste/Zoom UI and updated gesture help text. |
| src/Plotree/Strings/en-US/Resources.resw | Adds localized strings for Edit/Copy/Paste/Zoom UI and updated gesture help text. |
| src/Plotree/Services/CanvasExtentCalculator.cs | Introduces extent/origin calculator used to size/anchor the scrollable canvas. |
| src/Plotree/Package.appxmanifest | Bumps MSIX package version to 1.0.4.0. |
| src/Plotree/MainPage.xaml.cs | Adds copy/paste + zoom keyboard handlers and wires zoom buttons. |
| src/Plotree/MainPage.xaml | Adds Edit menu, toolbar buttons for copy/paste and zoom, and keyboard accelerators. |
| site/content/user-manual-ja.md | Updates Japanese manual for new clipboard and scroll/zoom gestures. |
| site/content/user-manual-en.md | Updates English manual for new clipboard and scroll/zoom gestures. |
| RELEASE_NOTES.md | Adds v1.0.4 release notes for new clipboard/scroll/zoom features and crash fix. |
| README.md | Updates feature list to include copy/paste and navigation improvements. |
| README.ja.md | Updates Japanese README with new gestures, clipboard feature, and manual link. |
Review details
- Files reviewed: 17/17 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1643
to
+1647
| UpdateWorldExtent(center, world); | ||
|
|
||
| WorldScrollViewer.ChangeView( | ||
| (world.X + _worldOrigin.X) * newZoom - center.X, | ||
| (world.Y + _worldOrigin.Y) * newZoom - center.Y, |
Comment on lines
747
to
751
| grip.ReleasePointerCaptures(); | ||
| _dragMode = DragMode.None; | ||
| _resizeNode = null; | ||
| _isGeometryGestureUpdating = false; | ||
|
|
| || !double.IsFinite(anchorViewportX) || !double.IsFinite(anchorViewportY) | ||
| || viewportWidth < 0 || viewportHeight < 0 || zoom <= 0 || padding < 0) | ||
| { | ||
| throw new ArgumentOutOfRangeException(nameof(zoom), "Canvas extent inputs must be finite and positive."); |
Comment on lines
+1529
to
+1532
| else if (!moved) | ||
| { | ||
| _viewModel?.ClearSelection(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
確認内容