fix: omit the voltage half of the fuse label when voltageRating is absent (#2833)#2834
fix: omit the voltage half of the fuse label when voltageRating is absent (#2833)#2834DPS0340 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
9ac0ae5 to
cd8d473
Compare
|
Housekeeping — rebased onto current Since I have several PRs open here now, a note on how they interact so none of this lands on you: Five of the seven are fully independent — they touch different files and merge in any order:
Two pairs conflict, and both are trivial:
Happy to do the merge myself: say the word and I'll combine any subset into a single PR, or rebase the losers as soon as the first one lands. I'd rather you not spend time on conflict resolution for my changes. I verified the above rather than assuming it — checked all 21 branch pairs for conflicts and confirmed each rebases cleanly onto |
cd8d473 to
5866812
Compare
Closes #2833.
A fuse declared with only
currentRating— which is the only required rating, so this is a fully supported way to write one — rendered a bare unit with no number:The fix
Both call sites interpolated the formatted value unconditionally, and
formatSiUnit(undefined)returns"", so the template collapsed to the unit suffix. Now the optional half is dropped instead:This mirrors
Resonator._getSchematicSymbolDisplayValue(), which already handles the same required/optional shape this way — I followed the existing convention rather than inventing one.NaNis covered as well asundefinedbecause the props accept strings:voltageRating="abc"goes throughparseFloatand would otherwise have produced"NaNpV".Verification
Fuses that do declare a voltage are untouched:
The new test bites. Reverting only
Fuse.ts:It asserts both the source fields and the schematic symbol values, and includes a two-rating fuse in the same board so a regression in either direction is caught.
Suite:
1257 pass / 0 fail(3 skipped suites unrelated).biome formatandtsc --noEmitclean for the touched files.About the 3 updated snapshots
They aren't collateral — they're the bug, captured. All three contain fuses with no
voltageRatingand were storing the broken label:schematic-text-bounding-box-fuse— four fuses atcurrentRating="2A", all showing2A / Vschematic-section-rp2040and-autolayout—<fuse name="F1" currentRating="500mA" />, showing500mA / VI rendered the bounding-box snapshot to confirm the labels now read
2Aand that the text bounding boxes shrink to match, rather than the label merely being blanked.Worth noting the existing fuse component test passes both ratings, which is why the optional path was never exercised.