Repository navigation
fix(schematic): traverse descendant groups in matchpack schematic layout - #5932
Open
RainyMarks wants to merge 1 commit into
Open
RainyMarks wants to merge 1 commit into
RainyMarks wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Fixes #5573
Problem
When schematic groups (
A,B) are nested inside separate physical/PCB wrapper groups (Left,Right) on a shared schematic sheet withschAutoLayoutEnabled, schematic auto-layout leaves their components overlapping at(0, 0).Cause
In
lib/components/primitive-components/Group/applySchematicMatchPackLayoutToTree.ts, nested group handling queried only directschematic_componentrows matchingschematic_group_id: schematicGroup.schematic_group_id. Because eachschematic_componentbelongs to its immediate parentschematic_group(AorB), the wrapper groups (Left,Right) had zero direct components:getNestedGroupMatchpackProxyfell back to a default2 x 2box centered at(0, 0)instead of measuring descendant components.schematic_groupcenters, leavingR1andR2stacked at(0, 0).Fix
collectNestedGroupSchematicElementsinlib/components/primitive-components/Group/applySchematicMatchPackLayoutToTree.tsto walk each nested group'sCircuitJsonTreeNodesubtree within the activeschematicSheetId(stopping at collapsedshow_as_schematic_boxchild groups) and return its rootschematic_group, descendantschematic_groups, and descendantschematic_components.collectNestedGroupSchematicElementswhen computing nested group matchpack proxies/pins, building connectivity groups, and applying solved position deltas—shifting descendantschematic_components (along with their ports, texts, and schematic primitives) as well as descendantschematic_groupcenters while preserving PCB group structure and placement.tests/groups/group-schematic-matchpack-nested-pcb-groups1.test.tsx(reproducing Schematic auto-layout overlaps groups nested under separate PCB groups #5573 and verifying PCB placement is preserved) andtests/groups/group-schematic-matchpack-nested-pcb-groups2.test.tsx(multi-sheet scoping with multi-component nested groups).Testing
bun test tests/groups/ tests/features/matchpack-solver-events.test.tsx tests/repros/repro88-schAutoLayoutEnabled.test.tsx tests/repros/repro139-multi-sheet-chips-auto-layout-together.test.tsx tests/repros/repro70-schematicbox-rotation-autolayout.test.tsx tests/repros/repro161-power-section-autolayout/ tests/repros/repro163-esp32-testpoint-autolayout/ tests/repros/repro164-rp2040-swd-status-led-layout.test.tsx tests/repros/repro183-battery-charger-status-led-component-overlap.test.tsx --timeout 30000(32 pass, 1 skip, 0 fail)bun test tests/scripts/ tests/components/primitive-components/schematic-section-autolayout-no-section.test.tsx tests/components/primitive-components/schematic-symbol-two-sheets-mosfet-opamp.test.tsx --timeout 30000(4 pass, 0 fail)bun run check:class-exportsbunx biome format(0 issues on modified files)bunx tsc --noEmit(0 errors)bun run build && bun run smoke-test:dist