Skip to content

Allow singleton node creation in landscape Quick Edit#586

Open
jonschull wants to merge 4 commits intomainfrom
feature/singleton-node-creation
Open

Allow singleton node creation in landscape Quick Edit#586
jonschull wants to merge 4 commits intomainfrom
feature/singleton-node-creation

Conversation

@jonschull
Copy link
Owner

Summary

  • Type a name in the From field, leave To empty, click Add → creates standalone node
  • New nodes immediately appear in the datalist autocomplete, so edges can be added without save/reload
  • Undo support for singleton creation
  • Fixes pre-existing hasUnsaved bug where undo always cleared the unsaved flag even when other ops remained

Closes #585

Test plan

  • Type name in From, leave To empty, click Add → node appears with toast
  • Type same name again → alert "already exists" + zoom to node
  • Click Undo → node removed, datalist updated
  • Create singleton "Alice", then create edge Alice→Bob → works without save/reload
  • Save, Re-Load → singleton persists

🤖 Generated with Claude Code

jonschull and others added 4 commits March 1, 2026 22:26
Type a name in the From field, leave To empty, click Add to create a
standalone node. The datalist autocomplete refreshes immediately so
edges can be added to the new node without save/reload.

- doAdd(): singleton branch when From filled, To empty
- doUndo(): node_add undo type removes the node
- Fix hasUnsaved bug: undo now checks pendingOps.length instead of
  always clearing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Without this, undoing a singleton creation left the node name
in the autocomplete datalist even though the node was removed
from the DataSet. Found during functional testing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add focusOnNode() that zooms to scale 1.0 with a 150px rightward
offset so the selected node lands in the clear area, not under the
toolbar/curation panel. Briefly pauses physics during the 600ms
animation so it doesn't fight the zoom.

Applied to: search box selection (From/To datalist), singleton
creation, and duplicate node reveal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixed 150px offset pushed nodes offscreen on narrow viewports
(375px iPhone). Now scales: 150px on desktop (>900px), 75px on
tablet (600-900px), 0 on phone (<600px).

Tested across 5 viewport sizes — node stays on screen at all sizes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Allow singleton node creation in landscape Quick Edit

1 participant