-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Another set of small fixes #8946
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
85a67b0
Enter works in numeric and text input
farmaazon bb1c836
Select node after inserting
farmaazon a908a81
Consider visualizations when seatching for place for node
farmaazon ec10dfa
Fixes
farmaazon ecf0807
Fix test and check if selected
farmaazon 78bc65f
Reduce test flakiness
farmaazon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,9 +118,10 @@ const interactionBindingsHandler = interactionBindings.handler({ | |
// used as the source of the placement. This means, for example, the selected nodes when creating from a selection | ||
// or the node that is being edited when creating from a port double click. | ||
function environmentForNodes(nodeIds: IterableIterator<NodeId>): Environment { | ||
const nodeRects = [...graphStore.nodeRects.values()] | ||
const nodeRects = graphStore.visibleNodeAreas | ||
console.log(nodeRects) | ||
const selectedNodeRects = [...nodeIds] | ||
.map((id) => graphStore.nodeRects.get(id)) | ||
.map((id) => graphStore.vizRects.get(id) ?? graphStore.nodeRects.get(id)) | ||
.filter((item): item is Rect => item !== undefined) | ||
const screenBounds = graphNavigator.viewport | ||
const mousePosition = graphNavigator.sceneMousePos | ||
|
@@ -207,9 +208,9 @@ const graphBindingsHandler = graphBindings.handler({ | |
let right = -Infinity | ||
let bottom = -Infinity | ||
const nodesToCenter = | ||
nodeSelection.selected.size === 0 ? graphStore.currentNodeIds : nodeSelection.selected | ||
nodeSelection.selected.size === 0 ? graphStore.db.nodeIdToNode.keys() : nodeSelection.selected | ||
for (const id of nodesToCenter) { | ||
const rect = graphStore.nodeRects.get(id) | ||
const rect = graphStore.vizRects.get(id) ?? graphStore.nodeRects.get(id) | ||
if (!rect) continue | ||
left = Math.min(left, rect.left) | ||
right = Math.max(right, rect.right) | ||
|
@@ -418,7 +419,14 @@ function onComponentBrowserCommit(content: string, requiredImports: RequiredImpo | |
} else { | ||
// We finish creating a new node. | ||
const metadata = undefined | ||
graphStore.createNode(componentBrowserNodePosition.value, content, metadata, requiredImports) | ||
const createdNode = graphStore.createNode( | ||
componentBrowserNodePosition.value, | ||
content, | ||
metadata, | ||
requiredImports, | ||
) | ||
console.log(createdNode) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another one |
||
if (createdNode) nodeSelection.setSelection(new Set([createdNode])) | ||
} | ||
} | ||
// Finish interaction. This should also hide component browser. | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug log