Commit 7c490c0
fix(schedule10): mirror the ballast D branch and disable the N-discarded inputs
Addresses both "worth fixing in this PR" items from SScholefield's review of #325.
1. Ballast method D had the same echo mismatch N was fixed for
-------------------------------------------------------------
buildStabilizing mirrored the server coercion only on N, so on D the request
carried whatever material had been picked BEFORE D was chosen -- the combo is
disabled on D, but the form still held the old value -- and
Schedule10Service:557-560 then silently replaced it with NA. That is precisely
the mismatch the N mirroring exists to prevent, reached by the other branch.
The material decision now goes through ballastForcesMaterialNa, which already
covered both branches, and is made independently of the figure zeroing. Only the
FIGURES are N-specific: D stores its figures as submitted, and still does.
2. Method N left the discarded inputs enabled
---------------------------------------------
The four dimensions plus actual cost and other transfer stayed editable while
buildStabilizing sent 0 for them, even though the material combo was disabled in
exactly the same situation. They are now disabled too, so the rule reads the same
way everywhere.
stTtTransfer is deliberately NOT in that set -- the server keeps it on the N
branch -- and the hint now names the affected fields and says so, rather than
leaving the reporter to work out which figures "dimensions, actual cost and other
transfer" meant.
The set lives in validation.ts as BALLAST_ZEROED_FIELDS, beside the builder that
zeroes them, so the disable list and the request body cannot drift apart.
Tests
-----
Three added, and all three were mutation-tested -- each fix reverted, the new
test confirmed failing, then restored:
- D sends NA for the material while every figure survives (this one fails with
the old ballastZeroesFigures gate).
- N disables the six discarded inputs and leaves TtT Transfer editable.
- D disables only the material, leaving the figures editable.
Plus a drift guard: the fields buildStabilizing actually zeroes on N are compared
against BALLAST_ZEROED_FIELDS, so the disable list cannot silently diverge from
the request in either direction.
Verified: 202 tests green across Schedule 10 and every file this branch touches;
full frontend suite 1045/1046 with the one failure PRE-EXISTING (Schedule8
Helicopter, passes in isolation); build clean; lint and Prettier clean.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 93fcb4c commit 7c490c0
4 files changed
Lines changed: 164 additions & 11 deletions
File tree
- frontend/src/components/schedule10
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
75 | 88 | | |
76 | 89 | | |
77 | 90 | | |
| |||
130 | 143 | | |
131 | 144 | | |
132 | 145 | | |
133 | | - | |
| 146 | + | |
134 | 147 | | |
135 | 148 | | |
136 | 149 | | |
| |||
167 | 180 | | |
168 | 181 | | |
169 | 182 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | 183 | | |
176 | 184 | | |
177 | 185 | | |
| |||
315 | 323 | | |
316 | 324 | | |
317 | 325 | | |
318 | | - | |
319 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
320 | 329 | | |
321 | 330 | | |
322 | 331 | | |
| |||
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1307 | 1307 | | |
1308 | 1308 | | |
1309 | 1309 | | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
1310 | 1363 | | |
1311 | 1364 | | |
1312 | 1365 | | |
| |||
Lines changed: 64 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
722 | 723 | | |
723 | 724 | | |
724 | 725 | | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
725 | 789 | | |
726 | 790 | | |
727 | 791 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
191 | 205 | | |
192 | 206 | | |
193 | 207 | | |
| |||
197 | 211 | | |
198 | 212 | | |
199 | 213 | | |
200 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
201 | 219 | | |
202 | 220 | | |
203 | 221 | | |
| |||
580 | 598 | | |
581 | 599 | | |
582 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
583 | 610 | | |
584 | 611 | | |
585 | 612 | | |
586 | | - | |
| 613 | + | |
587 | 614 | | |
588 | 615 | | |
589 | 616 | | |
| |||
596 | 623 | | |
597 | 624 | | |
598 | 625 | | |
599 | | - | |
| 626 | + | |
600 | 627 | | |
601 | 628 | | |
602 | 629 | | |
| |||
0 commit comments