@floless/app 0.124.0 → 0.125.0

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,7 +49,7 @@
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
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) */
@@ -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}
@@ -498,7 +572,15 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
498
572
  #moreMenu button:disabled{opacity:.4;cursor:default;background:transparent}
499
573
  #moreMenu button.on{color:var(--brand)}
500
574
  button:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
501
- #srcStat{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
575
+ /* Provenance is an at-a-glance marker, not a second sheet selector: a muted label plus one short bold
576
+ value, the way the header's other stat chips read (Members 6, Axes Global), with the full caption in
577
+ data-tip. Capping the value holds the whole chip to 173px even on a name that overruns (master's ran
578
+ to 240px), which is what keeps a 1920 window's button bank on one row — the header is flex-wrap:wrap,
579
+ so it still wraps below ~1870px, and sooner the longer the value. `b` needs
580
+ inline-block for max-width to apply at all, and vertical-align:bottom to hold its baseline with the
581
+ sibling chips (overflow:hidden makes an inline-block's bottom edge its own baseline). */
582
+ #srcStat{white-space:nowrap}
583
+ #srcStat b{display:inline-block;max-width:130px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
502
584
  #detailNewForm input#dnName{margin:2px 0 10px}
503
585
  #dnDrop{border:1px dashed #475569;border-radius:8px;background:#0b1220;min-height:88px;display:flex;align-items:center;justify-content:center;gap:12px;text-align:center;color:var(--mut);cursor:pointer;padding:12px;font-size:12px}
504
586
  #dnDrop:hover{border-color:var(--brand);color:var(--text)} #dnDrop.has{border-style:solid;border-color:var(--brand)}
@@ -874,7 +956,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
874
956
  #m3dRefsBody .refdet{padding:6px 6px 8px;margin:2px 0 6px;border-left:1px solid var(--line);display:flex;flex-direction:column;gap:6px}
875
957
  #m3dRefsBody .refdet .drow{display:flex;align-items:center;gap:6px}
876
958
  #m3dRefsBody .refdet .dlab{flex:none;color:var(--mut);font-size:11px;min-width:52px}
877
- #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 */
878
960
  #m3dRefsBody .refdet .dval{flex:none;min-width:34px;text-align:right;font-variant-numeric:tabular-nums;color:var(--mut);font-size:11px}
879
961
  #m3dRefsBody .refdet input[type=text]{height:24px;font-size:11px}
880
962
  #m3dRefsBody .refdet .dnote{color:var(--mut);font-size:11px;line-height:1.45}
@@ -1165,9 +1247,12 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1165
1247
  <b>Steel Model</b>
1166
1248
  <div id=viewToggle role=group aria-label="Canvas view"><button id=vt2d class="seg on" aria-pressed=true data-tip="Plan view (2D overlay)">2D</button><button id=vt3d class=seg aria-pressed=false data-tip="3D model view">3D</button></div>
1167
1249
  <!-- Plan switcher. See the .plan-* rules for why this is not a <select>. Unlike the sibling page's sheet
