Commit deafb0d
fix(ui): show a settings child listed under more than one parent value
The generated Update<setting>Children() emitted one independent if/else per
parent value, so a child appearing under two values (Compile Hosts, under both
'distcc' and 'nocc') was marked hidden by whichever branch did not match:
if (val == 'distcc') { ...show... }
else { hide; hiddenChildren.DistccHosts = 1; }
if (val == 'nocc') { if (mode == 0 || hiddenChildren.DistccHosts != 1) show }
else { hide; hiddenChildren.DistccHosts = 1; }
On page load UpdateChildSettingsVisibility() runs a hide pass then a show pass,
and the show pass is gated on that flag, so the row never came back. On the
onChange path (mode 0) the gate is skipped and the last emitted block won, which
is why one value appeared to work when the dropdown was changed but neither
survived a reload.
Replace the three copies of the emitter (checkbox, select, text) with one shared
PrintSettingChildrenFunction() that builds the show set for the current value
first and only hides children that are not in it. Cross-parent behaviour is
unchanged: a child claimed by two parents is still hidden if either hides it.
Also index hiddenChildren with brackets and escape dots in the row selector so a
plugin setting with a dotted child name cannot break the generated code.
Verified by rendering every setting that declares children through the real
generators, before and after, and simulating both passes: 115 child/value combos
on the load path and 115 on the onChange path differ only for the affected
setting, and 8 cross-parent combos are identical.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 174a546 commit deafb0d
1 file changed
Lines changed: 58 additions & 61 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1289 | 1289 | | |
1290 | 1290 | | |
1291 | 1291 | | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 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 | + | |
1292 | 1336 | | |
1293 | 1337 | | |
1294 | 1338 | | |
| |||
1312 | 1356 | | |
1313 | 1357 | | |
1314 | 1358 | | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
1319 | 1362 | | |
1320 | 1363 | | |
1321 | 1364 | | |
| |||
1324 | 1367 | | |
1325 | 1368 | | |
1326 | 1369 | | |
| 1370 | + | |
1327 | 1371 | | |
1328 | 1372 | | |
1329 | | - | |
1330 | | - | |
1331 | | - | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
1339 | | - | |
1340 | | - | |
1341 | | - | |
1342 | | - | |
1343 | | - | |
| 1373 | + | |
1344 | 1374 | | |
1345 | 1375 | | |
1346 | | - | |
1347 | | - | |
| 1376 | + | |
1348 | 1377 | | |
1349 | 1378 | | |
1350 | 1379 | | |
| |||
1435 | 1464 | | |
1436 | 1465 | | |
1437 | 1466 | | |
1438 | | - | |
1439 | | - | |
1440 | | - | |
| 1467 | + | |
| 1468 | + | |
1441 | 1469 | | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
| 1470 | + | |
1457 | 1471 | | |
1458 | | - | |
1459 | | - | |
| 1472 | + | |
1460 | 1473 | | |
1461 | 1474 | | |
1462 | 1475 | | |
| |||
1670 | 1683 | | |
1671 | 1684 | | |
1672 | 1685 | | |
1673 | | - | |
1674 | | - | |
1675 | | - | |
| 1686 | + | |
| 1687 | + | |
1676 | 1688 | | |
1677 | | - | |
1678 | | - | |
1679 | | - | |
1680 | | - | |
1681 | | - | |
1682 | | - | |
1683 | | - | |
1684 | | - | |
1685 | | - | |
1686 | | - | |
1687 | | - | |
1688 | | - | |
1689 | | - | |
1690 | | - | |
1691 | | - | |
| 1689 | + | |
1692 | 1690 | | |
1693 | | - | |
1694 | | - | |
| 1691 | + | |
1695 | 1692 | | |
1696 | 1693 | | |
1697 | 1694 | | |
| |||
0 commit comments