Skip to content

NOISSUE - Group boxes reserve note width and label room - #115

Closed
nyagamunene wants to merge 2 commits into
absmach:mainfrom
nyagamunene:schem-group-box-extents
Closed

nyagamunene wants to merge 2 commits into
absmach:mainfrom
nyagamunene:schem-group-box-extents

Conversation

@nyagamunene

@nyagamunene nyagamunene commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What

Schematic group boxes were sized from part bodies only. On the buck board that caused three problems. A long note line ran out of its box into the next region. Value text (1.5M, 47uF) and pin-stub labels (EN) sat on or outside the box edge. And nothing flagged any of it, because E-SYNTH-SCHEM-013 only compares box against box.

Change (crates/synth-layout/src/lib.rs)

  • A box now reaches across its group's widest note line (group_note_width, using the shared text_run_width estimate), and the region packer reserves the same width so neighbours do not overlap.
  • Left and right padding is GROUP_BOX_SIDE_PAD (5 mm plus 6 mm label room) instead of 5 mm. On boards with named groups, any leftover ungrouped parts form a region with no box, and that region now reserves this room too (12 mm wider, 6 mm further right). Boards with no groups are unchanged.
  • Two new tests: long_group_note_stays_inside_its_box_and_clear_of_neighbours (failed before the change, and also fails if the packer widening is removed) and group_box_leaves_label_room_beside_its_parts.

Pictures (buck board from #110)

Before:

before

After:

after

Test status

  • cargo test --workspace is green except two local-only failures that also fail on clean main. multisheet_kicad_loads fails because KiCad libraries are missing here. golden_svg fails because the local KiCad version differs from the committed fingerprints.
  • Two layout snapshots are updated (docs_blocks schematic and env_logger_layout). Their x positions shift.
  • fixtures/kicad-reference/svg/golden.json is not updated. Only ref_led_driver moves because of this change, and its new fingerprint has to come from CI, since local hashes differ for every design.

Not fixed here

  • The group caption can still sit on top of the first part's wire or reference text (the UVLO and BUCK titles).
  • Labels are covered by a fixed 6 mm margin, not measured per pin.
  • Group captions now sit 11 mm inside the box's left edge (it was 5 mm), because they are anchored at the first part, not at the box.
  • Note width uses the shared text_run_width estimate (0.72 em per character), so a line of very wide glyphs could still overrun.
  • The buck board itself is not in the tests, because its parts only exist in SYN-67 - Add a 24 V buck board with power-good and thermal copper to the Class B matrix #110. A second commit adds three integration tests on the real examples/env_logger.synth: boxes do not overlap, group notes sit inside their box, and parts keep 6 mm label room. Only the label-room test fails without the box change. The other two are guards.

Schematic group boxes were sized from part bodies only, so long note lines ran out of their box into the next region and value text / pin labels sat on the box edge. The box and the region packer now reserve the widest note line and 6 mm of label room left and right (regions with no box, packed beside grouped ones, get the same room). Moves two layout snapshots and the ref_led_driver SVG fingerprint (the fingerprint must come from CI).

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
@nyagamunene
nyagamunene force-pushed the schem-group-box-extents branch from 9a0e8b8 to 8e9498e Compare October 11, 2026 23:36
Three tests on examples/env_logger.synth through the public layout output: group boxes do not overlap, every group note line sits inside its box, and part bodies keep 6 mm of label room to the box's side edges. Only the label-room test fails without the box change; the other two guard the design against future packing regressions.

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

@rodneyosodo rodneyosodo 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.

Test shard 1/3 fails on golden_svg (ref_battery_charger 6115 paths vs 6134) and the PR is CONFLICTING. The new side pad changes every group box's drawn geometry, so the manifest and the remaining layout snapshots have to be re-recorded together.

/// net labels sit outside the body, so a body-sized box leaves them on
/// its edge. Ungrouped regions packed beside grouped ones reserve the
/// same room, so their own labels get it too.
const GROUP_BOX_SIDE_PAD: f64 = GROUP_BOX_PAD + 6.0;

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.

GROUP_BOX_SIDE_PAD widens every drawn group box by 12 mm, but fixtures/kicad-reference/svg/golden.json (and snapshots beyond docs_blocks/env_logger) are not re-recorded, so golden_svg cannot pass. Regenerate from CI (SYNTH_REGEN_SVG_GOLDEN=1) and rebase the conflicting layout/snapshots.

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