1168
- switcher it is NOT hidden for a single plan: this control is the ONLY place the current sheet name
1169
- appears in this editor, so hiding it for a one-plan model would delete information rather than a
1170
- dead control. (An earlier version of this comment justified that by claiming the sibling can hide
1250
+ switcher it is NOT hidden for a single plan: this control is the only place the name of the plan you
1251
+ are LOOKING AT appears, so hiding it for a one-plan model would delete information rather than a
1252
+ dead control. (#srcStat is not a second one: it names the READ, and only ever with C.source.name or
1253
+ the read date — never C.source.sheet, which is why the header can never appear to name the plan you
1254
+ are on. A read that recorded ONLY a sheet shows no chip at all.)
1255
+ (An earlier version of this comment justified that by claiming the sibling can hide
1171
1256
  because the sheet is also named on its #src readout. That is false — #src renders `C.source.name`,
1172
1257
  the source FILE's name — and the sibling really does leave a lone sheet unnamed on screen. The
1173
1258
  decision here stands on its own; it does not need a claim about the other page.) -->
@@ -1503,7 +1588,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1503
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>
1504
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>
1505
1590
  <div style="overflow:auto;flex:1;padding:14px;scrollbar-width:thin">
1506
- <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>
1507
1592
  </div></div></div>
1508
1593
  <div id=framesModal><div class=mbackdrop id=framesBackdrop></div>
1509
1594
  <div class=mpanel><div class=mhead><b>Moment frame schedule</b><button id=framesClose>✕</button></div>
@@ -1541,9 +1626,9 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1541
1626
  <button type=button id=riPickToggle class=pilllink style="display:none" aria-expanded=false aria-controls=riPick>Load only part of this file ▸</button>
1542
1627
  <div id=riPick style="display:none">
1543
1628
  <div id=riPickNote style="display:none"></div>
1544
- <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>
1545
1630
  <div class=reftree id=riStoreyList></div>
1546
- <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>
1547
1632
  <div class=reftree id=riTypeList></div>
1548
1633
  </div>
1549
1634
  <div id=riNoBreak style="display:none"></div>
@@ -2567,6 +2652,52 @@ function posDefault(m){
2567
2652
  const z1=(m.ends&&m.ends[1]&&m.ends[1].tos!=null)?m.ends[1].tos:defaultTOS;
2568
2653
  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;
2569
2654
  return dz>horiz*0.5774?'middle':'top';}
2655
+ // Effective HORIZONTAL profile position — where the work-line sits ACROSS the section. No heuristic:
2656
+ // absent = centred, which is what every member did before the field existed. MIRROR of
2657
+ // server/contract-to-scene.ts planePosition().
2658
+ function posHDefault(m){return (m.positionH==='left'||m.positionH==='right')?m.positionH:'middle';}
2659
+ // Does this member have a PLAN direction to take a left/right from? `leftDir = ẑ × d̂` is degenerate for
2660
+ // a plumb member, so a column or a plumb brace has no left or right at all. m.wp is display PIXELS in
2661
+ // BOTH model versions (v2's projectMember writes px), so it converts with the same k as posDefault before
2662
+ // comparing — MIRROR of the bake's DEGENERATE_MM (1 mm) threshold in server/contract-to-scene.ts
2663
+ // planeOffset(). KEEP IN LOCK-STEP: the inspector must offer the control exactly where the bake honours it.
2664
+ function hasPlanDir(m){
2665
+ if(!m||m.role==='column'||!Array.isArray(m.wp)||m.wp.length<2)return false;
2666
+ const k=304.8/((P&&P.pt_per_ft>0)?P.pt_per_ft:1);
2667
+ return Math.hypot(m.wp[1][0]-m.wp[0][0],m.wp[1][1]-m.wp[0][1])*k>=1;}
2668
+ // Can this member be justified left/right? Needs a plan direction AND a resolved designation: a member
2669
+ // whose profile does not parse has no section frame to flush a face to (the bake refuses it for the same
2670
+ // reason — the 3D orients an unresolved/CUSTOM section by a minimal-arc rotation that does not line its
2671
+ // axes up with the plan). profileDimsIn's null/non-null answer is a pure parse, so this agrees with the
2672
+ // server whether or not the AISC table has loaded.
2673
+ function posHEligible(m){return hasPlanDir(m)&&profileDimsIn(m&&m.profile)!=null;}
2674
+ // Profile Position copy, in ONE place so the single- and multi-select panels cannot drift (they already
2675
+ // described the same control two different ways). Per-button tips, not one heading tip carrying
2676
+ // everything: with two axes under one heading the two "Middle" buttons sit adjacent, and each button
2677
+ // explaining itself is what tells them apart. The horizontal wording is spelled out rather than left to
2678
+ // a detailer's prior, because it names where the LINE goes (like Top/Bottom), which is the opposite of
2679
+ // Tekla's on-plane Left/Right naming the side the PART goes.
2680
+ // The frame-of-reference clause is repeated on BOTH left and right, deliberately: it is the sentence a
2681
+ // user hovers precisely BECAUSE they are unsure of the sense, and carrying it on only one of the pair
2682
+ // leaves the other to be guessed. The two "Middle"s now read differently for the same reason — with the
2683
+ // axes stacked they sit adjacent, and identical text is exactly what stops them being told apart.
2684
+ const POSTIP={
2685
+ 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.',
2686
+ top:'Top-of-steel — the dots sit on the section’s top face.',
2687
+ mid:'Centred on the work-line — it runs through the centroid in depth (the default).',
2688
+ bot:'Underside — the dots sit on the section’s bottom face.',
2689
+ midH:'Centred across the work-line — it runs down the middle of the section in plan (the default).',
2690
+ 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.',
2691
+ 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.',
2692
+ // An ineligible member may still CARRY a value — set before its profile or its geometry changed. Say so
2693
+ // rather than only saying why the control is gone: the value persists, survives migration, and starts
2694
+ // applying again the moment the member becomes eligible, so a silent hint would make that a jump out of
2695
+ // nowhere. `set` is the stored value, or '' when there is none.
2696
+ plumb:set=>'This member is plumb — its ends share the same point in plan, so it has no left or right to set.'
2697
+ +(set?' '+set[0].toUpperCase()+set.slice(1)+' is stored but not applied; it will apply again if the ends move apart.':''),
2698
+ noProf:set=>'This profile does not resolve to a section, so there is no face to line up with the work-line.'
2699
+ +(set?' '+set[0].toUpperCase()+set.slice(1)+' is stored but not applied; it will apply again if the profile resolves.':''),
2700
+ approx:p=>'⚠ '+p+' is not in the AISC table, so its width is estimated — “flush” is approximate here.'};
2570
2701
  // Swap a member's start (yellow, end 1) and end (magenta, end 2) handles — reverse its direction.
2571
2702
  // Beam: reverse wp + the per-end metadata (each end's TOS/note/detail follows its point). Column:
2572
2703
  // the two handles are bottom (BOS) and top (TOS), so swap those. Used by 2D + 3D via the same panel.
@@ -2586,6 +2717,14 @@ function swapMemberEnds(m){
2586
2717
  // symbol is drawn on. Negate the offset to keep the drawn line exactly where it was (ui-ux review).
2587
2718
  if(m.brace.offset)ModelCmd.patchMemberBrace(m,{offset:-m.brace.offset});
2588
2719
  }
2720
+ // positionH is the SAME class of property as that brace offset, and was the last direction-dependent
2721
+ // one left uncompensated: planeOffset() takes its left/right from the a→b direction, so reversing wp
2722
+ // moves a justified section to the OTHER side of its line — a full section width — while the panel,
2723
+ // the tooltip and the property label all keep asserting the original value. Mirror it, so a swap is
2724
+ // what it says it is: a change of direction, not of where the steel sits. Reachable in bulk via the
2725
+ // Reversed-beams tool, whose own tooltip tells the user to press P. (review; pinned server-side by
2726
+ // "reversing a member and mirroring its positionH leaves the steel exactly where it was".)
2727
+ if(m.positionH==='left'||m.positionH==='right')ModelCmd.patchMember(m,{positionH:m.positionH==='left'?'right':'left'});
2589
2728
  // F9: reversing swaps m's two physical points, so a dim ref's pt 'a'↔'b' must swap to keep pointing at the same
2590
2729
  // real end. Plan-scoped by member identity — only THIS member's owning plan's dims (never by id across plans, Codex R4 #4).
2591
2730
  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';}}
@@ -3729,7 +3868,7 @@ function len(a,b){return Math.hypot(a[0]-b[0],a[1]-b[1]);}
3729
3868
  // /api/aisc-shapes. Returns null for an unresolved mark (RFI).
3730
3869
  function profileDimsIn(profile){
3731
3870
  if(!profile)return null;
3732
- const p=String(profile).trim().toUpperCase().replace(/×/g,'X'); // separator may be x / X / ×
3871
+ 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
3733
3872
  if(p===''||/(^|[^A-Z])MF($|[^A-Z])/.test(p))return null;
3734
3873
  const m=p.match(/^([A-Z]+)\s*(.+)$/);if(!m)return null;
3735
3874
  // parseDim (not parseFloat) so a mixed-fraction leg "3 1/2" → 3.5, not 3 — mirrors server contract-to-scene.
@@ -3746,6 +3885,18 @@ function profileDimsIn(profile){
3746
3885
  if(bf!==undefined)return{d,w:bf};const ratio=(prefix==='C'||prefix==='MC')?0.28:0.42;return{d,w:d*ratio};}
3747
3886
  return null;
3748
3887
  }
3888
+ // True when profileDimsIn had to GUESS this profile's width from a per-series ratio (0.42d for W, 0.28d
3889
+ // for channels) because the designation is in neither AISC table — the `approx` flag the server carries.
3890
+ // Returns false when the tables have not loaded, because then we cannot tell and the server, which always
3891
+ // has them, is the authority; warning on every W-shape while a fetch is in flight would be a false alarm.
3892
+ function widthEstimated(profile){
3893
+ const sec=window.__AISC_SECTIONS,bf=window.__AISC_BF;
3894
+ if(!sec||!bf||!Object.keys(sec).length)return false;
3895
+ const p=String(profile||'').trim().toUpperCase().replace(/[×✕✖]/g,'X');
3896
+ const m=p.match(/^([A-Z]+)\s*(.+)$/);
3897
+ 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
3898
+ const key=p.replace(/\s+/g,'');
3899
+ return sec[key]===undefined&&bf[key]===undefined;}
3749
3900
  // Section shape kind from the designation — mirrors steel-3d-view.js shapeOf (parity with 3D).
3750
3901
  function sectionKindOf(profile){const p=String(profile||'').toUpperCase().trim();
3751
3902
  if(/^(W|M|S|HP|UC|UB|UKC|UKB|IPE|HE)/.test(p))return 'I';
@@ -4716,7 +4867,7 @@ function render(){
4716
4867
  // rather than drawing a plausible plan in the wrong place, which is the worst defect class this epic has.
4717
4868
  // The inspector still repaints: the read-only panel is what the user actually has here.
4718
4869
  // …and the header state, which this return used to skip entirely. The ⋯ → Display rows are the one
4719
- // group of STATE-REPORTING rows read-only leaves usable (RO_LOCKED_SECS locks detailing/checks/snap;
4870
+ // group of STATE-REPORTING rows read-only leaves usable (applyReadOnlyChrome locks detailing/checks/snap;
4720
4871
  // coords and session are left live too, but carry actions rather than state). Their sync sits in
4721
4872
  // render()'s trailing upd*() batch, which this return never reaches — so every one of them showed its
4722
4873
  // static markup instead, and the static markup carries NO `on` class at all, so the slider switch
@@ -4956,8 +5107,13 @@ async function connModifyRequest(j){
4956
5107
  const onMember=j.main?' on member '+j.main:'';
4957
5108
  const label=j.kind==='custom'&&j.name?' ("'+j.name+'")':'';
4958
5109
  const instruction='Modify the '+kindName+' connection "'+j.id+'"'+label+onMember+' (sheet '+((P&&P.sheet)||'?')+') — adjust, replace or move it per my request.';
5110
+ // `project` like both sibling producers (detailRequest, Ask AI): without it the relay composes an
5111
+ // APP-keyed GET/PUT, so in a workspace project the AI reads the wrong store — and if that app store
5112
+ // is empty the GET falls through to the baked publication, which carries no ETag, at which point the
5113
+ // instruction's own "If-None-Match: * when there was no ETag" rule has it CREATE an app-scoped
5114
+ // contract while the user's project document is never touched.
4959
5115
  try{const res=await fetch('/api/contract-request',{method:'POST',headers:{'content-type':'application/json'},
4960
- body:JSON.stringify({appId:APP_ID,instruction,intent:'modify',target:{sheet:(P&&P.sheet)||undefined,ids:[j.id,j.main].filter(Boolean)}})});
5116
+ body:JSON.stringify({appId:APP_ID,project:PROJECT||undefined,instruction,intent:'modify',target:{sheet:(P&&P.sheet)||undefined,ids:[j.id,j.main].filter(Boolean)}})});
4961
5117
  toast(res.ok?'Change queued for your terminal AI session':'Could not queue the request');
4962
5118
  }catch(_){toast('Could not queue the request');}
4963
5119
  }
@@ -5404,6 +5560,10 @@ function panel(){
5404
5560
  `<div class=divrow><hr><button class=ghost id=matchEnds>Match → both ends (each)</button><hr></div>`+
5405
5561
  `<div class=sect>${dotE}End</div>${mTos('tosB','TOS',s1)}${mNote('ntB',s1)}${mDet('dtB',s1)}`;}
5406
5562
  const posA=!allCol?agg(beams,m=>posDefault(m)):null;
5563
+ // Horizontal justification aggregates over the ELIGIBLE subset only — a plumb or unresolved member has
5564
+ // no left/right, so folding it in would report a Varies (or a value) for members the bake ignores.
5565
+ 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
5566
+ const posHA=hOk.length?agg(hOk,m=>posHDefault(m)):null;
5407
5567
  const rotAgg=agg(arr,m=>((((+m.rot||0)%360)+360)%360)); // shared rotation, or VARIES
5408
5568
  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
5409
5569
  p.innerHTML=`<h3>${arr.length} members selected</h3>
@@ -5414,8 +5574,13 @@ function panel(){
5414
5574
  <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>
5415
5575
  <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>
5416
5576
  ${elev}
5417
- ${!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>
5418
- <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>`:''}
5577
+ ${!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>
5578
+ <div class=elab style="margin-top:0">Vertical</div>
5579
+ <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>
5580
+ ${hOk.length?`<div class=elab>Horizontal</div>
5581
+ <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>
5582
+ ${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>`:''}`
5583
+ :`<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>`}`:''}
5419
5584
  <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>
