Skip to content

Graph Editor: Add backdrop button to navigation toolbar with selection-aware creation#3011

Open
Copilot wants to merge 5 commits intodevelopfrom
copilot/add-backdrop-button-to-toolbar
Open

Graph Editor: Add backdrop button to navigation toolbar with selection-aware creation#3011
Copilot wants to merge 5 commits intodevelopfrom
copilot/add-backdrop-button-to-toolbar

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

Description

Adds a sticky_note_2 icon button to the Graph Editor's bottom-left navigation toolbar to create Backdrop nodes. When nodes are selected, the backdrop is sized and positioned to wrap around them; otherwise it is created at the viewport center. The create+resize operation produces a single undo stack entry.

Features list

  • Add "Add Backdrop" (sticky_note_2) button to the Graph Editor navigation toolbar
  • When nodes are selected, create the backdrop around their bounding box (with gridSpacing padding on all sides)
  • When no nodes are selected, create backdrop at viewport center with default size
  • Single undo stack entry for the combined create+resize operation

Implementation remarks

Bounding box uses node.nodeWidth/nodeHeight, falling back to uigraph.layout.nodeWidth/nodeHeight (160×120) for regular nodes whose size properties return 0. Padding uses uigraph.layout.gridSpacing (40px) for consistency with the layout system.

A new addBackdropNode(position, width, height) slot was added to UIGraph in graph.py. It uses groupedGraphModification to wrap node creation and nodeWidth/nodeHeight attribute setting atomically — avoiding the nested macro that would result from calling resizeNode (which already wraps itself):

@Slot(QPoint, int, int, result=QObject)
def addBackdropNode(self, position, width, height):
    with self.groupedGraphModification("Add Backdrop"):
        node = self.addNewNode("Backdrop", position)
        if node.hasInternalAttribute("nodeWidth"):
            self.setAttribute(node.internalAttribute("nodeWidth"), width)
        if node.hasInternalAttribute("nodeHeight"):
            self.setAttribute(node.internalAttribute("nodeHeight"), height)
    return node

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

… toolbar

Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add button for creating backdrop in graph editor Add backdrop creation button to Graph Editor navigation toolbar Feb 23, 2026
Copilot AI requested a review from fabiencastan February 23, 2026 18:58
Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot AI changed the title Add backdrop creation button to Graph Editor navigation toolbar Graph Editor: Add backdrop button to navigation toolbar, create around selection Feb 23, 2026
Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot AI changed the title Graph Editor: Add backdrop button to navigation toolbar, create around selection Graph Editor: Add backdrop button to navigation toolbar with selection-aware creation Feb 23, 2026
Copilot AI requested a review from fabiencastan February 23, 2026 19:26
@fabiencastan fabiencastan force-pushed the copilot/add-backdrop-button-to-toolbar branch from 1784268 to d5a348a Compare February 23, 2026 19:40
@fabiencastan fabiencastan marked this pull request as ready for review February 23, 2026 19:40
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.99%. Comparing base (43a24bb) to head (d5a348a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3011   +/-   ##
========================================
  Coverage    81.99%   81.99%           
========================================
  Files           69       69           
  Lines         9315     9315           
========================================
  Hits          7638     7638           
  Misses        1677     1677           

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

@fabiencastan fabiencastan added this to the Meshroom 2026.1.0 milestone Feb 24, 2026
@fabiencastan fabiencastan added the feature new feature (proposed as PR or issue planned by dev) label Feb 24, 2026
@Alxiice Alxiice self-requested a review February 27, 2026 17:25
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.

2 participants