@floless/app 0.124.1 → 0.125.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -662,6 +662,21 @@ export const MODEL_V2_TOL = Object.freeze({
662
662
  RESIDUAL_REFUSE_MM: 6.35, // ...and above this is refused: beyond drafting drift = a different grid
663
663
  ROTATION_REFUSE_DEG: 0.05, // secondary ceiling (the binding gate is induced displacement)
664
664
  SCALE_REFUSE_FRAC: 0.002, // secondary ceiling, 0.2%
665
+
666
+ // How far a HAND-READ registration control may land from the grid intersection it names. These two are
667
+ // in DISPLAY POINTS, and that unit is the whole point (#590): a sheet's display px are PDF points —
668
+ // 1/72" of the PRINTED drawing — so a tolerance stated in them means the same thing at every drawing
669
+ // scale and on every size of building, which a tolerance in mm does not. At 1/4"=1'-0" one point is
670
+ // 33.87 mm on the ground, so judging a pixel pick by the 6.35 mm de-dup distance demanded 0.19 pt of
671
+ // reading accuracy and refused every photographed drawing ever read.
672
+ //
673
+ // They bound the pick, NOT the registration: the transform is fitted from the grid, so a pick within
674
+ // tolerance moves nothing. What they bound is the evidence — the picks are the only measurement that
675
+ // sees the drawing at all, and so the only check on `grid.origin` and `pt_per_ft`. Two picks a
676
+ // baseline apart therefore bound a scale error to ±(REFUSE_PT / baselinePt), which is why the reader
677
+ // skill tells the AI to choose the FURTHEST intersection: a longer baseline is a better measurement.
678
+ CONTROL_CHECK_REPORT_PT: 2, // 1/36" on the printed sheet — past ordinary reading error, worth saying
679
+ CONTROL_CHECK_REFUSE_PT: 9, // 1/8" on the printed sheet — nobody misses a grid bubble by this much
665
680
  });
666
681
 
667
682
  /** The §5.2a elevation union: `{known:mm}` | `{unknown:true, rfiRef?}`. */