5420
5585
  <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>
5421
5586
  <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>
@@ -5445,6 +5610,15 @@ function panel(){
5445
5610
  {const sp=v=>edit(()=>{for(const m of selArr())if(m.role!=='column')ModelCmd.patchMember(m,{position:v});});
5446
5611
  const _pt=document.getElementById('posTop'),_pm=document.getElementById('posMid'),_pb=document.getElementById('posBot');
5447
5612
  if(_pt)_pt.onclick=()=>sp('top');if(_pm)_pm.onclick=()=>sp('middle');if(_pb)_pb.onclick=()=>sp('bottom');}
5613
+ // Horizontal: commit to the eligible members only and SAY how many were left out — a control that
5614
+ // silently no-ops on part of the selection is the failure this panel exists to avoid. The
5615
+ // `targets.length` guard is the same one Match → both ends carries: edit() pushes undo unconditionally,
5616
+ // so an all-ineligible selection must not enter it and leave an empty entry on the stack.
5617
+ {const shp=v=>{const targets=selArr().filter(posHEligible),sk=selArr().length-targets.length;
5618
+ if(targets.length)edit(()=>{for(const m of targets)ModelCmd.patchMember(m,{positionH:v});});
5619
+ 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');};
5620
+ const _hl=document.getElementById('posHLeft'),_hm=document.getElementById('posHMid'),_hr=document.getElementById('posHRight');
5621
+ if(_hl)_hl.onclick=()=>shp('left');if(_hm)_hm.onclick=()=>shp('middle');if(_hr)_hr.onclick=()=>shp('right');}
5448
5622
  // Rotation — apply one angle to every selected member's section (blank input = no-op). Normalised (-360,360).
5449
5623
  {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});});};
