Skip to content

fix: scope module zoom margin to labelled-dot anchors (#61) - #63

Merged
charlesangus merged 1 commit into
mainfrom
fix/issue-61-scope-margin-to-labelled-dots
Jun 15, 2026
Merged

charlesangus merged 1 commit into
mainfrom
fix/issue-61-scope-margin-to-labelled-dots

Conversation

@charlesangus

Copy link
Copy Markdown
Owner

Follow-up to #62. Relates to #61.

Problem

The #62 margin fix applied the post-fit zoom-out in navigate_to_anchor() to every anchor type it handles, not just labelled dots. Issue #61 is specifically about "the nodes above a labelled dot", and non-Dot anchors were already framed correctly — the extra zoom-out over-loosened their framing (reported as breaking the previously-good behavior).

The separate navigate_to_backdrop() path (BackdropNodes in the picker) was never touched and remains unchanged.

Fix

Gate the margin zoom-out on anchor_node.Class() == 'Dot'. Labelled-dot modules get the breathing room; all other anchor types keep the tight zoomToFitSelected fit they had before #62.

nuke.zoomToFitSelected()
if anchor_node.Class() == 'Dot':
    fitted_scale = nuke.zoom()
    fitted_center = nuke.center()
    nuke.zoom(fitted_scale * MODULE_ZOOM_MARGIN_FACTOR, fitted_center)

Tests

  • The two margin tests now navigate to a Dot anchor.
  • Added test_no_margin_zoom_out_for_non_dot_anchor — asserts a non-Dot anchor triggers zoomToFitSelected once and no post-fit zoom-out.

Full suite: 485 passed.

UAT

Pending — maintainer to verify in Nuke: labelled-dot module navigation keeps its margin; non-Dot anchor navigation is back to the previous (correct) tight framing.

The #61 margin fix applied the post-fit zoom-out to every anchor type
navigate_to_anchor() handles, not just labelled dots. That over-zoomed
the framing for non-Dot anchors, which were already framed correctly.

Issue #61 is specifically about "the nodes above a labelled dot", so gate
the margin zoom-out on anchor_node.Class() == 'Dot'. Other anchor types
keep the tight zoomToFitSelected fit they had before. The separate
navigate_to_backdrop() path is unaffected (it was never changed).

Tests: margin tests now use a Dot anchor; added a negative test asserting
non-Dot anchors trigger no post-fit zoom-out.
Copilot AI review requested due to automatic review settings June 15, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 corrects the module “margin zoom-out” behavior introduced in #62 by scoping it to labelled-dot modules only, restoring the prior tight framing for non-Dot anchor types while preserving the extra breathing room requested in issue #61.

Changes:

  • Gate the post-zoomToFitSelected() zoom-out in navigate_to_anchor() behind anchor_node.Class() == 'Dot'.
  • Update the two existing margin tests to navigate to a Dot anchor.
  • Add a new regression test ensuring non-Dot anchors do not trigger the post-fit margin zoom-out.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
anchor.py Applies the margin zoom-out only for Dot anchors in navigate_to_anchor().
tests/test_anchor_navigation.py Adjusts margin tests to use Dot anchors and adds a non-Dot regression test.

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

@charlesangus
charlesangus merged commit 0a0223c into main Jun 15, 2026
1 check passed
@charlesangus
charlesangus deleted the fix/issue-61-scope-margin-to-labelled-dots branch June 15, 2026 21:48
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.

2 participants