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
Allow node name to be auto-generated when added #3478
Conversation
Hi nick. This might be feature creep but I think 2 more features would make this even sweeter...
|
@Steve-Mcl you're quite right an action is the way to go. Having thought about it some more, I'm inclined to completely change the approach and remove the |
The consequence of moving to an Action approach is we no longer allows individual nodes to customise the behaviour:
In the live-stream where I put this together, a lot of people wanted 'flow' scoped number for the Debug nodes. That's a reasonable choice for that node type, but it wouldn't work (I don't believe) for Link nodes - which are more likely to want to reference each other across flows. On balance, I think going with globally scoped numbering is the best option. |
I have replaced the implementation with an action based approach and updated the PR description to match |
Nick, I've been running DEV with this change merged. I'm liking it :+1 That said, there is one frustruation.
Would you consider applying the auto name generation if a nodes Alternatively, we could set an |
Currently the copy/paste handling is the same as the import flow handling - and we wouldn't want to start renaming nodes in flows that are imported. That said, the import function does take some flags to customise its behaviour - such as whether to generate new Ids or not. So it would be feasible to add a flag to cause naming updates for paste actions only. |
I think the experience would be greatly improved if we did Nick. Are you ok with me raising an issue around this so its tracked? |
Does this also force new names into "old" nodes that have no name ? While I may want to name debug nodes I also like being able to see that it is set to msg.payload or msg.foobar or just msg etc |
No Dave, only newly added nodes & imported/pasted nodes without a name. It does mean however to see |
Yes please.
The 'rename on paste' should only happen if the existing name matches the auto-generated name pattern. It should not modify nodes with no name. |
With the current version in dev - If I have an existing node with no name - (showing msg.payload as label) - and copy/paste it to create another - it becomes "debug 1" - If I then copy paste that is creates another "debug 1". I would rather those actions were swapped... if blank - leave blank... if debug 1 then become debug 2... etc |
I may have lost track, but I don't think that is intended behaviour. I agree the expected behaviour should be to not change names unless they match the autogenerated name pattern. |
This is existing dev branch... not sure if @Steve-Mcl is still working on this branch. |
Nothing has been changed in |
Closes #3418
Proposed changes
The original proposal has been replaced by an action based approach
Adds a new action:
core:generate-node-names
When invoked, will apply a default name to the selected nodes.
<paletteLabel> <N>
whereN
is the next available integer that avoids a name clash. This is scoped to the whole editor - not just individual flows.It can also be invoked on an individual node to allow it to be used in a node's
onadd
function to generate a name when being added to the workspace.This PR adds
onadd
functions to thedebug
andlink in/out/call
nodes - as they all most benefit from having more human readable, distinct, default names.