5450
5624
  const _ri=document.getElementById('detRotZ');if(_ri)_ri.onchange=e=>{if(e.target.value.trim()==='')return;setRot(e.target.value);};
@@ -5469,6 +5643,13 @@ function panel(){
5469
5643
  if(sk)toast(sk+' brace'+(sk>1?'s':'')+' skipped — matching ends would flatten the slope its arrows encode');};}}
5470
5644
  return;}
5471
5645
  const m=ensureMeta(arr[0]), wpf=_wt(m.profile), L=_lenFt(m).toFixed(1), col=(m.role==='column'), pos=posDefault(m);
5646
+ // Horizontal axis: offered only where the bake honours it, and when it is not, the hint names both the
5647
+ // reason AND any value still stored on the member — that value keeps applying the moment the member
5648
+ // becomes eligible again, so silence would make the jump come from nowhere.
5649
+ const posH=posHDefault(m), hEl=posHEligible(m);
5650
+ const _hSet=(m.positionH==='left'||m.positionH==='right')?m.positionH:'';
5651
+ const hWhy=hasPlanDir(m)?POSTIP.noProf(_hSet):POSTIP.plumb(_hSet);
5652
+ const hApprox=hEl&&widthEstimated(m.profile)?POSTIP.approx(esc(m.profile)):'';
5472
5653
  const _lvl=({'S-202':'second','S-203':'roof'})[P.sheet];
