@floless/app 0.124.1 → 0.125.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,7 +41,7 @@
41
41
  svg{display:block;touch-action:none;flex:none}
42
42
  #zoombar{position:absolute;left:12px;bottom:12px;display:flex;align-items:center;gap:8px;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:6px 10px;box-shadow:0 4px 14px rgba(0,0,0,.45);z-index:5}
43
43
  #zoombar button{padding:1px 9px;font-size:15px}
44
- #zoombar input[type=range]{width:120px;padding:0;accent-color:var(--brand)}
44
+ #zoombar input[type=range]{width:120px} /* SIZING only — the theming is the global input[type=range] rule below */
45
45
  /* placed-detail inspector (Slice 4): ft-in fields in a row + a themed opacity slider (no native widgets) */
46
46
  .detrow{display:flex;gap:6px;margin:2px 0}
47
47
  .detf{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0;font-size:11px;color:var(--mut)}
@@ -49,10 +49,10 @@
49
49
  /* F14 definition-points: local-frame coord row — reuses the #csStat.local cyan wash (no new colour) */
50
50
  .dp-local{background:rgba(34,211,238,.06);border:1px solid rgba(34,211,238,.35);border-radius:6px;padding:4px 4px 2px}
51
51
  .dp-local .detf span{color:#22d3ee}
52
- #detOpacity{accent-color:var(--brand);flex:1;min-width:0}
52
+ #detOpacity{flex:1;min-width:0} /* SIZING only — the theming is the global input[type=range] rule below */
53
53
  #zoombar #zPct{min-width:40px;text-align:right;color:var(--mut);font-variant-numeric:tabular-nums}
54
54
  /* Connection Component breadcrumb (Slice A) — a floating chip over the 3D canvas, same recipe as #zoombar. */
55
- #connCrumb{position:absolute;left:50%;top:48px;transform:translateX(-50%);display:none;align-items:center;gap:1px;max-width:min(72%,560px);background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:4px 10px;box-shadow:0 4px 14px rgba(0,0,0,.45);z-index:58;font-size:12px;white-space:nowrap;overflow:hidden} /* below #m3dBar (top:12,h~29,z:59); z:58 keeps it clickable above the dim-label chips (57) */
55
+ #connCrumb{position:absolute;left:50%;top:48px;transform:translateX(-50%);display:none;align-items:center;gap:1px;max-width:min(72%,560px);background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:4px 10px;box-shadow:0 4px 14px rgba(0,0,0,.45);z-index:58;font-size:12px;white-space:nowrap;overflow:hidden} /* below #m3dBar (top:12,h~29,z:59); z:58 keeps it clickable above the model-glued label chips, which sit under the 3D chrome at z:3-4 (#614) */
56
56
  #connCrumb .seg{color:var(--mut);cursor:pointer;padding:1px 4px;border-radius:4px;background:none;border:0;font:inherit;max-width:260px;overflow:hidden;text-overflow:ellipsis}
57
57
  #connCrumb .seg:hover{color:var(--text);text-decoration:underline}
58
58
  #connCrumb .seg.cur{color:var(--brand);font-weight:600;cursor:default;text-decoration:none}
@@ -129,10 +129,72 @@
129
129
  NOTE for the guard: verify-native-controls deliberately cannot see inside a conditional @media, so
130
130
  this block neither satisfies nor weakens it — the unconditional rules above are still what it
131
131
  reads. (Raised by the Codex review on #592.) */
132
+ /* RANGE sliders go the same route, for the same measured reason and after the same mistake. All THREE
133
+ of this page's sliders were themed with `accent-color` and nothing else — `#zoombar
134
+ input[type=range]`, `#m3dRefsBody .refdet input[type=range]`, and `#detOpacity` (line ~52, the
135
+ placed-detail inspector's, built into #panel at ~line 5213) — and accent-color was never the
136
+ treatment. It tints the THUMB and the FILLED part of the track and leaves the rest as the UA widget:
137
+ measured in Chromium here as a WHITE bar across this dark panel, the same hole accent-color leaves
138
+ on an unchecked checkbox. And ALL THREE fell through to the generic `select,input` above, none of
139
+ them being a box: `#detOpacity` and `#m3dRefsBody .refdet input[type=range]` identically — 30px tall,
140
+ 6px of padding, a 1px #475569 border around the native slider — and `#zoombar input[type=range]`
141
+ partially, since its `padding:0` overrode only that one component and it kept the border and the
142
+ #0f172a background, measured at 18px. (An earlier version of this note singled #detOpacity out as
143
+ "worse off again"; it was not worse off, it was one of three. Corrected by the adversarial review on
144
+ #618, second pass, which measured all three.)
145
+ So the track and thumb are drawn rather than tinted, unscoped, and both engines get their own rules:
146
+ `appearance:none` DELETES Chromium's thumb unless ::-webkit-slider-thumb re-declares it, exactly as
147
+ it deletes the radio's dot, and Firefox does not implement that pseudo-element.
148
+ WHAT THIS COSTS, said out loud rather than left for the next reader to discover: accent-color also
149
+ tinted the FILLED part of the track, and Chromium has no pseudo-element for it, so these three
150
+ sliders no longer show how far along the value is — the rail is one uniform var(--line). That is a
151
+ real trade (a correct dark control, minus a cue), not a pure leak fix. Firefox DOES expose the
152
+ filled portion as ::-moz-range-progress, so it is authored below; leaving it unauthored would have
153
+ put a UA default over an authored track, which is the one-engine asymmetry this file rejects
154
+ everywhere else. Restoring the cue in Chromium needs JS (a gradient recomputed on input) and is a
155
+ separate change.
156
+ NOTE ON THE FIREFOX CLAIMS HERE: no Firefox is installed on the machines this was written and
157
+ reviewed on. Every Chromium statement in this block is measured; every Firefox one is reasoned from
158
+ the spec and should be treated as such until someone runs it.
159
+ DO NOT group the two vendors in one selector list. `…::-webkit-slider-thumb,…::-moz-range-thumb{…}`
160
+ is discarded WHOLESALE by both engines — an unrecognised pseudo-element invalidates the entire list
161
+ — so the pair that looks like it covers everything covers nothing. Each vendor gets its own rule
162
+ here and in the forced-colors block below for that reason, and verify-native-controls rejects the
163
+ grouped form outright.
164
+ The three per-container rules keep their SIZING and have dropped the now-inert accent-color, so
165
+ nothing reads as if that were the remedy. */
166
+ input[type=range]{appearance:none;-webkit-appearance:none;width:100%;height:14px;padding:0;border:0;
167
+ background:transparent;cursor:pointer}
168
+ input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:var(--line)}
169
+ input[type=range]::-moz-range-track{height:4px;border-radius:2px;background:var(--line)}
170
+ input[type=range]::-moz-range-progress{height:4px;border-radius:2px;background:var(--brand)}
171
+ /* margin-top centres the 12px thumb on the 4px track: (4-12)/2. Chromium paints the thumb 12px
172
+ INCLUDING its 1px border, so the border is not an extra -1 — measured at 8x on both surfaces, -5px
173
+ sat the thumb a whole pixel high. Firefox is expected to centre ::-moz-range-thumb itself. */
174
+ input[type=range]::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:12px;height:12px;
175
+ margin-top:-4px;border-radius:50%;background:var(--brand);border:1px solid var(--bg)}
176
+ input[type=range]::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:var(--brand);
177
+ border:1px solid var(--bg)}
178
+ input[type=range]:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
132
179
  @media (forced-colors: active){
133
180
  input[type=checkbox],input[type=radio]{appearance:revert;-webkit-appearance:revert;width:revert;height:revert;
134
181
  border:revert;background:revert;display:revert;padding:revert}
135
182
  input[type=checkbox]::before,input[type=radio]::before{content:none}
183
+ /* Same hand-back as the box controls above: in forced colours the OS picks every colour, so the
184
+ authored track/thumb collapse to system colours and the UA slider is the accessible one.
185
+ EVERY authored property is reverted, pseudo-elements included. Reverting only the input left the
186
+ track pinned at 4px and the thumb still suppressed by its own `-webkit-appearance:none`, so the
187
+ control collapsed to a 120x4 sliver with no handle — measured in Chromium at forced-colors:active,
188
+ and WORSE than the 16px native widget these users had before this block existed. */
189
+ input[type=range]{appearance:revert;-webkit-appearance:revert;width:revert;height:revert;
190
+ padding:revert;border:revert;background:revert}
191
+ input[type=range]::-webkit-slider-runnable-track{height:revert;border-radius:revert;background:revert}
192
+ input[type=range]::-moz-range-track{height:revert;border-radius:revert;background:revert}
193
+ input[type=range]::-moz-range-progress{height:revert;border-radius:revert;background:revert}
194
+ input[type=range]::-webkit-slider-thumb{appearance:revert;-webkit-appearance:revert;width:revert;
195
+ height:revert;margin-top:revert;border-radius:revert;background:revert;border:revert}
196
+ input[type=range]::-moz-range-thumb{width:revert;height:revert;border-radius:revert;background:revert;
197
+ border:revert}
136
198
  }
137
199
  input[type=number]{-moz-appearance:textfield;appearance:textfield}
138
200
  input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
@@ -388,8 +450,12 @@
388
450
  .conf-body{padding:0 14px 14px;overflow:auto;flex:1;min-height:0}
389
451
  .chip{display:inline-block;padding:1px 6px;border-radius:4px;font-size:10px;border:1px solid var(--line);color:var(--mut);margin:0 3px 3px 0}
