Commit Graph

10 Commits

Author SHA1 Message Date
Claude Bot
07571b64be review: address feedback — expand cut to include full outgoing structure (all hops) 2026-03-23 19:58:40 +00:00
Claude Bot
ed30804839 feature: implement cut and paste functionality (closes #8)
- Add CutStore (Zustand) to store cut node IDs, node data, edges, and source graph ID
- Update graphToDot() to render cut nodes with dashed grey style for visual indication
- Add 'Cut' action to node context menu; 'Paste' action to empty-area context menu
- Cut logic: captures selected nodes (or right-clicked node if none selected) plus
  all nodes reachable by outgoing edges from those nodes; clears selection afterwards
- Paste logic: adds cut nodes/edges to target graph, removes them from source graph
  in GraphsStore; pasting on the same graph as the cut source cancels the cut
- Graph re-renders automatically when cutNodeIds changes via useCutStore subscription
- Clear cut store on file load for consistency
- Add E2E tests covering: Cut menu visibility, Paste menu visibility, cut styling,
  linked-node inclusion, cross-subgraph paste, source-graph cleanup, same-graph cancel

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 15:57:28 +00:00
0eea473670 feature: add Create Node action for orphaned node creation
Right-clicking on empty graph area (outside any node or edge) now shows
a context menu with a single 'Create Node' option. Clicking it adds a new
node with a random label and no edges, allowing the user to wire it up
manually afterwards.

- NodeContext gains isEmptyArea flag to distinguish empty-area from node
  right-clicks
- Container div contextmenu handler covers the white space below the SVG;
  SVG-level handler covers empty space within the rendered graph
- node contextmenu handler calls stopPropagation so the SVG handler never
  fires for node clicks; SVG handler also guards via target.closest check
- NodeContextMenu renders emptyAreaItems (Create Node only) vs nodeItems
  (Rename / Subgraph / Remove) based on the flag
- randomWordList extracted as a named export so NodeContextMenu can reuse
  the same word bank
- Three new Playwright e2e tests cover: empty-area menu shows only Create
  Node, created node is orphaned (no new edges), node right-click does not
  show Create Node
2026-03-19 13:25:54 +01:00
92ef00e78f feature: navigation highlighting in tree 2026-03-16 19:35:35 +01:00
a643f24452 tsc fixes and rules 2026-02-28 01:10:14 +01:00
ae02080563 layers tree I 2025-11-11 23:31:22 +01:00
4092b12aef Nodes selection store, linking and unlinking nodes 2025-11-11 13:01:32 +01:00
cd4963a4bd refactor node context menu III, added zustand 2025-11-11 01:25:59 +01:00
8e630839a0 refactor context menu II 2025-11-10 21:33:12 +01:00
80f9044729 refactor context menu to separate component 2025-11-09 23:21:33 +01:00