Skip to content

Conversation

@Alxiice
Copy link
Contributor

@Alxiice Alxiice commented Dec 11, 2025

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 :
image
I find this cleaner because previously it was the "default label" (so it would have been TestCLNode_N here)

Features implemented

Here is a gif that shows the new rename system
test_rename_node
another gif to show the update on the label
test_rename_node_2

  • double click on the node editor to rename
  • the name is changed
  • it is added in the GraphCommand so undo/redo should work
  • if the set name doesn't start with the node type (like "NodeType_") then the node type is precised in a label after
  • On the graph editor if no specific label is set, then the label is updated to the new node name

Special point of attention for reviewers

  • Compute/Submit : When the node is locked, the node renaming is supposed to be locked so this should prevent most issues
  • Graph editor : Renaming the node should set the correct label too
  • try to close/reopen meshroom to make sure everything works well
  • 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 point

Remaining TODOs

  • add tests

@Alxiice Alxiice self-assigned this Dec 11, 2025
@Alxiice Alxiice added the feature new feature (proposed as PR or issue planned by dev) label Dec 12, 2025
@Alxiice Alxiice added this to the Meshroom 2026.1.0 milestone Dec 12, 2025
@servantftransperfect
Copy link
Contributor

  • There is no restriction on characters used. It accepts spaces, quotes, double quotes. did you test everything whenre there is those characters ?
  • When partially editing the name, nothing works well. (_1 is added each time, the label is kept empty, etc etc)

@Alxiice Alxiice force-pushed the dev/rename_node branch 5 times, most recently from abbc49f to a417207 Compare January 8, 2026 16:05
Copy link
Contributor

@cbentejac cbentejac left a 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.

Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

Comment on lines +94 to +96
root.nodeLabel = ""
// Restore binding to root.node.label
root.nodeLabel = Qt.binding(function() { return root.node.label; })
Copy link

Copilot AI Jan 14, 2026

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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

Copy link
Contributor

@nicolas-lambert-tc nicolas-lambert-tc Jan 16, 2026

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.

Copy link
Contributor Author

@Alxiice Alxiice Jan 21, 2026

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

Copy link
Contributor

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....

@alicevision alicevision deleted a comment from codecov bot Jan 15, 2026
Comment on lines +94 to +96
root.nodeLabel = ""
// Restore binding to root.node.label
root.nodeLabel = Qt.binding(function() { return root.node.label; })
Copy link
Contributor

@nicolas-lambert-tc nicolas-lambert-tc Jan 16, 2026

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.

Comment on lines 24 to 50
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()
}

Copy link
Contributor

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)

Comment on lines 205 to 206
text: "(" + root.displayNodeType + ")"
visible: root.displayNodeType !== "" && _reconstruction.selectedNode
Copy link
Contributor

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})`

@Alxiice Alxiice force-pushed the dev/rename_node branch 2 times, most recently from 6ae4f6c to 4039a2c Compare January 21, 2026 10:57
@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 80.43478% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.83%. Comparing base (d78b127) to head (9dde23e).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
meshroom/common/qt.py 12.50% 7 Missing ⚠️
meshroom/common/core.py 83.33% 1 Missing ⚠️
meshroom/core/node.py 66.66% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature new feature (proposed as PR or issue planned by dev)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants