Skip to content

ノード操作とスクロール可能なキャンバスを追加 - #18

Merged
Htkym merged 3 commits into
mainfrom
feature/node-copy-scrollable-canvas
Aug 24, 2026
Merged

ノード操作とスクロール可能なキャンバスを追加#18
Htkym merged 3 commits into
mainfrom
feature/node-copy-scrollable-canvas

Conversation

@Htkym

@Htkym Htkym commented Aug 24, 2026

Copy link
Copy Markdown
Owner

概要

  • 選択ノードと内部接続のコピー・貼り付けを追加
  • 接続ハンドルの判定を調整し、ノードを選択しやすく変更
  • キャンバスの縦横スクロール、パン、範囲選択を追加
  • Ctrl++ / Ctrl+-、ツールバー、コンテキストメニューの操作を追加
  • README、ユーザーマニュアル、リリースノートを更新
  • Microsoft Store 向けパッケージ版を 1.0.4.0 に更新

確認内容

  • x64 Debug ビルド成功
  • 165 テスト成功
  • 空白キャンバスの右クリックでクラッシュしないことを確認
  • x64 / ARM64、英語 / 日本語を含む 1.0.4.0 MSIX バンドルを生成・確認

Copilot AI lite review requested due to automatic review settings August 24, 2026 15:15
@Htkym
Htkym merged commit b3f6c06 into main Aug 24, 2026
5 checks passed
@Htkym
Htkym deleted the feature/node-copy-scrollable-canvas branch August 24, 2026 15:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 MainPageViewModel clipboard 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();
}
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