5473
5654
  const mfSug=((m.mf||/^MF/i.test(m.profile))&&_lvl&&C.moment_frames)?[...new Set(C.moment_frames.flatMap(f=>f[_lvl]||[]))].filter(Boolean):[];
5474
5655
  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>`;
@@ -5661,8 +5842,13 @@ function panel(){
5661
5842
  ${elev}
5662
5843
  ${defPts}
5663
5844
  ${bpSect}${spSect}${copeSect}
5664
- ${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>
5665
- <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>`}
5845
+ ${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>
5846
+ <div class=elab style="margin-top:0">Vertical</div>
5847
+ <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>
5848
+ ${hEl?`<div class=elab>Horizontal</div>
5849
+ <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>
5850
+ ${hApprox?`<div class=hint style="margin-top:4px">${hApprox}</div>`:''}`
5851
+ :`<div class=hint style="margin-top:8px">${hWhy}</div>`}`}
5666
5852
  <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>
5667
5853
  <div class=detrow><label class=detf><span>Angle °</span><input id=detRotZ inputmode=decimal value="${rotDisp}" autocomplete=off></label></div>
5668
5854
  <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>
@@ -5696,6 +5882,9 @@ function panel(){
5696
5882
  {const setPos=v=>edit(()=>{ModelCmd.patchMember(m,{position:v});}); // profile placement on the reference line; persists + re-extrudes the 3D
5697
5883
  const _pt=document.getElementById('posTop'),_pm=document.getElementById('posMid'),_pb=document.getElementById('posBot');
5698
5884
  if(_pt)_pt.onclick=()=>setPos('top');if(_pm)_pm.onclick=()=>setPos('middle');if(_pb)_pb.onclick=()=>setPos('bottom');}
5885
+ {const setPosH=v=>edit(()=>{ModelCmd.patchMember(m,{positionH:v});}); // the plan half of the same placement — shifts the section ACROSS the line (3D + exports)
5886
+ const _hl=document.getElementById('posHLeft'),_hm=document.getElementById('posHMid'),_hr=document.getElementById('posHRight');
5887
+ if(_hl)_hl.onclick=()=>setPosH('left');if(_hm)_hm.onclick=()=>setPosH('middle');if(_hr)_hr.onclick=()=>setPosH('right');}
5699
5888
  // Rotation — spin the section about the reference line. Normalised to (-360,360); 0 = as drawn.
5700
5889
  // edit() re-renders 2D (columnSectionPoly reads m.rot) AND re-extrudes 3D (steel-3d-view el.rot).
5701
5890
  {const setRot=v=>{let r=Number(String(v).replace(',','.'));if(!isFinite(r))return;r=r%360;edit(()=>{ModelCmd.patchMember(m,{rot:r});});};
@@ -6073,6 +6262,12 @@ const PROP_DEFS=[
6073
6262
  {key:'length', label:'Length', get:m=>_lenFt(m), fmt:v=>v==null?'':v.toFixed(1)+' ft'},
6074
6263
  {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'},
6075
6264
  {key:'position', label:'Position', get:m=>m.role==='column'?undefined:posDefault(m), fmt:v=>v?v[0].toUpperCase()+v.slice(1):''},
6265
+ // undefined wherever the concept itself is undefined (a column, a plumb member, an unresolved profile) —
6266
+ // the label must never print a justification the bake ignores.
6267
+ // A member that is ineligible but still CARRIES a value prints it as "not applied" rather than blank:
6268
+ // blank would say the member has no justification when it has one the bake is declining to honour, and
6269
+ // that value starts applying again the moment the profile resolves or the ends move apart.
6270
+ {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):''},
6076
6271
  {key:'verified', label:'Verified', get:m=>m.verified===true?'Yes':'No', fmt:v=>v||''},
6077
6272
  {key:'tos_start', label:'TOS (start)', get:m=>m.role==='column'?undefined:_effTos(m.ends&&m.ends[0]), fmt:v=>v==null?'':fmtFtIn(v)},
6078
6273
  {key:'tos_end', label:'TOS (end)', get:m=>m.role==='column'?undefined:_effTos(m.ends&&m.ends[1]), fmt:v=>v==null?'':fmtFtIn(v)},
@@ -7317,10 +7512,6 @@ document.getElementById('gridEditB').onclick=()=>{setGridMode(!gridMode);render(
7317
7512
  * why), and ⋯ → Display, whose rows are view state.
7318
7513
  */
7319
7514
  const RO_ANCHORS=['mAdd','dimB','xfB','m3dDim']; // the two 2D write tools, the Move/Copy menu, and the 3D twin of the Dimension tool
7320
- // The ⋯ sections whose ROWS write the model. Named once, so the disable and the stay-shut rule above
7321
- // cannot drift apart — the header ids follow from these. `display` is absent deliberately: its rows are
7322
- // view state, and Grid lines… lives there.
7323
- const RO_LOCKED_SECS=['detailing','checks','snap'];
7324
7515
  function applyReadOnlyChrome(){
7325
7516
  if(!MODEL_RO)return;
7326
7517
  document.body.classList.add('model-ro');
@@ -7339,7 +7530,7 @@ function applyReadOnlyChrome(){
7339
7530
  // Disabling stops the CLICK; it does not undo the restore. Both halves happen here, in one place,
7340
7531
  // addressed by id, because the restore loop itself is querySelectorAll-driven and a guard there could
7341
7532
  // never be proven headless. (unit 5, P7d.)
7342
- for(const id of ['secDetailingHdr','secChecksHdr','snapHdr']){ // the header ids for RO_LOCKED_SECS
7533
+ for(const id of ['secDetailingHdr','secChecksHdr','snapHdr']){ // the header ids of the locked sections: detailing, checks, snap
7343
7534
  const h=document.getElementById(id);off(h);
7344
7535
  if(!h)continue;
7345
7536
  h.setAttribute('aria-expanded','false');
@@ -12186,6 +12377,11 @@ function rfiReason(m){if(!m.profile)return 'No profile assigned';
12186
12377
  if(/^MF/i.test(m.profile))return 'Moment-frame mark — pick a girder (see Frames)';
12187
12378
  if(/^BF/i.test(m.profile))return 'Brace-frame mark — pick a section';
12188
12379
  return 'Size not in the AISC table — check the designation';}
12380
+ // #628. One string for both markers on a verified row (the green number chip and the ✓ Verified pill) so
12381
+ // they can never drift apart. The apostrophe is typographic because this is a SINGLE-quoted JS literal,
12382
+ // where a straight one would end the string — nothing to do with the markup, where either is legal. What
12383
+ // the markup does require is that it stay free of `"`, since it is interpolated into a data-tip="…".
12384
+ 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.';
12189
12385
  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
12190
12386
  applyZoom(Math.max(.3,Math.min(2.5,Math.min(stage.clientWidth/(w*2.2),stage.clientHeight/(h*2.2)))));
12191
12387
  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;}
