@floless/app 0.139.0 → 0.140.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.
@@ -16,7 +16,7 @@
16
16
  drawing palette — a separate piece of work — and #602's reporter names keeping the drawing dark as the
17
17
  acceptable choice as long as it is a deliberate one.
18
18
  THE FURNITURE FLOATING ON THE STAGE STAYS DARK WITH IT, and that is the same rule rather than an
19
- exception to it: a light zoom bar / 3D toolbar / legend over a dark model would put --text (near-black
19
+ exception to it: a light view band / 3D toolbar / legend over a dark model would put --text (near-black
20
20
  in light) on fills nobody re-tinted and drop its shadow into nothing. They are re-pinned wholesale by
21
21
  the ".island" block below — see it for the mechanism and the exact membership. */
22
22
  :root{
@@ -77,7 +77,6 @@
77
77
  --warn:#fbbf24;--warn-soft:#fcd34d;--warn-bg:#713f12;--warn-edge:#713f12; /* amber = "needs review", never an error */
78
78
  --ok:#86efac;--ok-bg:#166534;--ok-edge:#166534; /* green = human-confirmed */
79
79
  --ok-border:#16a34a;--ok-ink:#dcfce7; /* the FILLED success button (Dedupe done / Reviewed) */
80
- --hi:#4ade80;--hi-bg:#14532d; /* the confidence report's "high" band, one stop off --ok */
81
80
  --err:#fca5a5;--err-bg:#7f1d1d;--err-border:#991b1b;--err-edge:#7f1d1d;--err-ink:#fecaca;
82
81
  --err-underline:rgba(254,202,202,.55);
83
82
  --cyan:#22d3ee;--cyan-soft:rgba(34,211,238,.10); /* the "non-default, click to act" chip */
@@ -134,7 +133,6 @@
134
133
  --warn:#b45309;--warn-soft:#b45309;--warn-bg:#fef3c7;--warn-edge:#b45309;
135
134
  --ok:#15803d;--ok-bg:#dcfce7;--ok-edge:#15803d;
136
135
  --ok-border:#16a34a;--ok-ink:#15803d;
137
- --hi:#14532d;--hi-bg:#dcfce7; /* light keeps the two greens apart by INK depth, not a second tint */
138
136
  --err:#b91c1c;--err-bg:#fee2e2;--err-border:#ef4444;--err-edge:#b91c1c;--err-ink:#b91c1c;
139
137
  --err-underline:rgba(185,28,28,.55);
140
138
  --cyan:#155e75;--cyan-soft:rgba(21,94,117,.10);
@@ -162,7 +160,7 @@
162
160
  The 3D panel's tabs (#m3dLegend) and their row menus are out: they live in the main window's left Model
163
161
  section now (showLegendTab), not over the stage. */
164
162
  [data-theme="light"] #stage,[data-theme="light"] #stage3d,[data-theme="light"] #pane2d,[data-theme="light"] #pane3d,
165
- [data-theme="light"] #zoombar,[data-theme="light"] #connCrumb,[data-theme="light"] #bottomDock,
163
+ [data-theme="light"] #viewBar2d,[data-theme="light"] #connCrumb,[data-theme="light"] #bottomDock,
166
164
  [data-theme="light"] #selFly,[data-theme="light"] #m3dBar,[data-theme="light"] #m3dToolBar,
167
165
  [data-theme="light"] #propPop,[data-theme="light"] #snapMenu,[data-theme="light"] #dimEditPop,[data-theme="light"] #cmHud,
168
166
  [data-theme="light"] #m3dCube,[data-theme="light"] #m3dAxes,[data-theme="light"] #plHint,
@@ -207,7 +205,7 @@
207
205
  --ink-max:#fff;
208
206
  --warn:#fbbf24;--warn-soft:#fcd34d;--warn-bg:#713f12;--warn-edge:#713f12;
209
207
  --ok:#86efac;--ok-bg:#166534;--ok-edge:#166534;
210
- --ok-border:#16a34a;--ok-ink:#dcfce7;--hi:#4ade80;--hi-bg:#14532d;
208
+ --ok-border:#16a34a;--ok-ink:#dcfce7;
211
209
  --err:#fca5a5;--err-bg:#7f1d1d;--err-border:#991b1b;--err-edge:#7f1d1d;--err-ink:#fecaca;
212
210
  --err-underline:rgba(254,202,202,.55);
213
211
  --cyan:#22d3ee;--cyan-soft:rgba(34,211,238,.10);
@@ -335,9 +333,6 @@
335
333
  same inset bar, so no new colour enters the baseline. */
336
334
  body.split-view #pane2d.pane-active::after,body.split-view #pane3d.pane-active::after{content:"";position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 0 2px var(--brand);border-radius:2px;z-index:7}
337
335
  svg{display:block;touch-action:none;flex:none}
338
- #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}
339
- #zoombar button{padding:1px 9px;font-size:15px}
340
- #zoombar input[type=range]{width:120px} /* SIZING only — the theming is the global input[type=range] rule below */
341
336
  /* placed-detail inspector (Slice 4): ft-in fields in a row + a themed opacity slider (no native widgets) */
342
337
  .detrow{display:flex;gap:6px;margin:2px 0}
343
338
  .detf{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0;font-size:11px;color:var(--mut)}
@@ -355,8 +350,7 @@
355
350
  INTO, so an unusual profile cannot grow the rail. */
356
351
  #posSecSvg{display:block;width:100%;height:150px;background:var(--sunken);border:1px solid var(--line);border-radius:6px}
357
352
  #detOpacity{flex:1;min-width:0} /* SIZING only — the theming is the global input[type=range] rule below */
358
- #zoombar #zPct{min-width:40px;text-align:right;color:var(--mut);font-variant-numeric:tabular-nums}
359
- /* Connection Component breadcrumb (Slice A) — a floating chip over the 3D canvas, same recipe as #zoombar. */
353
+ /* Connection Component breadcrumb (Slice A) — a floating chip over the 3D canvas, same card recipe as the bands. */
360
354
  /* #935 — the plan-registration refusal, said out loud on the canvas the wrong geometry is drawn on.
361
355
  Floats over #pane2d the way #connCrumb floats over #pane3d (same recipe: absolute chip, themed
362
356
  chrome, its own z above the canvas), and wears .read-diag's amber triple because it reports
@@ -557,8 +551,8 @@
557
551
  `appearance:none` DELETES Chromium's thumb unless ::-webkit-slider-thumb re-declares it, exactly as
558
552
  it deletes the radio's dot, and Firefox does not implement that pseudo-element.
559
553
  WHAT THIS COSTS, said out loud rather than left for the next reader to discover: accent-color also
560
- tinted the FILLED part of the track, and Chromium has no pseudo-element for it, so these three
561
- sliders no longer show how far along the value is — the rail is one uniform var(--line). That is a
554
+ tinted the FILLED part of the track, and Chromium has no pseudo-element for it, so these sliders
555
+ (two since #1428 — the zoom bar's went with the bar) no longer show how far along the value is — the rail is one uniform var(--line). That is a
562
556
  real trade (a correct dark control, minus a cue), not a pure leak fix. Firefox DOES expose the
563
557
  filled portion as ::-moz-range-progress, so it is authored below; leaving it unauthored would have
564
558
  put a UA default over an authored track, which is the one-engine asymmetry this file rejects
@@ -1399,11 +1393,8 @@ rect.lblhot:focus-visible{outline:2px solid var(--brand);outline-offset:2px;stro
1399
1393
  #confStat{cursor:pointer;text-decoration:underline dotted} #confStat:hover b{filter:brightness(1.25)}
1400
1394
  .conf-cats{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;padding:14px;border-bottom:1px solid var(--line)}
1401
1395
  .ccard{background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:10px 12px}
1402
- .ccard.click{cursor:pointer} .ccard.click:hover{border-color:var(--brand)} .ccard.on{border-color:var(--brand)}
1403
1396
  .ccard .cc-label{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--mut);margin-bottom:4px}
1404
1397
  .ccard .cc-score{font-size:22px;font-weight:700;line-height:1;margin-bottom:6px}
1405
- .ccard .cc-bar{height:4px;border-radius:2px;background:var(--line);margin-bottom:6px;overflow:hidden}
1406
- .ccard .cc-fill{height:100%;border-radius:2px}
1407
1398
  .ccard .cc-counts{font-size:11px;color:var(--mut);display:flex;gap:8px;flex-wrap:wrap}
1408
1399
  .conf-filter{display:flex;gap:12px;flex-wrap:wrap;padding:12px 14px;border-bottom:1px solid var(--line);align-items:center}
1409
1400
  .conf-filter .glab{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--mut)}
@@ -1412,10 +1403,9 @@ rect.lblhot:focus-visible{outline:2px solid var(--brand);outline-offset:2px;stro
1412
1403
  .conf-filter .grp button.on{background:var(--brand);color:var(--brand-ink)}
1413
1404
  .conf-body{padding:0 14px 14px;overflow:auto;flex:1;min-height:0}
1414
1405
  .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}
1415
- .chip.assumed,.chip.weak{border-color:var(--warn-edge);color:var(--warn)} .chip.fail{border-color:var(--err-edge);color:var(--err)}
1416
- /* Human-confirmed. The same #166534/#86efac pair as the confidence report's `verified` band
1417
- (BANDPILL.verified) and the inspector's Mark-verified button — the TOKENS are shared, not the
1418
- treatment: this one is outlined like its .chip.fail/.chip.assumed siblings, BANDPILL's is filled. */
1406
+ .chip.assumed{border-color:var(--warn-edge);color:var(--warn)}
1407
+ /* Human-confirmed. The same --ok green as the Mark-verified buttons — the TOKENS are shared, not the
1408
+ treatment: this one is outlined like its .chip.assumed sibling. */
1419
1409
  .chip.verified{border-color:var(--ok-edge);color:var(--ok)}
1420
1410
  /* "user" = a value a human typed. Its blue holds on BOTH grounds (3.9:1 on light --panel, a clear edge
1421
1411
  on dark --panel), so only the INK steps down; the border is one of the few values needing no twin. */
@@ -1443,8 +1433,8 @@ rect.lblhot:focus-visible{outline:2px solid var(--brand);outline-offset:2px;stro
1443
1433
  .cbuilds{font-size:11px;line-height:1.4;color:var(--mut);margin-top:3px}
1444
1434
  .cbuilds b{color:var(--text);font-weight:600}
1445
1435
  .cbuilds .cundef{font-style:italic}
1446
- /* An authoring mistake the row itself can see — unreachable, not "waiting on you". Reuses the existing
1447
- .chip.fail tones rather than introducing a colour. */
1436
+ /* An authoring mistake the row itself can see — unreachable, not "waiting on you". Uses the --err tones
1437
+ rather than introducing a colour. */
1448
1438
  .cbuilds .cwarn{display:inline-block;margin-left:6px;padding:0 5px;border-radius:4px;font-size:10px;
1449
1439
  border:1px solid var(--err-edge);color:var(--err);cursor:default}
1450
1440
  .connset{opacity:.55}
@@ -1827,22 +1817,26 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1827
1817
  The sibling swatch `.swc` needs nothing — being an <input type=color> it already carries a
1828
1818
  1px border of its own. */
1829
1819
  [data-theme="light"] .epdot{box-shadow:0 0 0 1px var(--mut)}
1830
- /* 3D-only floating chrome (parity with AWARE viewer-3d): toolbar TL, ViewCube BR */
1820
+ /* Floating chrome over the panes (3D parity with AWARE viewer-3d): view bands TL, ViewCube BR */
1831
1821
  /* TWO BANDS over the viewport, not one bar and not a rail. The bar this began as was nine TEXT
1832
1822
  controls spanning left:12 to right:12 — near the full stage width, wrapping to extra rows on a
1833
1823
  narrow pane. As 30px icons the same nine come to ~280px in a single row that floats over the
1834
1824
  canvas rather than taking layout from it, which is a different proposition from what was moved.
1835
- The MODEL band (#m3dToolBar) is the other one: alone in 2D, where there is no view band, beside
1836
- this one in 3D and under it in Split — see the rules below. */
1825
+ The MODEL band (#m3dToolBar) is the other one: beside the 2D view band (#viewBar2d, #1428) in 2D,
1826
+ beside this one in 3D and under it in Split — see the rules below. */
1837
1827
  /* CAPPED SHORT OF THE CUBE. The cube hangs from the same top edge at right:12 (84px square), and this band
1838
1828
  wraps freely: in Split inside a project's Model step the 3D pane is ~345px, the band filled its width and
1839
1829
  sat over the cube, so a click on the cube hit the band. 124 = 12 left + 84 cube + 12 inset + 16 gap. */
1840
1830
  /* SIDE BY SIDE and both docked LEFT, view band first. The model band therefore starts where the
1841
1831
  view band ends, and that width is measured (--m3d-view-w) rather than assumed, because the view
1842
1832
  band wraps to a second row on a narrow pane and its own width is not fixed.
1843
- The offset applies ONLY when 3D is the only pane: Split has no room for the pair side by side, so
1844
- there the model band stacks under the view band instead (the Split rule below). In 2D there is no
1845
- view band at all, and the plain left:12 below is already right. */
1833
+ The offset applies when ONE pane is on screen: Split has no room for the pair side by side, so
1834
+ there the model band stacks under the view band instead (the Split rule below). 2D has its own,
1835
+ shorter view band (#viewBar2d — Fit all / Zoom to selected, #1428) in the same corner, so the base
1836
+ rule below docks off THAT one's measured width; 3D's rule swaps in the 3D band's. Both widths are
1837
+ measured by the same block of ResizeObserver hooks (one per band, just after the model shell mounts),
1838
+ so neither is assumed. The 2D rule sits AFTER the model band's own card rule below (same
1839
+ specificity, so order decides); these two outrank it by class. */
1846
1840
  body.v3d #m3dToolBar{left:calc(var(--m3d-view-w, 335px) + 22px)}
1847
1841
  /* Split gives the 3D half about 498px and the two bands want 486 of it, so side by side they sit flush
1848
1842
  against the pane edge and spill the moment the split is dragged narrower. In split the model band
@@ -1852,17 +1846,26 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1852
1846
  /* The model band: same card, always on — Add member and Dimension work in 2D as well as 3D. */
1853
1847
  #m3dToolBar{position:absolute;top:12px;left:12px;display:flex;flex-direction:row;flex-wrap:wrap;gap:2px;align-items:center;z-index:59;
1854
1848
  padding:4px;background:var(--panel);border:1px solid var(--line);border-radius:9px;box-shadow:0 6px 20px rgba(0,0,0,.5)} /* 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) */
1849
+ /* The 2D VIEW band (#1428): the 2D pane's counterpart of the 3D view band, in the same corner. It is the
1850
+ model band's card, declaration for declaration — steel-2d-view-band.test.ts holds the two rules equal,
1851
+ so they cannot drift — written as its own rule because steel-more-menu-stacking.test.ts reads the
1852
+ model band's `#m3dToolBar{` line by its own anchor (a shared selector list would break its z-index
1853
+ read). For the same reason the card rule above must stay ABOVE the `left:` re-statement below, which
1854
+ matches that anchor too and carries no z-index. */
1855
+ #viewBar2d{position:absolute;top:12px;left:12px;display:flex;flex-direction:row;flex-wrap:wrap;gap:2px;align-items:center;z-index:59;
1856
+ padding:4px;background:var(--panel);border:1px solid var(--line);border-radius:9px;box-shadow:0 6px 20px rgba(0,0,0,.5)}
1857
+ #m3dToolBar{left:calc(var(--v2d-view-w, 72px) + 22px)} /* 2D-only: beside #viewBar2d (the v3d / split rules above win by specificity); 72 is nominal — sync2d() overwrites it before first paint */
1855
1858
  /* Flat inside the card - the band carries the one shadow now. */
1856
- #m3dToolBar .m3dwrap>button,#m3dToolBar>button,#m3dToolBar .cmwrap>button,#m3dDim{width:30px;height:30px;padding:0;display:flex;align-items:center;justify-content:center;
1859
+ #m3dToolBar .m3dwrap>button,#m3dToolBar>button,#m3dToolBar .cmwrap>button,#m3dDim,#viewBar2d>button{width:30px;height:30px;padding:0;display:flex;align-items:center;justify-content:center;
1857
1860
  background:transparent;border:1px solid transparent;border-radius:6px;box-shadow:none;color:var(--mut)}
1858
- #m3dToolBar button:hover{background:var(--btn-hover);color:var(--text)}
1861
+ #m3dToolBar button:hover,#viewBar2d button:hover{background:var(--btn-hover);color:var(--text)}
1859
1862
  /* ONE ACTIVE LOOK for every kind of 'this is on': a mode that is armed (.on), a menu that is open,
1860
1863
  and a trigger that does announce aria-expanded. They are the same statement to the reader, so
1861
1864
  they get the same brand tint and border rather than three near-misses. */
1862
1865
  #m3dToolBar button[aria-expanded=true],#m3dToolBar button.on,
1863
1866
  #m3dToolBar .m3dwrap:has(> .m3dmenu.open) > button,
1864
1867
  #m3dToolBar .cmwrap:has(> .cmmenu.open) > button{background:#16243d;color:var(--brand);border-color:var(--brand)}
1865
- #m3dToolBar svg{width:16px;height:16px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
1868
+ #m3dToolBar svg,#viewBar2d svg{width:16px;height:16px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
1866
1869
  /* STATE IS THE ICON on the two buttons that have modes. CSS cannot compare one attribute to
1867
1870
  another, so each pairing is spelled out; the button carries data-proj / data-mode and only the
1868
1871
  matching glyph is drawn. Enumerated rather than swapped in JS because innerHTML would fight
@@ -1880,7 +1883,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1880
1883
  /* Disabled keeps the flat band shape and only loses contrast — the global button:disabled paints a
1881
1884
  --btn fill, which would read as a pressed pill sitting in the middle of a row of flat icons. */
1882
1885
  #m3dToolBar button:disabled{opacity:.38;cursor:default;background:transparent;border-color:transparent;box-shadow:none}
1883
- #m3dToolBar .rlbl{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
1886
+ #m3dToolBar .rlbl,#viewBar2d .rlbl{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
1884
1887
  /* position:relative anchors each menu to its own button and must stay; the pill padding and the
1885
1888
  per-button shadow are the old horizontal bar's and must not — the rail is one card with one
1886
1889
  shadow. The wrapper is sized to its button so it cannot widen the column around it. */
@@ -2711,7 +2714,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2711
2714
  <button data-command-id="steel.menu-section#Coordinate system" class=msec-hdr data-sec=coords aria-expanded=false data-tip="Local vs global drawing axes (for skewed framing)">Coordinate system<span class=chev aria-hidden=true>▸</span></button>
2712
2715
  <div class=msec-body data-reveal-by=".msec-hdr[data-sec=coords]">
2713
2716
  <button data-command-id="steel.local-axes" id=csSetB aria-pressed=false data-tip="Define a local X axis by clicking two points (origin, then X-direction). Y follows at 90°. Orthogonal drawing and X/Y dimensions then snap to this frame — for skewed framing.">↺ Set local axes…</button>
2714
- <button data-command-id="steel.local-frame" id=csArm3dB data-tip="Set the local drawing frame (3D): click 3 points — origin, X-direction, then a point on the Y side (which also sets which way Z points). Then drag the amber origin or the cyan ring to refine.">↺ Set local axes (3D)…</button>
2717
+ <button data-command-id="steel.local-frame" id=csArm3dB aria-pressed=false data-tip="Set the local drawing frame (3D): click 3 points — origin, X-direction, then a point on the Y side (which also sets which way Z points). Then drag the amber origin or the cyan ring to refine.">↺ Set local axes (3D)…</button>
2715
2718
  <div id=csF3dFields>
2716
2719
  <label class=csf3lab>Orientation</label><span id=csF3dOri class=csf3val data-tip="Set by the 3-click pick; spin it with the cyan ring. Re-pick to change the tilt.">—</span>
2717
2720
  <label class=csf3lab>Origin X (ft)</label><input data-command-id="steel.local-origin#X" aria-label="Local frame origin X (ft)" id=csF3dX type=number step=0.1 inputmode=decimal autocomplete=off>
@@ -2757,12 +2760,15 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2757
2760
  <button data-command-id="steel.provisional-source" id=provisionalSourceBtn type=button hidden>Open source</button>
2758
2761
  </div>
2759
2762
  </div>
2760
- <div id=zoombar>
2761
- <button data-command-id="steel.zoom" id=zOut data-tip="Zoom out">−</button>
2762
- <input data-command-id="steel.zoom" aria-label="Zoom level" id=zRange type=range min=10 max=400 step=1 value=100>
2763
- <button data-command-id="steel.zoom" id=zIn data-tip="Zoom in">+</button>
2764
- <span id=zPct>100%</span>
2765
- <button data-command-id="steel.zoom-fit" id=zFit data-tip="Zoom to fit (Home)">Fit</button>
2763
+ <!-- The 2D VIEW band (#1428): the same two view controls the 3D band leads with, in the same corner, with
2764
+ the same glyphs and the same words, so the plan and the model read as one editor. It replaced the
2765
+ bottom-left zoom bar (−/slider/+/percent/Fit) — the tester asked for parity with 3D, which has no
2766
+ numeric readout either; wheel zoom at the cursor, Home and Alt+Z all remain. The glyphs are the
2767
+ ICON map of web/model-viewport-toolbar.js (via modelToolbarIcon) verbatim (a test holds them equal), and the tips are the 3D
2768
+ adapter's. No wrapper: each button IS the carrier, so the two ids are what Instructor focuses. -->
2769
+ <div id=viewBar2d role=toolbar aria-label="2D view controls">
2770
+ <button data-command-id="steel.zoom-fit" id=fit2d type=button data-tip="Fit all to view (Home)"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 6V2h4M14 6V2h-4M2 10v4h4M14 10v4h-4"/></svg><span class=rlbl>Fit all to view</span></button>
2771
+ <button data-command-id="steel.zoom-selection" id=fitSel2d type=button data-tip="Zoom to selected — frame just the selected members (Alt+Z)"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 5.5V2h3.5M14 5.5V2h-3.5M2 10.5V14h3.5M14 10.5V14h-3.5"/><path d="M5.9 6.3h4.2v3.4H5.9z"/></svg><span class=rlbl>Zoom to selected</span></button>
2766
2772
  </div>
2767
2773
  </div>
2768
2774
  <div id=splitBar role=separator aria-orientation=vertical aria-label="Resize the plan and model panes" tabindex=0 aria-valuemin=15 aria-valuemax=85 aria-valuenow=50 data-tip="Drag to resize · double-click to reset"></div>
@@ -3543,7 +3549,7 @@ const SPLIT_MODE_KEY='steel:viewMode:v2', SPLIT_RATIO_KEY='steel:splitRatio:v2';
3543
3549
  // pane happens to be active.
3544
3550
  const DOCK_MIN_LEFT_PX=36;
3545
3551
  // How far INSIDE the 3D pane the docked group sits: the same 12px every other pane-anchored control on this
3546
- // stage is inset by (#zoombar, and #bottomDock itself, are left:12px), so nothing in it sits on the divider.
3552
+ // stage is inset by (#viewBar2d, and #bottomDock itself, are left:12px), so nothing in it sits on the divider.
3547
3553
  const DOCK_GUTTER_PX=12;
3548
3554
  // Extra room required to switch the per-pane layout ON, over what is required to keep it on. Wide enough
3549
3555
  // that a hand shaking on the divider cannot sit astride the boundary — the switch relocates the hint by
@@ -4612,7 +4618,7 @@ async function memberEndRequest(path,body){
4612
4618
  }
4613
4619
  async function scanMemberEnds(liveMessage){
4614
4620
  closeMore();if((memberEndScan&&memberEndScan.busy)||(memberEndReview&&memberEndReview.busy))return;if(!PROJECT){toast('Open this model from a project to check member ends.');return;}
4615
- if(gridMode)setGridMode(false);if(csaxisMode){csaxisMode=false;setCsMode();}if(dimStyleMode)setDimStyleMode(false);if(dimMode){dimMode=false;setDimMode();} // the review takes the Properties panel, so every other panel takeover lets go of it and of the canvas click (#1412)
4621
+ if(gridMode)setGridMode(false);if(csaxisMode){csaxisMode=false;setCsMode();}if(dimStyleMode)setDimStyleMode(false);if(dimMode){dimMode=false;setDimMode();}modelEditor.steel.disarmFrame3d(); // the review takes the Properties panel, so every other panel takeover lets go of it and of the canvas click — incl. the 3D local-frame tool, left out of #1449 because it arms through the csSyncF3d seam (#1412/#1413)
4616
4622
  revealInspector(); // the review list this scan is about to render IS the command's output — a collapsed Inspector would swallow it, progress and findings alike (#1352)
4617
4623
  memberEndScan={busy:true,error:false,live:'Checking member ends against drawing and model evidence…'};panel();
4618
4624
  const b=document.getElementById('memberEndsB');if(b)b.textContent='Checking member ends…';
@@ -7779,7 +7785,7 @@ function setGridMode(on){if(!C)return;if(on&&!gridMode&&!memberEndYieldPanel('Gr
7779
7785
  gridMode=!!on;reflectTakeoverButtons();
7780
7786
  if(!gridMode){const ae=document.activeElement,pn=document.getElementById('panel');if(ae&&pn&&pn.contains(ae))ae.blur(); // commit a focused field (change fires on blur) BEFORE the panel is torn down — a canvas click's pointerdown runs before the browser's own focus change
7781
7787
  gridPick=false;if(gridLinePick&&gridLinePick.line)gridLinePick.line.remove();gridLinePick=null;gridSetPickClass();snapClear();}
7782
- else{revealInspector();if(mode==='add'){mode='sel';setMode();}if(dimMode){dimMode=false;setDimMode();}if(csaxisMode){csaxisMode=false;setCsMode();}if(cmTool)disarmCm();dimStyleMode=false;geoMode=null;setGeo();modelSelection.clearMembers();selDimIds.clear();modelSelection.clearGrids();} // arming reveals the Inspector (the grid pane IS this command's output — #1352) and disarms Move/Copy + the Dimension style pane too — grid mode, cmTool and the pane must be mutually exclusive (they own the left-click/Esc or the panel). Drop the grid selection too — editing/re-inferring the grid invalidates its index-based ids.
7788
+ else{revealInspector();if(mode==='add'){mode='sel';setMode();}if(dimMode){dimMode=false;setDimMode();}if(csaxisMode){csaxisMode=false;setCsMode();}if(cmTool)disarmCm();modelEditor.steel.disarmFrame3d();dimStyleMode=false;geoMode=null;setGeo();modelSelection.clearMembers();selDimIds.clear();modelSelection.clearGrids();} // arming reveals the Inspector (the grid pane IS this command's output — #1352) and disarms Move/Copy + the Dimension style pane too — grid mode, cmTool and the pane must be mutually exclusive (they own the left-click/Esc or the panel). Also the 3D local-frame tool: it's reachable in 3D and owns the 3D left-click, so Grid lines must disarm it like every other takeover (#1413 repro 2). Drop the grid selection too — editing/re-inferring the grid invalidates its index-based ids.
7783
7789
  panel();}
7784
7790
  // The Dimension style pane — a panel takeover like the grid panel. It edits the MODEL-GLOBAL defaults
7785
7791
  // (C.dim_style), so every dim that doesn't carry its own style repaints as you click. Each change rides
@@ -8334,7 +8340,7 @@ function dupScore(m){let s=0;if(_wtPlf(m.profile)!=null)s+=2;if(m.profile&&!/^MF
8334
8340
  // Coincident-member dedupe → the redundant ids. Group by 2D footprint; within a footprint: ≤1 distinct EXPLICIT
8335
8341
  // elevation ⇒ all copies of one member ⇒ keep the best (highest rankFn; an elevation-tagged copy wins ties), rest
8336
8342
  // redundant; ≥2 explicit elevations ⇒ distinct levels ⇒ keep the best per level, unset copies kept (ambiguous).
8337
- // MIRROR of server/steel-confidence.ts redundantDupIds — keep in sync.
8343
+ // The same footprint rule the server's duplicate check applies (`dedupeFootprintIds`), so both agree.
8338
8344
  function dedupeFootprintIds(members,rankFn){const byFoot={};for(const m of members){const k=dupFoot(m);if(!k)continue;(byFoot[k]=byFoot[k]||[]).push(m);}
8339
8345
  const out=[],keepBest=grp=>{if(grp.length<2)return;grp.sort((a,b)=>rankFn(b)-rankFn(a)||((dupElev(b)!=='na')-(dupElev(a)!=='na')));for(let i=1;i<grp.length;i++)out.push(grp[i].id);};
8340
8346
  for(const k in byFoot){const grp=byFoot[k];if(grp.length<2)continue;
@@ -8419,9 +8425,7 @@ function applyZoom(z,ax,ay){z=Math.max(ZMIN,Math.min(ZMAX,z));
8419
8425
  const pt=(ax!=null)?toSvg({clientX:ax,clientY:ay}):null;
8420
8426
  zoom=z;svg.setAttribute('width',EXTX*zoom);svg.setAttribute('height',EXTY*zoom);
8421
8427
  if(pt){const m=svg.getScreenCTM();stage.scrollLeft+=(m.a*pt.x+m.e)-ax;stage.scrollTop+=(m.d*pt.y+m.f)-ay;}
8422
- document.getElementById('zRange').value=Math.round(zoom*100);
8423
- document.getElementById('zPct').textContent=Math.round(zoom*100)+'%';updateBadges();refreshProfileLabelOverlay();}
8424
- function zoomCentered(z){const r=stage.getBoundingClientRect();applyZoom(z,r.left+stage.clientWidth/2,r.top+stage.clientHeight/2);}
8428
+ updateBadges();refreshProfileLabelOverlay();}
8425
8429
  function fitToWindow(){applyZoom(Math.min(stage.clientWidth/EXTX,stage.clientHeight/EXTY)*0.98);}
8426
8430
  // --- duplicate the selected member(s) in place (Ctrl+D) ---
8427
8431
  function doDup(){const arr=sel2d();if(!arr.length)return;return runSteelAuthoring('copy',{source:'duplicate',selection:arr.map(m=>m.id)},()=>{const o=12,pv=snapshot(),ns=new Set();
@@ -10199,7 +10203,7 @@ function panel(){
10199
10203
  <div class="f"><div class=elab>Profile</div><div style="display:flex;gap:6px"><input data-command-id="steel.member-profile" aria-label="Profile" id=pf class=combo data-src=profiles value="${esc(m.profile)}" style="flex:1" autocomplete=off><button data-command-id="steel.browse-profile-catalog" id=profileBrowseS class=ghost aria-label="Search the profile catalog" data-tip="Search the profile catalog — 4,516 profiles, by designation or alias"><svg viewBox="0 0 16 16" aria-hidden=true width=13 height=13 fill=none stroke=currentColor stroke-width=1.4 stroke-linecap=round><circle cx="6.9" cy="6.9" r="4.3"/><path d="M10.1 10.1 13.7 13.7"/></svg></button><button data-command-id="steel.pick-profile" id=pickProf class="ghost${(picking&&pickKind==='profile')?' on':''}" aria-pressed="${(picking&&pickKind==='profile')?'true':'false'}" aria-label="Pick profile from a drawing label" data-tip="Pick profile from drawing labels by click, Enter, or Space">⌖</button></div>${(picking&&pickKind==='profile')?'<div class="hint" data-profile-pick-status role=status aria-live=polite style="margin-top:4px;font-style:italic;color:var(--brand)">'+esc(profilePickGuidance())+'</div>':''}</div>
10200
10204
  <div class="f"><div class=elab>Material grade</div><div style="display:flex;gap:6px"><input data-command-id="steel.member-material" aria-label="Material grade" id=mat class=combo data-src=materials value="${esc(m.material||'')}" placeholder="Profile default · ${esc(profileDefaultMaterial(m.profile))}" style="flex:1" autocomplete=off data-tip="${m.material?'This member carries its own grade, so it will not follow a profile change':'Empty — follows the profile’s default grade. Type or browse to give this member its own.'}"><button data-command-id="steel.browse-material-catalog" id=materialBrowseS class=ghost aria-label="Search material grades" data-tip="Search the material catalog by name or alias"><svg viewBox="0 0 16 16" aria-hidden=true width=13 height=13 fill=none stroke=currentColor stroke-width=1.4 stroke-linecap=round><circle cx="6.9" cy="6.9" r="4.3"/><path d="M10.1 10.1 13.7 13.7"/></svg></button><span class=pslot aria-hidden=true></span></div></div>
10201
10205
  <div class="row hint">Length <b>${L}</b> · ${wpf==null?'<span id=rfiPill class="pill pill-clickable" role=button tabindex=0 data-tip="Open the RFI list, focused on this member" style="background:var(--err-bg)">RFI — size unresolved</span>':'Weight <b>'+(_lenFt(m)*wpf).toFixed(0)+' lb</b> · '+_plf2(wpf)+' lb/ft'}</div>
10202
- <div class=elab>Verified</div><span class=vwrap data-panel-control><button data-command-id="steel.member-verified" id=verifyBtn class="vbtn${m.verified?' on':''}" aria-pressed="${m.verified?'true':'false'}" data-tip="Mark this member human-confirmed → 100% in the confidence report">${m.verified?'✓ Human-confirmed':'Mark verified'}</button></span>
10206
+ <div class=elab>Verified</div><span class=vwrap data-panel-control><button data-command-id="steel.member-verified" id=verifyBtn class="vbtn${m.verified?' on':''}" aria-pressed="${m.verified?'true':'false'}" data-tip="Mark this member human-confirmed">${m.verified?'✓ Human-confirmed':'Mark verified'}</button></span>
10203
10207
  ${appearanceSect}
10204
10208
  ${braceSect}
10205
10209
  ${mfSug.length?`<div class="row" style="border:1px solid var(--purple);border-radius:6px;padding:7px 8px;background:rgba(168,85,247,.07)"><div class=elab style="color:var(--purple-ink);margin:0">Moment-frame girder · ${_lvl==='roof'?'roof':'2nd floor'} (from Frames)</div><div style="display:flex;flex-wrap:wrap;gap:5px;margin-top:5px">${mfSug.map(s=>`<button data-command-id="steel.member-profile-suggestion#${esc(s)}" class="ghost mfsug${s===m.profile?' on':''}" data-s="${esc(s)}">${esc(s)}</button>`).join('')}</div></div>`:''}
@@ -10807,10 +10811,10 @@ function snapClear(){const c=document.getElementById('snapMark');if(c)c.remove()
10807
10811
  function _effTos(o){return o?(o.tosDef!==false?defaultTosMm:o.tosMm):undefined;} // beam end / column top → effective TOS in WORLD MM, default-aware
10808
10812
  // True 3D member length in feet = straight-line distance between the member's two end NODES, exactly as the 3D
10809
10813
  // scene places them — so it's correct for sloped members (braces, ramped beams, battered columns), not just the
10810
- // plan projection. Plan XY is in plan px (÷ppf→ft); elevations (TOS/BOS) are in inches (÷12→ft). Elevation is
10814
+ // plan projection. Plan XY is in plan px (÷ppf→ft); elevations (TOS/BOS) are in millimetres (÷FT_TO_MM→ft). Elevation is
10811
10815
  // default-aware (dTos = the plan datum a default-follow end/top rides; a null column base sits on the 0 datum).
10812
- // Shared by the display (_lenFt, active-plan default) and the confidence roll-up (_mConfTons /
10813
- // _mTonnage, per-plan default) so they agree.
10816
+ // Reached through _lenFt / _lenMm (active-plan default) only for a member with no canonical v2 twin — a
10817
+ // transient or synthetic display member; see _lenFt.
10814
10818
  function _len3dFt(m,ppf,dTos){
10815
10819
  const a=m.wp&&m.wp[0], b=m.wp&&m.wp[1]; if(!a||!b)return 0;
10816
10820
  const p=ppf>0?ppf:1, dx=(b[0]-a[0])/p, dy=(b[1]-a[1])/p; // plan run, feet
@@ -12416,14 +12420,24 @@ function csSyncF3d(){const d3=window.Steel3DView;if(!d3||!d3.frameInfo)return;
12416
12420
  const fi=d3.frameInfo(),armed=!!(modelEditor.steel.frameArmed&&modelEditor.steel.frameArmed()),armB=document.getElementById('csArm3dB'),fields=document.getElementById('csF3dFields');
12417
12421
  const pick=(modelEditor.steel.framePicking&&modelEditor.steel.framePicking())?(modelEditor.steel.framePickStep?modelEditor.steel.framePickStep():0):null, pickChanged=pick!==csPrevPick; csPrevPick=pick;
12418
12422
  const wasArmed=armB?armB.classList.contains('on'):false; // arm/disarm edge — take over / release #panel only on the transition (+ pick-step changes), not on every drag tick
12419
- if(armB)armB.classList.toggle('on',armed);if(fields)fields.classList.toggle('on',armed);
12423
+ if(armB){armB.classList.toggle('on',armed);armB.setAttribute('aria-pressed',String(armed));}if(fields)fields.classList.toggle('on',armed); // an armable mode must SAY whether it is armed (aria-pressed), like every other takeover button — the class alone is invisible to a screen reader (#1392, now that other commands flip this button too — #1413)
12420
12424
  if(armed){const FT=FT_TO_MM,set=(id,v)=>{const el=document.getElementById(id);if(el&&document.activeElement!==el)el.value=v;};
12421
12425
  const ori=document.getElementById('csF3dOri');
12422
12426
  if(fi.mode==='local'){
12423
12427
  if(ori)ori.textContent=fi.horizontal?(Math.round(fi.angleDeg)+'°'+(fi.zUp?'':' · Z down')):('Tilted '+Math.round(fi.tiltDeg)+'° · Z '+(fi.zUp?'up':'down')); // read-only: set by the pick, spun by the ring; note a flipped-Z horizontal frame (Codex)
12424
12428
  set('csF3dX',(fi.origin[0]/FT).toFixed(2));set('csF3dY',(fi.origin[1]/FT).toFixed(2));set('csF3dZ',(fi.origin[2]/FT).toFixed(2));}
12425
12429
  else if(ori)ori.textContent='—';}
12426
- if(armed&&!wasArmed)revealInspector(); // the 3D half of Set local axes… — same menu command, same takeover pane, so the same collapsed-Inspector no-op (#1352). The ARMING edge only, never the disarm or a pick-step repaint.
12430
+ if(armed&&!wasArmed){ // ARMING edge only (never a disarm or a pick-step repaint): the 3D frame just took the panel + the 3D left-click, so every OTHER 3D-reachable panel/click owner must let go (#1413)
12431
+ const had2d=gridMode; // Grid lines draws into the (3D-hidden) 2D SVG too — disarming it needs a 2D repaint or it comes back stale on the return to 2D (#1413; the view-switch note at :20631/:20579 says the same)
12432
+ if(gridMode)setGridMode(false); // Grid lines owns #panel AHEAD of the frame pane and consumes the 3D click behind it — release it (#1413, repro 1)
12433
+ // The member-end review also owns #panel (the #1412 contract, panel() shows it first). Yield it exactly like the
12434
+ // 2D takeovers do — it closes, or ASKS when ends are ticked; in the ask case disarm the frame NOW (so its 3-click
12435
+ // prompt isn't buried under the question and its picks don't run unseen) and re-arm it from the callback once the
12436
+ // review is out of the way (owner ruling, #1413 — the frame was left out of #1449 because it arms through here).
12437
+ if(!memberEndYieldPanel('Set local axes (3D)',()=>modelEditor.steel.armFrame3d(true),'csArm3dB')){modelEditor.steel.disarmFrame3d();return;} // through the facade; the disarm re-enters csSyncF3d (fireFrameChange→onFrame3dChange) and repaints the button + panel — don't reveal/render over the review's question
12438
+ revealInspector(); // the 3D half of Set local axes… — same menu command, same takeover pane, so the same collapsed-Inspector reveal (#1352)
12439
+ if(had2d)render(); // un-stale the 2D SVG the disarmed grid pane left behind, so the return to 2D isn't skipped by disarmed2d being already false (#1413)
12440
+ }
12427
12441
  if((wasArmed!==armed||pickChanged)&&typeof panel==='function')panel();} // arm/disarm edge OR a pick-step change → repaint #panel (drag ticks don't, so no per-move rebuild)
12428
12442
  document.getElementById('csArm3dB').onclick=()=>{const d3=window.Steel3DView;if(!d3||!d3.armFrame3d)return;const armed=!!(modelEditor.steel.frameArmed&&modelEditor.steel.frameArmed());d3.armFrame3d(!armed);csSyncF3d();updCS();};
12429
12443
  ['csF3dX','csF3dY','csF3dZ'].forEach(id=>{const el=document.getElementById(id);if(!el)return; // Origin X/Y/Z stay editable (translate-only); orientation is read-only (pick + ring)
@@ -12550,8 +12564,8 @@ function syncEnvChip(){
12550
12564
  // material one's details pane is built by the same code path.
12551
12565
  // EVERY SURFACE THAT SPEAKS UNITS, in one place — see the declaration: the SSE handler is page scope.
12552
12566
  // `render()` ends at `updConf()`, which repaints the confidence CHIP and not the report behind it,
12553
- // and slice 4 made that report units-dependent in three ways (its `Tons`/`t` header, its per-row
12554
- // tonnage and its evidence lines). Its own refresh idiom is the `updConf();if(confOpen())renderConf();`
12567
+ // and the report's recorded elevation fields are printed in display units (`readValueText`), so an open
12568
+ // report goes stale on a switch. Its own refresh idiom is the `updConf();if(confOpen())renderConf();`
12555
12569
  // pair used elsewhere in this file; without it a switch arriving from another tab left an open report
12556
12570
  // stating the old system's word beside the new system's numbers. (The picker `refresh()` calls are
12557
12571
  // here for the same reason, found the same way — an open control cannot repaint itself.)
@@ -12808,11 +12822,11 @@ addEventListener('keydown',e=>{
12808
12822
  if(selIds.size||selDimIds.size||selGridIds.size)clearWholeReferenceSelection();
12809
12823
  render();}
12810
12824
  else if(k==='s'){e.preventDefault();persist();(window.flushContract?window.flushContract():Promise.resolve()).then(()=>toast('Saved ✓')).catch(()=>toast('Save failed'));}}); // edits autosave; Ctrl+S just flushes now (no browser "save page" dialog)
12811
- // zoom bar
12812
- document.getElementById('zIn').onclick=()=>zoomCentered(zoom*1.25);
12813
- document.getElementById('zOut').onclick=()=>zoomCentered(zoom/1.25);
12814
- document.getElementById('zFit').onclick=fitToWindow;
12815
- document.getElementById('zRange').oninput=e=>zoomCentered(+e.target.value/100);
12825
+ // The 2D view band (#1428): the same pair as #m3dFit/#m3dFitSel, on the plan's own framing. Fit is
12826
+ // also Home; Zoom to selected is also Alt+Z / Shift+Space, and with nothing selected it frames the whole
12827
+ // plan, exactly as the 3D pair does with an empty selection — so neither button is ever disabled.
12828
+ document.getElementById('fit2d').onclick=fitToWindow;
12829
+ document.getElementById('fitSel2d').onclick=zoomToSelection;
12816
12830
  // --- "More" overflow menu: click-toggles a themed popup; closes on item-click, click-outside, or Esc. ---
12817
12831
  const moreBtn=document.getElementById('moreBtn'),moreMenu=document.getElementById('moreMenu');
12818
12832
  function moreOpen(){return moreMenu.classList.contains('open');}
@@ -12901,7 +12915,29 @@ let modelShellMount=null;
12901
12915
  {const root=document.querySelector('main'),viewport=document.getElementById('pane3d'),surface=document.getElementById('stage3d'),
12902
12916
  toolbar=document.getElementById('m3dBar'),orientation=document.getElementById('m3dCube'),axes=document.getElementById('m3dAxes'),
12903
12917
  explorer=legendBody('root'),pointerDock=document.getElementById('bottomDock'),inspector=document.getElementById('panel');
12904
- if(root&&viewport&&surface&&toolbar&&orientation&&axes&&explorer&&pointerDock&&inspector)modelShellMount=EditorShell.mountModelEditorShell({root,viewport,surface,toolbar,orientation,axes,explorer,pointerDock,inspector});}
12918
+ if(root&&viewport&&surface&&toolbar&&orientation&&axes&&explorer&&pointerDock&&inspector)modelShellMount=EditorShell.mountModelEditorShell({root,viewport,surface,toolbar,orientation,axes,explorer,pointerDock,inspector});
12919
+ // The model band (#m3dToolBar) docks off the view band (#m3dBar): to its RIGHT in 3D
12920
+ // (`left:calc(var(--m3d-view-w)…)`) and BELOW it in Split (`top:calc(…var(--m3d-view-h)…)`). The view
12921
+ // band wraps to a second row on a narrow pane, so both must be MEASURED, not assumed (#1455) — without
12922
+ // this they kept the 335px/40px CSS defaults, so on a ~430px Split pane the wrapped view band grew to
12923
+ // two rows while the model band stayed at the one-row offset and the two overlapped. Written on <body>
12924
+ // so #m3dToolBar inherits them; the observer re-measures on every wrap and view-mode change.
12925
+ if(toolbar&&window.ResizeObserver){
12926
+ const syncBand=()=>{const s=document.body.style;s.setProperty('--m3d-view-w',toolbar.offsetWidth+'px');s.setProperty('--m3d-view-h',toolbar.offsetHeight+'px');};
12927
+ // Measure once up front too: the observer's first callback is async, so without this the model band
12928
+ // would paint one frame at the 335px/40px defaults before jumping to the measured position.
12929
+ syncBand();new ResizeObserver(syncBand).observe(toolbar);
12930
+ }
12931
+ // The 2D view band (#1428) is measured the same way for the same reason: in 2D-only the model band docks
12932
+ // off ITS right edge (`#m3dToolBar{left:calc(var(--v2d-view-w)…)}`), and a width assumed in CSS is what
12933
+ // #1455 found overlapping. offsetWidth reads 0 while the band is display:none (3D-only), so the write is
12934
+ // SKIPPED rather than recorded: a 0 written on the way out would leave the 2D-only rule at left:22px for
12935
+ // the first frame back, until the observer's async callback re-measures.
12936
+ {const band2d=document.getElementById('viewBar2d');
12937
+ if(band2d&&window.ResizeObserver){
12938
+ const sync2d=()=>{if(band2d.offsetWidth)document.body.style.setProperty('--v2d-view-w',band2d.offsetWidth+'px');};
12939
+ sync2d();new ResizeObserver(sync2d).observe(band2d);
12940
+ }}}
12905
12941
  // The split divider. Deliberately the #panelResizer recipe above, gesture for gesture — drag,
12906
12942
  // double-click to reset, arrow keys with a Shift coarse step — so the editor's two separators behave the
12907
12943
  // same. The difference is the UNIT: this one stores a RATIO, not a width, so the split survives a window
@@ -20301,7 +20337,7 @@ function reflectViewChrome(){
20301
20337
  {const tb=document.getElementById('m3dToolBar'),host=document.getElementById(view3dShown?'pane3d':'stagewrap');
20302
20338
  if(tb&&host&&tb.parentElement!==host)host.appendChild(tb);}
20303
20339
  if(view3dShown)try{updateBandStateMarks();}catch(_){} // state the band already holds on arrival
20304
- document.getElementById('zoombar').style.display=chrome.zoombar?'':'none'; // zoom slider addresses the plan canvas
20340
+ document.getElementById('viewBar2d').style.display=chrome.viewBar2d?'':'none'; // the 2D view band addresses the plan canvas
20305
20341
  // Plan switcher is 2D-only (3D shows the whole model). Hidden by `display`, not the `hidden` attribute:
20306
20342
  // .plan-combo carries an author `display:inline-flex`, which beats the UA's [hidden] rule by ORIGIN, so
20307
20343
  // `hidden = true` would quietly do nothing here.
@@ -24002,12 +24038,7 @@ document.getElementById('rfiModal').addEventListener('keydown',e=>{e.stopPropaga
24002
24038
  if(rfiFormFor&&rfiFormFor.busy){toast('Still recording — wait for it to finish, or close the dialog and check the row.');return;}
24003
24039
  if(rfiFormFor){rfiCloseForm();return;}
24004
24040
  closeRFI();return;}if(e.key!=='Tab')return;const f=[...document.querySelectorAll('#rfiModal button,#rfiModal input,#rfiModal textarea,#rfiModal [tabindex]:not([tabindex="-1"])')].filter(n=>!n.disabled&&n.offsetParent!==null);if(!f.length)return;const first=f[0],last=f[f.length-1];if(e.shiftKey&&document.activeElement===first){e.preventDefault();last.focus();}else if(!e.shiftKey&&document.activeElement===last){e.preventDefault();first.focus();}});
24005
- // ===== Confidence report — evidence-based score (MIRROR of server/steel-confidence.ts; keep in sync) =====
24006
- // Deterministic: scores ONLY observable evidence already in the contract, never a model self-report.
24007
- const BANDW={verified:1,high:.9,med:.65,low:.35,rfi:0};
24008
- const BANDLAB={verified:'Verified',high:'High',med:'Medium',low:'Low',rfi:'RFI'};
24009
- const BANDC={verified:'var(--ok)',high:'var(--hi)',med:'var(--warn)',low:'var(--err)',rfi:'var(--err)'};
24010
- const BANDPILL={verified:'background:var(--ok-bg);color:var(--ok)',high:'background:var(--hi-bg);color:var(--hi)',med:'background:var(--warn-bg);color:var(--warn)',low:'background:var(--err-bg);color:var(--err)',rfi:'background:var(--err-bg);color:var(--err)'};
24041
+ // ===== Section weights, and the unit words a quantity is spelled with =====
24011
24042
  // The AISC catalogue weight — the only way most of the catalogue can be weighed at all. Nothing in
24012
24043
  // "HSS4X4X3/8" encodes 17.27 lb/ft (40.9 kg/m), so before the table carried weights every hollow section, angle
24013
24044
  // and double angle read as "not in the AISC table", was flagged RFI, and contributed 0 lb to the
@@ -24033,9 +24064,8 @@ function _wtKgM(profile){if(!profile)return null;
24033
24064
  // (UK epic, slice 4).
24034
24065
  //
24035
24066
  // _wtKgM the contract's own number, kg/m, untouched.
24036
- // _wtPlf lb/ft, ALWAYS. Two callers need this whatever the project displays: `contract_edited`'s
24037
- // machine-readable `weight_plf` field, whose NAME says pounds per foot, and the confidence
24038
- // weighting, which must keep its exact legacy arithmetic (see `_mConfTons`).
24067
+ // _wtPlf lb/ft, ALWAYS. `contract_edited`'s machine-readable `weight_plf` field needs this whatever
24068
+ // the project displays: its NAME says pounds per foot.
24039
24069
  // _wtBill the unit weight a PERSON is shown — lb/ft or kg/m, per the project's display units.
24040
24070
  //
24041
24071
  // All three are null for exactly the same profiles, by construction: each is `_wtKgM` plus arithmetic
@@ -24047,8 +24077,8 @@ function _wtBill(profile){const kgm=_wtKgM(profile);
24047
24077
  return kgm==null?null:(displayUnits()===DisplayUnits.MM?kgm:kgm/LB_PER_FT_TO_KG_PER_M);}
24048
24078
  // The words a quantity is spelled with, per system — the same spellings `server/bom-units.ts` uses, so
24049
24079
  // a number and the sentence about it cannot disagree. `t` is the SI symbol for a tonne; `T` is a tesla.
24050
- const UNIT_WORDS={'ft-in':{weight:'lb',unitWeight:'lb/ft',tonnage:'tons'},
24051
- mm:{weight:'kg',unitWeight:'kg/m',tonnage:'t'}};
24080
+ const UNIT_WORDS={'ft-in':{weight:'lb',tonnage:'tons'},
24081
+ mm:{weight:'kg',tonnage:'t'}};
24052
24082
  const _uw=()=>UNIT_WORDS[displayUnits()]||UNIT_WORDS['ft-in'];
24053
24083
  /*
24054
24084
  * A MEMBER'S DISPLAYED MASS, from the member itself and the unit weight `_wtBill` returned.
@@ -24078,93 +24108,6 @@ const _plf2=(plf)=>plf==null?null:Math.round(plf*100)/100;
24078
24108
  // erases the tail the kg/m division introduces (26.000000000000004 -> 26) without inventing or
24079
24109
  // discarding a digit that was actually there.
24080
24110
  const _plfWire=(plf)=>plf==null?null:Number(plf.toPrecision(12));
24081
- const _isMf=p=>!!p&&/(^|[^A-Z])MF($|[^A-Z])/i.test(p);
24082
- // Elevation-aware coincident dedupe for the browser confidence panel — same footprint+wildcard-elevation logic as
24083
- // redundantDups / the server, so the in-browser confidence report and the server score agree on stacked members.
24084
- function _confDupIds(members){return new Set(dedupeFootprintIds(members,m=>{let s=0;if(m.profile&&!_isMf(m.profile))s++;if(m.profile&&m.profile.trim()!=='')s++;return s;}));}
24085
- function _elevAssumed(m){if(m.role==='column')return !(m.col&&m.col.tosDef===false);const en=m.ends||[];if(!en.length)return true;return en.some(e=>e.tosDef!==false);}
24086
- function _scoreMember(m,dup){const plf=_wtPlf(m.profile),shown=_plf2(_wtBill(m.profile));const F=[];
24087
- // Same three reasons the RFI list gives, through the SAME euro-section predicate — this detail string
24088
- // is a second copy of that message, and the pair it already sits beside (/^MF/i here vs _isMf there)
24089
- // is the standing demonstration of what happens when two copies are left to be kept in step by hand.
24090
- if(plf==null){F.push({key:'profile',label:'Profile',state:'fail',detail:(!m.profile||!m.profile.trim())?'no profile assigned':_isMf(m.profile)?('unresolved mark "'+m.profile+'" — not a '+_catalogLabel()+' size'):_aiscKgM(m.profile)!=null?('this model records no weight for "'+m.profile+'" — the designation is a standard '+_catalogLabel()+' shape'):_isEuroSection(m.profile)?('"'+m.profile+'" is a European/British section — this catalogue holds AISC (US) shapes only'):('"'+m.profile+'" not in the '+_catalogLabel()+' weight table')});return {band:'rfi',factors:F};}
24091
- // The PROBE above is `_wtPlf` (unit-free: can this be priced at all); the number rendered HERE is the
24092
- // one the reader sees, so it is `_wtBill` in the reader's own units. Reporting "46.1 plf" over a
24093
- // kilogram-per-metre figure is the mislabelling this whole slice exists to remove. (Design review.)
24094
- const sched=m.mf===true,uwWord=_uw().unitWeight;
24095
- F.push({key:'profile',label:'Profile',state:sched?'assumed':'ok',detail:sched?(m.profile+' — resolved from the frame schedule ('+shown+' '+uwWord+')'):(m.profile+' ('+shown+' '+uwWord+', '+_catalogLabel()+')')});
24096
- const asm=_elevAssumed(m);F.push({key:'elevation',label:'Elevation',state:asm?'assumed':'ok',detail:asm?'plan default (UNO) — no local callout':'from a drawing callout'});
24097
- const isd=dup.has(m.id);if(isd)F.push({key:'dup',label:'Duplicate',state:'fail',detail:'coincident with a kept member — deleting dedupes the BOM'});
24098
- if(m.verified===true)F.push({key:'verified',label:'Verified',state:'ok',detail:'human-confirmed'});
24099
- const band=m.verified===true?'verified':isd?'low':(sched||asm)?'med':'high';return {band,factors:F};}
24100
- // `ptPerFt` is DISPLAY POINTS PER FOOT, not a view's stored `mm_per_px` — it forwards to `_len3dFt`,
24101
- // which divides plan px by it. Callers pass `ppfOf(plan)`.
24102
- // THE WEIGHT A MEMBER CARRIES IN THE CONFIDENCE MEAN. Legacy short tons, in BOTH unit systems, and
24103
- // deliberately so: it is a weight in a weighted average, its scale cancels, and the only thing that
24104
- // must not move is its arithmetic. `server/steel-model-score.ts` keeps the identical expression for
24105
- // the identical reason — accumulating a differently-scaled number and dividing later is the same sum
24106
- // in real arithmetic and a different one in IEEE, and it would shift a reported percentage.
24107
- function _mConfTons(m,ptPerFt,dTos){const plf=_wtPlf(m.profile);if(plf==null)return 0;
24108
- return _len3dFt(m,ptPerFt,dTos)*plf/2000;} // true 3D length × lb/ft — the expression this has always used
24109
- // THE MASS A PERSON IS SHOWN — short tons or tonnes, per the project. A separate calculation from the
24110
- // weight above, not a rescaling of it.
24111
- function _mTonnage(m,ptPerFt,dTos){const w=_wtBill(m.profile);if(w==null)return 0;
24112
- const lenFt=_len3dFt(m,ptPerFt,dTos);
24113
- // metric: metres x kg/m -> kg, then /1000 -> tonnes. imperial: feet x lb/ft -> lb, then /2000.
24114
- // NOT `_lenMm`, and not a defect: `_len3dFt` derives its length from PLAN PIXELS, so there is no
24115
- // stored millimetre here to be faithful to and `x 304.8` is a plain conversion rather than the
24116
- // round trip `_lenMm` exists to avoid. Left alone deliberately — see `_lenMm`.
24117
- return displayUnits()===DisplayUnits.MM?(lenFt*FT_TO_MM/1000)*w/1000:lenFt*w/2000;}
24118
- function _detSheet(t){const m=String(t||'').toUpperCase().match(/S-?\s?\d{2,3}/);return m?m[0].replace(/\s/g,''):null;}
24119
- const _cnt0=()=>({verified:0,high:0,med:0,low:0,rfi:0});
24120
- function _scoreConnections(){
24121
- const rows={};for(const c of (C.connections||[]))if(c&&c.id)rows[c.id]=c;
24122
- const bandEnd=(end)=>{const row=end.conn?rows[end.conn]:null;
24123
- const complete=!!(row&&row.type&&row.detail&&row.targets&&Object.keys(row.targets).length>0);
24124
- const hasNote=!!(end.note&&end.note.trim()!=='');
24125
- // Only a drawing callout counts as evidence — a company-rules/user row assignment is a mapping, not drawing-confirmed.
24126
- const evidence=hasNote||(row&&row.source==='drawing');
24127
- if(end.connVerified===true)return{band:'verified',reason:''};
24128
- if(!end.conn&&!hasNote)return{band:'rfi',reason:'no connection assigned'};
24129
- if(complete&&evidence)return{band:'high',reason:''};
24130
- if(complete)return{band:'med',reason:'connection type assumed (no drawing note)'};
24131
- if(hasNote&&end.detail&&end.detail.trim()!=='')return{band:'med',reason:'free-text note + detail (not a mapped library row)'};
24132
- if(end.conn&&!row)return{band:'low',reason:'references an unknown connection row'};
24133
- return{band:'low',reason:row?'library row has a type only (no detail/component id)':'connection type only (no detail)'};};
24134
- const byEnd=[];
24135
- (C.plans||[]).forEach((plan,pi)=>{for(const m of (plan.members||[])){
24136
- if(isBrace(m))continue; // a brace's ends are not beam shear connections — mirrors server scoreConnections (Codex review)
24137
- if(m.role==='column'){const r=bandEnd(m.col||{});byEnd.push({id:m.id+'#col',pi,sheet:plan.sheet||'',memberId:m.id,which:'col',band:r.band,reason:r.reason});}
24138
- else{const ends=m.ends||[];for(const w of [0,1]){const r=bandEnd(ends[w]||{});byEnd.push({id:m.id+'#'+w,pi,sheet:plan.sheet||'',memberId:m.id,which:w,band:r.band,reason:r.reason});}}}});
24139
- const counts=_cnt0();let num=0,den=0;
24140
- for(const e of byEnd){counts[e.band]++;if(e.band==='rfi')continue;num+=BANDW[e.band];den+=1;}
24141
- return{cat:{score:den>0?Math.round(num/den*100):null,tons:0,counts},ends:byEnd};}
24142
- function scoreContractJS(){const plans=C.plans||[];const byMember=[],byDetail=[];let segs=0;
24143
- const _conn=_scoreConnections();
24144
- const known=new Set();for(const p of plans)if(p.sheet)known.add(p.sheet.toUpperCase());for(const s of Object.keys(C.detail_bubbles||{}))known.add(s.toUpperCase());
24145
- plans.forEach((plan,pi)=>{segs+=(plan.segments||[]).length;const ms=plan.members||[];const dup=_confDupIds(ms);
24146
- // TWO quantities per member, deliberately kept apart (mirrors `server/steel-model-score.ts`):
24147
- // `w` the WEIGHT in the confidence mean — legacy short tons in both systems. Its scale cancels
24148
- // in a weighted average, so the only thing that must not move is its arithmetic.
24149
- // `tons` the MASS SHOWN — short tons or tonnes, per the project. Displayed, never averaged with.
24150
- for(const m of ms){const r=_scoreMember(m,dup);byMember.push({id:m.id,planIdx:pi,sheet:plan.sheet||'',role:m.role==='column'?'column':'beam',isBrace:isBrace(m)||undefined,profile:m.profile||'',band:r.band,w:r.band==='rfi'?0:_mConfTons(m,ppfOf(plan),plan.default_tos_mm),tons:r.band==='rfi'?0:_mTonnage(m,ppfOf(plan),plan.default_tos_mm),factors:r.factors});} // isBrace mirrors the server MemberScore so the report can label it Brace
24151
- // The details[]+callouts[] union minus sections/elevations (#401). Both scorers call the SAME helper
24152
- // in steel-detail-refs.js rather than each spelling the rule out, because a rule written twice is a
24153
- // rule that drifts. The banding below still mirrors steel-confidence.ts BY HAND; what keeps this call
24154
- // site honest is the pair of #401 tests in steel-editor-draft.test.ts, which boot the real page and
24155
- // assert the row count this produces. See the note at its matching loop for what is still unpinned.
24156
- for(const d of DetailRefs.planScoredDetails(plan)){const sh=_detSheet(d.text)??d.targetSheet;const ok=sh!=null&&known.has(sh.toUpperCase());byDetail.push({text:d.text,planIdx:pi,sheet:plan.sheet||'',band:ok?'high':'low',reason:ok?('references '+sh+' (in the set)'):sh?('references '+sh+' — not found in the set'):'no sheet reference parsed'});}});
24157
- // The MEAN weights by `m.w` (legacy short tons); the TOTAL reported is `m.tons` (the project's own
24158
- // units). Using one number for both would either move a US percentage or report the wrong mass.
24159
- const roll=(arr,cw)=>{const c=_cnt0();let n=0,d=0,t=0;for(const m of arr){c[m.band]++;if(m.band==='rfi')continue;const w=cw?1:m.w;n+=w*BANDW[m.band];d+=w;t+=m.tons;}return {score:d>0?Math.round(n/d*100):null,tons:t,counts:c};};
24160
- const dRoll=arr=>{const c=_cnt0();let n=0,d=0;for(const x of arr){c[x.band]++;n+=BANDW[x.band];d++;}return {score:d>0?Math.round(n/d*100):null,tons:0,counts:c};};
24161
- const beams=roll(byMember.filter(m=>m.role==='beam'));const columns=roll(byMember.filter(m=>m.role==='column'));const details=dRoll(byDetail);
24162
- const sc=byMember.filter(m=>m.band!=='rfi');const n=sc.reduce((s,m)=>s+m.w*BANDW[m.band],0),d=sc.reduce((s,m)=>s+m.w,0);
24163
- // `tons` on the overall row is the MASS SHOWN, summed from `m.tons`; `d` is the mean's denominator
24164
- // and is in legacy short tons, so reporting `d` here would have printed a short-ton figure under a
24165
- // tonne label in a metric project — the mislabelling this slice exists to remove.
24166
- return {byMember,byDetail,byConnection:_conn.ends,byCategory:{beams,columns,details,connections:_conn.cat},coverage:{members:byMember.length,segments:segs,note:'Approximate — precise per-segment binding is not available yet.'},overall:{score:d>0?Math.round(n/d*100):null,tons:sc.reduce((s,m)=>s+m.tons,0),rfiCount:byMember.filter(m=>m.band==='rfi').length}};}
24167
- function bandColorForPct(p){return p==null?'var(--mut)':p>=95?BANDC.verified:p>=80?BANDC.high:p>=50?BANDC.med:BANDC.low;}
24168
24111
  // Effective target: the user's per-read override (in the contract) wins; else the app's
24169
24112
  // target_confidence input default (read in boot()); else none. Editing the override never touches
24170
24113
  // the .flo, so it can't disarm the Run gate.
@@ -24196,9 +24139,9 @@ function readFieldsHtml(row,target){return (row.observations||[]).map(observatio
24196
24139
  let confReadBand='all',confRestoreMember=null,confRestoreControl=null;
24197
24140
  function rememberConfControl(control,kind){confRestoreControl={kind,value:control.dataset[kind]};}
24198
24141
  function restoreConfControl(){if(!confRestoreControl)return false;const pending=confRestoreControl;confRestoreControl=null;
24199
- const selectors={readBand:'#confFilter [data-read-band]',readCat:'#confFilter [data-read-cat]',band:'#confFilter [data-band]',fcat:'#confFilter [data-fcat]'};
24142
+ const selectors={readBand:'#confFilter [data-read-band]',readCat:'#confFilter [data-read-cat]'};
24200
24143
  const selector=selectors[pending.kind];if(!selector)return false;const next=[...document.querySelectorAll(selector)].find(control=>control.dataset[pending.kind]===pending.value);if(!next)return false;next.focus();return true;}
24201
- function renderReadConf(){const projection=readConfidenceProjection(),target=effectiveTarget(),summary=ReadConfidence.summarizeReadConfidence(projection,target);
24144
+ function renderConf(){const projection=readConfidenceProjection(),target=effectiveTarget(),summary=ReadConfidence.summarizeReadConfidence(projection,target);
24202
24145
  if(!['all','beams','columns'].includes(confCat))confCat='all';if(target==null)confReadBand='all';readTargetControl();
24203
24146
  const metric=(label,value,note)=>'<div class=ccard><div class=cc-label>'+label+'</div><div class=cc-score>'+value+'</div><div class=cc-counts><span>'+note+'</span></div></div>';
24204
24147
  document.getElementById('confCats').innerHTML=metric('Recorded fields',summary.totalFields,'immutable drawing values')+metric('Below target',target==null?'—':summary.belowFields,target==null?'No target set':('strictly below '+target+'%'))+metric('Members affected',target==null?'—':summary.affectedMembers,'review destinations')+metric('Not recorded',summary.notRecordedMembers,'members without field confidence');
@@ -24231,101 +24174,12 @@ async function locateReadMember(id,projection){const row=projection.rows.find(r=
24231
24174
  render();await setView('3d');if(!view3d){svg.focus();toast('Selected '+id+', but it has no editable 2D plan view and 3D is unavailable.');return;}
24232
24175
  document.getElementById('stage3d').focus();toast('Selected '+id+' in 3D — no editable 2D plan view is available.');}
24233
24176
  function updConf(){const el=document.getElementById('confStat');if(!el)return;
24234
- if(nativeElevationModel()){const projection=readConfidenceProjection();if(!projection.rows.length){el.style.display='none';return;}el.style.display='';const target=effectiveTarget(),summary=ReadConfidence.summarizeReadConfidence(projection,target),unread=summary.diagnosticCount;document.getElementById('confLabel').textContent='Read confidence';document.getElementById('confPct').textContent=summary.totalFields+' field'+(summary.totalFields===1?'':'s');const tg=document.getElementById('confTgt');tg.textContent=(target==null?(summary.lowest==null?' · not recorded':(' · lowest '+summary.lowest+'%')):(' · '+summary.belowFields+' below '+target+'%'+(summary.notRecordedMembers?' · '+summary.notRecordedMembers+' members not recorded':'')))+(unread?' · '+unread+' unread':'');tg.style.color=(target!=null&&summary.belowFields)||unread?'var(--warn)':'';el.dataset.tip=(unread?unread+' drawing-confidence record'+(unread===1?' could':'s could')+' not be read; the result is incomplete. ':'')+(target==null?'No confidence target is set. Click to review recorded drawing fields.':summary.belowFields+' recorded drawing field'+(summary.belowFields===1?' is':'s are')+' below the '+target+'% target. Click to review them.');return;}
24235
- const s=scoreContractJS();
24236
- if(!s.byMember.length){el.style.display='none';return;}el.style.display='';
24237
- document.getElementById('confLabel').textContent='Confidence';
24238
- const sc=s.overall.score,col=bandColorForPct(sc),tgt=effectiveTarget();
24239
- const b=document.getElementById('confPct');b.textContent=sc==null?'—':sc+'%';b.style.color=col;
24240
- // Goal suffix: "· target N%" (muted, static) + "(−G%)" gap in the band color, shown only while below target.
24241
- const tg=document.getElementById('confTgt');
24242
- if(tg){
24243
- if(tgt==null||sc==null)tg.textContent='';
24244
- else{const gap=tgt-sc;
24245
- tg.innerHTML=' · <span style="color:var(--mut)">target '+tgt+'%</span>'+(gap>0?' <span style="color:'+col+'">(−'+gap+'%)</span>':'');}
24246
- }
24247
- // The tonnage WORD comes from the per-system table, like every other unit word on this page. It was a
24248
- // literal `t` in both systems: right for a metric tonne, and wrong for a US project, whose number is
24249
- // SHORT TONS — a different unit about 10% away. (`T` would be a tesla, so that is not the fix either;
24250
- // the US convention is `tons`.) It shipped that way because slice 4's ruling kept US rendered output
24251
- // byte-unchanged; #1103 is the explicit decision to move these four characters.
24252
- //
24253
- // AND NOTHING ON SCREEN CHANGES, because EVERYTHING FROM `scoreContractJS()` DOWN IS UNREACHABLE in
24254
- // this build. `C` is assigned in exactly one place, after boot refuses any contract whose `type` is
24255
- // not `steel.model/v2`; nothing ever writes `C.type`; so `nativeElevationModel()` is true whenever
24256
- // there is a model at all, and the early `return` above always takes it. Both `scoreContractJS()`
24257
- // call sites — here and in `renderConf()` — sit behind that same guard. Proven by running the real
24258
- // page through the editor harness, not by reading: a v2 boot renders the Read-confidence tooltip, and
24259
- // a `steel.model/v1` boot never reaches `C` at all (it shows the unsupported-format empty state).
24260
- //
24261
- // The fix is made anyway because it is right either way and costs nothing, and the dead surface is
24262
- // filed rather than deleted here — removing it is a larger change than #1103 asked for. A reader who
24263
- // finds this branch looking for a bug on screen should start with that: it cannot be on screen.
24264
- el.dataset.tip='Confidence '+(sc==null?'—':sc+'%')+(tgt!=null?' vs target '+tgt+'%':'')+' — '+s.overall.tons.toFixed(1)+' '+_uw().tonnage+' scored · '+s.overall.rfiCount+' RFI. Click for the report.';}
24177
+ const projection=readConfidenceProjection();if(!projection.rows.length){el.style.display='none';return;}el.style.display='';const target=effectiveTarget(),summary=ReadConfidence.summarizeReadConfidence(projection,target),unread=summary.diagnosticCount;document.getElementById('confLabel').textContent='Read confidence';document.getElementById('confPct').textContent=summary.totalFields+' field'+(summary.totalFields===1?'':'s');const tg=document.getElementById('confTgt');tg.textContent=(target==null?(summary.lowest==null?' · not recorded':(' · lowest '+summary.lowest+'%')):(' · '+summary.belowFields+' below '+target+'%'+(summary.notRecordedMembers?' · '+summary.notRecordedMembers+' members not recorded':'')))+(unread?' · '+unread+' unread':'');tg.style.color=(target!=null&&summary.belowFields)||unread?'var(--warn)':'';el.dataset.tip=(unread?unread+' drawing-confidence record'+(unread===1?' could':'s could')+' not be read; the result is incomplete. ':'')+(target==null?'No confidence target is set. Click to review recorded drawing fields.':summary.belowFields+' recorded drawing field'+(summary.belowFields===1?' is':'s are')+' below the '+target+'% target. Click to review them.');}
24265
24178
  // --- the report modal ---
24266
- let confBand='all',confCat='all',confExpand=null;
24179
+ let confCat='all',confExpand=null;
24267
24180
  function openConf(){confExpand=null;renderConf();document.getElementById('confModal').style.display='flex';document.getElementById('confClose').focus();}
24268
24181
  function closeConf(restore=true){document.getElementById('confModal').style.display='none';if(restore)document.getElementById('confStat').focus();}
24269
24182
  function confOpen(){return document.getElementById('confModal').style.display==='flex';}
24270
- function _bar(pct){return '<div class=cc-bar><div class=cc-fill style="width:'+(pct||0)+'%;background:'+bandColorForPct(pct)+';'+(pct==null?'opacity:0':'')+'"></div></div>';}
24271
- function _countsHtml(c){const out=['verified','high','med','low','rfi'].filter(k=>c[k]>0).map(k=>'<span style="color:'+BANDC[k]+'">'+BANDLAB[k][0]+' <b>'+c[k]+'</b></span>').join('');return out||'<span>—</span>';}
24272
- function renderConf(){if(nativeElevationModel()){renderReadConf();return;}const s=scoreContractJS();const cat=s.byCategory;
24273
- const ct=document.getElementById('confTarget');if(ct&&document.activeElement!==ct){ // value = the per-read OVERRIDE only; the app default shows as a placeholder (empty = using default)
24274
- ct.value=typeof C.target_confidence==='number'?C.target_confidence:'';ct.placeholder='—';}readTargetControl();
24275
- const card=(key,label,cs,stub)=>'<div class="ccard'+(stub?' stub':' click')+(confCat===key?' on':'')+'" data-cat="'+key+'"'+(stub?' data-tip="not scored yet"':'')+'>'+
24276
- '<div class=cc-label>'+label+'</div>'+
24277
- '<div class=cc-score style="color:'+(stub?'var(--mut)':bandColorForPct(cs.score))+'">'+(stub||cs.score==null?'—':cs.score+'%')+'</div>'+
24278
- _bar(stub?null:cs.score)+
24279
- '<div class=cc-counts>'+(stub?'<span>reserved slot</span>':_countsHtml(cs.counts))+'</div></div>';
24280
- document.getElementById('confCats').innerHTML=card('beams','Beams',cat.beams)+card('columns','Columns',cat.columns)+card('details','Details',cat.details)+card('connections','Connections',cat.connections);
24281
- const bands=['all','verified','high','med','low','rfi'],cats=['all','beams','columns','details','connections'];
24282
- document.getElementById('confFilter').innerHTML=
24283
- '<span class=glab>Band</span><span class=grp>'+bands.map(b=>'<button data-command-id="steel.confidence-filter#band '+b+'" data-band="'+b+'" class="'+(confBand===b?'on':'')+'" aria-pressed="'+(confBand===b?'true':'false')+'">'+(b==='all'?'All':BANDLAB[b])+'</button>').join('')+'</span>'+
24284
- '<span class=glab>Category</span><span class=grp>'+cats.map(c=>'<button data-command-id="steel.confidence-filter#category '+c+'" data-fcat="'+c+'" class="'+(confCat===c?'on':'')+'" aria-pressed="'+(confCat===c?'true':'false')+'">'+(c==='all'?'All':c[0].toUpperCase()+c.slice(1))+'</button>').join('')+'</span>'+
24285
- '<span class=glab style="margin-left:auto">Coverage: '+s.coverage.members+' members · '+s.coverage.segments+' segments (approx.)</span>';
24286
- document.getElementById('confBody').innerHTML=confBodyHtml(s);
24287
- wireConf();restoreConfControl();}
24288
- function confBodyHtml(s){
24289
- if(!s.byMember.length&&!s.byDetail.length)return '<div class=hint style="padding:14px 0">No members in the model yet.</div>';
24290
- if(confCat==='connections'){
24291
- // worst-first so the RFIs / unmapped ends surface at the top (the "what to fix next" view)
24292
- const _ord={rfi:0,low:1,med:2,high:3,verified:4};
24293
- let conn=s.byConnection.slice().sort((a,b)=>_ord[a.band]-_ord[b.band]);
24294
- if(confBand!=='all')conn=conn.filter(e=>e.band===confBand);
24295
- if(!conn.length)return '<div class=hint style="padding:14px 0">Nothing matches this filter.</div>';
24296
- const whichLabel=w=>w==='col'?'Column':w===0?'End 1':'End 2';
24297
- let h='<table class=ftab><thead><tr><th>Band</th><th>Member</th><th>End</th><th>Sheet</th><th>Reason</th><th></th></tr></thead><tbody>';
24298
- conn.forEach(e=>{h+='<tr><td><span class=pill style="'+BANDPILL[e.band]+'">'+BANDLAB[e.band]+'</span></td>'+
24299
- '<td>'+esc(e.memberId)+'</td>'+
24300
- '<td>'+whichLabel(e.which)+'</td>'+
24301
- '<td>'+esc(e.sheet)+'</td>'+
24302
- '<td><span class=hint>'+esc(e.reason||'—')+'</span></td>'+
24303
- '<td><button data-command-id="steel.locate-member#'+esc(e.memberId)+'" class=ghost data-loc="'+esc(e.memberId)+'" data-pi="'+e.pi+'">Locate</button></td></tr>';});
24304
- h+='</tbody></table>';return h;}
24305
- let mem=s.byMember.slice();
24306
- if(confCat==='beams')mem=mem.filter(m=>m.role==='beam');else if(confCat==='columns')mem=mem.filter(m=>m.role==='column');else if(confCat==='details')mem=[];
24307
- if(confBand!=='all')mem=mem.filter(m=>m.band===confBand);
24308
- let det=(confCat==='all'||confCat==='details')?s.byDetail.slice():[];
24309
- if(confBand!=='all')det=det.filter(d=>d.band===confBand);
24310
- // The unit lives in the HEADER and the cells stay bare, which is what this table has always done —
24311
- // and the convention the design review picked out as the right one for a dense numeric column. US
24312
- // keeps `Tons` exactly; a metric project reads `t`.
24313
- let h='<table class=ftab><thead><tr><th>Band</th><th>Element</th><th>Sheet</th><th>'+(displayUnits()===DisplayUnits.MM?'t':'Tons')+'</th><th>Evidence</th><th></th></tr></thead><tbody>';
24314
- mem.forEach(m=>{const chips=m.factors.map(f=>'<span class="chip '+(f.state==='ok'?'':f.state)+'">'+esc(f.label)+(f.state==='ok'?' ✓':f.state==='fail'?' ✗':' ●')+'</span>').join('');
24315
- h+='<tr class=confrow data-mid="'+esc(m.id)+'" data-pi="'+m.planIdx+'"><td><span class=pill style="'+BANDPILL[m.band]+'">'+BANDLAB[m.band]+'</span></td>'+
24316
- '<td>'+(esc(m.profile)||'<span style="color:var(--mut)">(no profile)</span>')+' <span style="color:var(--mut);font-size:11px">'+esc(m.isBrace?'brace':m.role)+'</span></td>'+ // a brace carries role 'beam' — label it honestly
24317
- '<td>'+esc(m.sheet)+'</td><td>'+(m.tons?m.tons.toFixed(2):'—')+'</td><td>'+chips+'</td>'+
24318
- '<td><button data-command-id="steel.locate-member#'+esc(m.id)+'" class=ghost data-loc="'+esc(m.id)+'" data-pi="'+m.planIdx+'">Locate</button></td></tr>';
24319
- if(confExpand===m.id)h+='<tr><td></td><td colspan=5 class=conf-expand>'+m.factors.map(f=>'<div>• <b>'+esc(f.label)+':</b> '+esc(f.detail)+'</div>').join('')+'</td></tr>';});
24320
- det.forEach(d=>{h+='<tr><td><span class=pill style="'+BANDPILL[d.band]+'">'+BANDLAB[d.band]+'</span></td><td>'+(esc(d.text)||'(detail)')+' <span style="color:var(--mut);font-size:11px">detail</span></td><td>'+esc(d.sheet)+'</td><td>—</td><td><span class=hint>'+esc(d.reason)+'</span></td><td></td></tr>';});
24321
- if(!mem.length&&!det.length)h+='<tr><td colspan=6><div class=hint style="padding:14px 0">Nothing matches this filter.</div></td></tr>';
24322
- h+='</tbody></table>';return h;}
24323
- function wireConf(){
24324
- document.querySelectorAll('#confCats .ccard.click').forEach(c=>c.onclick=()=>{confCat=(confCat===c.dataset.cat?'all':c.dataset.cat);renderConf();});
24325
- document.querySelectorAll('#confFilter [data-band]').forEach(b=>b.onclick=()=>{rememberConfControl(b,'band');confBand=b.dataset.band;renderConf();});
24326
- document.querySelectorAll('#confFilter [data-fcat]').forEach(b=>b.onclick=()=>{rememberConfControl(b,'fcat');confCat=b.dataset.fcat;renderConf();});
24327
- document.querySelectorAll('#confBody tr.confrow').forEach(r=>r.onclick=e=>{if(e.target.closest('button'))return;const id=r.dataset.mid;confExpand=confExpand===id?null:id;renderConf();});
24328
- document.querySelectorAll('#confBody button[data-loc]').forEach(b=>b.onclick=e=>{e.stopPropagation();const pi=+b.dataset.pi;if(pi!==C.active)setPlan(pi);const m=byId(b.dataset.loc);if(!m)return;selDimIds.clear();modelSelection.replaceMembers([m.id]);geoMode=null;setGeo();closeConf();render();zoomToMember(m);});}
24329
24183
  document.getElementById('confStat').onclick=openConf;
24330
24184
  function commitConfTarget(el){ // per-read target override → contract.target_confidence (never the .flo)
24331
24185
  const raw=String(el.value).trim(),had=typeof C.target_confidence==='number',before=had?C.target_confidence:null;let after=null;
@@ -24606,8 +24460,8 @@ function buildJointFromDetail(m,which,res){
24606
24460
  if(!Array.isArray(C.joints))C.joints=[];
24607
24461
  C.joints=C.joints.filter(j=>!(j&&j.main===m.id&&(j.at===at||(which==='col'&&j.kind==='base-plate'&&!j.at))));
24608
24462
  C.joints.push(joint);
24609
- // Point the end at the row it was built from, on BOTH sides: the end gains the library reference the
24610
- // confidence report scores, and the joint cites the same row for its type/detail identity.
24463
+ // Point the end at the row it was built from, on BOTH sides: the end and the joint cite the same row,
24464
+ // so type/detail identity and the "unassigned" state cannot disagree between them.
24611
24465
  const end=endObjFor(m,which);if(end)end.conn=res.rowId;
24612
24466
  return id;}
24613
24467
  /**
@@ -24684,8 +24538,8 @@ function openCaptureModal(m,which){
24684
24538
  const type=el('input');type.placeholder='shear · moment · pinned — the drawing’s word';type.autocomplete='off';
24685
24539
  type.value=(existing&&existing.type)||'';
24686
24540
  body.append(type);
24687
- const typeHint=el('div','margin-top:4px','Without this the confidence report can never rate these ends highly — it is one word off the drawing.');
24688
- typeHint.className='hint';body.append(typeHint);
24541
+ const typeHint=el('div','margin-top:4px','One word off the drawing — it is how this connection is named wherever it is listed.');
24542
+ typeHint.className='hint';typeHint.id='capTypeHint';body.append(typeHint);
24689
24543
  const scopeLab=el('div',null,'Use these numbers for');scopeLab.className='elab';body.append(scopeLab);
24690
24544
  const group=el('div','display:flex;flex-direction:column;gap:2px');
24691
24545
  opts.forEach((o,i)=>{
@@ -24825,7 +24679,7 @@ function captureDetailRecipe(m,which,opt,type){
24825
24679
  // so this is for the reader, not for correctness.
24826
24680
  sched.sort((a,b)=>schedRank(a&&a.match)-schedRank(b&&b.match));
24827
24681
  rec.schedule=sched;}
24828
- ModelCmd.patchEnd(e,{conn:rowId});j.conn=rowId; // the end and the joint both cite the row, so the confidence report sees the reference
24682
+ ModelCmd.patchEnd(e,{conn:rowId});j.conn=rowId; // the end and the joint both cite the row, so neither can read as unassigned while the other is built
24829
24683
  });
24830
24684
  return {rowId:rowId,droppedSchedule:droppedSchedule};}
24831
24685
  const comboPop=document.createElement('div');comboPop.id='comboPop';document.body.appendChild(comboPop);
@@ -25696,9 +25550,6 @@ if(new URLSearchParams(location.search).get('selftest')==='1'){(function(){
25696
25550
  ok(near(_lenFt({role:'beam',wp:[[0,0],[36,0]],ends:[{tosMm:0,tosDef:false},{tosMm:ft(3),tosDef:false}]}),Math.hypot(3,0,3)),'_lenFt sloped beam = true 3D length (plan run + TOS rise)');
25697
25551
  // battered column: 4 ft plan lean + 12 ft rise → √(4²+12²), not the bare height
25698
25552
  ok(near(_lenFt({role:'column',wp:[[0,0],[48,0]],col:{bosMm:0,tosMm:ft(12),tosDef:false}}),Math.hypot(4,0,12)),'_lenFt battered column includes the plan lean');
25699
- // _mConfTons shares the SAME 3D helper → agrees with the inspector (no BOM-vs-display divergence), incl. default-follow
25700
- const dc={role:'column',profile:'W10X49',col:{bosMm:0,tosMm:null,tosDef:true}};
25701
- ok(near(_mConfTons(dc,10,ft(17)), _lenFt(dc)*49/2000),'_mConfTons shares _len3dFt with the display (agree even for a default-follow column)');
25702
25553
  FT=sf;defaultTosMm=st;}
25703
25554
  // 12) Tekla area-select — window (L→R drag) = fully enclosed; crossing (R→L drag) = touched
25704
25555
  {const r=[0,0,10,10],win=(a,b)=>inRect(a,r)&&inRect(b,r),crs=(a,b)=>rectHit(a,b,r);
@@ -25876,13 +25727,6 @@ if(new URLSearchParams(location.search).get('selftest')==='1'){(function(){
25876
25727
  modelSelection.replaceMembers(['jA:plate','C1']);ok(!selIsConnOnly(),'selIsConnOnly false when a member is mixed in');
25877
25728
  C.joints=sj;modelSelection.replaceMembers(ss);partsById=sPb;C.plans=sPl;C.active=sA;C.members=sCm;}
25878
25729
 
25879
- // the editor's confidence mirror: brace ends are not scored as beam connections
25880
- {const spl=C.plans,sa=C.active;
25881
- C.plans=[{sheet:'T',members:[normBrace(mk({id:'brC',wp:[[0,0],[100,0]]})),{id:'bC',role:'beam',profile:'W16X26',wp:[[0,50],[100,50]],ends:[{},{}]}]}];
25882
- const ids=_scoreConnections().ends.map(e=>e.memberId);
25883
- ok(!ids.includes('brC')&&ids.includes('bC'),'_scoreConnections skips brace ends, still scores beams');
25884
- C.plans=spl;C.active=sa;}
25885
-
25886
25730
  P.members=sm2;}
25887
25731
 
25888
25732
  P.members=sm;zoom=sz;P.mm_per_px=sp;defaultTosMm=st;}