390
452
  .chip.assumed,.chip.weak{border-color:#713f12;color:#fbbf24} .chip.fail{border-color:#7f1d1d;color:#fca5a5}
453
+ /* Human-confirmed. The same #166534/#86efac pair as the confidence report's `verified` band
454
+ (BANDPILL.verified) and the inspector's Mark-verified button — the TOKENS are shared, not the
455
+ treatment: this one is outlined like its .chip.fail/.chip.assumed siblings, BANDPILL's is filled. */
456
+ .chip.verified{border-color:#166534;color:#86efac}
391
457
  tr.confrow{cursor:pointer} .conf-expand{color:var(--mut);font-size:12px;line-height:1.6;background:#0b1220}
392
- .ftab td .combo{padding:4px 6px} .ftab .rea{color:var(--mut);font-size:12px}
458
+ .ftab td .combo{padding:4px 6px} .ftab .rea{color:var(--mut);font-size:12px} .ftab .vcell{white-space:nowrap}
393
459
  .ftab-inp{background:#0f172a;color:var(--text);border:1px solid #475569;border-radius:4px;padding:4px 6px;width:100%;font:13px system-ui}
394
460
  .ftab-inp:focus{outline:none;border-color:var(--brand)}
395
461
  .ftab .cdel{padding:3px 7px;font-size:11px} .ftab .csrc{white-space:nowrap}
@@ -415,6 +481,10 @@
415
481
  .cbuilds .cwarn{display:inline-block;margin-left:6px;padding:0 5px;border-radius:4px;font-size:10px;
416
482
  border:1px solid #7f1d1d;color:#fca5a5;cursor:default}
417
483
  .connset{opacity:.55} .rfichip{display:inline-block;min-width:18px;height:18px;line-height:18px;text-align:center;background:#7f1d1d;color:#fecaca;border-radius:9px;font-size:11px;padding:0 5px}
484
+ /* #628: a human-confirmed row's number chip goes green. Colour alone is the SCAN cue only — the row also
485
+ carries a text "✓ Verified" pill in its own column, which is what a screen reader and a colour-blind
486
+ reader get. Same #166534/#86efac pair as .chip.verified above. */
487
+ .rfichip.verified{background:#166534;color:#86efac}
418
488
  .mbackdrop{position:absolute;inset:0;background:rgba(2,8,23,.62)}
419
489
  .mpanel{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:10px;width:min(880px,92vw);max-height:86vh;display:flex;flex-direction:column;box-shadow:0 20px 60px rgba(0,0,0,.6)}
420
490
  .mhead{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--line)}
@@ -435,6 +505,10 @@
435
505
  .ftab td{padding:7px 10px;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}
436
506
  .ftab tbody tr:hover{background:#0b1220} .ftab .gcell{font-weight:600;color:var(--brand)}
437
507
  tr.rfi-row-focused{background:rgba(127,29,29,.28);transition:background-color .6s ease} tr.rfi-row-focused td:first-child{box-shadow:inset 3px 0 0 #fecaca}
508
+ /* #628: the focus wash is the RFI danger palette, which would say "urgent" over a row whose own chip just
509
+ said "handled". On a verified row it becomes the verified pair instead — the row is still the one you
510
+ arrived at, without the contradiction. Two classes beat one, so this wins without !important. */
511
+ tr.rfi-row-focused.rfi-verified{background:rgba(22,101,52,.28)} tr.rfi-row-focused.rfi-verified td:first-child{box-shadow:inset 3px 0 0 #86efac}
438
512
  #comboPop{position:fixed;z-index:30;background:var(--panel);border:1px solid #475569;border-radius:6px;max-height:240px;overflow:auto;box-shadow:0 8px 24px rgba(0,0,0,.5);display:none}
439
513
  #comboPop .opt{padding:6px 10px;cursor:pointer;font-size:13px;color:var(--text);white-space:nowrap}
440
514
  #comboPop .opt:hover,#comboPop .opt.active{background:#334155}
@@ -730,7 +804,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
730
804
  circle.handle.ep-end{fill:#f472b6;stroke:#0b1220;stroke-width:2}
731
805
  .epdot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;vertical-align:middle}
732
806
  /* 3D-only floating chrome (parity with AWARE viewer-3d): toolbar TL, legend BL, ViewCube BR */
733
- #m3dBar{position:absolute;top:12px;left:12px;right:12px;display:none;flex-wrap:wrap;gap:6px;align-items:center;z-index:59} /* bounded to the stage so narrow windows wrap this local toolbar instead of widening the whole document; above floating dim-label chips (57), below toasts (60) */
807
+ #m3dBar{position:absolute;top:12px;left:12px;right:12px;display:none;flex-wrap:wrap;gap:6px;align-items:center;z-index:59} /* bounded to the stage so narrow windows wrap this local toolbar instead of widening the whole document; above the model-glued label chips (z:3-4, under the 3D chrome — #614), below toasts (60) */
734
808
  #m3dBar .seg-group,#m3dBar>button{box-shadow:0 4px 14px rgba(0,0,0,.45)}
735
809
  #m3dBar>button{font-size:12px;padding:5px 9px}
736
810
  #m3dBar .m3dwrap{position:relative;display:inline-flex}
@@ -882,7 +956,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
882
956
  #m3dRefsBody .refdet{padding:6px 6px 8px;margin:2px 0 6px;border-left:1px solid var(--line);display:flex;flex-direction:column;gap:6px}
883
957
  #m3dRefsBody .refdet .drow{display:flex;align-items:center;gap:6px}
884
958
  #m3dRefsBody .refdet .dlab{flex:none;color:var(--mut);font-size:11px;min-width:52px}
885
- #m3dRefsBody .refdet input[type=range]{accent-color:var(--brand);flex:1;min-width:0}
959
+ #m3dRefsBody .refdet input[type=range]{flex:1;min-width:0} /* SIZING only — theming is the global rule */
886
960
  #m3dRefsBody .refdet .dval{flex:none;min-width:34px;text-align:right;font-variant-numeric:tabular-nums;color:var(--mut);font-size:11px}
887
961
  #m3dRefsBody .refdet input[type=text]{height:24px;font-size:11px}
888
962
  #m3dRefsBody .refdet .dnote{color:var(--mut);font-size:11px;line-height:1.45}
@@ -1514,7 +1588,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1514
1588
  <div class=mpanel><div class=mhead><b>Connection library</b><div style="display:flex;gap:8px;align-items:center"><button id=connNew>+ New row</button><button id=connClose>✕</button></div></div>
1515
1589
  <div class=conf-filter><span class=glab>Platform</span><div class=grp id=connPlatGrp><button class=on data-plat=tekla>Tekla</button><button data-plat=sds2>SDS2</button><button data-plat=revit>Revit</button></div><span class=hint style="margin:0">The design detail# is platform-neutral; the component id is per-platform.</span></div>
1516
1590
  <div style="overflow:auto;flex:1;padding:14px;scrollbar-width:thin">
1517
- <table class=ftab id=connTable><thead><tr><th style="width:24%">Type</th><th style="width:24%">Detail #</th><th id=connCompHead style="width:24%">Tekla id</th><th style="width:18%">Source</th><th style="width:10%"></th></tr></thead><tbody id=connBody></tbody></table>
1591
+ <table class=ftab><thead><tr><th style="width:24%">Type</th><th style="width:24%">Detail #</th><th id=connCompHead style="width:24%">Tekla id</th><th style="width:18%">Source</th><th style="width:10%"></th></tr></thead><tbody id=connBody></tbody></table>
1518
1592
  </div></div></div>
1519
1593
  <div id=framesModal><div class=mbackdrop id=framesBackdrop></div>
1520
1594
  <div class=mpanel><div class=mhead><b>Moment frame schedule</b><button id=framesClose>✕</button></div>
@@ -1552,9 +1626,9 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1552
1626
  <button type=button id=riPickToggle class=pilllink style="display:none" aria-expanded=false aria-controls=riPick>Load only part of this file ▸</button>
1553
1627
  <div id=riPick style="display:none">
1554
1628
  <div id=riPickNote style="display:none"></div>
1555
- <div class=cat-hdr id=riStoreyHdr><span class=cat-label>Storeys</span><span class=cat-count id=riStoreyCount></span><button type=button class=cat-tog id=riStoreyAll data-state=on data-tip="Select or clear every storey"></button></div>
1629
+ <div class=cat-hdr><span class=cat-label>Storeys</span><span class=cat-count id=riStoreyCount></span><button type=button class=cat-tog id=riStoreyAll data-state=on data-tip="Select or clear every storey"></button></div>
1556
1630
  <div class=reftree id=riStoreyList></div>
1557
- <div class=cat-hdr id=riTypeHdr><span class=cat-label>Types</span><span class=cat-count id=riTypeCount></span><button type=button class=cat-tog id=riTypeAll data-state=on data-tip="Select or clear every type"></button></div>
1631
+ <div class=cat-hdr><span class=cat-label>Types</span><span class=cat-count id=riTypeCount></span><button type=button class=cat-tog id=riTypeAll data-state=on data-tip="Select or clear every type"></button></div>
1558
1632
  <div class=reftree id=riTypeList></div>
1559
1633
  </div>
1560
1634
  <div id=riNoBreak style="display:none"></div>
@@ -2461,8 +2535,7 @@ function main() {
2461
2535
  *
2462
2536
  * v2's schema CLOSED both of those. Running v1's repair pass over a v2 document therefore does exactly the
2463
2537
  * wrong thing in both directions, and it is not theoretical — it is what the schema check measured:
2464
- * - it ADDS keys v2 forbids: `prop_labels.vis2d`/`vis3d` (v1's per-view label visibility) and
2465
- * `views[].projection` (v2 keeps the projection inside `camera.proj`);
2538
+ * - it ADDS keys v2 forbids: `views[].projection` (v2 keeps the projection inside `camera.proj`);
2466
2539
  * - it DROPS a key v2 requires: `views[].generated.axisId`, because v1's generated-view provenance is
2467
2540
  * keyed by label and elevation, and a canonical grid is referenced by stable axis id instead.
2468
2541
  * The second is data loss, and both land before the user has done anything — so the first save is refused
@@ -2470,6 +2543,12 @@ function main() {
2470
2543
  *
2471
2544
  * A v2 document does not need the pass: it arrives SERVER-VALIDATED (P7b validates schema plus referential
2472
2545
  * integrity on every PUT), which is a stronger guarantee than any of these clamps.
2546
+ *
2547
+ * EXCEPT `sanitizePropLabels`, WHICH NOW RUNS ON BOTH (#614). It was on this list for one key —
2548
+ * `prop_labels.vis2d`/`vis3d`, v1's per-view label visibility, which v2's closed `propLabels` refused.
2549
+ * The schema carries both now, so nothing it writes is forbidden, and skipping it is what left
2550
+ * `C.prop_labels` possibly absent on a v2 document while the label readers dereference `pl.props`. See
2551
+ * its call site for the full argument.
2473
2552
  */
2474
2553
  if(!MODEL_V2)C.member_styles=sanitizeMemberStyles(C.member_styles); // v2 arrives closed + validated; v1 needs repair
2475
2554
  let P, X0,Y0,X1,Y1, FT, RB64, EXTX, EXTY, profs, NO_PLAN_VIEW=false; // per-plan, set by setPlan()
@@ -2578,6 +2657,52 @@ function posDefault(m){
2578
2657
  const z1=(m.ends&&m.ends[1]&&m.ends[1].tos!=null)?m.ends[1].tos:defaultTOS;
2579
2658
  const dz=Math.abs((z0||0)-(z1||0))*25.4, horiz=Math.hypot(m.wp[1][0]-m.wp[0][0],m.wp[1][1]-m.wp[0][1])*k;
2580
2659
  return dz>horiz*0.5774?'middle':'top';}
2660
+ // Effective HORIZONTAL profile position — where the work-line sits ACROSS the section. No heuristic:
2661
+ // absent = centred, which is what every member did before the field existed. MIRROR of
2662
+ // server/contract-to-scene.ts planePosition().
2663
+ function posHDefault(m){return (m.positionH==='left'||m.positionH==='right')?m.positionH:'middle';}
2664
+ // Does this member have a PLAN direction to take a left/right from? `leftDir = ẑ × d̂` is degenerate for
2665
+ // a plumb member, so a column or a plumb brace has no left or right at all. m.wp is display PIXELS in
2666
+ // BOTH model versions (v2's projectMember writes px), so it converts with the same k as posDefault before
2667
+ // comparing — MIRROR of the bake's DEGENERATE_MM (1 mm) threshold in server/contract-to-scene.ts
2668
+ // planeOffset(). KEEP IN LOCK-STEP: the inspector must offer the control exactly where the bake honours it.
2669
+ function hasPlanDir(m){
2670
+ if(!m||m.role==='column'||!Array.isArray(m.wp)||m.wp.length<2)return false;
2671
+ const k=304.8/((P&&P.pt_per_ft>0)?P.pt_per_ft:1);
2672
+ return Math.hypot(m.wp[1][0]-m.wp[0][0],m.wp[1][1]-m.wp[0][1])*k>=1;}
2673
+ // Can this member be justified left/right? Needs a plan direction AND a resolved designation: a member
2674
+ // whose profile does not parse has no section frame to flush a face to (the bake refuses it for the same
2675
+ // reason — the 3D orients an unresolved/CUSTOM section by a minimal-arc rotation that does not line its
2676
+ // axes up with the plan). profileDimsIn's null/non-null answer is a pure parse, so this agrees with the
2677
+ // server whether or not the AISC table has loaded.
2678
+ function posHEligible(m){return hasPlanDir(m)&&profileDimsIn(m&&m.profile)!=null;}
2679
+ // Profile Position copy, in ONE place so the single- and multi-select panels cannot drift (they already
2680
+ // described the same control two different ways). Per-button tips, not one heading tip carrying
2681
+ // everything: with two axes under one heading the two "Middle" buttons sit adjacent, and each button
2682
+ // explaining itself is what tells them apart. The horizontal wording is spelled out rather than left to
2683
+ // a detailer's prior, because it names where the LINE goes (like Top/Bottom), which is the opposite of
2684
+ // Tekla's on-plane Left/Right naming the side the PART goes.
2685
+ // The frame-of-reference clause is repeated on BOTH left and right, deliberately: it is the sentence a
2686
+ // user hovers precisely BECAUSE they are unsure of the sense, and carrying it on only one of the pair
2687
+ // leaves the other to be guessed. The two "Middle"s now read differently for the same reason — with the
2688
+ // axes stacked they sit adjacent, and identical text is exactly what stops them being told apart.
2689
+ const POSTIP={
2690
+ head:h=>'Where the section sits relative to the work-line between the end dots'+(h?' — vertically and horizontally':'')+'. Affects the 3D model, the exports, and the connections that bind to this member; the 2D plan always draws the work-line itself.',
2691
+ top:'Top-of-steel — the dots sit on the section’s top face.',
2692
+ mid:'Centred on the work-line — it runs through the centroid in depth (the default).',
2693
+ bot:'Underside — the dots sit on the section’s bottom face.',
2694
+ midH:'Centred across the work-line — it runs down the middle of the section in plan (the default).',
2695
+ left:'The section’s LEFT face sits ON the work-line, so the steel is to the RIGHT of it — looking from the yellow start dot to the magenta end dot.',
2696
+ right:'The section’s RIGHT face sits ON the work-line, so the steel is to the LEFT of it — looking from the yellow start dot to the magenta end dot.',
2697
+ // An ineligible member may still CARRY a value — set before its profile or its geometry changed. Say so
2698
+ // rather than only saying why the control is gone: the value persists, survives migration, and starts
2699
+ // applying again the moment the member becomes eligible, so a silent hint would make that a jump out of
2700
+ // nowhere. `set` is the stored value, or '' when there is none.
2701
+ plumb:set=>'This member is plumb — its ends share the same point in plan, so it has no left or right to set.'
2702
+ +(set?' '+set[0].toUpperCase()+set.slice(1)+' is stored but not applied; it will apply again if the ends move apart.':''),
2703
+ noProf:set=>'This profile does not resolve to a section, so there is no face to line up with the work-line.'
2704
+ +(set?' '+set[0].toUpperCase()+set.slice(1)+' is stored but not applied; it will apply again if the profile resolves.':''),
2705
+ approx:p=>'⚠ '+p+' is not in the AISC table, so its width is estimated — “flush” is approximate here.'};
2581
2706
  // Swap a member's start (yellow, end 1) and end (magenta, end 2) handles — reverse its direction.
2582
2707
  // Beam: reverse wp + the per-end metadata (each end's TOS/note/detail follows its point). Column:
2583
2708
  // the two handles are bottom (BOS) and top (TOS), so swap those. Used by 2D + 3D via the same panel.
@@ -2597,6 +2722,14 @@ function swapMemberEnds(m){
2597
2722
  // symbol is drawn on. Negate the offset to keep the drawn line exactly where it was (ui-ux review).
2598
2723
  if(m.brace.offset)ModelCmd.patchMemberBrace(m,{offset:-m.brace.offset});
2599
2724
  }
2725
+ // positionH is the SAME class of property as that brace offset, and was the last direction-dependent
2726
+ // one left uncompensated: planeOffset() takes its left/right from the a→b direction, so reversing wp
2727
+ // moves a justified section to the OTHER side of its line — a full section width — while the panel,
2728
+ // the tooltip and the property label all keep asserting the original value. Mirror it, so a swap is
2729
+ // what it says it is: a change of direction, not of where the steel sits. Reachable in bulk via the
2730
+ // Reversed-beams tool, whose own tooltip tells the user to press P. (review; pinned server-side by
2731
+ // "reversing a member and mirroring its positionH leaves the steel exactly where it was".)
2732
+ if(m.positionH==='left'||m.positionH==='right')ModelCmd.patchMember(m,{positionH:m.positionH==='left'?'right':'left'});
2600
2733
  // F9: reversing swaps m's two physical points, so a dim ref's pt 'a'↔'b' must swap to keep pointing at the same
2601
2734
  // real end. Plan-scoped by member identity — only THIS member's owning plan's dims (never by id across plans, Codex R4 #4).
2602
2735
  if(!MODEL_V2){const own=planeOfMember(m);for(const d of (own&&own.dims||[]))for(const rk of ['aRef','bRef']){const r=d[rk];if(r&&r.m===m.id&&(r.pt==='a'||r.pt==='b'))r.pt=r.pt==='a'?'b':'a';}}
@@ -3262,6 +3395,14 @@ function applyDraftFields(d){
3262
3395
  const candidate=structuredClone(C);
3263
3396
  const rootKeys=['members','grid','custom_details','profile_colors','member_styles','member_types','target_confidence','dims3d','dim_overlays','dim_style','prop_labels','joints','connections','detail_placements','views'];
3264
3397
  for(const key of rootKeys)if(key in d)candidate[key]=structuredClone(d[key]);
3398
+ // …EXCEPT `prop_labels`, WHICH IS SANITISED LIKE THE v1 ARM DOES (#614). A draft is unvalidated
3399
+ // localStorage, and this restore runs AFTER the boot-time sanitise — so a raw copy re-introduces
3400
+ // exactly the shape that sanitise exists to prevent: `prop_labels` with no `props`, which
3401
+ // `renderPropLabels` dereferences on the next repaint. Reachable today, not hypothetically: a
3402
+ // migrated document legitimately has no `props` (remapPropLabels emits it only when the v1 side had
3403
+ // an array), and any draft written by a build that did not sanitise on v2 carries that shape
3404
+ // forward. The v1 arm below has always done this; the asymmetry was the bug. (Found by review.)
3405
+ if('prop_labels' in d)candidate.prop_labels=sanitizePropLabels(d.prop_labels);
3265
3406
  // REFERENCES ARE RECONCILED, NEVER REPLACED — and this is not tidiness, it is a reference that
3266
3407
  // vanished in front of me. Which references EXIST is the server's answer: insert and remove are
3267
3408
  // routes that write the contract themselves, and `adoptReferenceWrite` then re-points this draft at
@@ -3740,7 +3881,7 @@ function len(a,b){return Math.hypot(a[0]-b[0],a[1]-b[1]);}
3740
3881
  // /api/aisc-shapes. Returns null for an unresolved mark (RFI).
3741
3882
  function profileDimsIn(profile){
3742
3883
  if(!profile)return null;
3743
- const p=String(profile).trim().toUpperCase().replace(/×/g,'X'); // separator may be x / X / ×
3884
+ const p=String(profile).trim().toUpperCase().replace(/[×✕✖]/g,'X'); // separator may be x / X / × / ✕ / ✖ — the SAME fold as server contract-to-scene profileDimsIn, or the two disagree about which designations resolve
3744
3885
  if(p===''||/(^|[^A-Z])MF($|[^A-Z])/.test(p))return null;
3745
3886
  const m=p.match(/^([A-Z]+)\s*(.+)$/);if(!m)return null;
3746
3887
  // parseDim (not parseFloat) so a mixed-fraction leg "3 1/2" → 3.5, not 3 — mirrors server contract-to-scene.
@@ -3757,6 +3898,18 @@ function profileDimsIn(profile){
3757
3898
  if(bf!==undefined)return{d,w:bf};const ratio=(prefix==='C'||prefix==='MC')?0.28:0.42;return{d,w:d*ratio};}
3758
3899
  return null;
3759
3900
  }
3901
+ // True when profileDimsIn had to GUESS this profile's width from a per-series ratio (0.42d for W, 0.28d
3902
+ // for channels) because the designation is in neither AISC table — the `approx` flag the server carries.
3903
+ // Returns false when the tables have not loaded, because then we cannot tell and the server, which always
3904
+ // has them, is the authority; warning on every W-shape while a fetch is in flight would be a false alarm.
3905
+ function widthEstimated(profile){
3906
+ const sec=window.__AISC_SECTIONS,bf=window.__AISC_BF;
3907
+ if(!sec||!bf||!Object.keys(sec).length)return false;
3908
+ const p=String(profile||'').trim().toUpperCase().replace(/[×✕✖]/g,'X');
3909
+ const m=p.match(/^([A-Z]+)\s*(.+)$/);
3910
+ if(!m||!/^(W|S|M|HP|C|MC|WT|ST|MT)$/.test(m[1]))return false; // only the I/channel/tee families fall back to a ratio
3911
+ const key=p.replace(/\s+/g,'');
3912
+ return sec[key]===undefined&&bf[key]===undefined;}
3760
3913
  // Section shape kind from the designation — mirrors steel-3d-view.js shapeOf (parity with 3D).
3761
3914
  function sectionKindOf(profile){const p=String(profile||'').toUpperCase().trim();
3762
3915
  if(/^(W|M|S|HP|UC|UB|UKC|UKB|IPE|HE)/.test(p))return 'I';
@@ -4727,7 +4880,7 @@ function render(){
4727
4880
  // rather than drawing a plausible plan in the wrong place, which is the worst defect class this epic has.
4728
4881
  // The inspector still repaints: the read-only panel is what the user actually has here.
4729
4882
  // …and the header state, which this return used to skip entirely. The ⋯ → Display rows are the one
4730
- // group of STATE-REPORTING rows read-only leaves usable (RO_LOCKED_SECS locks detailing/checks/snap;
4883
+ // group of STATE-REPORTING rows read-only leaves usable (applyReadOnlyChrome locks detailing/checks/snap;
4731
4884
  // coords and session are left live too, but carry actions rather than state). Their sync sits in
4732
4885
  // render()'s trailing upd*() batch, which this return never reaches — so every one of them showed its
4733
4886
  // static markup instead, and the static markup carries NO `on` class at all, so the slider switch
@@ -4832,13 +4985,13 @@ function updateBadges(){const R=12/zoom,F=13/zoom,ox=el=>(+el.dataset.fi-(+el.da
4832
4985
  // threshold live (data-mlen × zoom), so zooming reveals/hides labels as members cross ~24px on screen.
4833
4986
  {const plG=svg.querySelector('g.pllabels');if(plG){let hid=0;
4834
4987
  plG.querySelectorAll('rect.plchip').forEach(r=>{const w=(+r.dataset.tw*6.4+12)/zoom,h=15/zoom,cy=(+r.dataset.ay)+(+r.dataset.off)/zoom;
4835
- const show=(+r.dataset.mlen)*zoom>=PLABEL_MIN_PX;r.style.display=show?'':'none';if(!show)hid++;
4988
+ const show=plabelVisible(+r.dataset.mlen);r.style.display=show?'':'none';if(!show)hid++;
4836
4989
  r.setAttribute('width',w);r.setAttribute('height',h);r.setAttribute('x',(+r.dataset.ax)-w/2);r.setAttribute('y',cy-h/2);});
4837
- plG.querySelectorAll('text.pltx').forEach(t=>{const show=(+t.dataset.mlen)*zoom>=PLABEL_MIN_PX;t.style.display=show?'':'none';t.setAttribute('y',(+t.dataset.ay)+(+t.dataset.off)/zoom);t.style.fontSize=(11/zoom)+'px';});
4990
+ plG.querySelectorAll('text.pltx').forEach(t=>{const show=plabelVisible(+t.dataset.mlen);t.style.display=show?'':'none';t.setAttribute('y',(+t.dataset.ay)+(+t.dataset.off)/zoom);t.style.fontSize=(11/zoom)+'px';});
4838
4991
  propLabelsHidden=hid;updatePropHint();}} // hid counts hidden chip ROWS (>0 ⇒ note shows) — the note only needs the boolean
4839
4992
  {const mlG=svg.querySelector('g.mlenlabels');if(mlG){ // on-select length chips: same zoom-rescale + threshold as the property chips
4840
- mlG.querySelectorAll('rect.mlenchip').forEach(r=>{const w=(+r.dataset.tw*6.4+12)/zoom,h=15/zoom,cx=(+r.dataset.mx)+(+r.dataset.nx)*(+r.dataset.base)/zoom,cy=(+r.dataset.my)+(+r.dataset.ny)*(+r.dataset.base)/zoom,show=(+r.dataset.mlen)*zoom>=PLABEL_MIN_PX;r.style.display=show?'':'none';r.setAttribute('width',w);r.setAttribute('height',h);r.setAttribute('x',cx-w/2);r.setAttribute('y',cy-h/2);});
4841
- mlG.querySelectorAll('text.mlentx').forEach(t=>{const show=(+t.dataset.mlen)*zoom>=PLABEL_MIN_PX;t.style.display=show?'':'none';t.setAttribute('x',(+t.dataset.mx)+(+t.dataset.nx)*(+t.dataset.base)/zoom);t.setAttribute('y',(+t.dataset.my)+(+t.dataset.ny)*(+t.dataset.base)/zoom);t.style.fontSize=(11/zoom)+'px';});}}
4993
+ mlG.querySelectorAll('rect.mlenchip').forEach(r=>{const w=(+r.dataset.tw*6.4+12)/zoom,h=15/zoom,cx=(+r.dataset.mx)+(+r.dataset.nx)*(+r.dataset.base)/zoom,cy=(+r.dataset.my)+(+r.dataset.ny)*(+r.dataset.base)/zoom,show=plabelVisible(+r.dataset.mlen);r.style.display=show?'':'none';r.setAttribute('width',w);r.setAttribute('height',h);r.setAttribute('x',cx-w/2);r.setAttribute('y',cy-h/2);});
4994
+ mlG.querySelectorAll('text.mlentx').forEach(t=>{const show=plabelVisible(+t.dataset.mlen);t.style.display=show?'':'none';t.setAttribute('x',(+t.dataset.mx)+(+t.dataset.nx)*(+t.dataset.base)/zoom);t.setAttribute('y',(+t.dataset.my)+(+t.dataset.ny)*(+t.dataset.base)/zoom);t.style.fontSize=(11/zoom)+'px';});}}
4842
4995
  const cg=svg.querySelector('g.csglyph');if(cg&&P.frame)cg.outerHTML=axisGlyphSvg(P.frame.o,P.frame.u,false);} // glyph is sized in 1/zoom → regenerate on zoom (like the dim chips)
4843
4996
  function updateHandles(m){svg.querySelectorAll(`circle.handle[data-mid="${m.id}"]`).forEach(h=>{const i=+h.dataset.h;h.setAttribute('cx',m.wp[i][0]);h.setAttribute('cy',m.wp[i][1]);});}
4844
4997
  function updateLine(m){
@@ -5420,6 +5573,10 @@ function panel(){
5420
5573
  `<div class=divrow><hr><button class=ghost id=matchEnds>Match → both ends (each)</button><hr></div>`+
5421
5574
  `<div class=sect>${dotE}End</div>${mTos('tosB','TOS',s1)}${mNote('ntB',s1)}${mDet('dtB',s1)}`;}
5422
5575
  const posA=!allCol?agg(beams,m=>posDefault(m)):null;
5576
+ // Horizontal justification aggregates over the ELIGIBLE subset only — a plumb or unresolved member has
5577
+ // no left/right, so folding it in would report a Varies (or a value) for members the bake ignores.
5578
+ const hOk=!allCol?beams.filter(posHEligible):[],hSkip=(!allCol?arr.length:0)-hOk.length; // arr, not beams: a column in the selection is skipped too, and the note has to say so
5579
+ const posHA=hOk.length?agg(hOk,m=>posHDefault(m)):null;
5423
5580
  const rotAgg=agg(arr,m=>((((+m.rot||0)%360)+360)%360)); // shared rotation, or VARIES
5424
5581
  const qdElig=(sel2d()||[]).filter(isDimAnchorableMember),qdN=qdElig.length+selGridIds.size,qdHasBeam=qdElig.some(m=>(m.role||'beam')!=='column'); // F7: active-plan beams + columns + co-selected grid lines; the Start/Mid/End toggle only matters when a beam is in the set
5425
5582
  p.innerHTML=`<h3>${arr.length} members selected</h3>
@@ -5430,8 +5587,13 @@ function panel(){
5430
5587
  <div class="row hint">Total length <b>${totalL} ft</b>${totalW!=null?` · <b>${totalW.toLocaleString()} lb</b>`:''}${dupSel?` · <span style="color:#fca5a5">${dupSel} duplicate${dupSel>1?'s':''}</span> (overlap a kept member — deleting these dedupes)`:''}</div>
5431
5588
  <div class=row><button class=ghostw id=verifyBtn${allVerified?' style="border-color:#166534;color:#86efac"':''}>${allVerified?'✓ All verified — click to unverify':'Mark all verified'}</button></div>
5432
5589
  ${elev}
5433
- ${!allCol?`<div class=divrow><hr><span class=sect style="margin:0" data-tip="Where the section sits on the reference line (beams). Top = top-of-steel; Middle = centroid; Bottom = underside.">Profile Position <span style="opacity:.45;font-weight:400">ⓘ</span></span><hr></div>
5434
- <div class=seg2 style="margin-top:0"><button id=posTop class="${posA==='top'?'on':''}">Top</button><button id=posMid class="${posA==='middle'?'on':''}">Middle</button><button id=posBot class="${posA==='bottom'?'on':''}">Bottom</button></div>`:''}
5590
+ ${!allCol?`<div class=divrow><hr><span class=sect style="margin:0" data-tip="${POSTIP.head(hOk.length>0)}">Profile Position <span style="opacity:.45;font-weight:400">ⓘ</span></span><hr></div>
5591
+ <div class=elab style="margin-top:0">Vertical</div>
5592
+ <div class=seg2 style="margin-top:2px"><button id=posTop class="${posA==='top'?'on':''}" data-tip="${POSTIP.top}">Top</button><button id=posMid class="${posA==='middle'?'on':''}" data-tip="${POSTIP.mid}">Middle</button><button id=posBot class="${posA==='bottom'?'on':''}" data-tip="${POSTIP.bot}">Bottom</button></div>
5593
+ ${hOk.length?`<div class=elab>Horizontal</div>
5594
+ <div class=seg2 style="margin-top:2px"><button id=posHLeft class="${posHA==='left'?'on':''}" data-tip="${POSTIP.left}">Left</button><button id=posHMid class="${posHA==='middle'?'on':''}" data-tip="${POSTIP.midH}">Middle</button><button id=posHRight class="${posHA==='right'?'on':''}" data-tip="${POSTIP.right}">Right</button></div>
5595
+ ${hSkip?`<div class=hint style="margin-top:4px">${hSkip} of the ${arr.length} selected members ${hSkip>1?'have':'has'} no left or right, and ${hSkip>1?'are':'is'} left unchanged.</div>`:''}`
5596
+ :`<div class=hint style="margin-top:8px">None of the selected members has a left or right to set — they are plumb, or their profile does not resolve to a section.</div>`}`:''}
5435
5597
  <div class=divrow><hr><span class=sect style="margin:0" data-tip="Spin every selected section about its reference line. 0° = as drawn. Blank = leave each unchanged; normalised to ±360°.">Profile Rotation <span style="opacity:.45;font-weight:400">ⓘ</span></span><hr></div>
5436
5598
  <div class=detrow><label class=detf><span>Angle °</span><input id=detRotZ inputmode=decimal placeholder="${rotAgg===VARIES?'Varies':''}" value="${rotAgg===VARIES?'':esc(String(Number(rotAgg)||0))}" autocomplete=off></label></div>
5437
5599
  <div class=seg2 style="margin-top:6px"><button id=rot0>0°</button><button id=rot90>90°</button><button id=rot180>180°</button><button id=rot270>270°</button></div>
@@ -5461,6 +5623,15 @@ function panel(){
5461
5623
  {const sp=v=>edit(()=>{for(const m of selArr())if(m.role!=='column')ModelCmd.patchMember(m,{position:v});});
5462
5624
  const _pt=document.getElementById('posTop'),_pm=document.getElementById('posMid'),_pb=document.getElementById('posBot');
5463
5625
  if(_pt)_pt.onclick=()=>sp('top');if(_pm)_pm.onclick=()=>sp('middle');if(_pb)_pb.onclick=()=>sp('bottom');}
5626
+ // Horizontal: commit to the eligible members only and SAY how many were left out — a control that
5627
+ // silently no-ops on part of the selection is the failure this panel exists to avoid. The
5628
+ // `targets.length` guard is the same one Match → both ends carries: edit() pushes undo unconditionally,
5629
+ // so an all-ineligible selection must not enter it and leave an empty entry on the stack.
5630
+ {const shp=v=>{const targets=selArr().filter(posHEligible),sk=selArr().length-targets.length;
5631
+ if(targets.length)edit(()=>{for(const m of targets)ModelCmd.patchMember(m,{positionH:v});});
5632
+ if(sk)toast(sk+' member'+(sk>1?'s':'')+' skipped — a column, a plumb member, or one whose profile does not resolve has no left or right to set');};
5633
+ const _hl=document.getElementById('posHLeft'),_hm=document.getElementById('posHMid'),_hr=document.getElementById('posHRight');
5634
+ if(_hl)_hl.onclick=()=>shp('left');if(_hm)_hm.onclick=()=>shp('middle');if(_hr)_hr.onclick=()=>shp('right');}
5464
5635
  // Rotation — apply one angle to every selected member's section (blank input = no-op). Normalised (-360,360).
5465
5636
  {const setRot=v=>{let r=Number(String(v).replace(',','.'));if(!isFinite(r))return;r=r%360;edit(()=>{for(const m of selArr())ModelCmd.patchMember(m,{rot:r});});};
5466
5637
  const _ri=document.getElementById('detRotZ');if(_ri)_ri.onchange=e=>{if(e.target.value.trim()==='')return;setRot(e.target.value);};
@@ -5485,6 +5656,13 @@ function panel(){
5485
5656
  if(sk)toast(sk+' brace'+(sk>1?'s':'')+' skipped — matching ends would flatten the slope its arrows encode');};}}
5486
5657
  return;}
5487
5658
  const m=ensureMeta(arr[0]), wpf=_wt(m.profile), L=_lenFt(m).toFixed(1), col=(m.role==='column'), pos=posDefault(m);
5659
+ // Horizontal axis: offered only where the bake honours it, and when it is not, the hint names both the
5660
+ // reason AND any value still stored on the member — that value keeps applying the moment the member
5661
+ // becomes eligible again, so silence would make the jump come from nowhere.
5662
+ const posH=posHDefault(m), hEl=posHEligible(m);
5663
+ const _hSet=(m.positionH==='left'||m.positionH==='right')?m.positionH:'';
5664
+ const hWhy=hasPlanDir(m)?POSTIP.noProf(_hSet):POSTIP.plumb(_hSet);
5665
+ const hApprox=hEl&&widthEstimated(m.profile)?POSTIP.approx(esc(m.profile)):'';
5488
5666
  const _lvl=({'S-202':'second','S-203':'roof'})[P.sheet];
5489
5667
  const mfSug=((m.mf||/^MF/i.test(m.profile))&&_lvl&&C.moment_frames)?[...new Set(C.moment_frames.flatMap(f=>f[_lvl]||[]))].filter(Boolean):[];
5490
5668
  const ftFld=(id,label,v)=>`<div class=elab>${label}</div><input id=${id} inputmode=decimal placeholder="5 3/4&quot; · 1&#39;-0 1/4&quot;" value="${esc(fmtFtIn(v))}"><span class=edec>${esc(fmtDecIn(v))}</span>`;
@@ -5677,8 +5855,13 @@ function panel(){
5677
5855
  ${elev}
5678
5856
  ${defPts}
5679
5857
  ${bpSect}${spSect}${copeSect}
5680
- ${col?'':`<div class=divrow><hr><span class=sect style="margin:0" data-tip="Where the section sits on the reference line (between the end dots). Top = top-of-steel (dots on the top flange); Middle = centroid; Bottom = underside.">Profile Position <span style="opacity:.45;font-weight:400">ⓘ</span></span><hr></div>
5681
- <div class=seg2 style="margin-top:0"><button id=posTop class="${pos==='top'?'on':''}">Top</button><button id=posMid class="${pos==='middle'?'on':''}">Middle</button><button id=posBot class="${pos==='bottom'?'on':''}">Bottom</button></div>`}
5858
+ ${col?'':`<div class=divrow><hr><span class=sect style="margin:0" data-tip="${POSTIP.head(hEl)}">Profile Position <span style="opacity:.45;font-weight:400">ⓘ</span></span><hr></div>
5859
+ <div class=elab style="margin-top:0">Vertical</div>
5860
+ <div class=seg2 style="margin-top:2px"><button id=posTop class="${pos==='top'?'on':''}" data-tip="${POSTIP.top}">Top</button><button id=posMid class="${pos==='middle'?'on':''}" data-tip="${POSTIP.mid}">Middle</button><button id=posBot class="${pos==='bottom'?'on':''}" data-tip="${POSTIP.bot}">Bottom</button></div>
5861
+ ${hEl?`<div class=elab>Horizontal</div>
5862
+ <div class=seg2 style="margin-top:2px"><button id=posHLeft class="${posH==='left'?'on':''}" data-tip="${POSTIP.left}">Left</button><button id=posHMid class="${posH==='middle'?'on':''}" data-tip="${POSTIP.midH}">Middle</button><button id=posHRight class="${posH==='right'?'on':''}" data-tip="${POSTIP.right}">Right</button></div>
5863
+ ${hApprox?`<div class=hint style="margin-top:4px">${hApprox}</div>`:''}`
5864
+ :`<div class=hint style="margin-top:8px">${hWhy}</div>`}`}
5682
5865
  <div class=divrow><hr><span class=sect style="margin:0" data-tip="Spin the section around the reference line (the work-line between the end dots). 0° = as drawn; the axis is fixed — this only changes which way the section faces. Any angle; normalised to ±360°.">Profile Rotation <span style="opacity:.45;font-weight:400">ⓘ</span></span><hr></div>
5683
5866
  <div class=detrow><label class=detf><span>Angle °</span><input id=detRotZ inputmode=decimal value="${rotDisp}" autocomplete=off></label></div>
5684
5867
  <div class=seg2 style="margin-top:6px"><button id=rot0 class="${rotN===0?'on':''}">0°</button><button id=rot90 class="${rotN===90?'on':''}">90°</button><button id=rot180 class="${rotN===180?'on':''}">180°</button><button id=rot270 class="${rotN===270?'on':''}">270°</button></div>
@@ -5712,6 +5895,9 @@ function panel(){
5712
5895
  {const setPos=v=>edit(()=>{ModelCmd.patchMember(m,{position:v});}); // profile placement on the reference line; persists + re-extrudes the 3D
5713
5896
  const _pt=document.getElementById('posTop'),_pm=document.getElementById('posMid'),_pb=document.getElementById('posBot');
5714
5897
  if(_pt)_pt.onclick=()=>setPos('top');if(_pm)_pm.onclick=()=>setPos('middle');if(_pb)_pb.onclick=()=>setPos('bottom');}
5898
+ {const setPosH=v=>edit(()=>{ModelCmd.patchMember(m,{positionH:v});}); // the plan half of the same placement — shifts the section ACROSS the line (3D + exports)
5899
+ const _hl=document.getElementById('posHLeft'),_hm=document.getElementById('posHMid'),_hr=document.getElementById('posHRight');
5900
+ if(_hl)_hl.onclick=()=>setPosH('left');if(_hm)_hm.onclick=()=>setPosH('middle');if(_hr)_hr.onclick=()=>setPosH('right');}
5715
5901
  // Rotation — spin the section about the reference line. Normalised to (-360,360); 0 = as drawn.
5716
5902
  // edit() re-renders 2D (columnSectionPoly reads m.rot) AND re-extrudes 3D (steel-3d-view el.rot).
5717
5903
  {const setRot=v=>{let r=Number(String(v).replace(',','.'));if(!isFinite(r))return;r=r%360;edit(()=>{ModelCmd.patchMember(m,{rot:r});});};
@@ -6081,14 +6267,46 @@ function v2CanonicalMember(id){
6081
6267
  function _lenFt(m){
6082
6268
  if(MODEL_V2&&m){const canon=v2CanonicalMember(m.id);if(canon)return modelReadsV2().lengthFt(canon);}
6083
6269
  return _len3dFt(m,FT,defaultTOS);}
6270
+ /*
6271
+ * THE LABEL'S LENGTH, WHICH IS `undefined` WHERE THERE ISN'T ONE.
6272
+ *
6273
+ * `_lenFt` answers 0 for a member whose geometry cannot be resolved — a v2 member with an
6274
+ * `{unknown:true}` elevation has no third dimension to measure. That is a defensible number for a total
6275
+ * (the header adds it), and a lie in a chip: measured by the independent QA, a beam with a 25 ft plan run
6276
+ * and unresolved elevations printed `Length: 0.0 ft` and `Weight: 0 lb` beside it, as fact. The TOS rows
6277
+ * already refuse this by returning `undefined` for an unknown elevation, and the schema's own `elevation`
6278
+ * note says an unknown must never be substituted with a default — this is the same rule, one property
6279
+ * over.
6280
+ *
6281
+ * SCOPED TO THE LABELS deliberately: the header total, the Inspect readout and the BOM all read `_lenFt`
6282
+ * and all report the same 0 today. That is a wider question about what a total should say when part of
6283
+ * it is unknown, and it is not this change's to answer — a chip stating a length that was never read is.
6284
+ *
6285
+ * WHICH IS WHY IT IS A `labelGet`, NOT THE ROW'S `get`. `PROP_DEFS[].get` has a second consumer:
6286
+ * `propAggRow` aggregates it across the selection, and `renderPropPop` DISABLES the row when every
6287
+ * member answers undefined. Wiring this into `get` therefore greyed out Length and Weight whenever the
6288
+ * selection was exactly the member that could not be measured — which is the natural member to
6289
+ * right-click, and the checkbox it blocks is plan-wide. Found by review, one round after the QA run that
6290
+ * produced this helper. The popup keeps aggregating the measurable answer; only the chip refuses.
6291
+ */
6292
+ function _lenFtLabel(m){
6293
+ if(MODEL_V2&&m){const canon=v2CanonicalMember(m.id);if(canon&&!SteelCore.memberGeometryV2(canon))return undefined;}
6294
+ const v=_lenFt(m);
6295
+ return (Number.isFinite(v)&&v>0)?v:undefined;}
6084
6296
  const PROP_DEFS=[
6085
6297
  {key:'id', label:'Mark', get:m=>m.id, fmt:v=>v==null?'':String(v)},
6086
6298
  {key:'profile', label:'Profile', get:m=>m.profile, fmt:v=>v==null?'':String(v)},
6087
6299
  {key:'type', label:'Type', get:m=>memberTypeLabel(memberTypeOf(m)), fmt:v=>v==null?'':String(v)},
6088
6300
  {key:'role', label:'Role', get:m=>m.role==='column'?'Column':'Beam', fmt:v=>v||''},
6089
- {key:'length', label:'Length', get:m=>_lenFt(m), fmt:v=>v==null?'':v.toFixed(1)+' ft'},
6090
- {key:'weight', label:'Weight', get:m=>{const w=_wt(m.profile);return w==null?undefined:_lenFt(m)*w;}, fmt:v=>v==null?'':Math.round(v).toLocaleString()+' lb'},
6301
+ {key:'length', label:'Length', get:m=>_lenFt(m), labelGet:m=>_lenFtLabel(m), fmt:v=>v==null?'':v.toFixed(1)+' ft'},
6302
+ {key:'weight', label:'Weight', get:m=>{const w=_wt(m.profile);return w==null?undefined:_lenFt(m)*w;}, labelGet:m=>{const w=_wt(m.profile),l=_lenFtLabel(m);return (w==null||l==null)?undefined:l*w;}, fmt:v=>v==null?'':Math.round(v).toLocaleString()+' lb'},
6091
6303
  {key:'position', label:'Position', get:m=>m.role==='column'?undefined:posDefault(m), fmt:v=>v?v[0].toUpperCase()+v.slice(1):''},
6304
+ // undefined wherever the concept itself is undefined (a column, a plumb member, an unresolved profile) —
6305
+ // the label must never print a justification the bake ignores.
6306
+ // A member that is ineligible but still CARRIES a value prints it as "not applied" rather than blank:
6307
+ // blank would say the member has no justification when it has one the bake is declining to honour, and
6308
+ // that value starts applying again the moment the profile resolves or the ends move apart.
6309
+ {key:'position_h',label:'Position (H)', get:m=>posHEligible(m)?posHDefault(m):((m.positionH==='left'||m.positionH==='right')?m.positionH+' (not applied)':undefined), fmt:v=>v?v[0].toUpperCase()+v.slice(1):''},
6092
6310
  {key:'verified', label:'Verified', get:m=>m.verified===true?'Yes':'No', fmt:v=>v||''},
6093
6311
  {key:'tos_start', label:'TOS (start)', get:m=>m.role==='column'?undefined:_effTos(m.ends&&m.ends[0]), fmt:v=>v==null?'':fmtFtIn(v)},
6094
6312
  {key:'tos_end', label:'TOS (end)', get:m=>m.role==='column'?undefined:_effTos(m.ends&&m.ends[1]), fmt:v=>v==null?'':fmtFtIn(v)},
@@ -6109,23 +6327,37 @@ function sanitizePropLabels(x){const o=(x&&typeof x==='object'&&!Array.isArray(x
6109
6327
  selected_only:o.selected_only===true,
6110
6328
  vis2d:o.vis2d!==false,vis3d:o.vis3d!==false, // per-view label VISIBILITY (B1): default ON; the property SELECTION (props) stays shared across 2D+3D — only show/hide is independent
6111
6329
  ids:Array.isArray(o.ids)?o.ids.filter(v=>typeof v==='string'):[]};}
6112
- // …all three skipped for v2 — see the repair-pass note at the top of main(). These two are the pair the
6113
- // schema check caught: prop_labels gains vis2d/vis3d, and views gains `projection` while LOSING each
6114
- // generated view's `axisId`.
6115
- if(!MODEL_V2){
6330
+ // PROP_LABELS IS SANITISED ON BOTH FORMATS (#614), and it is the ONE member of the repair-pass family
6331
+ // that is — see the note at the top of main() for why the others stay v1-only. It was excluded for one
6332
+ // reason: it materialises `vis2d`/`vis3d`, which v2's closed `prop_labels` refused, so running it added
6333
+ // keys that made the user's first save fail for an edit they never made. Now that the schema carries both
6334
+ // flags, every key it writes is legal on v2, and NOT running it is the defect — `propLabelLinesFor` and
6335
+ // `renderPropLabels` read `pl.props.length` on a document that may carry no `prop_labels` at all, which
6336
+ // is the TypeError the original v2 attempt hit and mis-attributed to the label derivation.
6337
+ //
6338
+ // Its siblings are still refused, and the reason is unchanged: `sanitizeViews` DROPS `views[].generated
6339
+ // .axisId` (v2 requires it — data loss) and adds `views[].projection` (v2 keeps that in `camera.proj`).
6116
6340
  C.prop_labels=sanitizePropLabels(C.prop_labels); // normalise the contract's incoming value now (PROP_KEYS is initialised above; runs before main's bootstrap render + restoreSaved override)
6341
+ if(!MODEL_V2){
6117
6342
  C.views=sanitizeViews(C.views); // normalise the incoming saved views now — inside main() where sanitizeViews is in scope (boot() only guaranteed an array); runs before the bootstrap render + restoreSaved override, same pattern as prop_labels above
6118
6343
  if(SteelCore)C.dims3d=SteelCore.sanitizeDims3d(C.dims3d); // UCS Stage 5: canonicalise each 3D dim's axisDir (drop junk / normalise non-unit) so a bad value can't wedge the schema-validated save — the SERVER contract copy; restoreSaved re-sanitises the localStorage draft below
6119
6344
  }
6120
6345
  // the "Label: value" lines a member contributes for the currently-checked props (registry order; skips N/A + empty)
6121
6346
  function propLabelLinesFor(m){const pl=C.prop_labels;if(!pl||!pl.props.length)return [];ensureMeta(m);
6122
- const out=[];for(const def of PROP_DEFS){if(!pl.props.includes(def.key))continue;const raw=def.get(m);if(raw===undefined)continue;const t=def.fmt(raw);if(t==='')continue;out.push(def.label+': '+t);}return out;}
6347
+ const out=[];for(const def of PROP_DEFS){if(!pl.props.includes(def.key))continue;const raw=(def.labelGet||def.get)(m);if(raw===undefined)continue;const t=def.fmt(raw);if(t==='')continue;out.push(def.label+': '+t);}return out;}
6123
6348
  // members that actually get a label, honouring the plan-wide-vs-selected-only scope
6124
6349
  function propLabelMembers(){const pl=C.prop_labels;if(!pl||!pl.props.length)return [];
6125
- // PER-SHEET for v1, and that is not incidental: renderPropLabels draws each chip at the member's
6126
- // plan-local PIXEL coordinates into the ACTIVE sheet's SVG, so an off-sheet member would be painted in
6127
- // the wrong place on any multi-sheet project. A repair briefly widened this to allMembers() to stop a
6128
- // v2 TypeError and introduced exactly that regression; the v2 half is what needed the model-wide list.
6350
+ // PER-SHEET ON BOTH FORMATS, and that is not incidental: renderPropLabels draws each chip at the
6351
+ // member's plan-local PIXEL coordinates into the ACTIVE sheet's SVG, so an off-sheet member would be
6352
+ // painted in the wrong place on any multi-sheet project. A repair briefly widened this to allMembers()
6353
+ // to stop a v2 TypeError and introduced exactly that regression.
6354
+ //
6355
+ // ON v2 `P` IS THE PROJECTION, so `P.members` is the active sheet's projected members — the same scope,
6356
+ // reached a different way. That has a consequence worth naming rather than leaving to be discovered:
6357
+ // the 3D view's own member list IS model-wide, so on a multi-sheet v2 model the 3D chips cover only the
6358
+ // active sheet's members. v1 behaves identically (`getMembers` returns `P.members` there too), so it is
6359
+ // parity, not a v2 regression — but it is a limit, and an earlier version of this comment implied the
6360
+ // v2 arm had been given a model-wide list, which it has not. (Found by review.)
6129
6361
  let base=P.members;
6130
6362
  if(pl.selected_only){const ids=new Set(pl.ids||[]);base=base.filter(m=>ids.has(m.id));}
6131
6363
  return base.filter(m=>propLabelLinesFor(m).length>0);}
@@ -6142,6 +6374,32 @@ let propLabelsHidden=0;
6142
6374
  // A member's labels hide when its on-screen length < this (px) — the density guard (§5.5). Kept as one
6143
6375
  // constant so renderPropLabels (initial paint) and updateBadges (live on zoom) agree.
6144
6376
  const PLABEL_MIN_PX=24;
6377
+ /*
6378
+ * …AND A MEMBER WITH NO PLAN RUN IS EXEMPT FROM IT. The ORDINARY column — authored as a coincident point
6379
+ * symbol, which is what the reader emits and what the plan draws — has a drawn line of length 0, so
6380
+ * `mlen * zoom` is 0 at every zoom and it could never carry a 2D chip. It also fed the "Labels hidden —
6381
+ * zoom in" pill, which therefore stayed up permanently while zooming did nothing about it. Measured by
6382
+ * the independent QA at 119 / 156 / 291 / 400% (the maximum): still hidden.
6383
+ *
6384
+ * "ordinary", not "every" — the same absolute review caught two commits ago on this branch. A raking or
6385
+ * battered column has two distinct plan points and a real run, and takes the ordinary arm.
6386
+ *
6387
+ * The threshold exists to hide a label on a member too SHORT TO READ ALONG. A point is not short; it has
6388
+ * no length to be short. So the rule is "if it has a run, the run must be legible", and a member without
6389
+ * one is drawn.
6390
+ *
6391
+ * ONE PREDICATE FOR ALL FIVE CALL SITES — the property chips (initial paint + both halves of
6392
+ * updateBadges' live re-apply) and the on-select member-length chips (the same three, minus one that
6393
+ * gates on 3D length instead). They were five copies of one inequality; converting three would have left
6394
+ * a column labelled by ⋯ Display → Property labels and unlabelled by ⋯ Display → Show member length, in
6395
+ * the same view, having already shown its length in 3D (refreshSelLen3d gates on the 3D length, which is
6396
+ * why the inconsistency was visible rather than merely latent).
6397
+ *
6398
+ * WHAT THIS DOES NOT FIX, stated because the pill's copy promises it: a member with a real but tiny run
6399
+ * still hides below `PLABEL_MIN_PX / ZMAX` = 6 plan px, and "zoom in" cannot rescue it. The class is now
6400
+ * "a stub under ~6 px" instead of "every column".
6401
+ */
6402
+ const plabelVisible=mlen=>!(mlen>0)||mlen*zoom>=PLABEL_MIN_PX;
6145
6403
  // On-select member-length chips (2D): when the ⋯ Display "Show member length" toggle is on, paint each selected
6146
6404
  // member's true 3D length at its midpoint, nudged perpendicular off the line (fixed relative to member direction).
6147
6405
  // Cyan dimension chips; the member being end-dragged is skipped (its live overlay covers it); coincident midpoints
@@ -6155,7 +6413,7 @@ function renderSelLenLabels(){if(!showSelLen)return '';const selM=sel2d();if(!se
6155
6413
  const lenFt=_lenFt(m);if(!(lenFt>0)||!isFinite(lenFt))return; // skip degenerate/NaN geometry — never paint an empty "len " chip
6156
6414
  const dx=b[0]-a[0],dy=b[1]-a[1],dl=Math.hypot(dx,dy)||1,nx=-dy/dl,ny=dx/dl,base=18+(j-(n-1)/2)*16,mlen=len(a,b);
6157
6415
  const txt='len '+fmtFtIn(lenFt*12),tw=txt.length,w=(tw*6.4+12)/zoom,hh=15/zoom,cx=mid[0]+nx*base/zoom,cy=mid[1]+ny*base/zoom;
6158
- const show=mlen*zoom>=PLABEL_MIN_PX,hide=show?'':';display:none',dd=`data-mx="${mid[0]}" data-my="${mid[1]}" data-nx="${nx}" data-ny="${ny}" data-base="${base}" data-mlen="${mlen}"`;
6416
+ const show=plabelVisible(mlen),hide=show?'':';display:none',dd=`data-mx="${mid[0]}" data-my="${mid[1]}" data-nx="${nx}" data-ny="${ny}" data-base="${base}" data-mlen="${mlen}"`;
6159
6417
  s+=`<rect class=mlenchip ${dd} data-tw="${tw}" x="${cx-w/2}" y="${cy-hh/2}" width="${w}" height="${hh}" rx="${3/zoom}" style="${hide}"/>`
6160
6418
  +`<text class=mlentx ${dd} x="${cx}" y="${cy}" style="font-size:${11/zoom}px${hide}">${esc(txt)}</text>`;});}
6161
6419
  return s?`<g class="mlenlabels">${s}</g>`:'';}
@@ -6166,7 +6424,7 @@ function renderPropLabels(){const pl=C.prop_labels;propLabelsHidden=0;if(!pl||!p
6166
6424
  // only sets each chip's initial visibility. updateBadges re-applies it live as the user zooms — so
6167
6425
  // zooming in reveals a hidden label and zooming out hides it (they're in the DOM either way).
6168
6426
  for(const m of ms){const lines=propLabelLinesFor(m);if(!lines.length)continue;
6169
- const vl=memberViewLine(m),a=vl[0],b=vl[1],mlen=len(a,b);const show=mlen*zoom>=PLABEL_MIN_PX;if(!show)hidden++; // chips ride the DRAWN line (offset brace included)
6427
+ const vl=memberViewLine(m),a=vl[0],b=vl[1],mlen=len(a,b);const show=plabelVisible(mlen);if(!show)hidden++; // chips ride the DRAWN line (offset brace included)
6170
6428
  const anc=pl.placement==='start'?a:pl.placement==='end'?b:[(a[0]+b[0])/2,(a[1]+b[1])/2];
6171
6429
  const n=lines.length,hide=show?'':';display:none';
6172
6430
  lines.forEach((txt,i)=>{const off=(i-(n-1)/2)*15,tw=txt.length,w=(tw*6.4+12)/zoom,h=15/zoom,cy=anc[1]+off/zoom;
@@ -6175,6 +6433,15 @@ function renderPropLabels(){const pl=C.prop_labels;propLabelsHidden=0;if(!pl||!p
6175
6433
  propLabelsHidden=hidden;
6176
6434
  return `<g class="pllabels">${s}</g>`;}
6177
6435
  // fixed-screen corner note when the zoom threshold is hiding labels (an HTML pill, outside the zoomed SVG)
6436
+ //
6437
+ // A SECOND MESSAGE WAS ADDED HERE AND REMOVED, and the reason is worth keeping. The UX review noted that
6438
+ // "visibility on, no properties ticked" leaves a toggle reading on over a canvas with no chips — true, and
6439
+ // "Clear all" reaches it in one click. But `props: []` with visibility on is not an anomaly, it is the
6440
+ // RESTING STATE OF EVERY DOCUMENT: `sanitizePropLabels` writes `props: []` and defaults both flags on, and
6441
+ // the reader emits the same empty skeleton. So the predicate that was supposed to explain a rare state
6442
+ // matched every project that had never used the feature, and parked a permanent pill telling the user to
6443
+ // right-click a member. Measured by review, not reasoned about. The honest place for that explanation is
6444
+ // the popup where "Clear all" lives, not the canvas.
6178
6445
  function updatePropHint(){let el=document.getElementById('plHint');
6179
6446
  const show=!view3d&&propLabelsHidden>0;
6180
6447
  if(!show){if(el)el.style.display='none';return;}
@@ -7293,9 +7560,11 @@ document.getElementById('calloutToggleB').onclick=e=>{e.stopPropagation();if(MOD
7293
7560
  // first repaint after boot — the row would silently go live and lose its screen-reader reason. A
7294
7561
  // mutation run proved the shape passes the suite unless it is asserted after an op, which is why
7295
7562
  // steel-editor-v2.test.ts re-asserts this row's whole state following a render.
7296
- // Its OFF-on-v2 reading needs no MODEL_RO term: plVis() already short-circuits to false under it — and
7297
- // that short-circuit is also what keeps this line safe, because C.prop_labels is left UNNORMALISED on a
7298
- // read-only document (sanitizePropLabels runs inside a canWriteModel() guard).
7563
+ // The `C.prop_labels &&` term is not belt-and-braces: sanitizePropLabels materialises the object on
7564
+ // every document now (#614), but this runs on EVERY render and a future path that replaces the contract
7565
+ // wholesale would reach it first. (It used to be load-bearing for a different reason — the sanitiser was
7566
+ // v1-only, so a v2 document arrived with no `prop_labels` at all. That is no longer the case, and the
7567
+ // paragraph claiming plVis short-circuits to false on v2 went with it: plVis now reads the flag.)
7299
7568
  function updPlToggle(){const b=document.getElementById('plToggleB');if(b){const on=!!(C.prop_labels&&plVis(false));b.classList.toggle('on',on);b.setAttribute('aria-checked',String(on));}} // B1: 2D property-label visibility (independent of 3D)
7300
7569
  document.getElementById('plToggleB').onclick=e=>{e.stopPropagation();if(!canWritePropLabelVis())return;C.prop_labels.vis2d=!C.prop_labels.vis2d;updPlToggle();refreshPropLabels();}; // refreshPropLabels → scheduleSave()+render(): repaints the 2D chips (gated by vis2d) and persists the choice
7301
7570
  // MODEL_RO is a term here in its own right, NOT covered by !hasOverlay(): `filter` is a legal v2 root key
@@ -7333,10 +7602,6 @@ document.getElementById('gridEditB').onclick=()=>{setGridMode(!gridMode);render(
7333
7602
  * why), and ⋯ → Display, whose rows are view state.
7334
7603
  */
7335
7604
  const RO_ANCHORS=['mAdd','dimB','xfB','m3dDim']; // the two 2D write tools, the Move/Copy menu, and the 3D twin of the Dimension tool
7336
- // The ⋯ sections whose ROWS write the model. Named once, so the disable and the stay-shut rule above
7337
- // cannot drift apart — the header ids follow from these. `display` is absent deliberately: its rows are
7338
- // view state, and Grid lines… lives there.
7339
- const RO_LOCKED_SECS=['detailing','checks','snap'];
7340
7605
  function applyReadOnlyChrome(){
7341
7606
  if(!MODEL_RO)return;
7342
7607
  document.body.classList.add('model-ro');
@@ -7355,7 +7620,7 @@ function applyReadOnlyChrome(){
7355
7620
  // Disabling stops the CLICK; it does not undo the restore. Both halves happen here, in one place,
7356
7621
  // addressed by id, because the restore loop itself is querySelectorAll-driven and a guard there could
7357
7622
  // never be proven headless. (unit 5, P7d.)
7358
- for(const id of ['secDetailingHdr','secChecksHdr','snapHdr']){ // the header ids for RO_LOCKED_SECS
7623
+ for(const id of ['secDetailingHdr','secChecksHdr','snapHdr']){ // the header ids of the locked sections: detailing, checks, snap
7359
7624
  const h=document.getElementById(id);off(h);
7360
7625
  if(!h)continue;
7361
7626
  h.setAttribute('aria-expanded','false');
@@ -7391,26 +7656,30 @@ function roLock(el){
7391
7656
  el.style.opacity='.4';el.style.pointerEvents='none';el.style.cursor='default';
7392
7657
  return el;}
7393
7658
  /**
7394
- * The two controls that set the per-view label flag — a key v2's closed `prop_labels` does not have.
7659
+ * The two controls that set the per-view label flag: make each REPORT the flag, and disable it only when
7660
+ * the document cannot take the write.
7395
7661
  *
7396
7662
  * Separate from applyReadOnlyChrome's anchor list because `m3dPropLabels` lives in the 3D legend, which is
7397
7663
  * built lazily by build3DLegend() long after boot; disabling it once at boot would miss it.
7398
7664
  */
7399
7665
  function roDisablePropLabelToggles(){
7400
- // MODEL_V2, not MODEL_RO: the flag has no home in v2's closed `prop_labels` whether or not the document
7401
- // is writable, so a live v2 model must disable these two exactly as a read-only one did. Leaving them
7402
- // enabled over a refused write is the silent no-op this whole mode exists to avoid.
7403
- if(!MODEL_V2)return;
7404
7666
  for(const id of ['plToggleB','m3dPropLabels']){
7405
7667
  const el=document.getElementById(id);
7406
7668
  if(!el)continue;
7407
- el.disabled=true;
7408
- // REPORT OFF, not just unavailable. `m3dPropLabels` is static markup carrying `checked`, and nothing
7409
- // syncs it until the user opens the View menu — so without this the first frame (and the closed menu's
7410
- // accessibility state) says "checked, and you cannot turn it off" for a flag plVis answers false to.
7411
- // That is the same lie the read-only repair removed from the 2D rows, which stay honest because
7412
- // updPlToggle derives both `on` and aria-checked from plVis. (Found by Codex reviewing this fix.)
7669
+ // THE STATE SYNC IS UNCONDITIONAL, and an early `if(canWritePropLabelVis())return;` was the first cut
7670
+ // of this repair — which quietly DELETED the one thing keeping `m3dPropLabels` honest at boot (#614).
7671
+ // It is static markup carrying `checked`, and nothing else syncs it until the user opens the View
7672
+ // menu, so a document holding `vis3d:false` would render its first frame — and answer a screen reader —
7673
+ // "checked" for a flag plVis reads false. That lie used to be impossible only because every v2
7674
+ // document reached the disabled branch; making them writable is exactly what exposed it. The 2D row
7675
+ // needs no help here (updPlToggle derives `on` and aria-checked from plVis on every render), but it
7676
+ // costs nothing and keeps the two controls under one rule. (Found by the UX review of this change.)
7413
7677
  if(el.type==='checkbox')el.checked=plVis(id==='m3dPropLabels');
7678
+ // WRITABILITY, not format. This read `MODEL_V2` while v2's closed `prop_labels` had no home for the
7679
+ // flag — a live v2 model had to disable these two exactly as a read-only one did, because leaving them
7680
+ // enabled over a refused write is the silent no-op that mode exists to avoid. v2 has the home now, so
7681
+ // the only remaining reason to grey them is a document that refuses every write.
7682
+ el.disabled=!canWritePropLabelVis();
7414
7683
  // The ribbon only renders under `body.model-ro`, so pointing a LIVE v2 control at it would name an
7415
7684
  // element that is not on the page — and its text says the whole model is read-only, which is no longer
7416
7685
  // true here. Describe it only where the ribbon actually exists.
@@ -7954,37 +8223,43 @@ async function sendSelectionToHost(host,ids,hostPid){
7954
8223
  * and it is worse here, because a wrong position looks right.
7955
8224
  */
7956
8225
  /**
7957
- * PROPERTY-LABEL VISIBILITY: a display flag v2's schema does not have (unit 5, P7d).
7958
- *
7959
- * v1's `prop_labels` is `additionalProperties: true`, and the editor stores a per-view `vis2d`/`vis3d`
7960
- * there. v2 CLOSED that object to `props`/`placement`/`selected_only`/`ids`, so writing either key
7961
- * corrupts the document — the save is then refused for a toggle the user flicked, which is precisely the
7962
- * failure §8.4 is about. Found by Codex's H9, not by the schema check, because the write happens on a
7963
- * click rather than at boot.
7964
- *
7965
- * So for v2 the flag is REFUSED at the write, and `roDisablePropLabelToggles()` actually disables the two
7966
- * controls that set it — the first version of this repair refused the write and left both looking live,
7967
- * which is the silent no-op this whole mode exists to avoid.
7968
- *
7969
- * AND THE READ ANSWERS OFF. A draft of this said the honest read of an absent flag is ON, since v2 has no
7970
- * per-view visibility concept — and a real browser pass proved that wrong immediately, with a TypeError:
7971
- * answering ON sends `refreshPropLabels3d` on into `propLabelMembers`, and the label CONTENT
7972
- * (`propLabelLinesFor`) is a v1-shaped derivation over `m.tos`/`m.col`/the plan's member list. There is
7973
- * nothing behind the flag that can produce a correct label for a v2 member, so OFF is the true answer and
7974
- * "no stored flag" was the wrong thing to reason from. Porting that derivation is a later unit's.
7975
- *
7976
- * This is the same line drawn everywhere else in this mode: display state stays live where v2's schema
7977
- * allows it (`dim_overlays` is open, and its toggles are untouched), and is refused where v2 closed it.
7978
- *
7979
- * BOTH GATES ASK THE FORMAT, NOT WRITABILITY. They shipped as `canWriteModel()` / `MODEL_RO`, which were
7980
- * indistinguishable from MODEL_V2 while v2 was read-only. Activating v2 (MODEL_V2_LIVE) made MODEL_RO
7981
- * permanently false and re-opened both: the click handlers began writing `vis2d`/`vis3d` onto a closed
7982
- * `prop_labels` — corrupting the document so the NEXT save is refused for a toggle the user flicked — and
7983
- * `plVis` began answering from those flags, which is the TypeError path the paragraph above describes.
7984
- * Making v2 writable does not give v2 a place to keep this flag, nor a label derivation that could use it.
8226
+ * PROPERTY-LABEL VISIBILITY — one flag, both formats (#614).
8227
+ *
8228
+ * HISTORY, because the shape of the repair follows from it. v1's `prop_labels` is
8229
+ * `additionalProperties: true` and the editor stores a per-view `vis2d`/`vis3d` there. v2 CLOSED that
8230
+ * object to `props`/`placement`/`selected_only`/`ids`, so unit 5 (P7d) refused the write and disabled the
8231
+ * two controls: leaving a live-looking toggle over a refused write is the silent no-op that mode existed
8232
+ * to remove, and writing the key anyway would corrupt the document so the NEXT save is refused for a
8233
+ * toggle the user flicked.
8234
+ *
8235
+ * That was right about the schema and wrong about the feature. Two causes were tangled in one flag and
8236
+ * only one was real:
8237
+ *
8238
+ * 1. REAL — v2 had nowhere to keep the flag. Fixed where it belonged, in the schema: `propLabels` now
8239
+ * carries `vis2d`/`vis3d`. It is closed to keep `ids` accountable to identity migration, not to
8240
+ * withhold display state, and `props`/`placement`/`selected_only`/`ids` were always accepted.
8241
+ * A browser-local store was the cheaper alternative and was rejected: the property SELECTION already
8242
+ * travels in the document, so keeping only show/hide per machine would open the same project on
8243
+ * another machine with the props ticked and the chips missing.
8244
+ * 2. NOT REAL — "nothing behind the flag can produce a correct label for a v2 member". The label
8245
+ * derivation reads `m.profile`, `m.role`, `m.ends[].tos`, `m.col`, and the ACTIVE PLAN's member
8246
+ * list; on v2 the active plan IS `V2_PROJECTION.plan`, and `projectMember()` emits exactly that v1
8247
+ * vocabulary (`web/steel-model-v2-projection.js`). The TypeError that killed the first attempt came
8248
+ * from answering ON while `sanitizePropLabels` was skipped, so `pl.props` was undefined — a missing
8249
+ * normalisation, not a missing derivation. That sanitiser now runs on both formats.
8250
+ *
8251
+ * ABSENT MEANS ON, and the `!== false` below is what says so. Both formats normalise at boot, so the
8252
+ * default is not what an ordinary open depends on — it is defence for the values that reach `plVis`
8253
+ * around that: the v2 draft restore (whose own sanitise this change also added), and a MIGRATED
8254
+ * document, since v1 only persists these flags once its editor has saved and migration cannot carry
8255
+ * what was never written. Reading either as "off" hides chips for properties the user has ticked.
8256
+ *
8257
+ * THE GATE ASKS WRITABILITY, WHICH IS NOW THE ONLY QUESTION LEFT. It shipped as `canWriteModel()`, was
8258
+ * narrowed to `&& !MODEL_V2` when v2 had no home for the flag, and goes back now that it does — the
8259
+ * format no longer decides anything here.
7985
8260
  */
7986
- function canWritePropLabelVis(){return canWriteModel()&&!MODEL_V2;}
7987
- function plVis(is3d){if(MODEL_V2)return false;const pl=C&&C.prop_labels;return !!(pl&&(is3d?pl.vis3d:pl.vis2d));}
8261
+ function canWritePropLabelVis(){return canWriteModel();}
8262
+ function plVis(is3d){const pl=C&&C.prop_labels;if(!pl)return false;return (is3d?pl.vis3d:pl.vis2d)!==false;}
7988
8263
  /** v2's ONE root member array. Not a plan property — see §8.3 on why reading `C.plans[].members` is worse than useless here. */
7989
8264
  function modelMembersV2(){return (C&&Array.isArray(C.members))?C.members:[];}
7990
8265
  /** Refuse a read the v2 arm cannot answer truthfully. THROWS — never a default, never a silent empty. */
@@ -8030,7 +8305,7 @@ function modelReadsV2(){
8030
8305
  invalidate(){}, // nothing is cached: a v2 member carries its own world-mm coordinates, so there is no per-plan scale to index
8031
8306
  geometryOf,
8032
8307
  lengthFt(m){const g=geometryOf(m),a=g&&g.line&&g.line[0],b=g&&g.line&&g.line[1];
8033
- return (a&&b)?Math.hypot(b[0]-a[0],b[1]-a[1],b[2]-a[2])/V2_PT_PER_FT:0;}, // stored world mm → true 3D feet; unknown/malformed elevations stay an absent label, never a fabricated length
8308
+ return (a&&b)?Math.hypot(b[0]-a[0],b[1]-a[1],b[2]-a[2])/V2_PT_PER_FT:0;}, // stored world mm → true 3D feet. Unknown/malformed elevations answer 0 here, which the header sums; it is `_lenFtLabel` that turns that into an ABSENT chip rather than a fabricated one (this comment claimed the absence and did not deliver it — #614)
8034
8309
  // A v2 member has no owning plan and no scale. This is only ever asked by a WRITE path (the member
8035
8310
  // drag, the endpoint drag, split), every one of which is refused — so reaching it is a bug, and a
8036
8311
  // throw says so instead of inverting a commit through a fabricated scale.
@@ -8097,8 +8372,14 @@ const view3dApi={
8097
8372
  onSelectBatch:({memberIds=[],gridIds=[]},additive)=>{const mids=memberIds.filter(selIdOK),gridAllowed=selGridOK(),gids=gridAllowed?gridIds:[];if(!additive&&(memberIds.length||gridIds.length)&&!mids.length&&!gids.length)return;selDimIds.clear();sel3dDimIds.clear();if(additive){for(const id of mids)selIds.has(id)?selIds.delete(id):selIds.add(id);for(const id of gids)selGridIds.has(id)?selGridIds.delete(id):selGridIds.add(id);}else{selIds=new Set(mids);selGridIds=new Set(gids);if(window.Steel3DView&&window.Steel3DView.setSelectedClips)window.Steel3DView.setSelectedClips([]);}render();if(window.Steel3DView&&window.Steel3DView.refreshDims)window.Steel3DView.refreshDims();}, // Atomic 3D area/direct pick for members + logical grids: filter each class, toggle additively, otherwise replace both selections together.
8098
8373
  // THE MEMBER LIST. v1 keeps one per sheet; v2 keeps ONE at the document root, which IS the whole model —
8099
8374
  // so for v2 both of these answer the same list, truthfully, rather than the silent [] that reading
8100
- // `C.plans[].members` would give (§8.3). The view only ever takes ids and hands the records back to
8101
- // `model().geometryOf`, so a v2 record travelling through here is read by nothing that assumes `wp`.
8375
+ // `C.plans[].members` would give (§8.3). The view takes ids and hands the records back to
8376
+ // `model().geometryOf`, which is what makes a v2 record safe to pass through here.
8377
+ //
8378
+ // "read by nothing that assumes `wp`" is what this said, and it was FALSE for two call sites: both 3D
8379
+ // label pools (`syncMemberLabels`, `syncPropLabels`) gated on `Array.isArray(m.wp)` and so skipped
8380
+ // every canonical member — the mark/id labels AND the property labels drew nothing on a v2 model, each
8381
+ // silently. Fixed at those sites (#614) by asking for the work line, the same repair P7d applied to the
8382
+ // reference lines. Stated rather than quietly corrected: the claim was the reason nobody looked.
8102
8383
  getMembers:()=>MODEL_V2?modelMembersV2():P.members, // v1: active-sheet members (wp); v2 3D reads canonical world members.
8103
8384
  allMembers, // EVERY member in the model — already format-aware (see its definition); the 3D box-select tests all visible meshes, not just the active sheet's
8104
8385
  // ── The three reads §8.3 names as plausible-but-FALSE for v2. Each is a v1 PLAN concept, and each has a
@@ -12202,6 +12483,11 @@ function rfiReason(m){if(!m.profile)return 'No profile assigned';
12202
12483
  if(/^MF/i.test(m.profile))return 'Moment-frame mark — pick a girder (see Frames)';
12203
12484
  if(/^BF/i.test(m.profile))return 'Brace-frame mark — pick a section';
12204
12485
  return 'Size not in the AISC table — check the designation';}
12486
+ // #628. One string for both markers on a verified row (the green number chip and the ✓ Verified pill) so
12487
+ // they can never drift apart. The apostrophe is typographic because this is a SINGLE-quoted JS literal,
12488
+ // where a straight one would end the string — nothing to do with the markup, where either is legal. What
12489
+ // the markup does require is that it stay free of `"`, since it is interpolated into a data-tip="…".
12490
+ const RFI_VTIP='Someone has confirmed this designation by hand. It is still listed because the AISC table can’t price it, so its weight stays out of the BOM.';
12205
12491
  function zoomToMember(m){const vl=memberViewLine(m),a=vl[0],b=vl[1],w=Math.abs(a[0]-b[0])||40,h=Math.abs(a[1]-b[1])||40; // frame what's DRAWN — an offset brace must land in view, not its invisible baseline
12206
12492
  applyZoom(Math.max(.3,Math.min(2.5,Math.min(stage.clientWidth/(w*2.2),stage.clientHeight/(h*2.2)))));
12207
12493
  const cx=(a[0]+b[0])/2,cy=(a[1]+b[1])/2;stage.scrollLeft=(cx-X0)*zoom-stage.clientWidth/2;stage.scrollTop=(cy-Y0)*zoom-stage.clientHeight/2;}
@@ -12241,11 +12527,12 @@ function zoomToMembers(arr){if(!arr.length){fitToWindow();return;}
12241
12527
  function zoomToSelection(){zoomToMembers(sel2d());}
12242
12528
  function openRFI(focusId){focusId=(typeof focusId==='string')?focusId:null; // #rfiStat binds openRFI directly (arg = MouseEvent) and the post-edit refresh passes nothing — only a real id string focuses a row
12243
12529
  const g=document.getElementById('rfiGrid');const list=rfiList();
12244
- g.innerHTML=list.length?('<div class=hint style="margin-bottom:10px">'+list.length+' member'+(list.length>1?'s':'')+' have no resolved AISC size, so their weight is excluded from the BOM. Assign a profile to clear it — for <b>MF/BF</b> marks use the <b>Frames</b> schedule. Edits here update the contract.</div><table class=ftab><thead><tr><th>#</th><th>Profile / mark</th><th>Role</th><th>Length</th><th>Why it’s flagged</th><th></th></tr></thead><tbody>'+
12245
- list.map((m,i)=>{ensureMeta(m);const L=_lenFt(m).toFixed(1);
12246
- return `<tr><td><span class=rfichip>${i+1}</span></td>
12530
+ g.innerHTML=list.length?('<div class=hint style="margin-bottom:10px">'+list.length+' member'+(list.length>1?'s have':' has')+' no resolved AISC size, so their weight is excluded from the BOM. A green <b>✓ Verified</b> means someone has already confirmed that designation by hand — it is right, it just isn’t in the AISC table. Assign a profile to clear it; for <b>MF/BF</b> marks use the <b>Frames</b> schedule. Edits here update the contract.</div><table class=ftab><thead><tr><th>#</th><th>Profile / mark</th><th>Role</th><th>Length</th><th>Why it’s flagged</th><th>Verified</th><th></th></tr></thead><tbody>'+
12531
+ list.map((m,i)=>{ensureMeta(m);const L=_lenFt(m).toFixed(1);const v=m.verified===true; // #628: verified ≠ resolved — a hand-confirmed member with no AISC size STAYS on this list (its weight is still out of the BOM); the marker only says a human has been here, so "checked, the library just can’t price it" stops reading like "not looked at yet"
12532
+ return `<tr${v?' class=rfi-verified':''}><td><span class="rfichip${v?' verified':''}"${v?` data-tip="${RFI_VTIP}"`:''}>${i+1}</span></td>
12247
12533
  <td><input class=combo data-src=profiles data-mid="${esc(m.id)}" value="${esc(m.profile||'')}" placeholder="e.g. W16X26" autocomplete=off style="width:124px"></td>
12248
12534
  <td>${m.role==='column'?'Column':'Beam'}</td><td>${L} ft</td><td class=rea>${esc(rfiReason(m))}</td>
12535
+ <td class=vcell>${v?`<span class="chip verified" data-tip="${RFI_VTIP}">✓ Verified</span>`:''}</td>
12249
12536
  <td><button class=ghost data-loc="${esc(m.id)}">Locate</button></td></tr>`;}).join('')+'</tbody></table>')
12250
12537
  :'<div class=hint>No unresolved members — every member has a resolved AISC size. ✓</div>';
12251
12538
  g.querySelectorAll('input.combo[data-mid]').forEach(inp=>inp.onchange=e=>{const m=byId(inp.dataset.mid);if(!m)return;
@@ -13875,6 +14162,22 @@ if(new URLSearchParams(location.search).get('selftest')==='1'){(function(){
13875
14162
  ok(posDefault(shallow({type:'vertical',floor:'above',offset:12},'top'))==='top','an explicit position still wins');
13876
14163
  P.pt_per_ft=sp2;defaultTOS=st2;}
13877
14164
 
14165
+ // 16) hasPlanDir()/posHEligible() must MIRROR the bake's own refusals in server/contract-to-scene.ts
14166
+ // planeOffset(), or the inspector offers a Left/Right the 3D silently ignores (or hides one it
14167
+ // would honour). The discriminating axis is UNITS: m.wp is display PIXELS in both model versions
14168
+ // while the bake's DEGENERATE_MM threshold is millimetres, so the conversion is the whole test —
14169
+ // at pt_per_ft 12 one px is 25.4 mm, and a raw-px comparison against 1 would pass BOTH cases below.
14170
+ {const sp3=P.pt_per_ft;P.pt_per_ft=12; // k = 304.8/12 = 25.4 mm per px
14171
+ const mk=(dx,profile)=>({id:'hp',role:'beam',profile,wp:[[0,0],[dx,0]],ends:[{tos:0,tosDef:false},{tos:0,tosDef:false}]});
14172
+ ok(hasPlanDir(mk(0.04,'W16X26'))===true,'hasPlanDir accepts 0.04 px = 1.016 mm (over the 1 mm floor)');
14173
+ ok(hasPlanDir(mk(0.03,'W16X26'))===false,'hasPlanDir rejects 0.03 px = 0.762 mm (under it) — px are not mm');
14174
+ ok(hasPlanDir(Object.assign(mk(120,'W16X26'),{role:'column'}))===false,'a column never has a plan direction to justify to');
14175
+ ok(posHEligible(mk(120,'W16X26'))===true,'a real beam with a resolved profile is eligible');
14176
+ ok(posHEligible(mk(120,'MF'))===false,'an unresolved mark has no section to flush a face to');
14177
+ ok(posHDefault(mk(120,'W16X26'))==='middle','posHDefault centres a member that never set one');
14178
+ ok(posHDefault(Object.assign(mk(120,'W16X26'),{positionH:'left'}))==='left','an explicit positionH wins');
14179
+ P.pt_per_ft=sp3;}
14180
+
13878
14181
  const msg=fails.length?('SELFTEST FAIL: '+fails.join(' | ')):'SELFTEST PASS (frame + snap + transform + brace math)';
13879
14182
  console[fails.length?'error':'log'](msg);try{toast(msg);}catch(_){}
13880
14183
  })();}