@floless/app 0.117.0 → 0.117.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.
@@ -54469,7 +54469,7 @@ function appVersion() {
54469
54469
  return resolveVersion({
54470
54470
  isSea: isSea2(),
54471
54471
  sqVersionXml: readSqVersionXml(),
54472
- define: true ? "0.117.0" : void 0,
54472
+ define: true ? "0.117.1" : void 0,
54473
54473
  pkgVersion: readPkgVersion()
54474
54474
  });
54475
54475
  }
@@ -54485,7 +54485,7 @@ function resolveChannel(s) {
54485
54485
  function appChannel() {
54486
54486
  return resolveChannel({
54487
54487
  isSea: isSea2(),
54488
- define: true ? "0.117.0" : void 0,
54488
+ define: true ? "0.117.1" : void 0,
54489
54489
  // argv[1] is the entry the runtime actually loaded (…/dist/floless-server.cjs), which is what
54490
54490
  // carries the npx cache prefix. Absent under the SEA exe, which never reaches the npx branch.
54491
54491
  modulePath: process.argv[1]
@@ -510,13 +510,6 @@
510
510
  "role": { "enum": ["beam", "column"], "description": "Defaults to beam when absent." },
511
511
  "position": { "enum": ["top", "middle", "bottom"], "description": "Profile placement relative to the reference line (the work-line between the two work-points) — the section's depth position. top = line at the section top (steel hangs below); middle = line through the centroid; bottom = line at the section bottom. When absent the editor defaults a flat beam to top (line = top of steel), and a column, a VERTICAL brace (whatever its slope — its work-points sit on the column centre-lines) or a steep beam to middle." },
512
512
  "rfi": { "type": "boolean", "description": "True when the size is unresolved (excluded from the BOM)." },
513
- "section": {
514
- "description": "The reader's traced section box `{w,d}` for a column whose `profile` has not resolved yet, so it still draws at its real footprint instead of a generic marker. **MILLIMETRES** — NOT display space, unlike `wp`. Declared here because it was previously carried by `additionalProperties` alone with its unit written down nowhere, and the 2D plan consequently drew it as inches for a whole release, making every traced column 25.4x oversize (#502). A resolved `profile` WINS over this box. DELIBERATELY unconstrained: this entry documents the unit and must not narrow what already validates, so no `type` is asserted here — v1 is the open, forward-compatible contract, and tightening it belongs in its own change, not in a rendering bugfix.",
515
- "properties": {
516
- "w": { "description": "Section width in mm." },
517
- "d": { "description": "Section depth in mm." }
518
- }
519
- },
520
513
  "mf": { "type": "boolean", "description": "Moment-frame member (persistent flag)." },
521
514
  "memberType": { "type": "string", "description": "Member category driving the legend (e.g. beam, ledger, brace). 'brace' is special: the member draws with the brace symbology and is excluded from every beam-only path (merge, reversed-beams, shear plates)." },
522
515
  "brace": {
@@ -3362,11 +3362,59 @@ const _polyStr=pts=>pts.map(p=>p[0].toFixed(1)+','+p[1].toFixed(1)).join(' ');
3362
3362
  // the blurry raster JPEG. Vector PDFs expose filterElsForPlan(); a genuinely scanned sheet (no vectors)
3363
3363
  // falls back to the RB64 raster. ponytail: all line d's are merged into ONE <path> so the browser parses
3364
3364
  // one node, not thousands — fast to re-render on pan/zoom.
3365
- function hasOverlay(){return !!(filterElsForPlan()||RB64);} // F13: the active plan carries a reference sheet — vector linework or a scanned raster
3365
+ function hasOverlay(){const d=drawablePlan();return d?d.renders:!!RB64;} // F13: the active plan carries a reference sheet — vector linework or a scanned raster. Keyed on whether anything DRAWABLE actually paints, so a vector sheet whose every layer is hidden (or whose survivors are all text) greys the toggle out instead of offering to show a blank page; only a sheet with NO vectors falls through to the raster (#507)
3366
+ // #507: `filter.layers[].drawable === false` means "listed but not drawn (e.g. a text/title-block
3367
+ // layer)" — the schema's own words. Only the Steel Filter's row styling ever honoured it; the plan drew
3368
+ // every element regardless, so a reader that marked its noise non-drawable exactly as instructed still
3369
+ // got the noise. On a faithfully-read sheet that is ~27 backdrop strokes per steel stroke, and the only
3370
+ // escape was to DELETE those elements from the contract — which throws away the user's ability to switch
3371
+ // the layer back on, the very thing the filter exists for.
3372
+ // The layer stays LISTED with its true count (that panel is steel-filter's and is untouched); this skips
3373
+ // the draw alone. Layers are global — one list applies to every sheet — per the takeoff schema.
3374
+ function nonDrawableLayers(){const f=C&&C.filter,out=new Set();
3375
+ for(const l of (f&&f.layers)||[]) if(l&&l.drawable===false&&typeof l.name==='string') out.add(l.name);
3376
+ return out;}
3377
+ // The sheet's linework MINUS every non-drawable layer — the one set all three overlay consumers share
3378
+ // (draw, snap, has-a-sheet), so what you can see, what you can snap to, and whether the toggle is even
3379
+ // enabled can never disagree. null and [] mean DIFFERENT things and callers must keep them apart:
3380
+ // null = this plan carries no vector overlay at all (a scanned sheet, so the raster IS the reference
3381
+ // sheet); [] = it carries one but every layer of it is hidden, and the raster must NOT stand in for it
3382
+ // — that bitmap is a picture of the whole sheet, so it would put the very text and title block the user
3383
+ // suppressed straight back on screen.
3384
+ // NOT folded into filterElsForPlan(): gridReadFromDrawing() reads the RAW set to detect the printed
3385
+ // grid, and the bubbles it hunts routinely sit on an annotation layer a reader would mark non-drawable.
3386
+ // Hiding them from the canvas must not blind the detector.
3387
+ // Memoised on the source array's identity AND the hidden-layer set, because overlaySnapGeom() caches
3388
+ // its parse by identity: handing it a fresh array each call would re-parse ~25k elements every snap.
3389
+ // The memo holds the ANSWER, not loose parallel variables: the filtered elements, how many layers were
3390
+ // hidden to get them, and whether any of them will actually paint. Keeping the count beside the array
3391
+ // is not tidiness — a count stored separately went stale on a cache HIT (sheet A hidden, switch to a
3392
+ // vectorless sheet B, switch back: B zeroed the count, A's early return handed back its cached array
3393
+ // without restoring it, and the tooltip then claimed nothing was excluded). Found by review.
3394
+ let _draw=null,_drawSrc=null,_drawKey=null;
3395
+ function drawablePlan(){
3396
+ const els=filterElsForPlan();
3397
+ if(!els){_draw=null;_drawSrc=null;_drawKey=null;return null;} // no vector overlay at all — every memo slot invalidated together, so nothing can survive into the next sheet
3398
+ const nd=nonDrawableLayers(),key=nd.size?JSON.stringify(Array.from(nd).sort()):''; // JSON, not a join: it escapes any separator character a CAD layer name might itself contain, so two different sets cannot produce one key — and unlike a NUL separator it leaves no control byte in this file (a raw one makes the browser's script tokenizer read U+FFFD where the node harness reads U+0000, and turns the file binary to grep)
3399
+ if(els===_drawSrc&&key===_drawKey&&_draw)return _draw;
3400
+ let out=els,hidden=0; // no hidden layer: the SAME array, so overlaySnapGeom's identity cache still hits
3401
+ if(nd.size){const seen=new Set();out=[];
3402
+ for(const e of els){if(e&&nd.has(e.layer)){seen.add(e.layer);continue;}out.push(e);}
3403
+ hidden=seen.size;} // counted from the ELEMENTS, so a layer marked non-drawable but absent from this sheet is never reported as hidden here
3404
+ let renders=false; // …and does anything LEFT actually paint? Raw length is not the question: a sheet of nothing but text spans, or of lines with no usable geometry, is length>0 and draws a blank white backdrop that reads as a failed read
3405
+ for(const e of out){if(!e)continue;
3406
+ if(e.kind==='line'&&((typeof e.d==='string'&&e.d)||(e.x1!=null&&e.x2!=null))){renders=true;break;}
3407
+ if(e.kind==='circle'&&e.r>0){renders=true;break;}}
3408
+ _drawSrc=els;_drawKey=key;_draw={els:out,hidden,renders};
3409
+ return _draw;}
3410
+ function drawableElsForPlan(){const d=drawablePlan();return d?d.els:null;}
3411
+ function hiddenLayerCount(){const d=drawablePlan();return d?d.hidden:0;}
3366
3412
  function overlaySvg(){
3367
3413
  if(!refSheetOn)return ''; // F13: reference sheet hidden → draw neither the raster/vector linework NOR the white pdfsheet backdrop
3368
- const els=filterElsForPlan();
3369
- if(!els)return RB64?`<image href="data:image/jpeg;base64,${RB64}" x="${X0}" y="${Y0}" width="${X1-X0}" height="${Y1-Y0}"/>`:'';
3414
+ const d0=drawablePlan();
3415
+ if(!d0)return RB64?`<image href="data:image/jpeg;base64,${RB64}" x="${X0}" y="${Y0}" width="${X1-X0}" height="${Y1-Y0}"/>`:''; // no vectors at all: the scanned raster IS the reference sheet
3416
+ if(!d0.renders)return ''; // vectors exist but nothing left will paint: draw NOTHING. Not the white backdrop (that reads as a failed read), and emphatically not RB64 — the raster pictures the WHOLE sheet, so it would put the suppressed text and title block straight back on screen
3417
+ const els=d0.els;
3370
3418
  let d='',circ='';
3371
3419
  for(const e of els){if(!e)continue;
3372
3420
  if(e.kind==='line'){if(typeof e.d==='string'&&e.d)d+=e.d+' ';else if(e.x1!=null&&e.x2!=null)d+=`M${e.x1} ${e.y1}L${e.x2} ${e.y2}`;}
@@ -5291,8 +5339,8 @@ function _segX(a,b,c,d){const rx=b[0]-a[0],ry=b[1]-a[1],sx=d[0]-c[0],sy=d[1]-c[1
5291
5339
  let _ovSnap=null,_ovSnapEls=null;
5292
5340
  function overlaySnapGeom(){
5293
5341
  if(!refSheetOn){_ovSnap=null;_ovSnapEls=null;return null;} // F13: hidden reference sheet contributes no snap candidates (don't snap to invisible linework — buildSnap :3062 + snapPerpTargets :3085)
5294
- const els=filterElsForPlan();
5295
- if(!els){_ovSnap=null;_ovSnapEls=null;return null;} // scanned raster / empty → nothing traced to snap to
5342
+ const els=drawableElsForPlan(); // …and a non-drawable LAYER is invisible for the same reason, so it owes the same silence (#507). The toggle's own tooltip promises hiding stops snap points; a layer the user cannot see must not capture an endpoint, midpoint or perpendicular either.
5343
+ if(!els||!els.length){_ovSnap=null;_ovSnapEls=null;return null;} // scanned raster / empty / every layer hidden → nothing traced to snap to
5296
5344
  if(els===_ovSnapEls&&_ovSnap)return _ovSnap; // same sheet's vectors → reuse the parse
5297
5345
  const pts=[],segs=[],mids=[];
5298
5346
  const add=(a,b)=>{if(!(isFinite(a[0])&&isFinite(a[1])&&isFinite(b[0])&&isFinite(b[1])))return;
@@ -6702,7 +6750,13 @@ document.getElementById('plToggleB').onclick=e=>{e.stopPropagation();if(!canWrit
6702
6750
  // hasOverlay() answers true — leaving this row live over a canvas that draws nothing. Worse than inert:
6703
6751
  // the handler persists to `steel:refSheet:v1`, which is not project-scoped, so a click here would follow
6704
6752
  // the user into their next v1 project and hide the traced sheet there.
6705
- function updRefToggle(){const b=document.getElementById('refToggleB');if(!b)return;const on=!MODEL_RO&&refSheetOn;b.disabled=MODEL_RO||!hasOverlay();b.classList.toggle('on',on);b.setAttribute('aria-checked',String(on));} // F13: grey the row out on a plan with no reference sheet (mirrors updGridToggle's no-grid disable)
6753
+ const REF_TIP='Show or hide the traced reference sheet (the PDF/SVG drawing under the model). Hidden, it also stops contributing snap points.';
6754
+ function updRefToggle(){const b=document.getElementById('refToggleB');if(!b)return;const on=!MODEL_RO&&refSheetOn;b.disabled=MODEL_RO||!hasOverlay();b.classList.toggle('on',on);b.setAttribute('aria-checked',String(on)); // F13: grey the row out on a plan with no reference sheet (mirrors updGridToggle's no-grid disable)
6755
+ // #507: a non-drawable layer is excluded whatever this toggle says, and NOTHING in the editor sets
6756
+ // that flag — the reader writes it and Steel Filter only dims the row. So say it here, on the one
6757
+ // control a user consults to reason about the backdrop, instead of leaving the omission silent.
6758
+ const n=hiddenLayerCount();
6759
+ b.setAttribute('data-tip',REF_TIP+(n?(' '+n+' layer'+(n===1?'':'s')+' marked “listed but not drawn” '+(n===1?'is':'are')+' always excluded — review them in Steel Filter.'):''));}
6706
6760
  document.getElementById('refToggleB').onclick=e=>{e.stopPropagation();if(MODEL_RO)return;refSheetOn=!refSheetOn;try{localStorage.setItem('steel:refSheet:v1',refSheetOn?'1':'0');}catch(_){}updRefToggle();render();}; // render() rebuilds the SVG (overlaySvg gone/back) and buildSnap re-reads overlaySnapGeom (snap candidates gone/back)
6707
6761
  document.getElementById('gridEditB').onclick=()=>{setGridMode(!gridMode);render();};
6708
6762
  {const ghb=document.getElementById('gridHdrB');if(ghb)ghb.onclick=()=>{setGridMode(!gridMode);render();};} // the header twin (read-only mode only) — same one action, not a second implementation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.117.0",
3
+ "version": "0.117.1",
4
4
  "type": "module",
5
5
  "description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
6
6
  "bin": {