fix(schematic): respect schTraceAutoLabelEnabled={false} to suppress port-net auto-labels#2248
Open
gsdali wants to merge 1 commit intotscircuit:mainfrom
Open
fix(schematic): respect schTraceAutoLabelEnabled={false} to suppress port-net auto-labels#2248gsdali wants to merge 1 commit intotscircuit:mainfrom
gsdali wants to merge 1 commit intotscircuit:mainfrom
Conversation
…port-net auto-labels Closes tscircuit#2243. `schTraceAutoLabelEnabled` was a tri-state prop in the type definitions but only the `true` case was wired up at runtime — for opting INTO net labels at complex multi-junction traces (in `Trace_doInitialSchematicTraceRender.ts`). Setting the prop to `false` had no observable effect, because the only consumer treated falsy (undefined or false) as "not opted in". The user-facing pain is that named-net connections (every chip pin tied to `net.V3_3` / `net.GND` / etc.) automatically get a `schematic_net_label` drawn at every endpoint — the canonical "label, not wire" rendering. Users wanted a way to opt out and got none. Wire `schTraceAutoLabelEnabled === false` (explicit, not undefined) into `Group_doInitialSchematicTraceRender` so that `insertNetLabelsForPortsMissingTrace` is skipped when the user explicitly opts out. The two existing call sites — early-return when no routable connections exist, and post-routing — both honour the opt-out. Tri-state semantics: - undefined (default) : existing behaviour, auto labels emitted - true : opt INTO labels for complex traces (existing, in Trace_doInitialSchematicTraceRender) - false : opt OUT of port-net auto-labels (NEW) Tests: - Add `tests/components/sch/sch-trace-autolabel-disabled.test.tsx`: - false → 0 schematic_net_labels for a chip on net.V3_3 / net.GND - unset → ≥1 schematic_net_label (existing default preserved) - Full-suite delta vs `main`: same flaky-test profile (1 fail in `tests/repros/repro81-panel-unnamed-pcb-group.test.tsx` which flakes under full-suite load on `main` too — passes in isolation). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Closes #2243.
schTraceAutoLabelEnabledis declared as a tri-state prop in the type definitions, but only thetruecase was wired up at runtime — for opting INTO net labels at complex multi-junction traces (inTrace_doInitialSchematicTraceRender.ts). Setting the prop tofalsehad no observable effect, because the only consumer treats falsy (undefined or false) as "not opted in".The user-facing pain: named-net connections (every chip pin tied to
net.V3_3/net.GND/ etc.) automatically get aschematic_net_labeldrawn at every endpoint — the canonical "label, not wire" rendering. Users wanted a way to opt out and got none.Fix
Wire
schTraceAutoLabelEnabled === false(explicit, not undefined) intoGroup_doInitialSchematicTraceRenderso thatinsertNetLabelsForPortsMissingTraceis skipped when the user explicitly opts out. Both call sites (early-return when no routable connections, and post-routing) honour the opt-out.Tri-state semantics
undefined(default)trueTrace_doInitialSchematicTraceRender)falseTest plan
tests/components/sch/sch-trace-autolabel-disabled.test.tsx:false→0schematic_net_labelrecords for a chip onnet.V3_3/net.GND≥1schematic_net_label(existing behaviour preserved)bun test tests/components/sch: 2/2 passmain: same flaky-test profile (1 fail intests/repros/repro81-panel-unnamed-pcb-group.test.tsxwhich flakes under full-suite load onmaintoo — passes in isolation; not caused by this change)What this PR does NOT solve
truecase behaviour is unchanged from current semantics (only opts into complex-trace labels).applyNetLabelPlacements) are not affected. Reasonable next step is to extend the opt-out to those paths too, but it'd touch more code and is left as follow-up.Why this scope
The most surprising part of the original report was the prop has zero observable effect when set to false. After this PR, setting
falseproduces an immediately-visible difference (no more port-net auto-labels). Users who want "named nets render as wires, not labels" still need other mechanisms (port-to-port connections via arrayconnections), but at least they have one knob that makes a visible difference.🤖 Generated with Claude Code