-
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
CB self icons #10006
CB self icons #10006
Conversation
- Fix node selection being visible (but glitched) while editing node. - Fix bug in CB positioning when editing a node at non-default zoom. - Fix disconnected edge hover allowing self-connection. - Consolidate some color logic in `nodeColors`
// When user, right after opening CB with source node types operator, we should | ||
// re-initialize input with it instead of dot at the end. |
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.
Could we keep this comment? It may be helpful, as what we do here is quite unusual.
const imports = ref<RequiredImport[]>([]) | ||
const processingAIPrompt = ref(false) | ||
const toastError = useToast.error() | ||
const sourceNode = ref<string>() |
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.
This is an identifier, I guess? Then please put that in the name (string could be theoretically ExpressionId, node's expression or whatever).
if (ctx.type === 'insert' && ctx.position === 0 && sourceNode.value) return entry.name | ||
if ( | ||
ctx.type === 'changeIdentifier' && | ||
ctx.identifier.inner.whitespaceStartInCodeParsed === 0 && | ||
sourceNode.value | ||
) | ||
return entry.name |
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.
I think we could have fewer exceptions of this kind, if we use a fullAst
computed value, i.e. parsed ${sourceNode}.${text}
. Then in places where we're returning new input, we could just skip ${sourceNode}.
prefix. As a bonus, the fullAst
could be published and used to create a new node.
But I do not treat it as a blocker, as it might be harder than I think. Or not actually cleaner.
() => | ||
graph.unconnectedEdge?.anchor.type === 'mouse' && |
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.
Perhaps instead of unconnectedEdge
we could have two fields: editedEdge
and componentBrowserEdge
of more specific type - here, for example, you would not have to check anchor type.
An additional note: if I understand this implementation, when someone will open CB without source node and type But this is a rare case for rather advanced users, so let's discuss it after merging. |
Pull Request Description
In the component browser input field, render the source node as an icon instead of its identifier; an edge connects the icon to the source node's output port.
Screen.Recording.2024-05-20.at.10.49.36.mov
Closes #9210.
Important Notes
nodeColors
.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.