Skip to content

Conversation

@Alxiice
Copy link
Contributor

@Alxiice Alxiice commented Jan 20, 2026

Description of the PR

Fix a little but that occurred when we switched the status
fail
failing node action position
kindofworking
-> fixed

Description of the bug

The event when the height is changed was not catched so what happened was :

  • We launch the computation : upstream nodes are locked
  • We select the node that is done, so all the buttons in the NodeActions are hidden because it is locked -> the height change to 0
  • We select the computing node, buttons show up
    • The updatePosition is called on the delegate change and it is set before we update the height
    • The height is recomputed (to 33)
    • However we didn't have a onHeightChanged function therefore the NodeAction position is off

Special point of interest during the review

I added the onHeightChanged which fixes the bug. However one little thing seems off to me :

  • the updatePosition is called twice : one with height=0 and a second time with height=33. We can see a small glitch because of these 2 updates. I tried to avoid that by using Qt.callLater but this didn't work. If you have an idea on something we could do, it would be great !

@Alxiice Alxiice self-assigned this Jan 20, 2026
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.80%. Comparing base (cca5cc5) to head (55bc4ac).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2981   +/-   ##
========================================
  Coverage    79.80%   79.80%           
========================================
  Files           64       64           
  Lines         8674     8674           
========================================
  Hits          6922     6922           
  Misses        1752     1752           

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

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 fixes a positioning bug in NodeActions that occurred when switching node status, where the action buttons would be misaligned due to height changes not triggering position updates.

Changes:

  • Added onHeightChanged handler to trigger position updates when the NodeActions height changes
  • Updated all position update calls to use Qt.callLater for deferred execution to handle timing issues
  • Added null safety check for chunks in ChunksListView to prevent index out of range errors

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
meshroom/ui/qml/Controls/NodeActions.qml Added height change handler and converted position updates to use Qt.callLater for proper timing
meshroom/ui/qml/GraphEditor/ChunksListView.qml Added null check for chunks before accessing its properties

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (currentIndex >= chunks.count)
if (!chunks)
currentIndex = -1
else if (chunks && currentIndex >= chunks.count)
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition chunks && is redundant here since it's already in the else-if branch that only executes when chunks is truthy (the if statement on line 21 handles the null/falsy case).

Suggested change
else if (chunks && currentIndex >= chunks.count)
else if (currentIndex >= chunks.count)

Copilot uses AI. Check for mistakes.
@Alxiice Alxiice force-pushed the dev/fix_nodeactions_position branch from 0083441 to 55bc4ac Compare January 21, 2026 10:57
@cbentejac cbentejac added this to the Meshroom 2026.1.0 milestone Jan 21, 2026
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.

This needs to be tested but I feel like the suggested changes are solving the graphical update issues, and with them we see only one update instead of two when selecting another node.

}

onHeightChanged: {
Qt.callLater(actionHeader.updatePosition)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Qt.callLater(actionHeader.updatePosition)
actionHeader.updatePosition()


onWidthChanged: {
updatePosition()
Qt.callLater(actionHeader.updatePosition)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Qt.callLater(actionHeader.updatePosition)
actionHeader.updatePosition()

if (y < 0) {
y = 0
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before the if (!selectedNodeDelegate || !draggable) return, I would add:


if (width == 0 && height == 0) {
    actionItemsRow.visible = true
    return
} else if (width == 0 || height == 0) {
    actionItemsRow.visible = false
    return
}
actionItemsRow.visible = true

if (!selectedNodeDelegate || !draggable) return
...

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants