@floless/app 0.160.0 → 0.162.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.
Files changed (40) hide show
  1. package/aware-version-pin.mjs +43 -0
  2. package/dist/floless-server.cjs +126990 -120010
  3. package/dist/schemas/steel.model.v2.schema.json +23 -0
  4. package/dist/skills/floless-app-knowledge/SKILL.md +6 -5
  5. package/dist/skills/floless-app-rfi/SKILL.md +18 -5
  6. package/dist/skills/floless-app-steel-model/SKILL.md +28 -6
  7. package/dist/skills/floless-app-steel-takeoff/SKILL.md +579 -282
  8. package/dist/templates/floless-workspace-read.flo +9 -1
  9. package/dist/templates/steel-model.flo +6 -2
  10. package/dist/templates/viewer-3d-demo.flo +8 -2
  11. package/dist/web/app.css +198 -17
  12. package/dist/web/app.js +23 -0
  13. package/dist/web/aware.js +303 -54
  14. package/dist/web/chat-question-card.js +10 -3
  15. package/dist/web/chat.css +79 -5
  16. package/dist/web/chat.js +1513 -243
  17. package/dist/web/commands-drawing-check.js +1 -0
  18. package/dist/web/commands-filter.js +11 -0
  19. package/dist/web/commands-shell.js +467 -29
  20. package/dist/web/commands-steel.js +40 -38
  21. package/dist/web/drawing-check-editor.js +76 -3
  22. package/dist/web/index.html +46 -2
  23. package/dist/web/instructor.js +5 -3
  24. package/dist/web/leave-guard.js +12 -2
  25. package/dist/web/pages.js +43 -12
  26. package/dist/web/project-history.js +349 -0
  27. package/dist/web/project-reconciliation.js +1 -0
  28. package/dist/web/project-rfis.js +260 -21
  29. package/dist/web/startup-admission.js +53 -7
  30. package/dist/web/steel-3d-core.js +115 -6
  31. package/dist/web/steel-3d-view.js +61 -5
  32. package/dist/web/steel-editor.html +439 -118
  33. package/dist/web/steel-filter.html +139 -0
  34. package/dist/web/steel-model-v2-commands.js +3 -3
  35. package/dist/web/steel-model-v2-projection.js +132 -4
  36. package/dist/web/steel-plan-transform.js +78 -0
  37. package/dist/web/tool-updates.js +59 -3
  38. package/dist/web/workspaces.js +1553 -196
  39. package/launch.mjs +36 -5
  40. package/package.json +6 -4
@@ -1660,6 +1660,9 @@ rect.lblhot:focus-visible{outline:2px solid var(--brand);outline-offset:2px;stro
1660
1660
  border:1px solid var(--err-edge);color:var(--err);cursor:default}
1661
1661
  .connset{opacity:.55}
1662
1662
  .mbackdrop{position:absolute;inset:0;background:var(--backdrop)}
1663
+ /* #2470 R6.6c: the RFI page fills the frame (it is a project step now, not a dialog). */
1664
+ #rfiModal.rfi-page{align-items:stretch;justify-content:stretch;background:var(--bg)}
1665
+ #rfiModal.rfi-page>.mpanel{width:100%;max-width:none;height:100%;max-height:none;border:0;border-radius:0;box-shadow:none}
1663
1666
  .mpanel{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:10px;width:min(880px,92vw);max-height:86vh;display:flex;flex-direction:column;box-shadow:var(--shadow-modal)}
1664
1667
  #hostBakeModal .mpanel{width:min(620px,92vw)}
1665
1668
  #hostBakeSub{margin:0;padding:12px 16px;color:var(--mut);font-size:12px;line-height:1.55;border-bottom:1px solid var(--line)}
@@ -2011,6 +2014,8 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2011
2014
  line.gridln.sel{stroke:var(--brand);stroke-width:2;opacity:1;filter:drop-shadow(0 0 3px var(--brand))} /* marquee/Ctrl+A grid selection */
2012
2015
  line.gridprev{stroke:var(--brand);stroke-width:1.2;stroke-dasharray:8 5;vector-effect:non-scaling-stroke;pointer-events:none;opacity:.9}