@@ -793,6 +808,20 @@ export function registerSheet(input) {
793
808
 
794
809
  // Induced displacement is the BINDING gate: §5.2b's own 0.05 deg over the measured 19.4 m baseline
795
810
  // admits ~16.9 mm, against a 6.35 mm refusal in the same table. Angle and ratio are secondary ceilings.
811
+ //
812
+ // IT IS CHARGED OVER THE WHOLE EXTENT. Charging it only over the reach no sample verifies was written
813
+ // during #590 and reverted before it shipped, because it is wrong twice — recorded here so it is not
814
+ // re-invented. The reasoning was that a sample which AGREES has measured the fit out to its own
815
+ // distance, so the proxy should not be charged for that span as well. But (a) the reach is a scalar
816
+ // radius, and on a grid the second-farthest node is nearly as far as the farthest, so the annulus left
817
+ // to charge collapses and the budget grows with lattice density — measured |scale-1| up to 2e-3 at
818
+ // 10x7, past SCALE_REFUSE_FRAC, i.e. this stops being the binding gate the line above claims it is; and
819
+ // (b) the case it was meant to admit is exactly the case where the error is REAL. A PROPORTIONAL
820
+ // difference between two sheets' grid strings leaves `residualMm` at zero by construction — a
821
+ // similarity absorbs a uniform scale exactly — so induced displacement is the only guard there, and
822
+ // relaxing it let one physical column land 8.3 mm apart when read on two sheets, past DEDUP_MM, and be
823
+ // emitted TWICE with a clean `ok` and no reasons. The migration's per-axis extent collapse also cites
824
+ // this bound by name and would have been silently invalidated with it.
796
825
  const induced = (Math.abs(transform.rotationRad) + Math.abs(transform.scale - 1)) * extentMm;
797
826
  let verdict = 'ok';
798
827
  const report = (why) => { reasons.push(why); if (verdict === 'ok') verdict = 'report'; };
@@ -249,8 +249,29 @@ function init(canvas, theApi) {
249
249
  refMeasureLine = new THREE.Line(new THREE.BufferGeometry().setFromPoints([new THREE.Vector3(), new THREE.Vector3()]),
250
250
  new THREE.LineDashedMaterial({ color: 0x22d3ee, dashSize: 60, gapSize: 40 }));
251
251
  refMeasureLine.material.depthTest = false; refMeasureLine.renderOrder = 997; refMeasureLine.visible = false; scene.add(refMeasureLine);
252
+ /*
253
+ * THE FOUR MODEL-GLUED LABEL HOSTS SIT UNDER THE 3D CHROME, and the numbers below are the whole rule.
254
+ *
255
+ * Each is `position:fixed` on `<body>` and projected per frame, so it is painted in the ROOT stacking
256
+ * context (`#stagewrap` and `<main>` are `position:relative; z-index:auto`, which creates none) — it
257
+ * competes directly with the panels. They shipped at 56/57, above every panel, and a chip landing over
258
+ * the expanded Objects panel drew ON TOP of it: unreadable itself, and hiding a control the user was
259
+ * reading. Reported against the 3D property labels, but it was never theirs — the mark/id, dimension
260
+ * and member-length chips all shared it.
261
+ *
262
+ * A label is a READING OF THE MODEL and belongs with the model, under the chrome that frames it. So the
263
+ * band is BELOW the lowest piece of 3D chrome (`#m3dAxes`, z 5) and above the canvas (z auto):
264
+ * 3 member / property / selected-length labels
265
+ * 4 dimension labels — above the other three, which is the order they shipped with
266
+ * 5+ chrome: the triad, the Objects panel and view cube (6), the collapse chevrons (12) …
267
+ * `#m3dBar` was already at 59 — the toolbar had been lifted over the labels one at a time while the
268
+ * panels were not, which is exactly the inconsistency this replaces with one rule.
269
+ *
270
+ * NOT in this band, deliberately: `hoverChip` (a fixed bottom-centre readout, chrome by position) and
271
+ * `rubber` (a live drag overlay, which must cover everything it is drawn across).
272
+ */
252
273
  dimLabelHost = document.createElement('div');
253
- dimLabelHost.style.cssText = 'position:fixed;left:0;top:0;pointer-events:none;z-index:57';
274
+ dimLabelHost.style.cssText = 'position:fixed;left:0;top:0;pointer-events:none;z-index:4';
254
275
  document.body.appendChild(dimLabelHost);
255
276
  // …and its label, in the dim host so it is positioned by the same per-frame projection. The cssText is
256
277
  // the member-label chip's verbatim (cyan border = a dimension read); only `display` is ours to drive.
@@ -258,12 +279,12 @@ function init(canvas, theApi) {
258
279
  refMeasureLabel.style.cssText = 'position:absolute;transform:translate(-50%,-50%);pointer-events:none;background:var(--panel,#0f172a);color:#e2e8f0;border:1px solid #22d3ee;border-radius:4px;padding:1px 6px;font:11px system-ui;white-space:nowrap;box-shadow:0 1px 4px rgba(0,0,0,.4);display:none';
259
280
  dimLabelHost.appendChild(refMeasureLabel);
260
281
  memberLabelHost = document.createElement('div'); // member mark/id labels (Slice 4) — below the dim labels
261
- memberLabelHost.style.cssText = 'position:fixed;left:0;top:0;pointer-events:none;z-index:56;display:none';
282
+ memberLabelHost.style.cssText = 'position:fixed;left:0;top:0;pointer-events:none;z-index:3;display:none';
262
283
  document.body.appendChild(memberLabelHost);
263
284
  propLabelHost = document.createElement('div'); // right-click property labels — own host so they never clobber the mark/id pool
264
- propLabelHost.style.cssText = 'position:fixed;left:0;top:0;pointer-events:none;z-index:56;display:none';
285
+ propLabelHost.style.cssText = 'position:fixed;left:0;top:0;pointer-events:none;z-index:3;display:none';
265
286
  selLenLabelHost = document.createElement('div'); // ⋯ Display → Show member length: on-select length chips (cyan dimension read)
266
- selLenLabelHost.style.cssText = 'position:fixed;left:0;top:0;pointer-events:none;z-index:56;display:none';
287
+ selLenLabelHost.style.cssText = 'position:fixed;left:0;top:0;pointer-events:none;z-index:3;display:none';
267
288
  document.body.appendChild(selLenLabelHost);
268
289
  document.body.appendChild(propLabelHost);
269
290
  // persistent hover/selection status chip, bottom-centre of the canvas (mirrors the viewer's readout)
@@ -1878,8 +1899,13 @@ function syncMemberLabels() {
1878
1899
  }
1879
1900
  for (let i = 0; i < memberLabelPool.length; i++) {
1880
1901
  const el = memberLabelPool[i], m = ms[i];
1881
- if (!m || !Array.isArray(m.wp) || m.wp.length < 2) { el.style.display = 'none'; el._mid = null; continue; }
1882
- const g = geoOf(m);
1902
+ // ASK THE READ HALF FOR A WORK LINE, never for `m.wp` — the same repair the reference lines got in
1903
+ // P7d (see buildRefLines), applied to the two label pools that sweep missed. `wp` is a v1 STORAGE
1904
+ // shape; a v2 canonical member has `from`/`to`, so this guard skipped every member of a canonical
1905
+ // model and the toggle drew nothing at all. MEASURED in a real browser on a v2 document: both pools
1906
+ // allocated their divs and left every one `display:none` with empty text (#614).
1907
+ const g = m && geoOf(m);
1908
+ if (!g || !g.line) { el.style.display = 'none'; el._mid = null; continue; }
1883
1909
  el._mid = [(g.line[0][0] + g.line[1][0]) / 2, (g.line[0][1] + g.line[1][1]) / 2, (g.line[0][2] + g.line[1][2]) / 2];
1884
1910
  el.textContent = m.mark || m.id || '';
1885
1911
  el.style.display = 'block';
@@ -1922,8 +1948,10 @@ function syncPropLabels() {
1922
1948
  const byId = new Map(members().map((m) => [m.id, m]));
1923
1949
  for (let i = 0; i < propLabelPool.length; i++) {
1924
1950
  const el = propLabelPool[i], L = labels[i], m = L ? byId.get(L.id) : null;
1925
- if (!m || !Array.isArray(m.wp) || m.wp.length < 2 || !L.lines || !L.lines.length) { el.style.display = 'none'; el._mid = null; el._memberId = null; continue; }
1926
- const g = geoOf(m), a = g.line[0], b = g.line[1];
1951
+ // The work line, not `m.wp` — see syncMemberLabels above for why, and for what it measured.
1952
+ const g = (m && L.lines && L.lines.length) ? geoOf(m) : null;
1953
+ if (!g || !g.line) { el.style.display = 'none'; el._mid = null; el._memberId = null; continue; }
1954
+ const a = g.line[0], b = g.line[1];
1927
1955
  el._mid = place === 'start' ? a : place === 'end' ? b : [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2, (a[2] + b[2]) / 2];
1928
1956
  el._memberId = m.id;
1929
1957
  el.textContent = L.lines.join('\n');