@@ -12225,11 +12421,12 @@ function zoomToMembers(arr){if(!arr.length){fitToWindow();return;}
12225
12421
  function zoomToSelection(){zoomToMembers(sel2d());}
12226
12422
  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
12227
12423
  const g=document.getElementById('rfiGrid');const list=rfiList();
12228
- 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>'+
12229
- list.map((m,i)=>{ensureMeta(m);const L=_lenFt(m).toFixed(1);
12230
- return `<tr><td><span class=rfichip>${i+1}</span></td>
12424
+ 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>'+
12425
+ 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"
12426
+ return `<tr${v?' class=rfi-verified':''}><td><span class="rfichip${v?' verified':''}"${v?` data-tip="${RFI_VTIP}"`:''}>${i+1}</span></td>
12231
12427
  <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>
12232
12428
  <td>${m.role==='column'?'Column':'Beam'}</td><td>${L} ft</td><td class=rea>${esc(rfiReason(m))}</td>
12429
+ <td class=vcell>${v?`<span class="chip verified" data-tip="${RFI_VTIP}">✓ Verified</span>`:''}</td>
12233
12430
  <td><button class=ghost data-loc="${esc(m.id)}">Locate</button></td></tr>`;}).join('')+'</tbody></table>')
12234
12431
  :'<div class=hint>No unresolved members — every member has a resolved AISC size. ✓</div>';
12235
12432
  g.querySelectorAll('input.combo[data-mid]').forEach(inp=>inp.onchange=e=>{const m=byId(inp.dataset.mid);if(!m)return;
@@ -13859,19 +14056,67 @@ if(new URLSearchParams(location.search).get('selftest')==='1'){(function(){
13859
14056
  ok(posDefault(shallow({type:'vertical',floor:'above',offset:12},'top'))==='top','an explicit position still wins');
13860
14057
  P.pt_per_ft=sp2;defaultTOS=st2;}
13861
14058
 
14059
+ // 16) hasPlanDir()/posHEligible() must MIRROR the bake's own refusals in server/contract-to-scene.ts
14060
+ // planeOffset(), or the inspector offers a Left/Right the 3D silently ignores (or hides one it
14061
+ // would honour). The discriminating axis is UNITS: m.wp is display PIXELS in both model versions
14062
+ // while the bake's DEGENERATE_MM threshold is millimetres, so the conversion is the whole test —
14063
+ // at pt_per_ft 12 one px is 25.4 mm, and a raw-px comparison against 1 would pass BOTH cases below.
14064
+ {const sp3=P.pt_per_ft;P.pt_per_ft=12; // k = 304.8/12 = 25.4 mm per px
14065
+ const mk=(dx,profile)=>({id:'hp',role:'beam',profile,wp:[[0,0],[dx,0]],ends:[{tos:0,tosDef:false},{tos:0,tosDef:false}]});
14066
+ ok(hasPlanDir(mk(0.04,'W16X26'))===true,'hasPlanDir accepts 0.04 px = 1.016 mm (over the 1 mm floor)');
14067
+ ok(hasPlanDir(mk(0.03,'W16X26'))===false,'hasPlanDir rejects 0.03 px = 0.762 mm (under it) — px are not mm');
14068
+ ok(hasPlanDir(Object.assign(mk(120,'W16X26'),{role:'column'}))===false,'a column never has a plan direction to justify to');
14069
+ ok(posHEligible(mk(120,'W16X26'))===true,'a real beam with a resolved profile is eligible');
14070
+ ok(posHEligible(mk(120,'MF'))===false,'an unresolved mark has no section to flush a face to');
14071
+ ok(posHDefault(mk(120,'W16X26'))==='middle','posHDefault centres a member that never set one');
14072
+ ok(posHDefault(Object.assign(mk(120,'W16X26'),{positionH:'left'}))==='left','an explicit positionH wins');
14073
+ P.pt_per_ft=sp3;}
14074
+
13862
14075
  const msg=fails.length?('SELFTEST FAIL: '+fails.join(' | ')):'SELFTEST PASS (frame + snap + transform + brace math)';
13863
14076
  console[fails.length?'error':'log'](msg);try{toast(msg);}catch(_){}
13864
14077
  })();}
13865
- // --- provenance caption: show contract.source when present (read from <name> · <sheet> · <read_at>) ---
14078
+ // --- provenance chip: contract.source (name/sheet/read_at) → "Source <file>", full caption in the tooltip ---
14079
+ // contract.source is authored by the terminal AI that read the drawing, so a source that is PRESENT but
14080
+ // unusable is a real upstream bug, not an empty state. An ABSENT one stays silent — a hand-built model
14081
+ // legitimately has none — but anything else warns, so a reader that drifts its shape is not mistaken for
14082
+ // "this model was never read from a drawing". console.warn, not error: the E2E gate reads the error channel
14083
+ // and a malformed contract must not spend it. (silent-failure review; same rule as normBrace above.)
13866
14084
  (function(){
13867
- const src=C.source;if(!src||typeof src!=='object')return;
13868
- const parts=[];
13869
- if(src.name)parts.push('read from '+src.name);
13870
- if(src.sheet)parts.push(src.sheet);
13871
- if(src.read_at){try{const d=new Date(src.read_at);if(!isNaN(d.getTime()))parts.push(d.toLocaleDateString());}catch{/* skip unparseable date */}}
13872
- if(!parts.length)return;
13873
- const el=document.getElementById('srcStat');if(!el)return;
13874
- el.textContent=parts.join(' · ');el.dataset.tip=parts.join(' · ');el.style.display=''; // title = full provenance (the chip itself truncates with ellipsis)
14085
+ const src=C.source;if(src==null)return; // no provenance recorded — the legitimate empty state
14086
+ // Each call states its OWN consequence: a refused field still leaves a chip, a refused source does not.
14087
+ const warn=(why,got)=>{console.warn('steel-editor: contract.source '+why,got);};
14088
+ if(typeof src!=='object'||Array.isArray(src)){warn('is not an object — the provenance chip stays hidden',src);return;}
14089
+ // Never coerce: every field here is drawing-derived, and an object reaching String() paints the literal
14090
+ // "[object Object]" into the header — the same reason planLabel refuses it. A non-string is not a value.
14091
+ // Refusing it WARNS, because partial drift is the likelier kind: a reader that starts emitting epoch-ms
14092
+ // for read_at, or a number for sheet, would otherwise have that one field vanish from the tooltip with
14093
+ // everything else still rendering, and nothing anywhere to notice. Absent — missing, null, or the empty
14094
+ // string a serializer writes for "unknown" — is silent; 0, false and objects are drift and are not.
14095
+ const str=(v,k)=>{if(v==null||v==='')return'';if(typeof v==='string'&&v.trim())return v.trim();warn('carried a '+k+' that is not a usable string — that field is left out of the chip',v);return'';};
14096
+ const name=str(src.name,'name'),sheet=str(src.sheet,'sheet'),stamp=str(src.read_at,'read_at');
14097
+ const parts=[];let day='';
14098
+ if(name)parts.push('read from '+name);
14099
+ if(sheet)parts.push(sheet);
14100
+ // No try/catch: new Date(<string>) never throws — it returns Invalid Date, which isNaN already catches.
14101
+ // Requiring a STRING also keeps read_at 0/null/true out; each of those is a VALID Date of 1 Jan 1970,
14102
+ // so a looser guard would stamp the chip with an epoch date nobody's drawing was read on.
14103
+ if(stamp){const d=new Date(stamp);if(isNaN(d.getTime()))warn('carried an unreadable read_at — the date is left out of the chip',src.read_at);else{day=d.toLocaleDateString(undefined,{timeZone:'UTC'});parts.push(day);}}
14104
+ if(!parts.length){warn('recorded no name, sheet or readable date — the provenance chip stays hidden',src);return;}
14105
+ const el=document.getElementById('srcStat');
14106
+ if(!el){warn('cannot render — #srcStat is missing from the header',null);return;}
14107
+ // The value must be one that CANNOT go stale, because this block runs once at boot and nothing re-runs
14108
+ // it on setPlan(). The file and the read date are fixed for the life of the page; source.sheet is not.
14109
+ // It is the single sheet the drawing was READ from, while plans[] holds many and C.active is restored
14110
+ // from localStorage — so a multi-sheet model opens on S-202 with the chip stamped S-201, in a row of
14111
+ // live per-sheet stats (Members, Dup, Axes) where that reads as "current". So the sheet NEVER heads this
14112
+ // chip, not even as a last resort: a source with no file and no readable date has recorded no stale-proof
14113
+ // identity, and a readout that is wrong is worse than one that is absent (see the per-sheet counts
14114
+ // above). That is the same call as the {path, sha256} case just above — hide, and say why. The sheet
14115
+ // still reaches the tooltip whenever anything else earns the chip, where "read from …" dates it.
14116
+ const val=name||day;
14117
+ if(!val){warn('recorded only a sheet, which cannot head this chip without reading as the plan you are on — the provenance chip stays hidden',src);return;}
14118
+ el.textContent='Source ';el.append(Object.assign(document.createElement('b'),{textContent:val}));
14119
+ el.dataset.tip=parts.join(' · ');el.style.display='';
13875
14120
  })();
13876
14121
  // --- Ask AI: send instruction + optional screenshots → POST /api/contract-request ---
13877
14122
  // The server records a tweak-contract request; the terminal AI picks it up async and PUTs
@@ -351,7 +351,7 @@ export function createV2CommandSession(model, options = {}) {
351
351
  id, profile: projected.profile || '', from, to,
352
352
  provenance: 'manual',
353
353
  };
354
- for (const key of ['material', 'role', 'memberType', 'position', 'rot', 'section', 'bf', 'rfi', 'mf', 'verified', 'source', 'brace']) {
354
+ for (const key of ['material', 'role', 'memberType', 'position', 'positionH', 'rot', 'section', 'bf', 'rfi', 'mf', 'verified', 'source', 'brace']) {
355
355
  if (projected[key] !== undefined) member[key] = clone(projected[key]);
356
356
  }
357
357
  if (Array.isArray(projected.ends)) {
@@ -77,7 +77,7 @@ export function projectMember(member, plan, session = null) {
77
77
  role: member.role || 'beam',
78
78
  provenance: member.provenance,
79
79
  };
80
- for (const key of ['material', 'memberType', 'position', 'rot', 'section', 'bf', 'rfi', 'mf', 'verified', 'source', 'brace']) {
80
+ for (const key of ['material', 'memberType', 'position', 'positionH', 'rot', 'section', 'bf', 'rfi', 'mf', 'verified', 'source', 'brace']) {
81
81
  if (member[key] !== undefined) meta[key] = clone(member[key]);
82
82
  }
83
83
  const endMeta = Array.isArray(member.ends) ? member.ends : [{}, {}];