2013
2016
  circle.gridbub{fill:#0f172a;stroke:#64748b;stroke-width:1.5;vector-effect:non-scaling-stroke;cursor:grab;filter:drop-shadow(0 1px 2px rgba(0,0,0,.45))}
2017
+ text.elvlbl{fill:#64748b;font-weight:600;font-family:system-ui;text-anchor:end;dominant-baseline:central;pointer-events:none} /* an elevation's level text (#2780): the grid's own slate, which reads on the canvas and on the source sheet under it in both themes */
2018
+ line.gridln.elvlvl{opacity:.6}
2014
2019
  text.gridtx{fill:#e2e8f0;font-weight:700;font-family:system-ui;text-anchor:middle;dominant-baseline:central;pointer-events:none}
2015
2020
  g.gridbubg:hover circle.gridbub{stroke:var(--brand);fill:#1e293b}
2016
2021
  body.gridpick #svg,body.gridpick line.member,body.gridpick line.seg,body.gridpick image{cursor:crosshair}
@@ -2127,6 +2132,10 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2127
2132
  that already existed. (UX review.) */
2128
2133
  #vtSplitWhy{position:absolute;top:calc(100% + 6px);left:0;z-index:9;white-space:nowrap;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:6px 10px;box-shadow:var(--shadow-float)}
2129
2134
  #vtSplitWhy[hidden]{display:none}
2135
+ /* The chip floats over the header's second row when the header wraps, so it must never take a click meant for a
2136
+ control under it (it is text only), and the way back from a Locate trip sits above it (#2470 R6.6c). */
2137
+ #vtSplitWhy{pointer-events:none}
2138
+ #rfiBackRfis{position:relative;z-index:10;background:var(--panel)}
2130
2139
  #viewToggle .seg{padding:5px 10px;margin:0;border:0;border-radius:0;background:transparent;color:var(--mut);font:600 11px var(--ui);cursor:pointer}
2131
2140
  #viewToggle .seg+.seg{border-left:1px solid var(--line)}
2132
2141
  #viewToggle .seg:hover:not(:disabled){color:var(--text)}
@@ -2971,7 +2980,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2971
2980
  <div class=statgrp id=qualGrp>
2972
2981
  <button data-command-id="steel.quality-stats" type=button class="stat statgrp-btn" id=qualBtn aria-expanded=false aria-controls=qualPanel data-tip="What is unresolved on this sheet — RFI, duplicates, member ends, and how well the drawing was read">Quality <b id=qualN>0</b></button>
2973
2982
  <div class=statgrp-panel id=qualPanel hidden>
2974
- <button data-command-id="steel.rfi-list" class="stat act" id=rfiStat aria-haspopup="dialog" aria-expanded="false" aria-controls="rfiModal" data-tip="List every RFI — a question for an engineer, or a member whose size FloLess cannot price"><span class=k>RFI</span><span class=v><b id=rc>0</b></span></button>
2983
+ <button data-command-id="steel.rfi-list" class="stat act" id=rfiStat aria-expanded="false" aria-controls="rfiModal" data-tip="List every RFI — a question for an engineer, or a member whose size FloLess cannot price"><span class=k>RFI</span><span class=v><b id=rc>0</b></span></button>
2975
2984
  <span class=stat id=dupStat data-tip="Overlapping/duplicate members (same geometry)"><span class=k>Duplicates</span><span class=v><b id=dpc>0</b></span></span>
2976
2985
  <span class=stat id=endsStat data-tip="Member ends that may stop at a support face instead of its centerline."><span class=k>Member ends</span><span class=v><b id=endsCount>—</b></span></span>
2977
2986
  <!-- Written by refresh() and shown only when every count above is zero. A panel of four zeroes states
@@ -3007,6 +3016,8 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
3007
3016
  <span class=tb-sep></span>
3008
3017
  <button data-command-id="steel.undo" id=undoB data-tip="Undo (Ctrl+Z)">↶</button>
3009
3018
  <button data-command-id="steel.redo" id=redoB data-tip="Redo (Ctrl+Y / Ctrl+Shift+Z)">↷</button>
3019
+ <!-- #2470 R6.6c: in the header row itself (the RFIs chip sits in the Quality panel, closed most of the time). -->
3020
+ <button data-command-id="steel.back-to-rfis" type=button class=ghost id=rfiBackRfis hidden data-tip="Go back to the RFI you were on">← Back to RFIs</button>
3010
3021
  <button data-command-id="steel.ask-ai" id=askAiBtn aria-expanded=false aria-controls=askAiModal>Ask AI ▸</button>
3011
3022
  <div id=moreWrap>
3012
3023
  <button data-command-id="steel.more-menu" id=moreBtn data-tip="More actions" aria-haspopup=menu aria-expanded=false aria-label="More actions">⋯</button>
@@ -3340,8 +3351,11 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
3340
3351
  <div id=rfiRaiseSub>FloLess wrote these questions from the model. You file one by marking it sent or recording its answer; nothing is saved until you file it.</div>
3341
3352
  <div id=rfiRaiseBanner role=status aria-live=polite aria-atomic=true hidden></div>
3342
3353
  <div id=rfiRaiseList></div></div></div>
3343
- <div id=rfiModal role=dialog aria-modal=true aria-labelledby=rfiTitle><div class=mbackdrop id=rfiBackdrop></div>
3344
- <div class=mpanel><div class=mhead><b id=rfiTitle>RFIs</b><button data-command-id="steel.dialog-close#the RFI list" id=rfiClose aria-label="Close the RFI list" data-tip="Close">✕</button></div>
3354
+ <!-- #2470 R6.6c: the project's RFIs step. In FloLess this page shows on the RFIs step, in the same frame as the model
3355
+ (plan 2026-10-25-2470-r6-6c-steel-rfis-step-PLAN.md); opened any other way (a direct URL, Edit contract) it shows
3356
+ in place of the model with Back to model. Same id as the RFI window it replaces, so its code is unchanged. -->
3357
+ <div id=rfiModal class=rfi-page role=region aria-labelledby=rfiTitle>
3358
+ <div class=mpanel><div class=mhead><b id=rfiTitle tabindex=-1>RFIs</b><button data-command-id="steel.back-to-model" id=rfiBackModel class=ghost hidden data-tip="Show the model again">Back to model</button></div>
3345
3359
  <div id=rfiSub></div>
3346
3360
  <div class=conf-filter id=rfiFilter></div>
3347
3361
  <div id=rfiBanner role=status aria-live=polite aria-atomic=true hidden></div>
@@ -3349,9 +3363,9 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
3349
3363
  <div id=rfiFail hidden></div>
3350
3364
  <div id=rfiList></div>
3351
3365
  <!-- #1090 5b-ii. The action outcome, announced. INSIDE the dialog rather than beside
3352
- #connectionTruthStatus: that one sits outside #rfiModal, and a live region for an aria-modal
3353
- dialog belongs within it. The accepted cost is that it starts inside a display:none subtree —
3354
- acceptable because every announcement happens while the dialog is already display:flex. -->
3366
+ #connectionTruthStatus: that one sits outside #rfiModal, and a live region for the RFI page
3367
+ belongs within it. The accepted cost is that it starts inside a display:none subtree —
3368
+ acceptable because every announcement happens while the page is already showing. -->
3355
3369
  <span id=rfiSay class=sr-only role=status aria-live=polite aria-atomic=true></span></div></div>
3356
3370
  <!-- Reference-model import (#278): drop → probe → confirm. Three stages in one modal, the whole body
3357
3371
  swapping per stage, so Insert is never a disabled button waiting for a condition to be met. -->
@@ -5508,6 +5522,7 @@ function installMemberEndContract(doc,etag,revision,keepHistory){
5508
5522
  bumpRfiEpoch(); // #1090 — a server command replaced the model; the unresolved-size count is stale
5509
5523
  const activePlan=C.plans&&C.plans[C.active];
5510
5524
  if(activePlan&&activePlan.viewKind==='plan'){NO_PLAN_VIEW=false;V2_PROJECTION=v2ProjectionForView(viewIdOf(activePlan));P=projectPlan();}
5525
+ else if(installElevationViewState(activePlan)){} // #2780: an elevation or section stays drawn (read-only) across a server install
5511
5526
  else{V2_PROJECTION=null;NO_PLAN_VIEW=true;if(!activePlan)C.active=0;P=activePlan?{...structuredClone(activePlan),members:[],segments:[],dims:[],details:[],callouts:[],tos_callouts:[],grid:null,default_tos_mm:Number.isFinite(activePlan.elevation_mm)?activePlan.elevation_mm:0}:{sheet:'',members:[],segments:[],dims:[],details:[],callouts:[],tos_callouts:[],grid:null,default_tos_mm:0};resetPlanViewState(C.active);}
5512
5527
  syncElevationContext();
5513
5528
  // A server command replaces the model underneath the editor's local history. Retaining those snapshots
@@ -5664,8 +5679,108 @@ async function undoMemberEndResolution(){if(!memberEndReview||memberEndReview.bu
5664
5679
  // world-mm root member.
5665
5680
  function v2ProjectionForView(viewId){
5666
5681
  let projection=V2_PROJECTIONS.get(viewId);
5667
- if(!projection){projection=V2Projection.createV2Projection(C,viewId,{session:V2_SESSION});V2_SESSION.registerProjection(projection);V2_PROJECTIONS.set(viewId,projection);}
5682
+ if(!projection){
5683
+ projection=V2Projection.createV2Projection(C,viewId,{session:V2_SESSION});V2_SESSION.registerProjection(projection);V2_PROJECTIONS.set(viewId,projection);}
5668
5684
  return projection;}
5685
+ /* The same cache, for an elevation or section: drawn read-only from its own registration (#2780), not through the plan
5686
+ transform. Kept out of v2ProjectionForView on purpose — that one is the plan path and must keep refusing a non-plan. */
5687
+ function elevationProjectionForView(viewId){
5688
+ let projection=V2_PROJECTIONS.get(viewId);
5689
+ if(!projection||!projection.elevation){projection=V2Projection.createElevationProjection(C,viewId,{session:V2_SESSION});V2_SESSION.registerProjection(projection);V2_PROJECTIONS.set(viewId,projection);}
5690
+ return projection;}
5691
+ /* #2780 — an ELEVATION or SECTION view. It used to have no 2D picture at all (choosing one left the plan on screen);
5692
+ it is now drawn from its own registration, with its members at their true positions, and is for LOOKING: you can
5693
+ select a member and Inspect it, and the canvas says in words that moving or adding steel here is not available.
5694
+ `P.elevationView` is what marks the active view as one of these. */
5695
+ function isLookView(plan){return !!plan&&(plan.viewKind==='elevation'||plan.viewKind==='section');}
5696
+ function elevationActive(){return !!(P&&P.elevationView);}
5697
+ /** Points the editor at an elevation/section's read-only projection. false → not such a view, caller falls back. */
5698
+ function installElevationViewState(plan){
5699
+ if(!isLookView(plan))return false;
5700
+ try{V2_PROJECTION=elevationProjectionForView(viewIdOf(plan));}
5701
+ catch(e){console.error('steel: could not draw '+viewIdOf(plan)+' as an elevation',e);return false;}
5702
+ NO_PLAN_VIEW=false;P=projectPlan();return true;}
5703
+ /* What the canvas says about an elevation, in the words a detailer uses. One sentence, used by the banner, the tool
5704
+ toast and the refused-edit toast, so the three can never disagree about what is and is not available here. */
5705
+ const ELEV_VIEW_ONLY='Elevations are view only. Open a plan or the 3D view to move, add or delete steel.';
5706
+ function elevationToolArmed(){return mode!=='sel'||dimMode||dimChain||dimSplitMode||csaxisMode||gridMode||gridPick||!!gridLinePick||dimStyleMode||!!cmTool||picking||!!geoMode||!!qdPick||calloutEditMode;}
5707
+ /** Puts every armed edit tool away and says why. Idempotent: with nothing armed it does nothing, which also ends the
5708
+ * render() it can trigger (each disarm below repaints, and a repaint with nothing armed does not come back here). */
5709
+ function elevationDisarmTools(){
5710
+ mode='sel';geoMode=null;setGeo();qdPick=null;setQdPickCls();picking=false;pickKind='profile';pickEnd=null;
5711
+ dimMode=false;dimChain=false;dimSplitMode=false;setDimMode();setMode();
5712
+ if(gridMode||gridPick||gridLinePick){if(gridLinePick&&gridLinePick.line)gridLinePick.line.remove();gridMode=false;gridPick=false;gridLinePick=null;gridSetPickClass();}
5713
+ dimStyleMode=false;csaxisMode=false;setCsMode();closeSnapMenu();disarmCm();
5714
+ calloutEditMode=false;document.body.classList.remove('calloutedit');closeCalloutForm();
5715
+ toast(ELEV_VIEW_ONLY);}
5716
+ /** An elevation's grid lines (vertical, with their bubbles) and levels (horizontal, labelled). Passive: nothing here is
5717
+ * hit-tested, dragged or renamed — the bubbles reuse the plan grid's group so a zoom resizes them and a crowd of them
5718
+ * declutters the same way, but carry none of its drag/rename attributes. */
5719
+ function elevationFrameSvg(){
5720
+ const v=P&&P.elevationView;if(!v||!v.ok||!(v.gridLines.length||v.levels.length))return '';
5721
+ const ys=[...v.levels.map(l=>l.py),...P.members.flatMap(m=>[m.wp[0][1],m.wp[1][1]])],xs=[...v.gridLines.map(l=>l.px),...P.members.flatMap(m=>[m.wp[0][0],m.wp[1][0]])];
5722
+ if(!ys.length||!xs.length)return '';
5723
+ const top=Math.min(...ys)-30,bottom=Math.max(...ys)+30,left=Math.min(...xs)-20,right=Math.max(...xs)+20;
5724
+ let s='<g id=elevFrameG>';
5725
+ for(const l of v.gridLines)s+=`<line class=gridln x1="${l.px}" y1="${top}" x2="${l.px}" y2="${bottom}"/>`;
5726
+ for(const l of v.levels)s+=`<line class="gridln elvlvl" style="stroke-dasharray:3 5" x1="${left}" y1="${l.py}" x2="${right}" y2="${l.py}"/><text class=elvlbl data-ax="${left}" data-ay="${l.py}" x="${left}" y="${l.py}" style="font-size:${11/zoom}px">${esc(l.label)}</text>`;
5727
+ for(const l of v.gridLines){const R=gridBubbleRPx()/zoom,F=gridLabelFontPx(l.label)/zoom,cy=top-R;
5728
+ s+=`<g class=gridbubg data-ax="${l.px}" data-ay="${top}" data-ux="0" data-uy="-1" data-label="${esc(l.label)}" data-tip="Grid ${esc(l.label)}"><circle class=gridbub cx="${l.px}" cy="${cy}" r="${R}"/><text class=gridtx x="${l.px}" y="${cy}" style="font-size:${F}px">${esc(l.label)}</text></g>`;}
5729
+ return s+'</g>';}
5730
+ /** Keeps the level text a constant size on screen as the canvas zooms (the grid bubbles do the same in sizeGridBubbles). */
5731
+ function sizeElevationLabels(){
5732
+ // Levels a few hundred mm apart (a floor and its bottom-of-base) sit a few px apart and their text would print on top of
5733
+ // itself. The lowest level wins (it is the datum), and any label that would land within one text height of a kept one is
5734
+ // hidden until a zoom gives it room; its line stays.
5735
+ const labels=[...svg.querySelectorAll('text.elvlbl')].sort((a,b)=>(+b.dataset.ay)-(+a.dataset.ay)),kept=[];
5736
+ for(const t of labels){t.style.fontSize=(11/zoom)+'px';t.setAttribute('x',(+t.dataset.ax)-6/zoom);
5737
+ const y=+t.dataset.ay,clash=kept.some(k=>Math.abs(k-y)*zoom<16);
5738
+ t.style.display=clash?'none':'';if(!clash)kept.push(y);}}
5739
+ /** A press on an elevation's canvas: select or deselect, nothing else. Returns true when it handled the press. */
5740
+ function elevationPointerDown(e){
5741
+ if(!(P&&P.elevationView))return false;
5742
+ const t=e.target,hit=t&&t.closest?t.closest('.member[data-id]'):null;
5743
+ e.preventDefault();
5744
+ if(hit){const id=hit.dataset.id;
5745
+ if(e.ctrlKey||e.metaKey||e.shiftKey)modelSelection.replaceMembers(selIds.has(id)?[...selIds].filter(x=>x!==id):[...selIds,id]);
5746
+ else if(!(selIds.size===1&&selIds.has(id)))modelSelection.replaceMembers([id]);
5747
+ render();}
5748
+ else if(selIds.size){modelSelection.clearMembers();render();}
5749
+ return true;}
5750
+ /** Inspect for an elevation: the member as the MODEL holds it (its own position in model coordinates, one axis per row,
5751
+ * in the project's units), read-only. The canvas rows are in this drawing's pixels, so nothing here reads them. */
5752
+ function renderElevationPanel(p){
5753
+ const v=P.elevationView,name=esc(viewLabel(P)||P.sheet||'this view');
5754
+ const kv=(k,val)=>'<div style="display:flex;justify-content:space-between;gap:8px;font-size:12px;margin:3px 0"><span style="color:var(--mut)">'+esc(k)+'</span><span style="font-variant-numeric:tabular-nums;text-align:right">'+val+'</span></div>';
5755
+ const note='<div class=hint style="margin-top:10px">Viewing only. To move or change this steel, open a plan or the 3D view.</div>';
5756
+ const drawn=new Set(P.members.map(m=>m.id)),ids=[...selIds].filter(id=>v2CanonicalMember(id));
5757
+ let h='';
5758
+ if(!ids.length){
5759
+ h='<span class=badge>Elevation · view only</span><h3 style="margin-top:10px">'+name+'</h3>'
5760
+ +(v.ok?'<div class=hint style="margin-top:8px">Select a member to Inspect it.</div>'
5761
+ +kv('Members shown',String(v.shown))+(v.unplaced.length?kv('Not drawn (height unknown)',String(v.unplaced.length)):'')
5762
+ :'<div class=hint style="margin-top:8px">'+esc(v.refusal.message)+' Ask your terminal AI to correct this view’s registration; nothing is drawn here until then.</div>')
5763
+ +note;
5764
+ }else if(ids.length>1){
5765
+ h='<span class=badge>Elevation · view only</span><h3 style="margin-top:10px">'+ids.length+' members selected</h3>'
5766
+ +ids.slice(0,12).map(id=>{const m=v2CanonicalMember(id);return kv(id,esc(m.profile||'size unresolved'));}).join('')
5767
+ +(ids.length>12?'<div class=hint>…and '+(ids.length-12)+' more.</div>':'')+note;
5768
+ }else{
5769
+ const id=ids[0],m=v2CanonicalMember(id),props=V2Projection.memberProperties(m);
5770
+ const pt=(label,pnt)=>{const z=pnt&&pnt.z&&Number.isFinite(pnt.z.known)?pnt.z.known:null;
5771
+ return '<div class=sect style="margin-top:12px">'+esc(label)+'</div>'+kv('X',pnt&&Number.isFinite(pnt.x)?esc(fmtDisp(pnt.x)):'—')+kv('Y',pnt&&Number.isFinite(pnt.y)?esc(fmtDisp(pnt.y)):'—')+kv('Z',z===null?'<span class=pill style="background:var(--warn-bg);color:var(--warn)">height unknown</span>':esc(fmtDisp(z)));};
5772
+ const a=m.from,b=m.to,len=(a&&b&&[a.x,a.y,a.z&&a.z.known,b.x,b.y,b.z&&b.z.known].every(Number.isFinite))?Math.hypot(b.x-a.x,b.y-a.y,b.z.known-a.z.known):null;
5773
+ const col=m.role==='column';
5774
+ const others=V2Projection.memberViewIds(C,id).map(vid=>viewLabel((C.plans||[]).find(r=>viewIdOf(r)===vid))||vid);
5775
+ h='<span class=badge>Elevation · view only</span><h3 style="margin-top:10px">Member '+esc(id)+'</h3>'
5776
+ +'<div class=sect style="margin-top:8px">Identity</div>'
5777
+ +kv('Profile',esc(props.profile||'Size unresolved'))+kv('Material',esc(m.material||'Profile default'))+kv('Type',esc(memberTypeLabel(memberTypeOf(props))))
5778
+ +kv('Length',len===null?'—':esc(fmtDisp(len)))
5779
+ +pt(col?'Bottom — model coordinates':'Start — model coordinates',a)+pt(col?'Top — model coordinates':'End — model coordinates',b)
5780
+ +(others.length?'<div class=sect style="margin-top:12px">Drawn on</div><div class=hint>'+esc(others.join(' · '))+'</div>':'')
5781
+ +(drawn.has(id)?'':'<div class=hint style="margin-top:8px">This member is not part of this elevation.</div>')+note;
5782
+ }
5783
+ p.innerHTML=h;}
5669
5784
  /* This row's identity — `id`, or the sheet name for a page carrying one view (#938). One accessor, so
5670
5785
  nothing in this file has to decide whether `.sheet` means the page or the view. */
5671
5786
  const viewIdOf=pl=>V2Projection?V2Projection.planViewId(pl):((pl&&pl.id)||(pl&&pl.sheet)||'');
@@ -5685,7 +5800,9 @@ function viewLabel(pl){
5685
5800
  this whole change exists to end. Walk the sheets and take the first projection that actually has the
5686
5801
  row. Stops at the first hit, so the ordinary one-sheet case still builds exactly one projection. */
5687
5802
  function v2ProjectedMember(id){
5688
- const here=(P&&P.members||[]).find(m=>m&&m.id===id);if(here)return here;
5803
+ // An elevation's rows are in ITS drawing's pixels, which no plan-space consumer can use: skip them, so a member
5804
+ // shown there resolves through the plan that holds it, or to nothing (#2780).
5805
+ const here=P&&P.elevationView?null:(P&&P.members||[]).find(m=>m&&m.id===id);if(here)return here;
5689
5806
  for(const viewId of V2Projection.memberPlanViewIds(C,id)){
5690
5807
  const row=v2ProjectionForView(viewId).plan.members.find(m=>m&&m.id===id);
5691
5808
  if(row)return row;
@@ -5796,8 +5913,8 @@ function sourceViewList(rows){
5796
5913
  return named.length<=1?named.join(''):named.slice(0,-1).join(', ')+' and '+named[named.length-1];}
5797
5914
  function sourceOnlyLead(count,rows){
5798
5915
  return (count===1?'This member was':'These '+count+' members were')+' read from '+sourceViewList(rows)+'. '
5799
- +'Only plan views are drawn in 2D for now, so '+(count===1?'it appears':'they appear')
5800
- +' in the 3D view only, placed from that drawing.'
5916
+ +'No plan view shows '+(count===1?'it, so it appears':'them, so they appear')
5917
+ +' in 3D, placed from that drawing, and in 2D only in '+(rows.length===1?'that view':'those views')+', for looking.'
5801
5918
  +(rows.some(sourceViewUnaligned)?' Check '+(count===1?'its position':'their positions')+' in 3D before relying on '+(count===1?'it':'them')+'.':'');}
5802
5919
  /* The same fact for a refused ACTION (a 3D drag, an RFI locate/resolve): what could not happen, which
5803
5920
  members, why, and — from the caller, because it differs — the way forward. Null when none of `ids` is
@@ -5808,7 +5925,7 @@ function sourceOnlyBlockedText(ids,what,next){
5808
5925
  const only=sourceOnlyIds(ids);if(!only.length)return null;
5809
5926
  const one=only.length===1,rows=[...sourceOnlyViewsFor(only).values()];
5810
5927
  return 'FloLess can’t '+what+' here: '+(one?only[0]+' was':only.join(', ')+' were')+' read from '+sourceViewList(rows)
5811
- +', and only plan views are drawn in 2D for now. '+next(one);}
5928
+ +', and no plan view draws '+(one?'it':'them')+'. '+next(one);}
5812
5929
  /* A 3D drag on such a member has no plan row to write through (`byId` answers nothing), so it used to be
5813
5930
  accepted and silently do nothing. Say why instead, open no empty undo step, and REBUILD the scene the
5814
5931
  way `edit()` would have: the 3D view moves its own mesh during the drag preview and does not put it
@@ -6790,6 +6907,7 @@ function apply(json,noSave){
6790
6907
  // transform refuses anything that is not a plan: the same placeholder `setPlan` installs for it, then.
6791
6908
  const activeView=C.plans&&C.plans[C.active];
6792
6909
  if(activeView&&activeView.viewKind==='plan'){V2_PROJECTION=v2ProjectionForView(viewIdOf(activeView));P=projectPlan();}
6910
+ else if(installElevationViewState(activeView)){} // #2780: …and across an undo/redo
6793
6911
  else{V2_PROJECTION=null;NO_PLAN_VIEW=true;P=activeView?{...structuredClone(activeView),members:[],segments:[],dims:[],details:[],callouts:[],tos_callouts:[],grid:null,default_tos_mm:Number.isFinite(activeView.elevation_mm)?activeView.elevation_mm:0}:{sheet:'',members:[],segments:[],dims:[],details:[],callouts:[],tos_callouts:[],grid:null,default_tos_mm:0};}
6794
6912
  syncElevationContext();
6795
6913
  updCS();
@@ -8972,7 +9090,7 @@ function sheetDerivedIds(ids,presence){
8972
9090
  const byMemberId=presence?presence.members:new Map();if(!presence)for(const x of C.members||[])if(x&&!byMemberId.has(x.id))byMemberId.set(x.id,x);
8973
9091
  return [...new Set(ids)].filter(id=>{
8974
9092
  const m=byMemberId.get(id);if(!m||m.role!=='column')return false;
8975
- const pr=V2Projection.memberPresence(C,plan,m,presence);return (pr.crossing||pr.below)&&!pr.observed&&!pr.explicit;});
9093
+ const pr=V2Projection.memberPresence(C,plan,m,presence);return (pr.crossing||pr.below||pr.nearAbove)&&!pr.observed&&!pr.explicit;});
8976
9094
  }
8977
9095
  /** True (and said) when a Delete asks only about columns this sheet derives: there is nothing to delete, so NO edit is
8978
9096
  opened at all (no empty undo step, no "unsaved" mark) and the selection stays, which keeps the explaining notice up. */
@@ -9717,7 +9835,8 @@ function applyZoom(z,ax,ay){z=Math.max(ZMIN,Math.min(ZMAX,z));
9717
9835
  updateBadges();refreshProfileLabelOverlay();}
9718
9836
  function fitToWindow(){applyZoom(Math.min(stage.clientWidth/EXTX,stage.clientHeight/EXTY)*0.98);}
9719
9837
  // --- duplicate the selected member(s) in place (Ctrl+D) ---
9720
- 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();
9838
+ function doDup(){const arr=sel2d();if(!arr.length)return;if(P.elevationView&&!view3d){toast(ELEV_VIEW_ONLY);return;} // #2780: an elevation's rows are the drawing's own pixels
9839
+ return runSteelAuthoring('copy',{source:'duplicate',selection:arr.map(m=>m.id)},()=>{const o=12,pv=snapshot(),ns=new Set();
9721
9840
  const mc=MC();let i=0;const mk=()=>'m'+Date.now()+'_'+(i++); // doDup's OWN id policy — NOT cmSeq's '_c' form; both land in the stored contract
9722
9841
  for(const s of arr){const id=mk();const c=mc.clone(s,()=>id); // mint BEFORE the deep copy: doDup always did, cloneMember always did the reverse, and one shared primitive can only pick one order. The characterization clock is constant within an operation, so the baseline cannot see this — hence pre-minting here rather than relying on it (Codex code review)
9723
9842
  mc.replaceEndpoints(c,[[s.wp[0][0]+o,s.wp[0][1]+o],[s.wp[1][0]+o,s.wp[1][1]+o]]); // replaces the wp array wholesale, as `c.wp=[[…],[…]]` did
@@ -10072,6 +10191,7 @@ function render(){
10072
10191
  const profileFocusToken=profilePickerFocusToken();
10073
10192
  // Arming ANY other tool ends the + Callout tool. Every tool arm ends in a render(), so this one line covers them
10074
10193
  // all, instead of a disarm call at every arm site (and the next tool added needs no edit here).
10194
+ if(P&&P.elevationView&&!view3d&&elevationToolArmed())elevationDisarmTools(); // #2780: an elevation is for looking, so an edit tool armed there is put away, and says so
10075
10195
  if(calloutEditMode&&(mode!=='sel'||dimMode||dimChain||dimSplitMode||csaxisMode||gridMode||gridPick||gridLinePick||dimStyleMode||cmTool||picking||geoMode||qdPick||view3d||NO_PLAN_VIEW)){
10076
10196
  calloutEditMode=false;document.body.classList.remove('calloutedit');closeCalloutForm();}
10077
10197
  syncCalloutButton();
@@ -10097,6 +10217,7 @@ function render(){
10097
10217
  if(geoMode&&(selIds.size<1||(geoMode==='split'&&selIds.size!==1))){geoMode=null;setGeo();} // Split needs exactly one member; Extend/Trim works on any selection. setGeo() clears BOTH geo + geoel (not a bare remove('geo')) so the grid affordance can't outlive the tool
10098
10218
  let s=overlaySvg(); // reviewed source image (inert) beneath crisp Filter vectors (the only snap authority)
10099
10219
  s+=gridSvg(); // structural grid under the linework (members/dims stay on top)
10220
+ s+=elevationFrameSvg(); // an elevation's own grid lines and levels (#2780); empty on a plan
10100
10221
  s+=provisionalMembersSvg();
10101
10222
  for(const sg of P.segments) s+=`<line class=seg data-seg="${sg.id}" x1="${sg.a[0]}" y1="${sg.a[1]}" x2="${sg.b[0]}" y2="${sg.b[1]}"/>`;
10102
10223
  for(const m of P.members){if(!visible2d(m))continue; // hidden or isolated away in this sheet's Objects list
@@ -10108,8 +10229,8 @@ function render(){
10108
10229
  // on a canvas whose own counter said there were none, with no row anywhere to clear it. One source
10109
10230
  // of truth for "is this an RFI", and it is the same one everything else already uses. (code review)
10110
10231
  const rfi=_wtPlf(m.profile)==null;
10111
- if(isBrace(m)){s+=braceSymbol(m,c,g);continue;} // a brace draws as its distinct symbol (dashed=below-floor + hi/lo arrows), not a plain line (B4)
10112
- if(m.role==='column'){const pts=columnSectionPoly(m); // a column draws as its profile-section footprint, not a line
10232
+ if(!P.elevationView&&isBrace(m)){s+=braceSymbol(m,c,g);continue;} // (an elevation draws every member as its true line: the plan symbols are plan conventions, #2780) a brace draws as its distinct symbol (dashed=below-floor + hi/lo arrows), not a plain line (B4)
10233
+ if(!P.elevationView&&m.role==='column'){const pts=columnSectionPoly(m); // a column draws as its profile-section footprint, not a line
10113
10234
  // A placeholder footprint on a member that is NOT an RFI reads as a real, small section — the size is
10114
10235
  // the one thing on this canvas it cannot be trusted for, so it says so rather than looking resolved.
10115
10236
  const _phText=(pts&&pts.placeholder&&!rfi)?`Footprint shown as a placeholder — the ${_catalogLabel()} table gives no footprint for this shape. Its weight and length are still exact.`:'';
@@ -10125,7 +10246,7 @@ function render(){
10125
10246
  // A column below the floor whose footprint cannot be built falls to this line, and must still say what it is (#2214).
10126
10247
  const _lcb=(m.role==='column'&&m.belowCut)?colBelowInfo(m):null,_lt=_lcb?` data-tip="${esc(_lcb.tip)}"`:'';
10127
10248
  s+=`<line class="member${rfi?' rfi':''}${_lcb?' colbelow':''}${sel?' sel':''}${fh?' find-hit':''}" data-id="${m.id}"${_lt} x1="${m.wp[0][0]}" y1="${m.wp[0][1]}" x2="${m.wp[1][0]}" y2="${m.wp[1][1]}" stroke="${c}"${_sty}/>`;}
10128
- {const hsel=sel2d().filter(visible2d);if(hsel.length>=1){const HR=epR();for(const sm of hsel)for(let i=0;i<2;i++) s+=`<circle class="handle ${i===0?'ep-start':'ep-end'}" data-mid="${sm.id}" data-h="${i}" cx="${sm.wp[i][0]}" cy="${sm.wp[i][1]}" r="${HR}"/>`;}} // end 1 (start) yellow, end 2 (end) magenta · shown for every selected member · radius grows with zoom (epR) so it stays visible against the thick line
10249
+ {const hsel=sel2d().filter(visible2d);if(hsel.length>=1&&!P.elevationView){const HR=epR();for(const sm of hsel)for(let i=0;i<2;i++) s+=`<circle class="handle ${i===0?'ep-start':'ep-end'}" data-mid="${sm.id}" data-h="${i}" cx="${sm.wp[i][0]}" cy="${sm.wp[i][1]}" r="${HR}"/>`;}} // end 1 (start) yellow, end 2 (end) magenta · shown for every selected member · radius grows with zoom (epR) so it stays visible against the thick line
10129
10250
  if(mode==='add'||(picking&&pickKind==='profile')){
10130
10251
  const armed=picking&&pickKind==='profile';profileLabelState=profileLabelQuery(armed);
10131
10252
  s+=`<g id=profileLabelOverlay>${profileLabelMarkup(profileLabelState.labels)}</g>`;
@@ -10165,7 +10286,7 @@ function render(){
10165
10286
  // `profs` and `detTexts()` live — so the combobox offers the same list with no mirror to keep filled.
10166
10287
  // Deleting the elements while these two writes stayed made render() throw on null here, which also
10167
10288
  // killed every call after it on this line (stats/panel/upd*/syncDisplayRows). Measured in Chromium.
10168
- svg.innerHTML=s; stats(); panel(); updUR(); updDup(); updRegistration(); updateMemberEndStatus(); updConf(); updCS(); updConnBtn(); updBpBtn(); updSpBtn(); syncReachRow(); syncDisplayRows(); syncUnitsRow();syncEnvChip();restoreProfilePickerFocus(profileFocusToken);if(typeof askAiRefreshSelection==='function')askAiRefreshSelection();
10289
+ svg.innerHTML=s; if(P.elevationView)sizeElevationLabels(); layoutPropLabels2d(); stats(); panel(); updUR(); updDup(); updRegistration(); updateMemberEndStatus(); updConf(); updCS(); updConnBtn(); updBpBtn(); updSpBtn(); syncReachRow(); syncDisplayRows(); syncUnitsRow();syncEnvChip();restoreProfilePickerFocus(profileFocusToken);if(typeof askAiRefreshSelection==='function')askAiRefreshSelection();
10169
10290
  if(selFilterReady)reflectSelFilter(); // keep the Select-bar Members/Connections buttons in sync with the model — a new/removed connection kind (e.g. the first auto-detailed base plate) flips their on/off without a manual toggle. Gated on selFilterReady so it doesn't run until the deferred first reflect has armed it (that reflect needs BASE_MEMBER_TYPES, initialised later in main()).
10170
10291
  if(view3dShown&&window.Steel3DView){updateIsolateBtn();if((selIds.size||selGridIds.size)&&modelEditor.steel.selectedClips&&modelEditor.steel.selectedClips().length)modelEditor.steel.setSelectedClips([]);} // canonical commits keep member + grid highlight in sync; selecting geometry still clears clip-tool selection (exclusive)
10171
10292
  syncLegendToPane(); // the Objects list: the selection, and in 2D the sheet it lists
@@ -10242,6 +10363,15 @@ function paintRegBanner(){
10242
10363
  if(detBtn)detBtn.hidden=true;if(copyBtn)copyBtn.hidden=true;if(reviewBtn){reviewBtn.hidden=false;reviewBtn.textContent=n===1?'Review question':'Review questions';}if(sourceBtn)sourceBtn.hidden=n!==1;
10243
10364
  bar.classList.toggle('plain',counts.every(row=>row.reason==='view-unregistered-unstarted'));bar.classList.add('on');placeRegBanner(bar);return;
10244
10365
  }
10366
+ if(P&&P.elevationView){ // #2780: an elevation is for looking; the banner says so, and what (if anything) could not be drawn
10367
+ const ev=P.elevationView;
10368
+ document.getElementById('regLead').textContent=ev.ok
10369
+ ?(sheetName||'This view')+' is '+(ev.kind==='section'?'a section':'an elevation')+', view only. '+ev.shown+' member'+(ev.shown===1?'':'s')+' shown at their true positions.'
10370
+ :(sheetName||'This view')+' can’t be drawn yet: '+ev.refusal.message;
10371
+ document.getElementById('regDetail').textContent=ev.ok?'':ev.refusal.message;
10372
+ if(cta)cta.textContent=ev.ok?'Select one to Inspect it. To move, add or delete steel, open a plan or the 3D view.':'Ask your terminal AI to correct this view’s registration.';
10373
+ if(detBtn)detBtn.hidden=true;if(copyBtn)copyBtn.hidden=true;if(reviewBtn)reviewBtn.hidden=true;if(sourceBtn)sourceBtn.hidden=true;
10374
+ bar.classList.toggle('plain',ev.ok);bar.classList.add('on');placeRegBanner(bar);return;}
10245
10375
  if(cta)cta.textContent="This can't be fixed here — ask your terminal AI to correct the sheet's registration.";
10246
10376
  if(detBtn)detBtn.hidden=false;if(copyBtn)copyBtn.hidden=false;if(reviewBtn)reviewBtn.hidden=true;if(sourceBtn)sourceBtn.hidden=true;
10247
10377
  if(!refusal){bar.classList.remove('on');bar.classList.remove('plain');return;}
@@ -10340,11 +10470,23 @@ function cutLeadText(name,total,shown){
10340
10470
  if(shown===0)return head+(total===1?'The model has 1 column and this sheet does not show it.':'The model has '+total+' columns; this sheet shows none of them.');
10341
10471
  return head+'The model has '+total+' columns; this sheet shows '+shown+' of them.';
10342
10472
  }
10473
+ /** #2815 — when a level reaches nothing, WHICH columns come closest and by how much, so the person can judge whether the
10474
+ * level or the column heights are the thing to fix (the read can put a base a few mm off its floor). A sentence to append
10475
+ * to the lead, or '' when no column has a known height. Names the gap and the side; moves nothing and decides nothing:
10476
+ * "Show all columns here" is the way to draw them anyway. */
10477
+ function nearestColumnsText(st){
10478
+ const cut=st.plan.elevation_mm,rows=[];
10479
+ for(const m of st.cols){const g=SteelCore.columnCutGap(m.from&&m.from.z,m.to&&m.to.z,cut);if(g)rows.push({name:m.mark||m.id,g});}
10480
+ if(!rows.length)return '';
10481
+ rows.sort((a,b)=>a.g.mm-b.g.mm);
10482
+ const top=rows.slice(0,3).map(r=>r.name+', '+(r.g.side==='above'?'base ':'top ')+underFloorText(r.g.mm)+(r.g.side==='above'?' above the level':' below the level'));
10483
+ return ' Closest: '+top.join('; ')+(rows.length>3?' (and '+(rows.length-3)+' more).':'.');
10484
+ }
10343
10485
  function cutNoticeText(st,name){
10344
10486
  if(st.kind==='no-level')return {lead:cutLeadText(name,st.cols.length,st.shown),cta:'A level draws the columns that reach it. Show all places every column here by hand.',enter:'Enter a level…',pill:name+' has no floor level'};
10345
10487
  if(st.kind==='quiet')return {lead:name+' has no floor level. '+(st.cols.length===1?'Its column is':'Its '+st.cols.length+' columns are')+' drawn because '+(st.cols.length===1?'it was':'they were')+' placed on it by hand.',cta:'A level also draws the columns that reach it.',enter:'Enter a level…',pill:name+' has no floor level'};
10346
10488
  const level=fmtDispElev(st.plan.elevation_mm);
10347
- return {lead:name+' is at '+level+' and no column reaches it. The model has '+st.cols.length+' column'+(st.cols.length===1?'':'s')+'.',cta:'Check the level, or place the columns by hand. Show all places every column here by hand.',enter:'Change level…',pill:'No column reaches '+name+'’s level'};
10489
+ return {lead:name+' is at '+level+' and no column reaches it. The model has '+st.cols.length+' column'+(st.cols.length===1?'':'s')+'.'+nearestColumnsText(st),cta:'Check the level, or place the columns by hand. Show all places every column here by hand.',enter:'Change level…',pill:'No column reaches '+name+'’s level'};
10348
10490
  }
10349
10491
  function paintCutBanner(){
10350
10492
  const bar=document.getElementById('cutBanner'),pill=document.getElementById('cutPill');if(!bar||!pill)return;
@@ -10475,20 +10617,35 @@ function updateBadges(){const R=12/zoom,F=13/zoom,ox=el=>(+el.dataset.fi-(+el.da
10475
10617
  // (brace arrowheads need no rescale here — they are content-unit sized, so they scale with the member
10476
10618
  // stroke exactly like the line they cap. See braceHeadPoints().)
10477
10619
  {const dg=svg.querySelector('g.dimsg');if(dg)dg.innerHTML=renderDimsInner();} // dims shrink below DIM_ZMIN (see dimSvg) so dense dims don't overlap when zoomed out (B8) — every part of a dim is zoom-derived, so rebuild the group rather than patch it
10620
+ sizeElevationLabels(); // an elevation's level text (#2780)
10478
10621
  sizeGridBubbles(); // radius, font AND centre — the bubble hangs off its line end by its own radius, so a zoom that changes the radius moves it too
10479
10622
  // property-label chips: recompute size + stacked screen offset from the baked anchor (ax,ay) + per-row screen
10480
10623
  // offset (off) so they stay constant on screen while zooming (like dim chips) — AND re-apply the zoom
10481
10624
  // threshold live (data-mlen × zoom), so zooming reveals/hides labels as members cross ~24px on screen.
10482
- {const plG=svg.querySelector('g.pllabels');if(plG){let hid=0;
10483
- plG.querySelectorAll('rect.plchip').forEach(r=>{const w=(+r.dataset.tw*6.4+12)/zoom,h=15/zoom,cy=(+r.dataset.ay)+(+r.dataset.off)/zoom;
10484
- const show=plabelVisible(+r.dataset.mlen);r.style.display=show?'':'none';if(!show)hid++;
10485
- r.setAttribute('width',w);r.setAttribute('height',h);r.setAttribute('x',(+r.dataset.ax)-w/2);r.setAttribute('y',cy-h/2);});
10486
- plG.querySelectorAll('text.pltx').forEach(t=>{const show=plabelVisible(+t.dataset.mlen);t.style.display=show?'':'none';t.setAttribute('y',(+t.dataset.ay)+(+t.dataset.off)/zoom);t.style.fontSize=(11/zoom)+'px';});
10487
- propLabelsHidden=hid;updatePropHint();}} // hid counts hidden chip ROWS (>0 ⇒ note shows) — the note only needs the boolean
10625
+ layoutPropLabels2d();
10488
10626
  {const mlG=svg.querySelector('g.mlenlabels');if(mlG){ // on-select length chips: same zoom-rescale + threshold as the property chips
10489
10627
  mlG.querySelectorAll('rect.mlenchip').forEach(r=>{const w=(+r.dataset.tw*6.4+12)/zoom,h=15/zoom,cx=(+r.dataset.mx)+(+r.dataset.nx)*(+r.dataset.base)/zoom,cy=(+r.dataset.my)+(+r.dataset.ny)*(+r.dataset.base)/zoom,show=plabelVisible(+r.dataset.mlen);r.style.display=show?'':'none';r.setAttribute('width',w);r.setAttribute('height',h);r.setAttribute('x',cx-w/2);r.setAttribute('y',cy-h/2);});
10490
10628
  mlG.querySelectorAll('text.mlentx').forEach(t=>{const show=plabelVisible(+t.dataset.mlen);t.style.display=show?'':'none';t.setAttribute('x',(+t.dataset.mx)+(+t.dataset.nx)*(+t.dataset.base)/zoom);t.setAttribute('y',(+t.dataset.my)+(+t.dataset.ny)*(+t.dataset.base)/zoom);t.style.fontSize=(11/zoom)+'px';});}}
10491
10629
  const cg=svg.querySelector('g.csglyph');if(cg&&P.frame)cg.outerHTML=axisGlyphSvg(P.frame.o,P.frame.u,false);} // glyph is sized in 1/zoom → regenerate on zoom (like the dim chips)
10630
+ /* The property-label chips, laid out for the current zoom: each chip's size follows the zoom, a member shorter than ~24px on
10631
+ screen drops its label (plabelVisible), and (#2780) a label that would print on top of a kept one is hidden too, so a
10632
+ dense frame shows the readable few instead of a pile. A member's rows move as one block; a selected member wins, then the
10633
+ longer member. Zooming in gives the rest room and brings them back. */
10634
+ function layoutPropLabels2d(){
10635
+ const plG=svg.querySelector('g.pllabels');if(!plG)return;
10636
+ const groups=new Map();
10637
+ plG.querySelectorAll('rect.plchip').forEach(r=>{const w=(+r.dataset.tw*6.4+12)/zoom,h=15/zoom,cy=(+r.dataset.ay)+(+r.dataset.off)/zoom,cx=+r.dataset.ax;
10638
+ r.setAttribute('width',w);r.setAttribute('height',h);r.setAttribute('x',cx-w/2);r.setAttribute('y',cy-h/2);
10639
+ const id=r.dataset.mid||'',g=groups.get(id)||{rows:0,mlen:+r.dataset.mlen,x0:Infinity,x1:-Infinity,y0:Infinity,y1:-Infinity};
10640
+ g.rows++;g.x0=Math.min(g.x0,cx-w/2);g.x1=Math.max(g.x1,cx+w/2);g.y0=Math.min(g.y0,cy-h/2);g.y1=Math.max(g.y1,cy+h/2);groups.set(id,g);});
10641
+ const items=[];
10642
+ for(const [id,g] of groups)if(plabelVisible(g.mlen))items.push({key:id,x:(g.x0+g.x1)/2,y:(g.y0+g.y1)/2,w:g.x1-g.x0,h:g.y1-g.y0,priority:selIds.has(id)?1e12:g.mlen});
10643
+ const crowded=SteelCore&&SteelCore.declutterLabelRects?SteelCore.declutterLabelRects(items,2/zoom):new Set();
10644
+ let hid=0;
10645
+ const shown=id=>{const g=groups.get(id);return !!g&&plabelVisible(g.mlen)&&!crowded.has(id);};
10646
+ plG.querySelectorAll('rect.plchip').forEach(r=>{const show=shown(r.dataset.mid||'');r.style.display=show?'':'none';if(!show)hid++;});
10647
+ plG.querySelectorAll('text.pltx').forEach(t=>{t.style.display=shown(t.dataset.mid||'')?'':'none';t.setAttribute('y',(+t.dataset.ay)+(+t.dataset.off)/zoom);t.style.fontSize=(11/zoom)+'px';});
10648
+ propLabelsHidden=hid;updatePropHint();} // hid counts hidden chip ROWS (>0 means the note shows); the note only needs the boolean
10492
10649
  function updateHandles(m){svg.querySelectorAll(`circle.handle[data-mid="${m.id}"]`).forEach(h=>{const i=+h.dataset.h;h.setAttribute('cx',m.wp[i][0]);h.setAttribute('cy',m.wp[i][1]);});}
10493
10650
  function updateLine(m){
10494
10651
  if(isBrace(m)){const g=svg.querySelector(`g.bracesym[data-id="${m.id}"]`); // a brace is a symbol group — re-serialize the whole glyph so it follows the drag live (moves off true WPs, redraws offset)
@@ -10511,10 +10668,10 @@ function showStat(id){const el=document.getElementById(id);if(el)el.style.displa
10511
10668
  function structureScope(is3d,noPlanView){return is3d?'model':noPlanView?'none':'sheet';}
10512
10669
  function structureMembers(scope,planMembers,modelMembers){return scope==='model'?modelMembers:planMembers;}
10513
10670
  /** Plain-English note + tooltip for the Structure panel, stating which scope the numbers are. */
10514
- function structureCopy(scope,sheetName){
10671
+ function structureCopy(scope,sheetName,what){what=what||'plan sheet';
10515
10672
  if(scope==='model')return {note:'All members in the model, across every plan sheet.',tip:'How much steel is in the whole model — members and weight'};
10516
10673
  const nm=sheetName?' ('+sheetName+')':'';
10517
- return {note:'Members on this plan sheet'+nm+'. The 3D view counts the whole model.',tip:'How much steel is on this plan sheet'+nm+' — members and weight'};}
10674
+ return {note:'Members on this '+what+nm+'. The 3D view counts the whole model.',tip:'How much steel is on this '+what+nm+' — members and weight'};}
10518
10675
  /** Repaint the Structure readouts when the VIEW changes (2D / 3D / Split, active pane) — those do not render(),
10519
10676
  * and stats() is otherwise only reached from render(). Quiet before the model has loaded. */
10520
10677
  function refreshStructureStats(){if(C&&P)stats();}
@@ -10536,7 +10693,7 @@ function stats(){
10536
10693
  // repeat the reason.
10537
10694
  //
10538
10695
  // A model with no plan view cannot report plan-derived counts honestly. A projected plan can.
10539
- const scope=structureScope(view3d,NO_PLAN_VIEW); // 3D counts the whole model, so a 3D-only model (no plan view) still reads
10696
+ const scope=structureScope(view3d,NO_PLAN_VIEW||(P&&P.elevationView&&!P.elevationView.ok)); // 3D counts the whole model, so a 3D-only model (no plan view) still reads
10540
10697
  if(scope==='none'){for(const id of PLAN_STATS)hideStat(id);return;}
10541
10698
  // REVERSIBLE, and this line is the whole of it: hideStat writes an INLINE display:none that nothing else
10542
10699
  // clears, so without this the first no-plan-view sheet would hide these four permanently — including
@@ -10545,7 +10702,7 @@ function stats(){
10545
10702
  for(const id of PLAN_STATS)showStat(id);
10546
10703
  const counted=structureMembers(scope,P.members,allMembers());
10547
10704
  document.getElementById('mc').textContent=counted.length;
10548
- {const cp=structureCopy(scope,viewLabel(C.plans[C.active])||P.sheet||''),note=document.getElementById('structNote'),btn=document.getElementById('structBtn');
10705
+ {const cp=structureCopy(scope,viewLabel(C.plans[C.active])||P.sheet||'',P.elevationView?'elevation view':''),note=document.getElementById('structNote'),btn=document.getElementById('structBtn');
10549
10706
  if(note&&note.textContent!==cp.note)note.textContent=cp.note;if(btn)btn.setAttribute('data-tip',cp.tip);}
10550
10707
  // In the project's own units: feet x lb/ft -> lb -> short tons, or metres x kg/m -> kg -> tonnes.
10551
10708
  // A member with no billable weight is simply skipped here; it is counted by `paintRfiStat` above,
@@ -10700,17 +10857,23 @@ function notOnViewHtml(missing,total,presence){
10700
10857
  function wireAddToSheet(root,missing){const b=root.querySelector('[data-add-to-sheet]');if(b){b.onclick=()=>{addToThisSheet(missing);};keyActivates(b);}}
10701
10858
  /** Resolve selected projected rows once for this refresh; lazy projections build their own fresh presence data. */
10702
10859
  function selectionNoticeMembers(ids,presence){
10860
+ const lookup=projectedMemberLookup(presence),out=[];
10861
+ for(const id of ids){const member=lookup(id);if(member)out.push(member);}
10862
+ return out;}
10863
+ /** One bulk operation owns these maps. Rebuild them on the next operation, even when the model object is unchanged. */
10864
+ function projectedMemberLookup(presence=V2Projection.createMemberPresenceIndex(C)){
10703
10865
  const rows=new Map();
10704
10866
  const mapRows=plan=>{const map=new Map();for(const row of plan.members||[])if(row&&!map.has(row.id))map.set(row.id,row);return map;};
10705
- const here=mapRows(P||{}),out=[];
10706
- for(const id of ids){let member=here.get(id);
10707
- if(!member)for(const viewId of V2Projection.memberPlanViewIds(C,id,presence)){
10867
+ // Elevation rows use that drawing's pixels; bulk plan-space consumers follow the same rule as v2ProjectedMember.
10868
+ const here=P&&P.elevationView?new Map():mapRows(P||{});
10869
+ return id=>{const active=here.get(id);if(active)return active;
10870
+ for(const viewId of V2Projection.memberPlanViewIds(C,id,presence)){
10708
10871
  if(!rows.has(viewId))rows.set(viewId,mapRows(v2ProjectionForView(viewId).plan));
10709
- member=rows.get(viewId).get(id);if(member)break;
10872
+ const member=rows.get(viewId).get(id);if(member)return member;
10710
10873
  }
10711
- if(member)out.push(member);
10712
- }
10713
- return out;}
10874
+ return undefined;
10875
+ };}
10876
+
10714
10877
  function syncV2SelectionNotice(p){
10715
10878
  if(!p||!selIds.size||viewPropsId)return; // a view in the panel keeps the selection, not its notices
10716
10879
  p.querySelectorAll('.v2-selection-notice,.v2-elevation-warning,.v2-elevation-proposal,.v2-elevation-answered').forEach(el=>el.remove());
@@ -10812,7 +10975,7 @@ function syncV2SelectionNotice(p){
10812
10975
  // sentence above would be false for it: say which view it came from and that the edits below skip it.
10813
10976
  const onlyLost=sourceOnlyIds(lost,presence),sourceReason=onlyLost.length
10814
10977
  ?' '+(onlyLost.length===1?onlyLost[0]+' was':onlyLost.join(', ')+' were')+' read from '+sourceViewList([...sourceOnlyViewsFor(onlyLost,presence).values()])
10815
- +'; only plan views are drawn in 2D for now, so the edits below don’t change '+(onlyLost.length===1?'it':'them')+'.':'';
10978
+ +'; no plan view draws '+(onlyLost.length===1?'it':'them')+', so the edits below don’t change '+(onlyLost.length===1?'it':'them')+'.':'';
10816
10979
  msg.textContent=lost.length+' more selected member'+(lost.length===1?' is':'s are')+' not shown below ('+lost.join(', ')+') — '+(lost.length===1?'it':'they')+' cannot be drawn on this sheet.'+reason+sourceReason;
10817
10980
  row.appendChild(msg);if(after)after.after(row);else p.prepend(row);after=row;}}
10818
10981
  const selectedIds=new Set(ids),selected=[...presence.members.values()].filter(m=>selectedIds.has(m.id));
@@ -10839,6 +11002,11 @@ function syncV2SelectionNotice(p){
10839
11002
  * The first sentence is the model's own fact (`assumed`); the proposal and its wording are the server's,
10840
11003
  * from the last questions read — nothing here decides which height is right.
10841
11004
  */
11005
+ /* #2788: where a confirmed proposal came from, so a derived height never reads as one taken off a drawing. */
11006
+ function answeredProposalSaid(a){const p=a&&a.how==='confirmed'&&a.proposal&&typeof a.proposal==='object'?a.proposal:null;if(!p)return'';
11007
+ if(p.how==='derived')return', which the read derived from '+String(p.basis||'');
11008
+ if(p.how==='measured')return', which the read measured on the drawings'+(p.basis?' ('+String(p.basis)+')':'');
11009
+ return', read off the drawings'+(p.basis?' ('+String(p.basis)+')':'');}
10842
11010
  function inspectorHeightNotes(m,canonical){
10843
11011
  const ids=m.role==='column'?['bos','tosC']:['tosA','tosB'];
10844
11012
  [0,1].forEach(end=>{
@@ -10859,7 +11027,7 @@ function inspectorHeightNotes(m,canonical){
10859
11027
  const said=a.how==='typed'?'You typed '+(a.typed||fmtDispElev(z.known)):'You confirmed '+(a.shownAs||fmtDispElev(z.known));
10860
11028
  const text=document.createElement('span');
10861
11029
  const fromPicture=a.basis==='read-of-your-picture'?' (the read’s reading of your picture)':a.basis==='read-of-your-note'?' (the read’s reading of your note)':'';
10862
- text.textContent=' '+said+fromPicture+' for “'+String(a.label||'this end')+'” when the drawing read asked'+when+'. FloLess uses your answer as this height.';
11030
+ text.textContent=' '+said+answeredProposalSaid(a)+fromPicture+' for “'+String(a.label||'this end')+'” when the drawing read asked'+when+'. FloLess uses your answer as this height.';
10863
11031
  box.append(chip,text);
10864
11032
  // #1906: the person's source note and pictures travel with the answer, so the model says why.
10865
11033
  if(typeof a.note==='string'&&a.note){const note=document.createElement('span');note.textContent=' Source: '+a.note+'.';box.append(note);}
@@ -11383,6 +11551,7 @@ function panel(){
11383
11551
  }
11384
11552
  }}
11385
11553
  if(refSelectedId!==null&&refSelectedObjIdx!==null&&renderPanelReferenceObject(p))return;
11554
+ if(P&&P.elevationView&&!view3d){renderElevationPanel(p);return;} // #2780: an elevation's Inspect is read-only and reads the model, not this drawing's pixels
11386
11555
  if(NO_PLAN_VIEW){p.innerHTML='<span class=badge>No editable plan view</span><div class=hint style="margin-top:8px">This model has no registered plan view to map into the 2D canvas. Elevation, section, detail, and unknown views stay available in 3D, but they are not edited as plans.</div>';return;}
11387
11556
  if(dimStyleMode&&(selIds.size||selDimIds.size))dimStyleMode=false; // anything that selects (Ctrl+A, Duplicates, Reversed beams, a legend/RFI locate…) takes the panel back from the style pane — one guard instead of a disarm call at every such command
11388
11557
  if(dimStyleMode){renderDimStylePanel(p);return;}
@@ -11729,7 +11898,7 @@ function panel(){
11729
11898
  user their click did nothing. */
11730
11899
  const onlyIds=new Set(sourceOnlyIds(canon.map(m=>m.id),inspectorPresence)),onlyRows=canon.filter(m=>onlyIds.has(m.id));
11731
11900
  if(onlyRows.length){
11732
- p.innerHTML='<h3>Shown in 3D only</h3><div class="dmsg" style="margin-top:8px;flex:none">'
11901
+ p.innerHTML='<h3>Not on a plan</h3><div class="dmsg" style="margin-top:8px;flex:none">'
11733
11902
  +esc(sourceOnlyLead(onlyRows.length,[...sourceOnlyViewsFor([...onlyIds],inspectorPresence).values()]))+'</div>'
11734
11903
  +'<div class="row hint" style="margin-top:8px">Read-only — these come from the model itself. To change one, ask your terminal AI; this editor can&rsquo;t yet edit a member shown only on an elevation or section.</div>'
11735
11904
  +refusedSheetPropsHtml(onlyRows);
@@ -12089,27 +12258,38 @@ function panel(){
12089
12258
  // Bottom = BOS, Top = TOS (respecting the "follow default" flag). A beam's two ends can differ in all of X/Y/Z.
12090
12259
  const _dpColZ=i=>i===0?(Number.isFinite(+m.col.bosMm)?+m.col.bosMm:0):(m.col.tosDef!==false?defaultTosMm:(Number.isFinite(+m.col.tosMm)?+m.col.tosMm:defaultTosMm));
12091
12260
  const _dpZmm=i=>col?_dpColZ(i):effEndTos(m.ends[i]); // WORLD MM, both branches
12092
- const _dpMmPerPx=mmPerPxOf(P);
12093
- const _dpGlobal=i=>{const p=col?m.wp[0]:m.wp[i];return [p[0]*_dpMmPerPx,-p[1]*_dpMmPerPx,_dpZmm(i)];}; // point i → world MM (a column's Bottom/Top share wp[0])
12261
+ // The row's px belong to the plan that PROJECTED it, which in 3D need not be the active view (an elevation can be).
12262
+ const _dpPlane=planeOfMember(m)||P;
12263
+ const _dpMmPerPx=mmPerPxOf(_dpPlane);
12264
+ // Display px ↔ world mm goes THROUGH THE SHEET'S OWN REGISTRATION (its datum, rotation and scale), never px × scale: that
12265
+ // product is a position on the sheet, not in the model, and it put "22687.1 · -24542.8" in the fields for a member that
12266
+ // stands at 180 · 4 (#2780). The fallback is the old arithmetic and is only reachable when the registration was refused,
12267
+ // which projects no member to select in the first place.
12268
+ const _dpPx2W=(x,y)=>{try{const w=PlanXf.sheetPxToWorld([x,y],_dpPlane,null);return [w.x,w.y];}catch(_){return [x*_dpMmPerPx,-y*_dpMmPerPx];}};
12269
+ const _dpW2Px=(x,y)=>{try{return PlanXf.worldToSheetPx({x,y,z:{unknown:true}},_dpPlane);}catch(_){return [x/_dpMmPerPx,-y/_dpMmPerPx];}};
12270
+ const _dpGlobal=i=>{const p=col?m.wp[0]:m.wp[i],w=_dpPx2W(p[0],p[1]);return [w[0],w[1],_dpZmm(i)];}; // point i → world MM (a column's Bottom/Top share wp[0])
12094
12271
  const _dpToLocal=g=>{ // world-MM [x,y,z] → local-MM, or null
12095
12272
  if(_dp3d)return SteelCore.worldToLocal(g,_dpFI); // _dpFI IS a {origin,xAxis,yAxis,normal} frame, ALREADY in mm — this used to scale into mm and back out again, which double-scaled z once z became mm
12096
- if(_dp2d){const o=P.frame.o,u=P.frame.u,px=g[0]/_dpMmPerPx,py=-g[1]/_dpMmPerPx,dx=px-o[0],dy=py-o[1];
12273
+ if(_dp2d){const o=P.frame.o,u=P.frame.u,q=_dpW2Px(g[0],g[1]),px=q[0],py=q[1],dx=px-o[0],dy=py-o[1];
12097
12274
  return [(dx*u[0]+dy*u[1])*_dpMmPerPx,(dx*u[1]-dy*u[0])*_dpMmPerPx,g[2]];} // v=[uy,−ux]; Z′=global Z (planar frame)
12098
12275
  return null;};
12099
12276
  const _dpFromLocal=l=>{ // local-MM [x,y,z] → world-MM, or null
12100
12277
  if(_dp3d)return SteelCore.localToWorld(l,_dpFI);
12101
12278
  if(_dp2d){const o=P.frame.o,u=P.frame.u,du=l[0]/_dpMmPerPx,dv=l[1]/_dpMmPerPx,px=o[0]+du*u[0]+dv*u[1],py=o[1]+du*u[1]-dv*u[0];
12102
- return [px*_dpMmPerPx,-py*_dpMmPerPx,l[2]];}
12279
+ const w=_dpPx2W(px,py);return [w[0],w[1],l[2]];}
12103
12280
  return null;};
12104
12281
  // Commit a new world-MM point Pt=[x,y,z] to point i. A column stays plumb — X/Y write BOTH wp; Z writes this
12105
12282
  // point's elevation (Bottom→col.bosMm, Top→col.tosMm). Touch the elevation ONLY when world Z actually changed, so a
12106
12283
  // plain X/Y move keeps a default-following Top on the sheet default (a tilted-frame local edit that really moves
12107
12284
  // Z still clears it). Same per-end TOS rule for a beam.
12108
- const _dpCommit=(i,Pt)=>edit(()=>{const nx=Pt[0]/_dpMmPerPx,ny=-Pt[1]/_dpMmPerPx,zChg=Math.abs(Pt[2]-_dpZmm(i))>1e-6;
12285
+ // A typed point is written only through the registration: with none that holds, nothing moves and the person is told so,
12286
+ // rather than storing a sheet position as a model one.
12287
+ const _dpPlace=(x,y)=>{try{return PlanXf.worldToSheetPx({x,y,z:{unknown:true}},_dpPlane);}catch(_){toast('This sheet’s registration doesn’t hold, so FloLess can’t turn that position into a place on the drawing. Nothing moved. Ask your terminal AI to correct the sheet’s registration.');return null;}};
12288
+ const _dpCommit=(i,Pt)=>{const placed=_dpPlace(Pt[0],Pt[1]);if(!placed)return false;return edit(()=>{const [nx,ny]=placed,zChg=Math.abs(Pt[2]-_dpZmm(i))>1e-6;
12109
12289
  const mc=MC();
12110
12290
  if(col){mc.setEndpointsInPlace(m,[nx,ny],[nx,ny]); // TWO literals, not one variable: the original wrote two distinct arrays, and sharing one would alias wp[0] and wp[1]
12111
12291
  if(zChg){if(i===0)ModelCmd.setBosMm(m.col,Pt[2]);else ModelCmd.setTosValueMm(m.col,Pt[2]);}} // Bottom writes bos ONLY; Top writes tos AND clears the default link
12112
- else{mc.setEndpoint(m,i,[nx,ny]);if(zChg)ModelCmd.setTosValueMm(m.ends[i],Pt[2]);}});
12292
+ else{mc.setEndpoint(m,i,[nx,ny]);if(zChg)ModelCmd.setTosValueMm(m.ends[i],Pt[2]);}});};
12113
12293
  const _dpAxes=['X','Y','Z'];
12114
12294
  const _dpPH=esc(lenExample()); // a coordinate component is a LENGTH, so its example follows the project's units
12115
12295
  const _dpIn=(id,lbl,vmm)=>{const v=Math.abs(vmm)<1e-6?0:vmm,point=id.includes('_0_')?'start or bottom point':'end or top point',frame=id.startsWith('dpL')?'local frame':'global coordinates';return `<label class=detf><span>${lbl}</span><input data-command-id="steel.definition-point#${esc(lbl+' for the '+point+' in '+frame)}" id=${id} inputmode=decimal placeholder="${_dpPH}" value="${esc(fmtDisp(v))}" autocomplete=off></label>`;}; // snap float-noise to 0 (no "-0"" from a local round-trip)
@@ -12477,6 +12657,7 @@ function foldRowButtons(row){
12477
12657
  }
12478
12658
  function applyPanelRows(){
12479
12659
  const p=document.getElementById('panel');if(!p)return;
12660
+ const labels=[];
12480
12661
  const STOP=el=>el.classList&&(el.classList.contains('elab')||el.classList.contains('sect')||el.classList.contains('divrow'));
12481
12662
  for(const lab of [...p.querySelectorAll('.elab')]){
12482
12663
  if(!lab.parentElement||lab.closest('.prow'))continue;
@@ -12523,8 +12704,11 @@ function applyPanelRows(){
12523
12704
  for(const nEl of notes){nEl.classList.add('phint');row.appendChild(nEl);}
12524
12705
  }
12525
12706
  if(!row.classList.contains('stack'))foldRowButtons(row);
12526
- if(lab.scrollWidth>lab.clientWidth+1&&!lab.dataset.tip)lab.dataset.tip=lab.textContent.trim();
12707
+ if(!lab.dataset.tip)labels.push(lab);
12527
12708
  }
12709
+ // Measure only after every row is in place: interleaving reads and row mutations forces a layout per field.
12710
+ const clipped=labels.filter(lab=>lab.scrollWidth>lab.clientWidth+1);
12711
+ for(const lab of clipped)lab.dataset.tip=lab.textContent.trim();
12528
12712
  }
12529
12713
  function applyPanelFolding(){
12530
12714
  const p=document.getElementById('panel');if(!p)return;
@@ -12637,7 +12821,8 @@ const selGridOK=()=>selFilter.grid!==false;
12637
12821
  const selDimOK=()=>selFilter.dim!==false;
12638
12822
  const selReferenceOK=()=>selFilter.reference!==false;
12639
12823
  // classify any id already in / entering selIds — connection part, placed detail, or plain member — → allowed?
12640
- function selIdOK(id){if(id==null)return true;if(partsById&&partsById[id]&&partsById[id].conn)return selConnPartOK(id);if(/^det:/.test(id))return true;const m=byId(id);return m?selMemberOK(m):true;}
12824
+ function selIdOK(id,lookup=byId){if(id==null)return true;if(partsById&&partsById[id]&&partsById[id].conn)return selConnPartOK(id);if(/^det:/.test(id))return true;const m=lookup(id);return m?selMemberOK(m):true;}
12825
+ function selectableIds(ids){const lookup=projectedMemberLookup();return ids.filter(id=>selIdOK(id,lookup));}
12641
12826
  // a type fires when a transient override forces exactly it (override ignores running-snaps, AutoCAD-style), else when its running-snap is on
12642
12827
  const snapAllowed=k=>snapOnly?snapOnly===k:snapEnabled[k]!==false;
12643
12828
  const _mid=(a,b)=>[(a[0]+b[0])/2,(a[1]+b[1])/2];
@@ -13037,7 +13222,8 @@ function syncActiveViewLabels(){refreshPropLabels3d();updPlToggle();}
13037
13222
  function labelTargetName(is3d){if(!is3d)return '2D plan';const v=viewById(activeViewId);
13038
13223
  return v?'3D · '+(String(v.name||'').trim()||'Untitled view'):'3D default';}
13039
13224
  function propLabelMembers(is3d=false,target=labelTarget(is3d,is3d?activeViewId:null)){const pl=C.prop_labels;if(!pl||!pl.props.length)return [];
13040
- let base=is3d?allMembers().map(m=>v2ProjectedMember(m.id)||m):P.members.filter(visible2d);
13225
+ const lookup=is3d?projectedMemberLookup():null;
13226
+ let base=is3d?allMembers().map(m=>lookup(m.id)||m):P.members.filter(visible2d);
13041
13227
  const sc=target.scope;
13042
13228
  if(!sc.for_all){const ids=new Set(sc.selected_only?sc.ids:[]);if(sc.on_selection)for(const m of propLabelSelection())ids.add(m.id);base=base.filter(m=>ids.has(m.id));}
13043
13229
  return base.filter(m=>propLabelLinesFor(m).length>0);}
@@ -13108,8 +13294,8 @@ function renderPropLabels(){const pl=C.prop_labels;propLabelsHidden=0;if(!pl||!p
13108
13294
  const anc=pl.placement==='start'?a:pl.placement==='end'?b:[(a[0]+b[0])/2,(a[1]+b[1])/2];
13109
13295
  const n=lines.length,hide=show?'':';display:none';
13110
13296
  lines.forEach((txt,i)=>{const off=(i-(n-1)/2)*15,tw=txt.length,w=(tw*6.4+12)/zoom,h=15/zoom,cy=anc[1]+off/zoom;
13111
- s+=`<rect class=plchip data-ax="${anc[0]}" data-ay="${anc[1]}" data-off="${off}" data-tw="${tw}" data-mlen="${mlen}" x="${anc[0]-w/2}" y="${cy-h/2}" width="${w}" height="${h}" rx="${3/zoom}" style="${hide}"/>`
13112
- +`<text class=pltx data-ax="${anc[0]}" data-ay="${anc[1]}" data-off="${off}" data-mlen="${mlen}" x="${anc[0]}" y="${cy}" style="font-size:${11/zoom}px${hide}">${esc(txt)}</text>`;});}
13297
+ s+=`<rect class=plchip data-mid="${esc(m.id)}" data-ax="${anc[0]}" data-ay="${anc[1]}" data-off="${off}" data-tw="${tw}" data-mlen="${mlen}" x="${anc[0]-w/2}" y="${cy-h/2}" width="${w}" height="${h}" rx="${3/zoom}" style="${hide}"/>`
13298
+ +`<text class=pltx data-mid="${esc(m.id)}" data-ax="${anc[0]}" data-ay="${anc[1]}" data-off="${off}" data-mlen="${mlen}" x="${anc[0]}" y="${cy}" style="font-size:${11/zoom}px${hide}">${esc(txt)}</text>`;});}
13113
13299
  propLabelsHidden=hidden;
13114
13300
  return `<g class="pllabels">${s}</g>`;}
13115
13301
  // fixed-screen corner note when the zoom threshold is hiding labels (an HTML pill, outside the zoomed SVG)
@@ -13124,14 +13310,14 @@ function updatePropHint(){let el=document.getElementById('plHint');
13124
13310
  if(!show){if(el)el.style.display='none';return;}
13125
13311
  if(!el){el=document.createElement('div');el.id='plHint';el.style.cssText='position:fixed;z-index:20;pointer-events:none;background:var(--panel);color:var(--mut);border:1px solid var(--line);border-radius:6px;padding:3px 9px;font:11px var(--ui);box-shadow:0 2px 8px rgba(0,0,0,.4)';document.body.appendChild(el);}
13126
13312
  const st=document.getElementById('stage').getBoundingClientRect();
13127
- el.textContent='Labels hidden — zoom in';el.style.display='block';
13313
+ el.textContent='Some labels hidden — zoom in to see more';el.style.display='block';
13128
13314
  el.style.left=(st.left+st.width/2-70)+'px';el.style.top=(st.bottom-30)+'px';}
13129
13315
 
13130
13316
  // ---- 3D bridge: hand the label spec to the 3D view (it owns projection/placement over member geometry) ----
13131
13317
  function refreshPropLabels3d(){const V=window.Steel3DView;if(!V||!V.setPropLabels)return;
13132
13318
  const pl=C.prop_labels,t=pl&&labelTarget(true,activeViewId); // resolved ONCE, so visibility and scope come from the same set
13133
13319
  if(!pl||!pl.props.length||!t.vis){V.setPropLabels(null);return;}
13134
- V.setPropLabels({labels:propLabelMembers(true,t).map(m=>({id:m.id,lines:propLabelLinesFor(m)})),placement:pl.placement});}
13320
+ V.setPropLabels({labels:propLabelMembers(true,t).map(m=>({id:m.id,lines:propLabelLinesFor(m),selected:selIds.has(m.id)})),placement:pl.placement});} // `selected` lets the 3D view keep a selected member's label when a crowd forces some to hide (#2780)
13135
13321
 
13136
13322
  // ---- The floating Properties popup ----
13137
13323
  let propPopPinned=false;
@@ -14133,6 +14319,7 @@ svg.addEventListener('pointerdown',e=>{if(e.button!==0)return;const t=e.target;
14133
14319
  if(releaseViewProps())panel(); // a click on the plan is about the model, not the saved view the panel was showing
14134
14320
  const provisional=t&&typeof t.closest==='function'?t.closest('[data-provisional-id]'):null;
14135
14321
  if(provisional){e.preventDefault();selectProvisional(provisional.dataset.provisionalId,false,provisional.dataset.provisionalTrace);return;}
14322
+ if(elevationPointerDown(e))return; // #2780: on an elevation a press only selects; no tool, drag or marquee runs
14136
14323
  if(memberEndReview){const pick=t.closest&&t.closest('[data-mer-canvas-target]');if(pick&&!memberEndReview.busy){const f=memberEndReview.report.findings[memberEndReview.focus];chooseMemberEndTarget(memberEndKey(f),+pick.dataset.merCanvasTarget);}e.preventDefault();e.stopPropagation();return;}
14137
14324
  if(csaxisMode){csClick(e);e.preventDefault();return;} // set-local-axes armed → clicks define origin then X-direction
14138
14325
  if(calloutEditMode){calloutClick(e);e.preventDefault();return;} // + Callout armed → a click on a mark edits it, a click anywhere else adds one there (BEFORE the bubble-navigation branch below, and members/segments are inert)
@@ -14854,7 +15041,8 @@ addEventListener('keydown',e=>{
14854
15041
  if(e.key==='Escape'&&detailsOpen()){closeDetails();return;}
14855
15042
  if(e.key==='Escape'&&connLibOpen()){closeConnLib();return;}
14856
15043
  if(e.key==='Escape'&&framesOpen()){closeFrames();return;}
14857
- if(e.key==='Escape'&&rfiOpen()){closeRFI();return;}
15044
+ // #2470 R6.6c: the RFI page is a step, not a dialog — Escape doesn't leave it, and no model key acts under it.
15045
+ if(rfiOpen())return;
14858
15046
  if(e.key==='Escape'&&confOpen()){closeConf();return;}
14859
15047
  if(e.key==='Escape'&&snapMenuOpen()){closeSnapMenu();return;}
14860
15048
  if(e.key==='Escape'&&selFly.classList.contains('open')){closeSelFly();return;} // close the Select-filter type flyout first
@@ -14901,6 +15089,8 @@ addEventListener('keydown',e=>{
14901
15089
  if(view3d){escLadderIdle=!leftAdd;return;} // the later-mounted 3D CAD arbiter owns the final selection-Escape rung (it marks what it uses)
14902
15090
  escLadderIdle=!leftAdd&&!picking&&!selIds.size&&!selGridIds.size; // nothing to cancel and nothing to deselect: the Esc goes up to the overlay (#1571)
14903
15091
  picking=false;pickKind='profile';pickEnd=null;modelSelection.clearMembers();modelSelection.clearGrids();render();return;}
15092
+ // #2780: nothing is deleted, duplicated or end-swapped from an elevation's 2D view (its rows are in the drawing's own pixels); say so
15093
+ if(!view3d&&!inForm&&P&&P.elevationView&&selIds.size&&(e.key==='Delete'||e.key==='Backspace'||(!e.altKey&&e.key.toLowerCase()==='p'&&!e.ctrlKey&&!e.metaKey)||((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==='d'))){e.preventDefault();toast(ELEV_VIEW_ONLY);return;}
14904
15094
  if((e.key==='Delete'||e.key==='Backspace')&&view3d&&modelEditor.steel.selectedClips&&modelEditor.steel.selectedClips().length&&!selIds.size&&!sel3dDimIds.size&&!selDimIds.size&&!inForm){e.preventDefault();window.Steel3DView.deleteSelectedClips();return;} // 3D: Del removes the selected clip plane(s)/box(es) — only when nothing else is selected (clip selection is exclusive)
14905
15095
  if((e.key==='Delete'||e.key==='Backspace')&&view3d&&sel3dDimIds.size&&!selIds.size&&!inForm){e.preventDefault();const V=window.Steel3DView;[...sel3dDimIds].forEach(id=>V&&V.removeMeasureById?V.removeMeasureById(id):view3dApi.onDeleteDim3d(id));return;} // 3D: Delete removes ALL selected 3D dims through the shared measure session — only when no member is selected
14906
15096
  if((e.key==='Delete'||e.key==='Backspace')&&selIds.size&&!selDimIds.size&&[...selIds].every(id=>/^det:/.test(id))&&!inForm){e.preventDefault();runSteelAuthoring('delete',{source:'keyboard',selection:[...selIds]},()=>edit(()=>{const rm=new Set([...selIds].map(id=>id.slice(4)));C.detail_placements=(C.detail_placements||[]).filter(x=>x&&!rm.has(x.id));modelSelection.clearMembers();}));return;} // a placed-detail-only selection deletes from detail_placements
@@ -14953,7 +15143,7 @@ addEventListener('keydown',e=>{
14953
15143
  e.preventDefault();
14954
15144
  // Scope to what's VISIBLE: 3D asks the renderer after legend/isolate/work-area/selection-hide filtering, then the editor applies its per-type Select switches. 2D uses the active plan, matching its marquee.
14955
15145
  const objectIds=view3d?(window.Steel3DView&&window.Steel3DView.visibleObjectIds?window.Steel3DView.visibleObjectIds():[]):P.members.filter(visible2d).map(m=>m.id);
14956
- modelSelection.replaceMembers(objectIds.filter(selIdOK));
15146
+ modelSelection.replaceMembers(selectableIds(objectIds));
14957
15147
  selDimIds.clear();sel3dDimIds.clear();modelSelection.clearGrids();
14958
15148
  if(selGridOK())modelSelection.replaceGrids(view3d?(window.Steel3DView&&window.Steel3DView.visibleGridIds?window.Steel3DView.visibleGridIds():[]):gridSelectables().map(g=>g.id));
14959
15149
  if(!view3d){ // the 2D-drawable dimensions join the sweep
@@ -15781,13 +15971,13 @@ const view3dApi={
15781
15971
  copesByMember=cm;partsById=pb;return sc;}, // cache resolved parts by id (real dims for the part Inspector) AND cope labels per member; placed details ride in as image elements
15782
15972
 
15783
15973
  onSelect:(id,additive)=>{if(id&&!selIdOK(id))return;releaseViewProps();if(id)clearWholeReferenceSelection();selDimIds.clear();sel3dDimIds.clear();if(!id){modelSelection.replaceMembers();if(!additive)modelSelection.clearGrids();}else{if(additive){selIds.has(id)?modelSelection.removeMember(id):modelSelection.addMember(id);}else{modelSelection.replaceMembers([id]);modelSelection.clearGrids();}}render();if(window.Steel3DView&&window.Steel3DView.refreshDims)window.Steel3DView.refreshDims();}, // 3D pick → shared model-wide selection (byId/selArr span all sheets, so no plan switch needed; clears dimension + non-additive grid selection so Delete is unambiguous). A filtered object (Select switch off) is inert.
15784
- onSelectMany:(ids,additive)=>{const ids2=(ids||[]).filter(selIdOK); // 3D box / whole-connection → gate each framed id through the Select switches (members by type, connection parts by kind)
15974
+ onSelectMany:(ids,additive)=>{const ids2=selectableIds(ids||[]); // 3D box / whole-connection → gate each framed id through the Select switches (members by type, connection parts by kind)
15785
15975
  if(!additive&&(ids||[]).length&&!ids2.length)return; // a direct pick / box that caught ONLY filtered objects → inert (leave the current selection), matching a filtered single-pick; a genuinely empty box (ids empty) still falls through and clears
15786
15976
  releaseViewProps();if(ids2.length)clearWholeReferenceSelection();selDimIds.clear();sel3dDimIds.clear();
15787
15977
  if(additive){for(const id of ids2)selIds.has(id)?modelSelection.removeMember(id):modelSelection.addMember(id);} // Ctrl/Shift + 3D area-select → toggle each framed object into the current selection (add/remove), like Tekla — spans sheets
15788
15978
  else{modelSelection.replaceMembers(ids2);modelSelection.clearGrids();}
15789
15979
  if(mode==='add'){mode='sel';setMode();}render();if(window.Steel3DView&&window.Steel3DView.refreshDims)window.Steel3DView.refreshDims();}, // 3D box-select → shared selection
15790
- onSelectBatch:({memberIds=[],gridIds=[]},additive)=>{const mids=memberIds.filter(selIdOK),gridAllowed=selGridOK(),gids=gridAllowed?gridIds:[];if(!additive&&(memberIds.length||gridIds.length)&&!mids.length&&!gids.length)return;if(mids.length||gids.length||!(memberIds.length||gridIds.length))releaseViewProps();if(mids.length||gids.length)clearWholeReferenceSelection();selDimIds.clear();sel3dDimIds.clear();if(additive){for(const id of mids)selIds.has(id)?modelSelection.removeMember(id):modelSelection.addMember(id);for(const id of gids)selGridIds.has(id)?modelSelection.removeGrid(id):modelSelection.addGrid(id);}else{modelSelection.replaceMembers(mids);modelSelection.replaceGrids(gids);if(modelEditor.isReady()&&modelEditor.steel.setSelectedClips)modelEditor.steel.setSelectedClips([]);}render();if(window.Steel3DView&&window.Steel3DView.refreshDims)window.Steel3DView.refreshDims();}, // Atomic 3D area/direct pick for members + logical grids: filter each class, toggle additively, otherwise replace both selections together.
15980
+ onSelectBatch:({memberIds=[],gridIds=[]},additive)=>{const mids=selectableIds(memberIds),gridAllowed=selGridOK(),gids=gridAllowed?gridIds:[];if(!additive&&(memberIds.length||gridIds.length)&&!mids.length&&!gids.length)return;if(mids.length||gids.length||!(memberIds.length||gridIds.length))releaseViewProps();if(mids.length||gids.length)clearWholeReferenceSelection();selDimIds.clear();sel3dDimIds.clear();if(additive){for(const id of mids)selIds.has(id)?modelSelection.removeMember(id):modelSelection.addMember(id);for(const id of gids)selGridIds.has(id)?modelSelection.removeGrid(id):modelSelection.addGrid(id);}else{modelSelection.replaceMembers(mids);modelSelection.replaceGrids(gids);if(modelEditor.isReady()&&modelEditor.steel.setSelectedClips)modelEditor.steel.setSelectedClips([]);}render();if(window.Steel3DView&&window.Steel3DView.refreshDims)window.Steel3DView.refreshDims();}, // Atomic 3D area/direct pick for members + logical grids: filter each class, toggle additively, otherwise replace both selections together.
15791
15981
  onVisibilitySelectionHidden:()=>{modelSelection.clearMembers();modelSelection.clearGrids();render();},
15792
15982
  // THE MEMBER LIST lives once at the document root, which is the whole model. The view takes ids and hands
15793
15983
  // the records back to `model().geometryOf`, keeping geometry reads on the native adapter boundary.
@@ -15810,6 +16000,7 @@ const view3dApi={
15810
16000
  snap3dFree:()=>snap3dFree, // SNAP-bar "3D snapping" mode — ON: free 3D snap; OFF: 3D placement snap constrained to the working plane
15811
16001
  originGrid:()=>({on:originGridOn,incMm:originGridIncMm}), // UCS Stage 6 origin-relative snap — read live per hover; the step IS millimetres now, so there is nothing to convert. Off ⇒ view skips it; requires a local frame to have any effect
15812
16002
  canSelectId:(id)=>selIdOK(id), // Select-filter predicate for the 3D view (e.g. don't draw a whole-connection envelope for a fully-filtered connection)
16003
+ canSelectIds:selectableIds, // One fresh projected-row lookup per area/Ctrl+A operation, with the same per-id Select switches.
15813
16004
  canSelectGrid:()=>selGridOK(), // Grid line/bubble picks and area selection obey the same Select switch as 2D.
15814
16005
  canSelectReference:()=>selReferenceOK(), // Reference picks/drills obey their 3D-only Select switch; visibility and snapping stay independent.
15815
16006
  gridScopeKey:()=>'model',
@@ -16230,12 +16421,12 @@ window.ModelSelectionCoordinator=modelSelection;
16230
16421
  // The selection as model objects (#1653). Raw ids include connection parts and `det:` placement tokens; this is
16231
16422
  // the one place they become {kind, id}: a part is its connection, `det:<id>` a placed detail, a member itself.
16232
16423
  // Anything else (grid, dimension, reference) is not an object a question can be about. Shared with Ask AI.
16233
- function canonicalTargetItems(ids){
16424
+ function canonicalTargetItems(ids,members=new Map((C.members||[]).filter(Boolean).map(m=>[m.id,m]))){
16234
16425
  const items=[],seen=new Set();let ignored=0,total=0;
16235
16426
  for(const id of (ids||[])){total++;let item=null;const part=(partsById||{})[id];
16236
16427
  if(part&&typeof part.conn==='string'&&part.conn)item={kind:'joint',id:part.conn};
16237
16428
  else if(typeof id==='string'&&id.startsWith('det:')&&id.slice(4))item={kind:'detail',id:id.slice(4)};
16238
- else if((C.members||[]).some(m=>m&&m.id===id))item={kind:'member',id};
16429
+ else if(members.has(id))item={kind:'member',id};
16239
16430
  else{ignored++;continue;}
16240
16431
  const key=item.kind+'\0'+item.id;if(seen.has(key))continue;seen.add(key);items.push(item);
16241
16432
  }
@@ -16243,17 +16434,18 @@ function canonicalTargetItems(ids){
16243
16434
  }
16244
16435
  // A label exactly as the server stores it, and the selection's key: both shared with every model viewer.
16245
16436
  function subjectLabelText(text){return ChatQuestions.subjectLabelText(text);}
16246
- function subjectLabel(item){
16247
- if(item.kind==='member'){const m=(C.members||[]).find(x=>x&&x.id===item.id);return m?((m.mark||m.id)+(m.profile?' · '+m.profile:'')):item.id;}
16437
+ function subjectLabel(item,lookup){
16438
+ if(item.kind==='member'){const m=lookup?lookup.members.get(item.id):(C.members||[]).find(x=>x&&x.id===item.id);return m?((m.mark||m.id)+(m.profile?' · '+m.profile:'')):item.id;}
16248
16439
  if(item.kind==='joint')return 'Connection '+item.id; // a placed joint (C.joints), never a connection-library row
16249
- const d=(C.detail_placements||[]).find(x=>x&&x.id===item.id);return 'Detail '+((d&&d.detailName)||item.id);
16440
+ const d=lookup?lookup.details.get(item.id):(C.detail_placements||[]).find(x=>x&&x.id===item.id);return 'Detail '+((d&&d.detailName)||item.id);
16250
16441
  }
16251
16442
  function subjectsKeyOf(items){return ChatQuestions.subjectsKeyOf(items);}
16252
16443
  function modelSubjects(){
16253
- const items=canonicalTargetItems([...selIds]).items;
16444
+ const lookup={members:new Map((C.members||[]).filter(Boolean).map(m=>[m.id,m])),details:new Map((C.detail_placements||[]).filter(Boolean).map(d=>[d.id,d]))};
16445
+ const items=canonicalTargetItems([...selIds],lookup.members).items;
16254
16446
  if(!items.length)return null;
16255
16447
  return {source:'steel',revision:serverRevision>=0?serverRevision:null,total:items.length,key:subjectsKeyOf(items),
16256
- items:items.slice(0,200).map(item=>({kind:item.kind,id:item.id,label:subjectLabelText(subjectLabel(item))||item.id}))};
16448
+ items:items.slice(0,200).map(item=>({kind:item.kind,id:item.id,label:subjectLabelText(subjectLabel(item,lookup))||item.id}))};
16257
16449
  }
16258
16450
  // Announced again whenever the objects it names change — a relabel or a new server revision included — so AI Chat
16259
16451
  // never reads a stale label at Send. A replay of the same selection is not announced.
@@ -23090,9 +23282,22 @@ function exportPayload(){
23090
23282
  return {mm_per_px:(P&&P.mm_per_px>0)?P.mm_per_px:FT_TO_MM/12,elev_units:'mm',members:P.members.map(m=>{ensureMeta(m);return {profile:m.profile,workpoint:m.wp,role:m.role,rfi:_wtPlf(m.profile)==null,
23091
23283
  length_ft:+_lenFt(m).toFixed(1),weight_plf:_plfWire(_wtPlf(m.profile)), // `_wtPlf`, never `_wtBill`: this field's NAME says pounds per foot // columns measure vertical height (TOS−BOS), not their ~0 plan-point distance
23092
23284
  ends:m.role==='column'?undefined:(m.ends||[]).map(wireEnd), column:m.role==='column'?wireCol(m.col):undefined};})};}
23093
- document.getElementById('exp').onclick=()=>{
23094
- const b=new Blob([JSON.stringify(exportPayload(),null,1)],{type:'application/json'});
23095
- const a=document.createElement('a');a.href=URL.createObjectURL(b);a.download='contract_edited.json';a.click();};
23285
+ /* #2521 row 5b: the downloaded file says what the EXACT document it was made from rests on. The live model (unsaved
23286
+ edits included) is labelled by the server: the /scene route answers `quick` for a Quick or possibly Quick candidate
23287
+ and nothing for a precise one. A failed or unreadable answer is labelled "could not be read", never left unlabelled.
23288
+ Every existing field keeps its name, order and value; the label is one more key at the end. */
23289
+ function exportFileFor(payload,answer){
23290
+ if(answer&&answer.ok===true&&!answer.quick)return{name:'contract_edited.json',payload};
23291
+ const q=answer&&answer.ok===true&&answer.quick&&typeof answer.quick.label==='string'
23292
+ ?answer.quick:{state:'unknown',label:'Quick model · AI decisions could not be read'};
23293
+ return{name:'contract_edited-Quick.json',payload:{...payload,quick_model:{state:q.state==='quick'?'quick':'unknown',label:q.label}}};
23294
+ }
23295
+ document.getElementById('exp').onclick=async()=>{
23296
+ const payload=exportPayload();
23297
+ let answer=null;try{answer=await fetchScenePayload(C);}catch{answer=null;}
23298
+ const out=exportFileFor(payload,answer);
23299
+ const b=new Blob([JSON.stringify(out.payload,null,1)],{type:'application/json'});
23300
+ const a=document.createElement('a');a.href=URL.createObjectURL(b);a.download=out.name;a.click();};
23096
23301
  // --- details gallery (preview = crop of detail N from its sheet; .preview base64 when available) ---
23097
23302
  // per-detail thumbnail = the bubble's cell cropped client-side from the full-sheet preview (no extra crops stored)
23098
23303
  const THUMBS={};
@@ -24494,6 +24699,9 @@ async function refreshRfiRecords(opts){
24494
24699
  }catch(e){
24495
24700
  if(mine!==rfiFetchSeq)return false;
24496
24701
  if(opts&&opts.signal&&opts.signal.aborted)return false;
24702
+ // FloLess disposed this editor (the project is being reopened or switched) and is replacing the frame, which cuts
24703
+ // off any read still in flight. Nobody is looking at this page any more, so that is not a failure to report.
24704
+ if(editorTerminalDisposed)return false;
24497
24705
  // Bind and log it. A dead server, a DNS failure and a TypeError thrown by our own code inside the
24498
24706
  // try all render the same banner, and a bug report cannot tell them apart from that banner alone.
24499
24707
  console.error('[steel] could not read the filed RFIs', e);
@@ -26076,7 +26284,7 @@ function rfiRestoreFocus(want){
26076
26284
  if(target)break;
26077
26285
  }
26078
26286
  if(!target&&want.ctl&&want.ctl!=='*first')target=_rfiByAttr(modal,'data-rfi-ctl',want.ctl);
26079
- if(!target)target=document.getElementById('rfiClose');
26287
+ if(!target)target=document.getElementById('rfiTitle');
26080
26288
  if(target&&target.focus)target.focus({preventScroll:true});
26081
26289
  }
26082
26290
  /**
@@ -26305,7 +26513,7 @@ function paintRfiBanner(){
26305
26513
  // The loading repaint removes Retry, so its ordinary focus capture falls back to Close. Restore the
26306
26514
  // exact action when the read settles and Retry returns, but only while focus remains on that
26307
26515
  // temporary fallback. A user who moves to a filter or row keeps the focus they chose.
26308
- rfiFocusOverride={rows:[],ctl:'retry',whenFocused:document.getElementById('rfiClose')};
26516
+ rfiFocusOverride={rows:[],ctl:'retry',whenFocused:document.getElementById('rfiTitle')};
26309
26517
  refreshRfiRecords();
26310
26518
  };
26311
26519
  }
@@ -26366,7 +26574,7 @@ async function runEditorFocus(req,current){
26366
26574
  // #2471: a member an answer cited. The shell checked the project is the cited one; this frame shows that project.
26367
26575
  if(req.memberId){
26368
26576
  const m=await focusMember(req.memberId,{current,
26369
- beforeSelect:()=>rfiFormFor?'An RFI form is open. Finish or cancel it, then press Show in the model again.':'',
26577
+ beforeSelect:()=>rfiFormFor&&rfiOpen()?'An RFI form is open. Finish or cancel it, then press Show in the model again.':'',
26370
26578
  beforeFrame:()=>{if(rfiOpen())closeRFI();}});
26371
26579
  if(!m||!current())return null;
26372
26580
  if(!m.ok){
@@ -26377,7 +26585,7 @@ async function runEditorFocus(req,current){
26377
26585
  return {ok:true};
26378
26586
  }
26379
26587
  const r=await focusConnection(req.jointId,{current,fallbackToMain:true,
26380
- beforeSelect:()=>rfiFormFor?'An RFI form is open. Finish or cancel it, then press Open in the model again.':'',
26588
+ beforeSelect:()=>rfiFormFor&&rfiOpen()?'An RFI form is open. Finish or cancel it, then press Open in the model again.':'',
26381
26589
  beforeFrame:()=>{if(rfiOpen())closeRFI();}});
26382
26590
  if(!r||!current())return null;
26383
26591
  // #2450: "Raise an RFI" opens its dialog whether or not the connection could be selected — a hidden or
@@ -26492,7 +26700,7 @@ async function focusConnection(jointId,opts){
26492
26700
  }
26493
26701
  if(!ready||!window.Steel3DView)return {ok:false,reason:'view',said:'The 3D view could not show connection '+jointId+'.'};
26494
26702
  if(!parts.length)return {ok:false,reason:'unbuilt',said:'FloLess could not build connection '+jointId+', so the model has nothing of it to show.'};
26495
- if(!parts.every(selIdOK))return {ok:false,reason:'filter',said:'Connection '+jointId+' is excluded by the selection filter. Turn on '+(joint.kind||'its type')+' connections under Select, then try again.'};
26703
+ if(!parts.every(id=>selIdOK(id)))return {ok:false,reason:'filter',said:'Connection '+jointId+' is excluded by the selection filter. Turn on '+(joint.kind||'its type')+' connections under Select, then try again.'};
26496
26704
  if(viewMode==='split')setActivePane('3d'); // as above: the 3D pane holds the selection and its tools
26497
26705
  const selectedThisAttempt=treeSelectConn(jointId,{});
26498
26706
  const selected=connSelInfo();
@@ -27087,7 +27295,8 @@ async function rfiCommitProfileRepair(inp,rawValue){
27087
27295
  const mismatch=record&&rfiProfileTruthMismatch(record);if(mismatch)rfiSay(rfiProfileTruthMessage(mismatch));
27088
27296
  const modal=document.getElementById('rfiModal');
27089
27297
  const replacement=rfiProfileInputFor(modal,rowKey,m.id);
27090
- if(replacement)replacement.focus({preventScroll:true});
27298
+ // Only while the page still shows: a settle that lands after the person left for another step takes no focus.
27299
+ if(replacement&&rfiOpen())replacement.focus({preventScroll:true});
27091
27300
  }
27092
27301
 
27093
27302
  /** A failed save/read remains explicit and recoverable. Retrying the same value deliberately enters
@@ -27097,8 +27306,8 @@ const rfiGestureFailure=e=>{console.error('[steel] an RFI gesture failed',e);toa
27097
27306
  /** Keep a catalogue selection inside the parent dialog when resolving it removes an unfiled symptom row. */
27098
27307
  function rfiFocusAfterSymptomProfilePick(modal,rowKey,memberId){
27099
27308
  if(!rfiRowIsSize(rowKey)||rfiProfileInputFor(modal,rowKey,memberId))return false;
27100
- const close=modal&&modal.querySelector&&modal.querySelector('#rfiClose');
27101
- const fallback=close||document.getElementById('rfiClose');
27309
+ const close=modal&&modal.querySelector&&modal.querySelector('#rfiTitle');
27310
+ const fallback=close||document.getElementById('rfiTitle');
27102
27311
  if(!fallback||!fallback.focus)return false;
27103
27312
  fallback.focus({preventScroll:true});return true;
27104
27313
  }
@@ -27319,8 +27528,10 @@ const liveRfiSubjects=owner=>owner&&owner.occurrence&&owner.occurrence.liveGap&&
27319
27528
  async function openActiveProvisional(memberId,openSource,invoker){
27320
27529
  const members=provisionalMembersForActiveView();
27321
27530
  const member=memberId?selectedProvisionalTrace(members,memberId):(new Set(members.map(row=>row.id)).size===1?members[0]:null);if(!member&&!members.length)return;
27322
- openRFI(null,invoker);
27531
+ // The page opens on the RFIs step (#2470 R6.6c): wait for it, and stop if the person went elsewhere meanwhile.
27532
+ if(!(await openRFI(null,invoker)))return;
27323
27533
  if(PROJECT)await refreshRfiRecords({force:true});
27534
+ if(!rfiOpen())return;
27324
27535
  if(!member){
27325
27536
  rfiStatusFilter='open';renderRfiList();
27326
27537
  const ids=new Set(members.map(row=>row.id));
@@ -27384,7 +27595,7 @@ function openRaiseRfi(jointId,checkId,invoker){
27384
27595
  // A filing still out keeps the dialog: replacing it would drop that filing's answer unsaid.
27385
27596
  if(rfiRaise&&rfiRaise.busy)return 'An RFI about connection '+rfiRaise.jointId+' is still being filed. Wait for it, then press Raise an RFI again.';
27386
27597
  // A form being typed in the RFI list is never closed under the person.
27387
- if(rfiFormFor)return 'An RFI form is open in the RFI list. Finish or cancel it, then press Raise an RFI again.';
27598
+ if(rfiFormFor&&rfiOpen())return 'An RFI form is open in the RFI list. Finish or cancel it, then press Raise an RFI again.';
27388
27599
  if(rfiOpen())closeRFI();
27389
27600
  rfiRaiseReturn=invoker&&invoker.isConnected?invoker:(document.activeElement instanceof Element?document.activeElement:null);
27390
27601
  rfiRaise={jointId,checkId:checkId||null,status:'loading',data:null,error:'',useSaved:false,expanded:null,forms:new Map(),outcomes:new Map(),busy:null,generation:-1,seq:++rfiRaiseSeq};
@@ -27663,55 +27874,162 @@ document.getElementById('rfiRaiseModal').addEventListener('keydown',e=>{
27663
27874
  if(e.shiftKey&&document.activeElement===first){e.preventDefault();last.focus();}
27664
27875
  else if(!e.shiftKey&&document.activeElement===last){e.preventDefault();first.focus();}
27665
27876
  });
27666
- function openRFI(focusId,invoker,recordId){focusId=(typeof focusId==='string')?focusId:null; // #rfiStat binds openRFI directly, so the arg is a MouseEvent; only a real id string focuses a row (the profile picker's onApply passes one)
27667
- const isElement=value=>typeof Element!=='undefined'&&value instanceof Element;
27668
- rfiDialogReturn=isElement(invoker)?invoker:(isElement(document.activeElement)?document.activeElement:null);
27669
- renderRfiList();
27670
- document.getElementById('rfiModal').style.display='flex';
27671
- document.getElementById('rfiStat').setAttribute('aria-expanded','true');
27672
- // Records are a file another session may have written, so re-read them each time the list is opened.
27673
- if(PROJECT&&rfiState.status!=='loading')refreshRfiRecords();
27674
- if(PROJECT)refreshRfiGmailReadiness();
27675
- if(typeof recordId==='string'&&recordId){ // a specific question (the one a callout's "See the question" names)
27676
- const row=_rfiByAttr(document.getElementById('rfiList'),'data-rfi-row',rfiRowKey('record',recordId));
27877
+ /* ── #2470 R6.6c: the RFI page (plan 2026-10-25-2470-r6-6c-steel-rfis-step-PLAN.md §10) ──────────────────────────
27878
+ * In FloLess the page is the project's RFIs step: the shell shows this same frame on Model and on RFIs and says which
27879
+ * (`floless:step-shown`, after this page's `floless:editor-ready`). This page asks to switch with
27880
+ * `floless:rfis-request-step`. Opened any other way (a direct URL; the Edit-contract overlay, whose frame the shell does
27881
+ * not treat as a project's editor) nobody answers the ready message, and the page shows locally with Back to model.
27882
+ * One state, `rfiSurface`: 'model' | 'rfis' | 'away'. `rfiOpen()` means the page is showing. */
27883
+ let rfiSurface='model',rfiTrip=null;
27884
+ const RFI_BRIDGE={negotiated:false,seq:0,reqSeq:0,pending:null,uuid:null,modelRequest:null};
27885
+ function rfiShellWindow(){try{return window.parent&&window.parent!==window?window.parent:null;}catch(_){return null;}}
27886
+ function rfiPostShell(message){const w=rfiShellWindow();if(!w)return false;
27887
+ try{w.postMessage({...message,projectId:PROJECT,projectUuid:RFI_BRIDGE.uuid},location.origin);return true;}
27888
+ catch(error){console.warn('[steel] could not reach FloLess to switch steps',error);return false;}}
27889
+ // Inert AND hidden: an inert element is skipped by hit-testing but still paints, and the model's floating tools sit
27890
+ // above the page's layer. `visibility` keeps the layout, so the 3D view is not re-flowed under the page.
27891
+ function rfiSetModelInert(on){for(const el of document.querySelectorAll('body>header,body>main')){el.inert=on;el.style.visibility=on?'hidden':'';}}
27892
+ function rfiApplyFocus(focus){
27893
+ const list=document.getElementById('rfiList');
27894
+ if(focus&&focus.recordId){ // a specific question (the one a callout's "See the question" names)
27895
+ const row=_rfiByAttr(list,'data-rfi-row',rfiRowKey('record',focus.recordId));
27677
27896
  if(row){row.scrollIntoView({block:'center'});const f=row.querySelector('button,input,[tabindex]');if(f)f.focus({preventScroll:true});return;}
27678
27897
  }
27679
- if(focusId){
27680
- const inp=[...document.querySelectorAll('#rfiList input.combo[data-mid]')].find(i=>i.dataset.mid===focusId);
27898
+ if(focus&&focus.focusId){
27899
+ const inp=[...document.querySelectorAll('#rfiList input.combo[data-mid]')].find(i=>i.dataset.mid===focus.focusId);
27681
27900
  const row=inp&&inp.closest('.rfirow');
27682
27901
  if(row){row.scrollIntoView({block:'center'});inp.focus({preventScroll:true});return;}
27683
27902
  }
27684
- // A plain open lands on the close button, the baseline every other dialog here carries.
27685
- const c=document.getElementById('rfiClose');if(c)c.focus();
27903
+ if(focus&&focus.trip){ // Back to RFIs: where the person was before the model trip
27904
+ if(Number.isFinite(focus.trip.scroll))list.scrollTop=focus.trip.scroll;
27905
+ const row=focus.trip.rowKey&&_rfiByAttr(list,'data-rfi-row',focus.trip.rowKey);
27906
+ // The control the person left from (Locate, usually), else the row's first control.
27907
+ const f=row&&((focus.trip.cmd&&[...row.querySelectorAll('[data-command-id]')].find(n=>n.getAttribute('data-command-id')===focus.trip.cmd))
27908
+ ||row.querySelector('button,input,[tabindex]'));
27909
+ if(f){f.focus({preventScroll:true});return;}
27910
+ }
27911
+ const h=document.getElementById('rfiTitle');if(h)h.focus({preventScroll:true});
27686
27912
  }
27687
- function closeRFI(){
27913
+ /** Show the page now (this document only) and refresh it, as opening the RFI window always did. */
27914
+ function rfiActivate(focus,invoker){
27915
+ rfiDialogReturn=invoker||null;
27916
+ renderRfiList();
27917
+ document.getElementById('rfiModal').style.display='flex';
27918
+ rfiSetModelInert(true);rfiSurface='rfis';
27919
+ document.getElementById('rfiStat').setAttribute('aria-expanded','true');
27920
+ document.getElementById('rfiBackRfis').hidden=true;
27921
+ document.getElementById('rfiBackModel').hidden=RFI_BRIDGE.negotiated;
27922
+ // Records are a file another session may have written, so they are read again every time the page shows.
27923
+ if(PROJECT&&rfiState.status!=='loading')refreshRfiRecords();
27924
+ if(PROJECT)refreshRfiGmailReadiness();
27925
+ rfiApplyFocus(focus);
27926
+ }
27927
+ /** Hide the page (to the model, or away to another step). Transient work it owned ends; an unsubmitted form stays. */
27928
+ function rfiLeavePage(to){
27688
27929
  rfiCancelTarget();if(rfiLightboxReturn)closeLightbox();
27689
- // The draft and the standing sentence go with the dialog. Without this, reopening resurrects a form
27690
- // the user pressed Escape on and a failure they have already read — and `rfiDispatch`'s own
27691
- // ownership check is what stops a settle that lands after this from putting either of them back.
27692
- rfiFormFor=null;rfiOutcome=null;rfiFocusOverride=null;
27930
+ rfiOutcome=null;rfiFocusOverride=null;
27693
27931
  paintRfiFail();
27694
27932
  document.getElementById('rfiModal').style.display='none';
27695
- const b=document.getElementById('rfiStat');
27696
- if(b)b.setAttribute('aria-expanded','false');
27697
- const back=rfiDialogReturn&&rfiDialogReturn.isConnected?rfiDialogReturn:b;rfiDialogReturn=null;if(back)back.focus();
27933
+ rfiSetModelInert(false);rfiSurface=to;
27934
+ const b=document.getElementById('rfiStat');if(b)b.setAttribute('aria-expanded','false');
27935
+ rfiDialogReturn=null;
27936
+ }
27937
+ /** Open the RFI page, focused on a member's size row or a record. Resolves true once it shows, false if superseded. */
27938
+ function openRFI(focusId,invoker,recordId){
27939
+ focusId=(typeof focusId==='string')?focusId:null; // #rfiStat binds openRFI directly, so the arg is a MouseEvent; only a real id string focuses a row (the profile picker's onApply passes one)
27940
+ const isElement=value=>typeof Element!=='undefined'&&value instanceof Element;
27941
+ const inv=isElement(invoker)?invoker:(isElement(document.activeElement)?document.activeElement:null);
27942
+ const focus={focusId,recordId:typeof recordId==='string'&&recordId?recordId:null,trip:invoker&&invoker.trip?invoker.trip:null};
27943
+ // Already showing: render and read again, exactly as opening always did (a vanished row's lost draft is said here).
27944
+ if(rfiOpen()){rfiActivate(focus,inv);return Promise.resolve(true);}
27945
+ if(!RFI_BRIDGE.negotiated){rfiActivate(focus,inv);return Promise.resolve(true);}
27946
+ if(RFI_BRIDGE.pending)RFI_BRIDGE.pending.resolve(false);
27947
+ return new Promise(resolve=>{
27948
+ const n=++RFI_BRIDGE.reqSeq,requestId='rfi-step-'+n;
27949
+ RFI_BRIDGE.pending={requestId,n,focus,invoker:inv,resolve};
27950
+ if(!rfiPostShell({type:'floless:rfis-request-step',requestId,step:'rfis'})){RFI_BRIDGE.pending=null;toast('FloLess could not open the RFIs step just now. Click RFIs above, or try again.');resolve(false);}
27951
+ });
27698
27952
  }
27699
- function rfiOpen(){return document.getElementById('rfiModal').style.display==='flex';}
27953
+ /** Leave the page for the model (Locate, a repair, a connection the chat asked for): Back to RFIs returns here. */
27954
+ function closeRFI(){
27955
+ if(!rfiOpen())return;
27956
+ const list=document.getElementById('rfiList');
27957
+ const active=document.activeElement,row=active&&active.closest&&active.closest('[data-rfi-row]');
27958
+ rfiTrip={scroll:list?list.scrollTop:0,rowKey:row&&row.dataset?row.dataset.rfiRow:null,
27959
+ cmd:active&&active.getAttribute?active.getAttribute('data-command-id'):null};
27960
+ const hadFocus=document.getElementById('rfiModal').contains(document.activeElement);
27961
+ rfiLeavePage('model');
27962
+ const back=document.getElementById('rfiBackRfis');back.hidden=false;
27963
+ // Focus was on the page (Locate, usually): put it on the way back rather than let it fall to the page body.
27964
+ if(hadFocus)back.focus({preventScroll:true});
27965
+ if(RFI_BRIDGE.negotiated){
27966
+ // The model shows at once (same document); the shell's tab follows. A refusal puts both back where the shell is.
27967
+ const requestId='rfi-step-'+(++RFI_BRIDGE.reqSeq);RFI_BRIDGE.modelRequest=requestId;
27968
+ if(!rfiPostShell({type:'floless:rfis-request-step',requestId,step:'model'})){
27969
+ // The shell never heard it, so its tab still says RFIs: show the page again rather than a model the tab disowns.
27970
+ RFI_BRIDGE.modelRequest=null;rfiBackFromTrip();
27971
+ toast('FloLess could not switch to the Model step just now. Click Model above, or try again.');
27972
+ }
27973
+ }
27974
+ }
27975
+ /** Put the page back as the person left it for the model (its scroll and row), when the move to the model did not happen. */
27976
+ function rfiBackFromTrip(){const trip=rfiTrip;rfiTrip=null;rfiActivate({focusId:null,recordId:null,trip},null);}
27977
+ /** The number in an id this editor minted ('rfi-step-<n>'), or 0 for anything else. */
27978
+ function rfiRequestNo(id){const m=/^rfi-step-(\d+)$/.exec(String(id||''));return m?Number(m[1]):0;}
27979
+ function rfiOpen(){return rfiSurface==='rfis';}
27980
+ /** The shell says which step shows. A step other than RFIs hides the page; Model keeps a Back to RFIs only after a trip. */
27981
+ function rfiFollowStep(step,cause){
27982
+ const pending=RFI_BRIDGE.pending;
27983
+ if(step==='rfis'){
27984
+ RFI_BRIDGE.pending=null;
27985
+ if(!rfiOpen()||pending)rfiActivate(pending?pending.focus:null,pending?pending.invoker:null);
27986
+ if(pending)pending.resolve(true);
27987
+ return;
27988
+ }
27989
+ // Another step: an open still waiting for RFIs is no longer wanted (a later RFIs step is its own, fresh intent) —
27990
+ // unless this step is only the shell carrying out an OLDER request of this editor's (Locate's move to the model,
27991
+ // arriving after the person already pressed Back to RFIs): that is not the person walking away.
27992
+ const echoOfOlder=pending&&rfiRequestNo(cause)>0&&rfiRequestNo(cause)<pending.n;
27993
+ if(pending&&!echoOfOlder){RFI_BRIDGE.pending=null;pending.resolve(false);}
27994
+ if(rfiOpen())rfiLeavePage(step==='model'?'model':'away');else rfiSurface=step==='model'?'model':'away';
27995
+ if(step!=='model'){document.getElementById('rfiBackRfis').hidden=true;rfiTrip=null;}
27996
+ }
27997
+ window.addEventListener('message',e=>{
27998
+ if(e.origin!==location.origin||e.source!==rfiShellWindow())return;
27999
+ const m=e.data;if(!m||m.projectId!==PROJECT)return;
28000
+ // The first step message names this project's incarnation; anything about another incarnation is not for this page.
28001
+ const sameUuid=!RFI_BRIDGE.uuid||String(m.projectUuid||'').toLowerCase()===RFI_BRIDGE.uuid;
28002
+ if(m.type==='floless:step-shown'){
28003
+ // A disposed editor is on its way out (FloLess is replacing the frame): it shows nothing and reads nothing more.
28004
+ if(!sameUuid||editorTerminalDisposed)return;
28005
+ if(typeof m.seq==='number'){if(m.seq<=RFI_BRIDGE.seq)return;RFI_BRIDGE.seq=m.seq;}
28006
+ if(!RFI_BRIDGE.uuid&&m.projectUuid)RFI_BRIDGE.uuid=String(m.projectUuid).toLowerCase();
28007
+ RFI_BRIDGE.negotiated=true;
28008
+ rfiFollowStep(m.step,m.cause);
28009
+ return;
28010
+ }
28011
+ if(m.type==='floless:rfis-step-ack'&&sameUuid){
28012
+ const pending=RFI_BRIDGE.pending;
28013
+ if(pending&&pending.requestId===m.requestId){
28014
+ if(!m.ok){RFI_BRIDGE.pending=null;pending.resolve(false);}
28015
+ // ok: the shell is on RFIs now. Its step message normally came first and already showed the page; if that message
28016
+ // was lost, the acknowledgement is enough (messages from the shell arrive in order, so nothing newer is overtaken).
28017
+ else if(m.step==='rfis')rfiFollowStep('rfis');
28018
+ return;
28019
+ }
28020
+ // A refused move to the model: show what the shell shows, so the tab and the page agree again.
28021
+ if(RFI_BRIDGE.modelRequest===m.requestId){RFI_BRIDGE.modelRequest=null;
28022
+ if(!m.ok&&m.step==='rfis'&&!rfiOpen())rfiBackFromTrip();else if(!m.ok&&m.step)rfiFollowStep(m.step);}
28023
+ }
28024
+ });
27700
28025
  document.getElementById('rfiStat').onclick=openRFI;
27701
- document.getElementById('rfiClose').onclick=closeRFI;
27702
- document.getElementById('rfiBackdrop').onclick=closeRFI;
27703
- // The Tab trap and Escape, copied from #confModal — the most complete dialog wiring on this page, and
27704
- // something neither this dialog nor the panel it replaces ever had.
27705
- document.getElementById('rfiModal').addEventListener('keydown',e=>{e.stopPropagation();if(e.key==='Escape'){e.preventDefault();
27706
- // AN OPEN FORM OWNS ESCAPE FIRST, and this branch is the only thing that makes the command's own
27707
- // escLabel true — without it Escape closed the whole dialog and (before closeRFI learned to clear
27708
- // it) the draft came back on the next open, so Escape neither closed the form nor discarded it.
27709
- // A form mid-flight is not cancellable: the request is already out. It used to fall through and
27710
- // close the whole DIALOG, which is not what the command's own escLabel narrates and not what anybody
27711
- // pressing Escape over a form expects.
27712
- if(rfiFormFor&&rfiFormFor.busy){toast('Still recording — wait for it to finish, or close the dialog and check the row.');return;}
27713
- if(rfiFormFor){rfiCloseForm();return;}
27714
- 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();}});
28026
+ document.getElementById('rfiBackRfis').onclick=async()=>{const trip=rfiTrip;rfiTrip=null;if(!(await openRFI(null,{trip}))&&!rfiTrip)rfiTrip=trip;};
28027
+ document.getElementById('rfiBackModel').onclick=closeRFI;
28028
+ // The page keeps the RFI window's keyboard rules, minus closing: its keys never reach the model's shortcuts, and
28029
+ // AN OPEN FORM OWNS ESCAPE (a form mid-flight is not cancellable: the request is already out).
28030
+ document.getElementById('rfiModal').addEventListener('keydown',e=>{e.stopPropagation();if(e.key!=='Escape')return;e.preventDefault();
28031
+ if(rfiFormFor&&rfiFormFor.busy){toast('Still recording — wait for it to finish, then check the row.');return;}
28032
+ if(rfiFormFor){rfiCloseForm();return;}});
27715
28033
  // ===== Section weights, and the unit words a quantity is spelled with =====
27716
28034
  // The AISC catalogue weight — the only way most of the catalogue can be weighed at all. Nothing in
27717
28035
  // "HSS4X4X3/8" encodes 17.27 lb/ft (40.9 kg/m), so before the table carried weights every hollow section, angle
@@ -27826,7 +28144,7 @@ function yourAnswersHtml(){const rows=[];
27826
28144
  const said=a.how==='typed'?'you typed '+(a.typed||fmtDispElev(z.known)):'you confirmed '+(a.shownAs||fmtDispElev(z.known));
27827
28145
  const when=typeof a.answeredAt==='string'&&!Number.isNaN(Date.parse(a.answeredAt))?', '+new Date(a.answeredAt).toLocaleDateString():'';
27828
28146
  const pics=(Array.isArray(a.evidence)?a.evidence:[]).map(ref=>' <button type=button class=answer-picture data-command-id="steel.answer-picture-open#'+esc(ref.fileName)+'" data-answer-request="'+esc(a.requestId)+'" data-answer-evidence="'+esc(ref.attachmentId)+'" data-command-instance-label="'+esc(String(a.label||m.id))+'" data-tip="Open '+esc(ref.fileName)+'">'+esc(ref.fileName)+'</button>').join('');
27829
- rows.push('<li>'+esc(String(a.label||m.id))+': '+esc(said)+(a.basis==='read-of-your-picture'?' (the read’s reading of your picture)':a.basis==='read-of-your-note'?' (the read’s reading of your note)':'')+' on height question'+esc(when)+(a.note?' — '+esc(a.note):'')+pics+'</li>');}
28147
+ rows.push('<li>'+esc(String(a.label||m.id))+': '+esc(said+answeredProposalSaid(a))+(a.basis==='read-of-your-picture'?' (the read’s reading of your picture)':a.basis==='read-of-your-note'?' (the read’s reading of your note)':'')+' on height question'+esc(when)+(a.note?' — '+esc(a.note):'')+pics+'</li>');}
27830
28148
  return rows.length?'<h3>Your answers</h3><ul>'+rows.join('')+'</ul>':'';}
27831
28149
  /** A button that opens a picture the person attached to an answer (#1906), served only after its digest check. */
27832
28150
  function answerPictureButton(requestId,ref,instance){const b=document.createElement('button');b.type='button';b.className='answer-picture';
@@ -27944,7 +28262,7 @@ function closeLightbox(){
27944
28262
  const lightbox=document.getElementById('lightbox'),close=document.getElementById('lbClose');
27945
28263
  lightbox.removeAttribute('role');lightbox.removeAttribute('aria-modal');lightbox.removeAttribute('aria-labelledby');close.removeAttribute('aria-label');
27946
28264
  document.getElementById('rfiModal').inert=held.inert;URL.revokeObjectURL(held.objectUrl);
27947
- if(held.button.isConnected)held.button.focus();else if(rfiOpen())document.getElementById('rfiClose').focus();
28265
+ if(held.button.isConnected)held.button.focus();else if(rfiOpen())document.getElementById('rfiTitle').focus();
27948
28266
  }
27949
28267
  }
27950
28268
  function lightboxOpen(){return document.getElementById('lightbox').style.display==='flex';}
@@ -29101,7 +29419,7 @@ function setPlan(i){
29101
29419
  NO_PLAN_VIEW=true;C.active=0;P={sheet:'',members:[],segments:[],dims:[],details:[],callouts:[],tos_callouts:[],grid:null,default_tos_mm:0};
29102
29420
  resetPlanViewState(0);return;
29103
29421
  }
29104
- if(canonical.viewKind!=='plan'){
29422
+ if(canonical.viewKind!=='plan'&&!isLookView(canonical)){ // an elevation or section is drawn read-only below (#2780); only an unknown or detail view still stays where it was
29105
29423
  const kind=canonical.viewKind||'unknown',current=C.plans[C.active];
29106
29424
  const hasProvisionals=provisionalMembersForView(viewIdOf(canonical)).length>0;
29107
29425
  if(((kind==='elevation'||kind==='section')&&hasProvisionals)||!current||current.viewKind!=='plan'){
@@ -29117,8 +29435,8 @@ function setPlan(i){
29117
29435
  syncPlanSwitcher(C.active);return;}
29118
29436
  C.active=i;
29119
29437
  NO_PLAN_VIEW=false;
29120
- svg.setAttribute('aria-label','2D model plan '+viewLabel(canonical));
29121
- V2_PROJECTION=v2ProjectionForView(viewIdOf(canonical));
29438
+ svg.setAttribute('aria-label',(isLookView(canonical)?'2D '+canonical.viewKind+' (view only) ':'2D model plan ')+viewLabel(canonical));
29439
+ V2_PROJECTION=isLookView(canonical)?elevationProjectionForView(viewIdOf(canonical)):v2ProjectionForView(viewIdOf(canonical));
29122
29440
  P=projectPlan();
29123
29441
  syncElevationContext();
29124
29442
  // clip = the drawing's display-space crop. A contract may ship WITHOUT a raster/clip (a shared or
@@ -30596,6 +30914,9 @@ modelPanelBridge=ModelPanelBridge.createModelPanelBridge({win:window,origin:loca
30596
30914
  panel:showLegendTab});
30597
30915
  modelPanelBridge.ready(String(PROJECT||APP_ID));modelPanelGeneration=modelEditGeneration;
30598
30916
  refreshChatLinks(false);window.addEventListener('focus',()=>refreshChatLinks(false));
30917
+ // #2470 R6.6c: the model and the RFI page are ready; FloLess answers with the step on screen (RFIs on a cold open).
30918
+ // Here, at the end of main(), because the RFI page lives in main(): boot() runs outside it and cannot see it.
30919
+ rfiPostShell({type:'floless:editor-ready'});
30599
30920
  } // end main()
30600
30921
  /* -- Structure / Quality: the two expandable stat groups ---------------------------------------------
30601
30922
  The row used to state six numbers at once. It now states two, each a button over a panel holding the