fix: scope module zoom margin to labelled-dot anchors (#61) - #63
Merged
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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 innavigate_to_anchor()behindanchor_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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 tightzoomToFitSelectedfit they had before #62.Tests
test_no_margin_zoom_out_for_non_dot_anchor— asserts a non-Dot anchor triggerszoomToFitSelectedonce 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.