-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[ui] Rename node #2953
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
base: develop
Are you sure you want to change the base?
[ui] Rename node #2953
Conversation
|
abbc49f to
a417207
Compare
cbentejac
left a comment
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.
One minor change is needed on the QML side, otherwise everything looks good to me!
I do think it'd be good to add some unit tests though, as it looks like a feature that may unintentionally break without realising it otherwise.
a417207 to
56d8033
Compare
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.
Pull request overview
This PR implements a node renaming feature in the UI, allowing users to double-click on node names in the NodeEditor to rename them. The feature includes undo/redo support via GraphCommand and updates node labels accordingly.
Changes:
- Added interactive node name editing in the NodeEditor with validation and keyboard shortcuts
- Implemented RenameNodeCommand for undo/redo support
- Modified node name property to be mutable with change notifications
- Extended data structures to support renaming operations
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| meshroom/ui/qml/GraphEditor/NodeEditor.qml | Adds custom title component with editable TextField for node name and display logic for node type |
| meshroom/ui/qml/GraphEditor/Node.qml | Updates node label binding to refresh when node name changes |
| meshroom/ui/qml/Controls/Panel.qml | Adds support for custom title components via Loader |
| meshroom/ui/graph.py | Implements renameNode slot with name sanitization logic |
| meshroom/ui/commands.py | Adds RenameNodeCommand for undoable node renaming |
| meshroom/core/node.py | Changes name property from constant to notify signal and fixes nameToLabel for names without underscores |
| meshroom/core/graph.py | Implements renameNode method to update node names and emit change signals |
| meshroom/common/qt.py | Adds rename method to QObjectListModel |
| meshroom/common/core.py | Adds rename method to DictModel |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2b6aa45 to
c0542f8
Compare
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.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 13 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| root.nodeLabel = "" | ||
| // Restore binding to root.node.label | ||
| root.nodeLabel = Qt.binding(function() { return root.node.label; }) |
Copilot
AI
Jan 14, 2026
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.
Similar to the pattern in NodeEditor.qml, the empty string assignment followed by Qt.binding() restoration is used to force a property update. This is the same fragile workaround pattern. While this works, it would be better to have a consistent approach across the codebase. Consider refactoring both occurrences to use a more explicit state management approach.
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.
yeah but I don't have another way yet
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 would propably use the declarative way by creating a property on the core.BaseNode:
nodeLabel = Property(str, getLabel, notify=nodeNameChanged)
So you can directly use this property in the qml:
text: node.nodeLabel
One advantage is that anywhere you are using this property, any change on it will send the signal, so you don't have to explicitly connect in the qml.
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 have issues making this working because nodeLabel is already a property that binds to another signal (internal properties) and it doesn't prevent the issues I had when cancelling the textEdit editing which was the initial reason why I had to force reset the binding.
I will text you directly to see if I missed something in the approach here
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.
Right, not so obvious problem....
| root.nodeLabel = "" | ||
| // Restore binding to root.node.label | ||
| root.nodeLabel = Qt.binding(function() { return root.node.label; }) |
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 would propably use the declarative way by creating a property on the core.BaseNode:
nodeLabel = Property(str, getLabel, notify=nodeNameChanged)
So you can directly use this property in the qml:
text: node.nodeLabel
One advantage is that anywhere you are using this property, any change on it will send the signal, so you don't have to explicitly connect in the qml.
| property variant nodeName: node !== null ? node.name : undefined | ||
| property string displayNodeName: node !== null ? node.name : "" | ||
| property string validatedNodeName: displayNodeName | ||
| property string displayNodeType: "" | ||
|
|
||
| function updateNodeNameDisplay() { | ||
| if (_reconstruction.selectedNode) { | ||
| const nodeName = _reconstruction.selectedNode.name | ||
| root.displayNodeName = nodeName | ||
| root.validatedNodeName = nodeName | ||
| // Set the display node type only if it is not contained in the node name | ||
| const nodeType = _reconstruction.selectedNode.nodeType | ||
| root.displayNodeType = nodeName.startsWith(nodeType + "_") ? "" : nodeType | ||
| } | ||
| } | ||
|
|
||
| Connections { | ||
| target: _reconstruction | ||
| function onSelectedNodeChanged() { | ||
| updateNodeNameDisplay() | ||
| } | ||
| } | ||
|
|
||
| onNodeNameChanged: { | ||
| updateNodeNameDisplay() | ||
| } | ||
|
|
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.
It would be preferable to use the properties of the BaseNode (nodeType, and the suggested in the other comment nodeLabel) ?
You can remove all those imperative declaractions, and use the power of reactivity qml offer (see comments below)
| text: "(" + root.displayNodeType + ")" | ||
| visible: root.displayNodeType !== "" && _reconstruction.selectedNode |
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.
No need to check selectedNode, the component activeness is already linked on the selection, I guess.
You can directly use node, and it's reactive properties
visible: node.nodeType
text: `(${node.nodeType})`6ae4f6c to
4039a2c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2953 +/- ##
===========================================
+ Coverage 79.80% 79.83% +0.03%
===========================================
Files 64 64
Lines 8674 8718 +44
===========================================
+ Hits 6922 6960 +38
- Misses 1752 1758 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…t specified index
…+ other fixes suggested by copilot)
e59751f to
9dde23e
Compare
Why this PR ?
We miss a way to rename the node name. Node names are usually decided when we create the node by the graph part, but there is no way to set the name.

There is a label system that was used but that has only an impact on the display, it doesn't really changes the node name
Finally now if the name differs from the node type the node type is displayed on parenthesis :
I find this cleaner because previously it was the "default label" (so it would have been
TestCLNode_Nhere)Features implemented
Here is a gif that shows the new rename system


another gif to show the update on the label
GraphCommandso undo/redo should workSpecial point of attention for reviewers
NodeEditor.qml cancelNodeNameChange: is it ok to set an empty string to force the update ? I haven't found a better way to make this work but Copilot flagged it as a fragile workaround. I'm open to suggestions on this pointRemaining TODOs