@floless/app 0.159.0 → 0.161.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.
- package/dist/floless-server.cjs +76823 -65608
- package/dist/schemas/steel.model.v2.schema.json +24 -0
- package/dist/skills/floless-app-onboarding/SKILL.md +4 -3
- package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +1 -2
- package/dist/skills/floless-app-rfi/SKILL.md +44 -3
- package/dist/skills/floless-app-steel-model/SKILL.md +2 -2
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +417 -261
- package/dist/templates/steel-model.flo +6 -2
- package/dist/templates/viewer-3d-demo.flo +8 -2
- package/dist/web/app.css +342 -160
- package/dist/web/app.js +17 -51
- package/dist/web/aware.js +656 -574
- package/dist/web/chat-question-card.js +27 -1
- package/dist/web/chat.css +185 -30
- package/dist/web/chat.js +2099 -255
- package/dist/web/commands-drawing-check.js +1 -0
- package/dist/web/commands-filter.js +11 -0
- package/dist/web/commands-shell.js +1118 -134
- package/dist/web/commands-steel.js +41 -38
- package/dist/web/drawing-check-editor.js +76 -3
- package/dist/web/guide.js +8 -0
- package/dist/web/index.html +68 -42
- package/dist/web/instructor.js +17 -6
- package/dist/web/pages.js +158 -30
- package/dist/web/panels.js +19 -1
- package/dist/web/project-history.js +349 -0
- package/dist/web/project-reconciliation.js +1 -0
- package/dist/web/project-rfis.js +954 -0
- package/dist/web/project-workflows.js +236 -4
- package/dist/web/run-history.js +198 -0
- package/dist/web/run-page-view.js +12 -2
- package/dist/web/startup-admission.js +53 -7
- package/dist/web/steel-3d-core.js +144 -7
- package/dist/web/steel-3d-view.js +61 -5
- package/dist/web/steel-editor.html +510 -128
- package/dist/web/steel-filter.html +139 -0
- package/dist/web/steel-model-v2-commands.js +3 -3
- package/dist/web/steel-model-v2-projection.js +139 -4
- package/dist/web/steel-plan-transform.js +78 -0
- package/dist/web/tool-updates.js +5 -0
- package/dist/web/workspaces.js +1438 -159
- package/launch.mjs +36 -5
- package/package.json +7 -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)}
|
|
@@ -1880,6 +1883,11 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
1880
1883
|
inline-block for max-width to apply at all, and vertical-align:bottom to hold its baseline with the
|
|
1881
1884
|
sibling chips (overflow:hidden makes an inline-block's bottom edge its own baseline). */
|
|
1882
1885
|
#srcStat{white-space:nowrap}
|
|
1886
|
+
/* #2521 row 5: the Quick model chip. Amber (= needs review, never an error), as last saved; dashed when unknown. */
|
|
1887
|
+
#quickStat{white-space:nowrap;color:var(--warn)}
|
|
1888
|
+
#quickStat.is-unknown{text-decoration:underline dashed;text-underline-offset:3px}
|
|
1889
|
+
.conf-quick{margin:0 0 8px;padding:6px 10px;border:1px solid var(--warn-edge);border-radius:6px;color:var(--mut);font-size:12px;line-height:1.45}
|
|
1890
|
+
.conf-quick b{color:var(--warn)}
|
|
1883
1891
|
#srcStat b{display:inline-block;max-width:130px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
|
|
1884
1892
|
#detailNewForm input#dnName{margin:2px 0 10px}
|
|
1885
1893
|
#dnDrop{border:1px dashed var(--ctrl-border);border-radius:8px;background:var(--sunken);min-height:88px;display:flex;align-items:center;justify-content:center;gap:12px;text-align:center;color:var(--mut);cursor:pointer;padding:12px;font-size:12px}
|
|
@@ -2006,6 +2014,8 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
2006
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 */
|
|
2007
2015
|
line.gridprev{stroke:var(--brand);stroke-width:1.2;stroke-dasharray:8 5;vector-effect:non-scaling-stroke;pointer-events:none;opacity:.9}
|
|
2008
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}
|
|
2009
2019
|
text.gridtx{fill:#e2e8f0;font-weight:700;font-family:system-ui;text-anchor:middle;dominant-baseline:central;pointer-events:none}
|
|
2010
2020
|
g.gridbubg:hover circle.gridbub{stroke:var(--brand);fill:#1e293b}
|
|
2011
2021
|
body.gridpick #svg,body.gridpick line.member,body.gridpick line.seg,body.gridpick image{cursor:crosshair}
|
|
@@ -2122,6 +2132,10 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
2122
2132
|
that already existed. (UX review.) */
|
|
2123
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)}
|
|
2124
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)}
|
|
2125
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}
|
|
2126
2140
|
#viewToggle .seg+.seg{border-left:1px solid var(--line)}
|
|
2127
2141
|
#viewToggle .seg:hover:not(:disabled){color:var(--text)}
|
|
@@ -2966,7 +2980,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
2966
2980
|
<div class=statgrp id=qualGrp>
|
|
2967
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>
|
|
2968
2982
|
<div class=statgrp-panel id=qualPanel hidden>
|
|
2969
|
-
<button data-command-id="steel.rfi-list" class="stat act" id=rfiStat aria-
|
|
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>
|
|
2970
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>
|
|
2971
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>
|
|
2972
2986
|
<!-- Written by refresh() and shown only when every count above is zero. A panel of four zeroes states
|
|
@@ -2998,9 +3012,12 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
2998
3012
|
<button data-command-id="steel.confidence-report" class=stat id=confStat data-tip="Confidence report — review recorded drawing evidence." style="display:none" aria-haspopup=dialog aria-controls=confModal><span id=confLabel>Confidence</span> <b id=confPct>—</b><span id=confTgt></span></button>
|
|
2999
3013
|
<span class=stat id=saveStat data-tip="Edits auto-save in this browser (localStorage)">Saved</span>
|
|
3000
3014
|
<span class=stat id=srcStat style="display:none"></span>
|
|
3015
|
+
<span class=stat id=quickStat data-command-id="steel.quick-model-chip" tabindex=0 style="display:none"></span>
|
|
3001
3016
|
<span class=tb-sep></span>
|
|
3002
3017
|
<button data-command-id="steel.undo" id=undoB data-tip="Undo (Ctrl+Z)">↶</button>
|
|
3003
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>
|
|
3004
3021
|
<button data-command-id="steel.ask-ai" id=askAiBtn aria-expanded=false aria-controls=askAiModal>Ask AI ▸</button>
|
|
3005
3022
|
<div id=moreWrap>
|
|
3006
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>
|
|
@@ -3334,8 +3351,11 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
3334
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>
|
|
3335
3352
|
<div id=rfiRaiseBanner role=status aria-live=polite aria-atomic=true hidden></div>
|
|
3336
3353
|
<div id=rfiRaiseList></div></div></div>
|
|
3337
|
-
|
|
3338
|
-
|
|
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>
|
|
3339
3359
|
<div id=rfiSub></div>
|
|
3340
3360
|
<div class=conf-filter id=rfiFilter></div>
|
|
3341
3361
|
<div id=rfiBanner role=status aria-live=polite aria-atomic=true hidden></div>
|
|
@@ -3343,9 +3363,9 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
3343
3363
|
<div id=rfiFail hidden></div>
|
|
3344
3364
|
<div id=rfiList></div>
|
|
3345
3365
|
<!-- #1090 5b-ii. The action outcome, announced. INSIDE the dialog rather than beside
|
|
3346
|
-
#connectionTruthStatus: that one sits outside #rfiModal, and a live region for
|
|
3347
|
-
|
|
3348
|
-
acceptable because every announcement happens while the
|
|
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. -->
|
|
3349
3369
|
<span id=rfiSay class=sr-only role=status aria-live=polite aria-atomic=true></span></div></div>
|
|
3350
3370
|
<!-- Reference-model import (#278): drop → probe → confirm. Three stages in one modal, the whole body
|
|
3351
3371
|
swapping per stage, so Insert is never a disabled button waiting for a condition to be met. -->
|
|
@@ -3484,6 +3504,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
3484
3504
|
</div></div>
|
|
3485
3505
|
<div id=confModal role=dialog aria-modal=true aria-labelledby=confTitle><div class=mbackdrop id=confBackdrop></div>
|
|
3486
3506
|
<div class=mpanel><div class=mhead><b id=confTitle>Confidence report</b><label class=conf-tgt data-tip="Confidence target for this read (%). Overrides the workflow default; saved with the contract.">Target <input data-command-id="steel.confidence-target" id=confTarget type=number min=0 max=100 step=1 placeholder="—"> % <span id=confTargetState></span></label><button data-command-id="steel.dialog-close#the confidence report" id=confClose aria-label="Close confidence report">✕</button></div>
|
|
3507
|
+
<div id=confQuick class=conf-quick role=note hidden></div>
|
|
3487
3508
|
<div id=confCats class=conf-cats></div>
|
|
3488
3509
|
<div id=confFilter class=conf-filter></div>
|
|
3489
3510
|
<div id=confBody class=conf-body></div></div></div>
|
|
@@ -4373,6 +4394,32 @@ function handleReviewChanged(m){
|
|
|
4373
4394
|
applying it to a sign-off would throw away the user's unsaved edits because another tab clicked a
|
|
4374
4395
|
button. A review generation moving is not a reason to lose work. */
|
|
4375
4396
|
markReviewDirty({storeRevision:reviewAt.storeRevision,reviewRevision:m.reviewRevision});}
|
|
4397
|
+
/* #2521 row 5: paint the Quick model chip from the server's `quick` (the snapshot served, or what a save stored). The
|
|
4398
|
+
server sends the words; a precise model, or no field, hides the chip. It describes the model AS LAST SAVED. */
|
|
4399
|
+
let lastSavedQuick=null;
|
|
4400
|
+
function paintQuickStat(q){
|
|
4401
|
+
if(q===undefined)return; // a reply whose body could not be read leaves the last label in place; null = precise
|
|
4402
|
+
lastSavedQuick=q&&(q.state==='quick'||q.state==='unknown')&&typeof q.short==='string'?q:null;
|
|
4403
|
+
const el=document.getElementById('quickStat');if(!el)return;
|
|
4404
|
+
// Precise: hide the chip AND clear an open confidence report's line, so both describe the same saved document.
|
|
4405
|
+
if(!lastSavedQuick){el.style.display='none';el.textContent='';el.removeAttribute('data-tip');if(typeof renderConfQuick==='function')renderConfQuick();return;}
|
|
4406
|
+
el.textContent=lastSavedQuick.short;
|
|
4407
|
+
el.classList.toggle('is-unknown',lastSavedQuick.state==='unknown');
|
|
4408
|
+
el.setAttribute('data-tip',(lastSavedQuick.label||'')+'. '+(lastSavedQuick.tip||'')+' Shown as last saved.');
|
|
4409
|
+
el.style.display='';
|
|
4410
|
+
if(typeof renderConfQuick==='function')renderConfQuick();
|
|
4411
|
+
}
|
|
4412
|
+
/* The confidence report's line: scoped to the last saved model, and it says so when the report shows unsaved edits. */
|
|
4413
|
+
function renderConfQuick(){
|
|
4414
|
+
const el=document.getElementById('confQuick');if(!el)return;
|
|
4415
|
+
if(!lastSavedQuick){el.hidden=true;el.textContent='';return;}
|
|
4416
|
+
el.textContent='';
|
|
4417
|
+
const b=document.createElement('b');b.textContent='As last saved: '+(lastSavedQuick.label||lastSavedQuick.short)+'.';
|
|
4418
|
+
el.appendChild(b);
|
|
4419
|
+
el.appendChild(document.createTextNode(' '+(lastSavedQuick.tip||'')
|
|
4420
|
+
+(editorHasUnsavedWork()?' This report includes changes not saved yet; the label is the last saved model’s.':'')));
|
|
4421
|
+
el.hidden=false;
|
|
4422
|
+
}
|
|
4376
4423
|
async function rebootstrapContractEvents(epoch,attempt=0){
|
|
4377
4424
|
if(epoch!==contractEventEpoch)return;contractEventReady=false;
|
|
4378
4425
|
try{
|
|
@@ -4749,6 +4796,7 @@ async function boot() {
|
|
|
4749
4796
|
// assigning before the type is validated would publish a document this editor cannot render — briefly
|
|
4750
4797
|
// live, and observable to anything that runs in between. Validate, then publish.
|
|
4751
4798
|
const snapshotPayload = await res.json();
|
|
4799
|
+
paintQuickStat(snapshotPayload && typeof snapshotPayload === 'object' ? (snapshotPayload.quick ?? null) : undefined);
|
|
4752
4800
|
const loaded = snapshotPayload && snapshotPayload.contract;
|
|
4753
4801
|
// Shape first, then type. A body that is null, an array or a scalar has no `type` to test, so a
|
|
4754
4802
|
// type-only gate waved it through and the failure surfaced as a raw red `boot().catch` — "Cannot read
|
|
@@ -5228,6 +5276,11 @@ function openChangeList(ctx) {
|
|
|
5228
5276
|
const headline = el('b', null, String(r.headline || '')); summary.appendChild(headline);
|
|
5229
5277
|
if (typeof r.weight === 'string' && r.weight) summary.appendChild(el('span', 'clweight', r.weight));
|
|
5230
5278
|
for (const n of (Array.isArray(r.notes) ? r.notes : [])) body.appendChild(el('div', 'clnote warn', String(n && n.text || '')));
|
|
5279
|
+
// #2521 row 5: each side says what IT rests on, above the changes, so a Quick side never reads as precise.
|
|
5280
|
+
const q = r.quick && typeof r.quick === 'object' ? r.quick : null;
|
|
5281
|
+
for (const [side, scope] of q ? [[q.base, 'Before'], [q.current, 'Now']] : []) {
|
|
5282
|
+
if (side && (side.state === 'quick' || side.state === 'unknown') && typeof side.label === 'string') body.appendChild(el('div', 'clnote warn', scope + ': ' + side.label + '.'));
|
|
5283
|
+
}
|
|
5231
5284
|
if (ctx && ctx.situation === 'A' && typeof r.targetEtag === 'string' && r.targetEtag !== serverEtag) body.appendChild(el('div', 'clnote', CHANGE_LIST_TEXT.changedAgain));
|
|
5232
5285
|
if (r.nothingChanged && typeof r.emptyBody === 'string') body.appendChild(el('p', 'clmsg quiet', r.emptyBody));
|
|
5233
5286
|
for (const g of (Array.isArray(r.groups) ? r.groups : [])) {
|
|
@@ -5469,6 +5522,7 @@ function installMemberEndContract(doc,etag,revision,keepHistory){
|
|
|
5469
5522
|
bumpRfiEpoch(); // #1090 — a server command replaced the model; the unresolved-size count is stale
|
|
5470
5523
|
const activePlan=C.plans&&C.plans[C.active];
|
|
5471
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
|
|
5472
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);}
|
|
5473
5527
|
syncElevationContext();
|
|
5474
5528
|
// A server command replaces the model underneath the editor's local history. Retaining those snapshots
|
|
@@ -5541,7 +5595,8 @@ async function memberEndRequest(path,body){
|
|
|
5541
5595
|
if(!PROJECT)throw new Error('Member-end review is available inside a project.');
|
|
5542
5596
|
const mutating=path!=='scan',mid=mutating?newMutationId():null,headers={'content-type':'application/json'};if(mutating){headers['x-floless-mutation-id']=mid;if(serverEtag)headers['if-match']=serverEtag;claimMutation(mid);}
|
|
5543
5597
|
let res;try{res=await fetch('/api/projects/'+encodeURIComponent(PROJECT)+'/member-ends/'+path,{method:'POST',headers,body:JSON.stringify(body)});}catch(e){if(mid)releaseMutation(mid);throw e;}
|
|
5544
|
-
const d=await res.json().catch(()=>({}));if(!res.ok){if(mid)releaseMutation(mid);const error=new Error(d.error||('Member-end request failed ('+res.status+')'));error.code=d.code;error.status=res.status;throw error;}
|
|
5598
|
+
const d=await res.json().catch(()=>({}));if(!res.ok){if(mid)releaseMutation(mid);const error=new Error(d.error||('Member-end request failed ('+res.status+')'));error.code=d.code;error.status=res.status;throw error;}if(d&&d.contract)paintQuickStat(d.quick??null); /* #2521 row 5: a reply carrying the model repaints its label; none means precise */
|
|
5599
|
+
return d;
|
|
5545
5600
|
}
|
|
5546
5601
|
async function scanMemberEnds(liveMessage,pinnedScope){ // pinnedScope: re-check the scope an open review was scanned with (Undo/Redo, a stale apply) instead of the view you are on; only the explicit "Check this sheet/3D model" rescan omits it
|
|
5547
5602
|
closeMore();if((memberEndScan&&memberEndScan.busy)||(memberEndReview&&memberEndReview.busy))return;if(!PROJECT){toast('Open this model from a project to check member ends.');return;}
|
|
@@ -5624,8 +5679,108 @@ async function undoMemberEndResolution(){if(!memberEndReview||memberEndReview.bu
|
|
|
5624
5679
|
// world-mm root member.
|
|
5625
5680
|
function v2ProjectionForView(viewId){
|
|
5626
5681
|
let projection=V2_PROJECTIONS.get(viewId);
|
|
5627
|
-
if(!projection){
|
|
5682
|
+
if(!projection){
|
|
5683
|
+
projection=V2Projection.createV2Projection(C,viewId,{session:V2_SESSION});V2_SESSION.registerProjection(projection);V2_PROJECTIONS.set(viewId,projection);}
|
|
5628
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;}
|
|
5629
5784
|
/* This row's identity — `id`, or the sheet name for a page carrying one view (#938). One accessor, so
|
|
5630
5785
|
nothing in this file has to decide whether `.sheet` means the page or the view. */
|
|
5631
5786
|
const viewIdOf=pl=>V2Projection?V2Projection.planViewId(pl):((pl&&pl.id)||(pl&&pl.sheet)||'');
|
|
@@ -5645,7 +5800,9 @@ function viewLabel(pl){
|
|
|
5645
5800
|
this whole change exists to end. Walk the sheets and take the first projection that actually has the
|
|
5646
5801
|
row. Stops at the first hit, so the ordinary one-sheet case still builds exactly one projection. */
|
|
5647
5802
|
function v2ProjectedMember(id){
|
|
5648
|
-
|
|
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;
|
|
5649
5806
|
for(const viewId of V2Projection.memberPlanViewIds(C,id)){
|
|
5650
5807
|
const row=v2ProjectionForView(viewId).plan.members.find(m=>m&&m.id===id);
|
|
5651
5808
|
if(row)return row;
|
|
@@ -5756,8 +5913,8 @@ function sourceViewList(rows){
|
|
|
5756
5913
|
return named.length<=1?named.join(''):named.slice(0,-1).join(', ')+' and '+named[named.length-1];}
|
|
5757
5914
|
function sourceOnlyLead(count,rows){
|
|
5758
5915
|
return (count===1?'This member was':'These '+count+' members were')+' read from '+sourceViewList(rows)+'. '
|
|
5759
|
-
+'
|
|
5760
|
-
+' in
|
|
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.'
|
|
5761
5918
|
+(rows.some(sourceViewUnaligned)?' Check '+(count===1?'its position':'their positions')+' in 3D before relying on '+(count===1?'it':'them')+'.':'');}
|
|
5762
5919
|
/* The same fact for a refused ACTION (a 3D drag, an RFI locate/resolve): what could not happen, which
|
|
5763
5920
|
members, why, and — from the caller, because it differs — the way forward. Null when none of `ids` is
|
|
@@ -5768,7 +5925,7 @@ function sourceOnlyBlockedText(ids,what,next){
|
|
|
5768
5925
|
const only=sourceOnlyIds(ids);if(!only.length)return null;
|
|
5769
5926
|
const one=only.length===1,rows=[...sourceOnlyViewsFor(only).values()];
|
|
5770
5927
|
return 'FloLess can’t '+what+' here: '+(one?only[0]+' was':only.join(', ')+' were')+' read from '+sourceViewList(rows)
|
|
5771
|
-
+', and
|
|
5928
|
+
+', and no plan view draws '+(one?'it':'them')+'. '+next(one);}
|
|
5772
5929
|
/* A 3D drag on such a member has no plan row to write through (`byId` answers nothing), so it used to be
|
|
5773
5930
|
accepted and silently do nothing. Say why instead, open no empty undo step, and REBUILD the scene the
|
|
5774
5931
|
way `edit()` would have: the 3D view moves its own mesh during the drag preview and does not put it
|
|
@@ -6673,7 +6830,16 @@ function openMaterialPicker({ids=[],current=null,scope='',invoker,onApply}={}){
|
|
|
6673
6830
|
source:`${materialCatalog?.provider?.label||'Material catalog'} · ${env}`,onApply:onApply||((value)=>applyMaterialChoice(targets,value))});
|
|
6674
6831
|
}
|
|
6675
6832
|
let basePickColId=null; // Mode B: the column whose base an armed 3D level-pick retargets
|
|
6676
|
-
|
|
6833
|
+
// Never trim a column below a minimum stub (keeps bos < tos). A FUNCTION, not a constant, because
|
|
6834
|
+
// the number is a drafting convention and a metric project's is a round 300 mm rather than the
|
|
6835
|
+
// 304.8 a converted foot lands on (owner ruling, Pawel, 2026-10-23). Keyed on the project's
|
|
6836
|
+
// ENVIRONMENT — immutable, and a property of the project — never on `displayUnits`, which is a
|
|
6837
|
+
// view preference a person flips at will; a geometry clamp that moved with a display toggle would
|
|
6838
|
+
// make the same model trim differently depending on who was looking at it.
|
|
6839
|
+
// Read off the CONTRACT's own environment, the same field `columnBelowReachOf` reads, so the clamp
|
|
6840
|
+
// the editor applies and the reach a sheet draws can never resolve to different standards. The
|
|
6841
|
+
// server stamps it on write (`stampSteelEnvironment`), so a UK contract always carries it.
|
|
6842
|
+
const minColStubMm=()=>SteelCore.defaultColumnBelowReach(C&&C.environment);
|
|
6677
6843
|
// Mode B: arm the 3D column-base pick on `colId` (a level-snapped elevation → col.bosMm). 3D-view only.
|
|
6678
6844
|
function armBaseTrim(colId){
|
|
6679
6845
|
if(!view3d){toast('Open the 3D view to pick the column base point');return;}
|
|
@@ -6741,6 +6907,7 @@ function apply(json,noSave){
|
|
|
6741
6907
|
// transform refuses anything that is not a plan: the same placeholder `setPlan` installs for it, then.
|
|
6742
6908
|
const activeView=C.plans&&C.plans[C.active];
|
|
6743
6909
|
if(activeView&&activeView.viewKind==='plan'){V2_PROJECTION=v2ProjectionForView(viewIdOf(activeView));P=projectPlan();}
|
|
6910
|
+
else if(installElevationViewState(activeView)){} // #2780: …and across an undo/redo
|
|
6744
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};}
|
|
6745
6912
|
syncElevationContext();
|
|
6746
6913
|
updCS();
|
|
@@ -7147,7 +7314,7 @@ async function persistServer(force,token){const seq=saveSeq;
|
|
|
7147
7314
|
// write is usually still in flight — the server broadcasts before it replies — so releasing here would
|
|
7148
7315
|
// make the tab read its OWN echo as external and reload itself mid-edit. The id is released when the
|
|
7149
7316
|
// echo consumes it, when the write fails, or when the SSE channel closes (nothing can echo after that).
|
|
7150
|
-
if(res.ok){let d={},bodyReadable=true;try{d=await res.json();}catch(_){bodyReadable=false;}const t=d.etag||res.headers.get('ETag');if(d.contract&&t&&Number.isSafeInteger(d.storeRevision))adoptSaveReply(d.contract,t,d.storeRevision,seq);else{if(t){const pv=serverEtag;serverEtag=t;restampDraftBase(pv,t);}if(Number.isSafeInteger(d.storeRevision))serverRevision=Math.max(serverRevision,d.storeRevision);serverDecided=sentDecided;if(seq!==saveSeq)reconcileDecisions();}conflicted=false;lastSeenCommitOwnSave(t,d,bodyReadable,sentCopy);
|
|
7317
|
+
if(res.ok){let d={},bodyReadable=true;try{d=await res.json();}catch(_){bodyReadable=false;}paintQuickStat(bodyReadable?(d.quick??null):undefined);const t=d.etag||res.headers.get('ETag');if(d.contract&&t&&Number.isSafeInteger(d.storeRevision))adoptSaveReply(d.contract,t,d.storeRevision,seq);else{if(t){const pv=serverEtag;serverEtag=t;restampDraftBase(pv,t);}if(Number.isSafeInteger(d.storeRevision))serverRevision=Math.max(serverRevision,d.storeRevision);serverDecided=sentDecided;if(seq!==saveSeq)reconcileDecisions();}conflicted=false;lastSeenCommitOwnSave(t,d,bodyReadable,sentCopy);
|
|
7151
7318
|
// The write COMMITTED. Apply its revalidation report ONLY when we can prove it describes the live `C`:
|
|
7152
7319
|
// the body was readable AND `seq===saveSeq` (no newer edit landed while this PUT was in flight). Otherwise
|
|
7153
7320
|
// do NOTHING — no merge, no bookkeeping. That is safe because a joint whose removal we then miss is
|
|
@@ -7247,7 +7414,7 @@ async function flushContractWith(token, signal) {
|
|
|
7247
7414
|
showConflictBanner();
|
|
7248
7415
|
throw new Error('save conflict');
|
|
7249
7416
|
}
|
|
7250
|
-
if (res.ok) { let d = {}, bodyReadable = true; try { d = await res.json(); } catch (_) { bodyReadable = false; } if(signal&&signal.aborted)quarantineMutation(mid, seq); const t = d.etag || res.headers.get('ETag'); adoptedTag = t || null; if (d.contract && t && Number.isSafeInteger(d.storeRevision)) { const generationBefore = modelEditGeneration; adoptSaveReply(d.contract, t, d.storeRevision, seq); /* #1936 - installing the reply re-bumps the generation although nothing the person looked at changed; report the post-install generation, but ONLY when nothing visible moved between the PUT and the install (a genuine concurrent edit still shows as a mismatch) */ if (generationBefore === publishedGeneration && modelEditGeneration === generationBefore + 1) publishedGeneration = modelEditGeneration; } else { if (t) { const pv = serverEtag; serverEtag = t; restampDraftBase(pv, t); } if (Number.isSafeInteger(d.storeRevision)) serverRevision = Math.max(serverRevision, d.storeRevision); serverDecided = sentDecided; if (seq !== saveSeq) reconcileDecisions(); } conflicted = false; lastSeenCommitOwnSave(t, d, bodyReadable, sentCopy);
|
|
7417
|
+
if (res.ok) { let d = {}, bodyReadable = true; try { d = await res.json(); } catch (_) { bodyReadable = false; } paintQuickStat(bodyReadable ? (d.quick ?? null) : undefined); if(signal&&signal.aborted)quarantineMutation(mid, seq); const t = d.etag || res.headers.get('ETag'); adoptedTag = t || null; if (d.contract && t && Number.isSafeInteger(d.storeRevision)) { const generationBefore = modelEditGeneration; adoptSaveReply(d.contract, t, d.storeRevision, seq); /* #1936 - installing the reply re-bumps the generation although nothing the person looked at changed; report the post-install generation, but ONLY when nothing visible moved between the PUT and the install (a genuine concurrent edit still shows as a mismatch) */ if (generationBefore === publishedGeneration && modelEditGeneration === generationBefore + 1) publishedGeneration = modelEditGeneration; } else { if (t) { const pv = serverEtag; serverEtag = t; restampDraftBase(pv, t); } if (Number.isSafeInteger(d.storeRevision)) serverRevision = Math.max(serverRevision, d.storeRevision); serverDecided = sentDecided; if (seq !== saveSeq) reconcileDecisions(); } conflicted = false; lastSeenCommitOwnSave(t, d, bodyReadable, sentCopy);
|
|
7251
7418
|
// The flush committed. Same rule as persistServer: apply the report only when the body was readable and
|
|
7252
7419
|
// `seq===saveSeq` (Approve awaits this flush, so the user CAN edit meanwhile and make it stale). Otherwise
|
|
7253
7420
|
// do nothing — the next save re-introduces any joint whose removal we missed, and the server re-decides it.
|
|
@@ -8923,7 +9090,7 @@ function sheetDerivedIds(ids,presence){
|
|
|
8923
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);
|
|
8924
9091
|
return [...new Set(ids)].filter(id=>{
|
|
8925
9092
|
const m=byMemberId.get(id);if(!m||m.role!=='column')return false;
|
|
8926
|
-
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;});
|
|
8927
9094
|
}
|
|
8928
9095
|
/** True (and said) when a Delete asks only about columns this sheet derives: there is nothing to delete, so NO edit is
|
|
8929
9096
|
opened at all (no empty undo step, no "unsaved" mark) and the selection stays, which keeps the explaining notice up. */
|
|
@@ -9668,7 +9835,8 @@ function applyZoom(z,ax,ay){z=Math.max(ZMIN,Math.min(ZMAX,z));
|
|
|
9668
9835
|
updateBadges();refreshProfileLabelOverlay();}
|
|
9669
9836
|
function fitToWindow(){applyZoom(Math.min(stage.clientWidth/EXTX,stage.clientHeight/EXTY)*0.98);}
|
|
9670
9837
|
// --- duplicate the selected member(s) in place (Ctrl+D) ---
|
|
9671
|
-
function doDup(){const arr=sel2d();if(!arr.length)return;
|
|
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();
|
|
9672
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
|
|
9673
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)
|
|
9674
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
|
|
@@ -10023,6 +10191,7 @@ function render(){
|
|
|
10023
10191
|
const profileFocusToken=profilePickerFocusToken();
|
|
10024
10192
|
// Arming ANY other tool ends the + Callout tool. Every tool arm ends in a render(), so this one line covers them
|
|
10025
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
|
|
10026
10195
|
if(calloutEditMode&&(mode!=='sel'||dimMode||dimChain||dimSplitMode||csaxisMode||gridMode||gridPick||gridLinePick||dimStyleMode||cmTool||picking||geoMode||qdPick||view3d||NO_PLAN_VIEW)){
|
|
10027
10196
|
calloutEditMode=false;document.body.classList.remove('calloutedit');closeCalloutForm();}
|
|
10028
10197
|
syncCalloutButton();
|
|
@@ -10048,6 +10217,7 @@ function render(){
|
|
|
10048
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
|
|
10049
10218
|
let s=overlaySvg(); // reviewed source image (inert) beneath crisp Filter vectors (the only snap authority)
|
|
10050
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
|
|
10051
10221
|
s+=provisionalMembersSvg();
|
|
10052
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]}"/>`;
|
|
10053
10223
|
for(const m of P.members){if(!visible2d(m))continue; // hidden or isolated away in this sheet's Objects list
|
|
@@ -10059,8 +10229,8 @@ function render(){
|
|
|
10059
10229
|
// on a canvas whose own counter said there were none, with no row anywhere to clear it. One source
|
|
10060
10230
|
// of truth for "is this an RFI", and it is the same one everything else already uses. (code review)
|
|
10061
10231
|
const rfi=_wtPlf(m.profile)==null;
|
|
10062
|
-
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)
|
|
10063
|
-
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
|
|
10064
10234
|
// A placeholder footprint on a member that is NOT an RFI reads as a real, small section — the size is
|
|
10065
10235
|
// the one thing on this canvas it cannot be trusted for, so it says so rather than looking resolved.
|
|
10066
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.`:'';
|
|
@@ -10076,7 +10246,7 @@ function render(){
|
|
|
10076
10246
|
// A column below the floor whose footprint cannot be built falls to this line, and must still say what it is (#2214).
|
|
10077
10247
|
const _lcb=(m.role==='column'&&m.belowCut)?colBelowInfo(m):null,_lt=_lcb?` data-tip="${esc(_lcb.tip)}"`:'';
|
|
10078
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}/>`;}
|
|
10079
|
-
{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
|
|
10080
10250
|
if(mode==='add'||(picking&&pickKind==='profile')){
|
|
10081
10251
|
const armed=picking&&pickKind==='profile';profileLabelState=profileLabelQuery(armed);
|
|
10082
10252
|
s+=`<g id=profileLabelOverlay>${profileLabelMarkup(profileLabelState.labels)}</g>`;
|
|
@@ -10116,7 +10286,7 @@ function render(){
|
|
|
10116
10286
|
// `profs` and `detTexts()` live — so the combobox offers the same list with no mirror to keep filled.
|
|
10117
10287
|
// Deleting the elements while these two writes stayed made render() throw on null here, which also
|
|
10118
10288
|
// killed every call after it on this line (stats/panel/upd*/syncDisplayRows). Measured in Chromium.
|
|
10119
|
-
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();
|
|
10120
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()).
|
|
10121
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)
|
|
10122
10292
|
syncLegendToPane(); // the Objects list: the selection, and in 2D the sheet it lists
|
|
@@ -10193,6 +10363,15 @@ function paintRegBanner(){
|
|
|
10193
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;
|
|
10194
10364
|
bar.classList.toggle('plain',counts.every(row=>row.reason==='view-unregistered-unstarted'));bar.classList.add('on');placeRegBanner(bar);return;
|
|
10195
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;}
|
|
10196
10375
|
if(cta)cta.textContent="This can't be fixed here — ask your terminal AI to correct the sheet's registration.";
|
|
10197
10376
|
if(detBtn)detBtn.hidden=false;if(copyBtn)copyBtn.hidden=false;if(reviewBtn)reviewBtn.hidden=true;if(sourceBtn)sourceBtn.hidden=true;
|
|
10198
10377
|
if(!refusal){bar.classList.remove('on');bar.classList.remove('plain');return;}
|
|
@@ -10291,11 +10470,23 @@ function cutLeadText(name,total,shown){
|
|
|
10291
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.');
|
|
10292
10471
|
return head+'The model has '+total+' columns; this sheet shows '+shown+' of them.';
|
|
10293
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
|
+
}
|
|
10294
10485
|
function cutNoticeText(st,name){
|
|
10295
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'};
|
|
10296
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'};
|
|
10297
10488
|
const level=fmtDispElev(st.plan.elevation_mm);
|
|
10298
|
-
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'};
|
|
10299
10490
|
}
|
|
10300
10491
|
function paintCutBanner(){
|
|
10301
10492
|
const bar=document.getElementById('cutBanner'),pill=document.getElementById('cutPill');if(!bar||!pill)return;
|
|
@@ -10426,20 +10617,35 @@ function updateBadges(){const R=12/zoom,F=13/zoom,ox=el=>(+el.dataset.fi-(+el.da
|
|
|
10426
10617
|
// (brace arrowheads need no rescale here — they are content-unit sized, so they scale with the member
|
|
10427
10618
|
// stroke exactly like the line they cap. See braceHeadPoints().)
|
|
10428
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)
|
|
10429
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
|
|
10430
10622
|
// property-label chips: recompute size + stacked screen offset from the baked anchor (ax,ay) + per-row screen
|
|
10431
10623
|
// offset (off) so they stay constant on screen while zooming (like dim chips) — AND re-apply the zoom
|
|
10432
10624
|
// threshold live (data-mlen × zoom), so zooming reveals/hides labels as members cross ~24px on screen.
|
|
10433
|
-
|
|
10434
|
-
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;
|
|
10435
|
-
const show=plabelVisible(+r.dataset.mlen);r.style.display=show?'':'none';if(!show)hid++;
|
|
10436
|
-
r.setAttribute('width',w);r.setAttribute('height',h);r.setAttribute('x',(+r.dataset.ax)-w/2);r.setAttribute('y',cy-h/2);});
|
|
10437
|
-
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';});
|
|
10438
|
-
propLabelsHidden=hid;updatePropHint();}} // hid counts hidden chip ROWS (>0 ⇒ note shows) — the note only needs the boolean
|
|
10625
|
+
layoutPropLabels2d();
|
|
10439
10626
|
{const mlG=svg.querySelector('g.mlenlabels');if(mlG){ // on-select length chips: same zoom-rescale + threshold as the property chips
|
|
10440
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);});
|
|
10441
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';});}}
|
|
10442
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
|
|
10443
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]);});}
|
|
10444
10650
|
function updateLine(m){
|
|
10445
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)
|
|
@@ -10462,10 +10668,10 @@ function showStat(id){const el=document.getElementById(id);if(el)el.style.displa
|
|
|
10462
10668
|
function structureScope(is3d,noPlanView){return is3d?'model':noPlanView?'none':'sheet';}
|
|
10463
10669
|
function structureMembers(scope,planMembers,modelMembers){return scope==='model'?modelMembers:planMembers;}
|
|
10464
10670
|
/** Plain-English note + tooltip for the Structure panel, stating which scope the numbers are. */
|
|
10465
|
-
function structureCopy(scope,sheetName){
|
|
10671
|
+
function structureCopy(scope,sheetName,what){what=what||'plan sheet';
|
|
10466
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'};
|
|
10467
10673
|
const nm=sheetName?' ('+sheetName+')':'';
|
|
10468
|
-
return {note:'Members on this
|
|
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'};}
|
|
10469
10675
|
/** Repaint the Structure readouts when the VIEW changes (2D / 3D / Split, active pane) — those do not render(),
|
|
10470
10676
|
* and stats() is otherwise only reached from render(). Quiet before the model has loaded. */
|
|
10471
10677
|
function refreshStructureStats(){if(C&&P)stats();}
|
|
@@ -10487,7 +10693,7 @@ function stats(){
|
|
|
10487
10693
|
// repeat the reason.
|
|
10488
10694
|
//
|
|
10489
10695
|
// A model with no plan view cannot report plan-derived counts honestly. A projected plan can.
|
|
10490
|
-
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
|
|
10491
10697
|
if(scope==='none'){for(const id of PLAN_STATS)hideStat(id);return;}
|
|
10492
10698
|
// REVERSIBLE, and this line is the whole of it: hideStat writes an INLINE display:none that nothing else
|
|
10493
10699
|
// clears, so without this the first no-plan-view sheet would hide these four permanently — including
|
|
@@ -10496,7 +10702,7 @@ function stats(){
|
|
|
10496
10702
|
for(const id of PLAN_STATS)showStat(id);
|
|
10497
10703
|
const counted=structureMembers(scope,P.members,allMembers());
|
|
10498
10704
|
document.getElementById('mc').textContent=counted.length;
|
|
10499
|
-
{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');
|
|
10500
10706
|
if(note&¬e.textContent!==cp.note)note.textContent=cp.note;if(btn)btn.setAttribute('data-tip',cp.tip);}
|
|
10501
10707
|
// In the project's own units: feet x lb/ft -> lb -> short tons, or metres x kg/m -> kg -> tonnes.
|
|
10502
10708
|
// A member with no billable weight is simply skipped here; it is counted by `paintRfiStat` above,
|
|
@@ -10651,17 +10857,23 @@ function notOnViewHtml(missing,total,presence){
|
|
|
10651
10857
|
function wireAddToSheet(root,missing){const b=root.querySelector('[data-add-to-sheet]');if(b){b.onclick=()=>{addToThisSheet(missing);};keyActivates(b);}}
|
|
10652
10858
|
/** Resolve selected projected rows once for this refresh; lazy projections build their own fresh presence data. */
|
|
10653
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)){
|
|
10654
10865
|
const rows=new Map();
|
|
10655
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;};
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
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)){
|
|
10659
10871
|
if(!rows.has(viewId))rows.set(viewId,mapRows(v2ProjectionForView(viewId).plan));
|
|
10660
|
-
member=rows.get(viewId).get(id);if(member)
|
|
10872
|
+
const member=rows.get(viewId).get(id);if(member)return member;
|
|
10661
10873
|
}
|
|
10662
|
-
|
|
10663
|
-
}
|
|
10664
|
-
|
|
10874
|
+
return undefined;
|
|
10875
|
+
};}
|
|
10876
|
+
|
|
10665
10877
|
function syncV2SelectionNotice(p){
|
|
10666
10878
|
if(!p||!selIds.size||viewPropsId)return; // a view in the panel keeps the selection, not its notices
|
|
10667
10879
|
p.querySelectorAll('.v2-selection-notice,.v2-elevation-warning,.v2-elevation-proposal,.v2-elevation-answered').forEach(el=>el.remove());
|
|
@@ -10763,7 +10975,7 @@ function syncV2SelectionNotice(p){
|
|
|
10763
10975
|
// sentence above would be false for it: say which view it came from and that the edits below skip it.
|
|
10764
10976
|
const onlyLost=sourceOnlyIds(lost,presence),sourceReason=onlyLost.length
|
|
10765
10977
|
?' '+(onlyLost.length===1?onlyLost[0]+' was':onlyLost.join(', ')+' were')+' read from '+sourceViewList([...sourceOnlyViewsFor(onlyLost,presence).values()])
|
|
10766
|
-
+';
|
|
10978
|
+
+'; no plan view draws '+(onlyLost.length===1?'it':'them')+', so the edits below don’t change '+(onlyLost.length===1?'it':'them')+'.':'';
|
|
10767
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;
|
|
10768
10980
|
row.appendChild(msg);if(after)after.after(row);else p.prepend(row);after=row;}}
|
|
10769
10981
|
const selectedIds=new Set(ids),selected=[...presence.members.values()].filter(m=>selectedIds.has(m.id));
|
|
@@ -10790,6 +11002,11 @@ function syncV2SelectionNotice(p){
|
|
|
10790
11002
|
* The first sentence is the model's own fact (`assumed`); the proposal and its wording are the server's,
|
|
10791
11003
|
* from the last questions read — nothing here decides which height is right.
|
|
10792
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)+')':'');}
|
|
10793
11010
|
function inspectorHeightNotes(m,canonical){
|
|
10794
11011
|
const ids=m.role==='column'?['bos','tosC']:['tosA','tosB'];
|
|
10795
11012
|
[0,1].forEach(end=>{
|
|
@@ -10810,7 +11027,7 @@ function inspectorHeightNotes(m,canonical){
|
|
|
10810
11027
|
const said=a.how==='typed'?'You typed '+(a.typed||fmtDispElev(z.known)):'You confirmed '+(a.shownAs||fmtDispElev(z.known));
|
|
10811
11028
|
const text=document.createElement('span');
|
|
10812
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)':'';
|
|
10813
|
-
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.';
|
|
10814
11031
|
box.append(chip,text);
|
|
10815
11032
|
// #1906: the person's source note and pictures travel with the answer, so the model says why.
|
|
10816
11033
|
if(typeof a.note==='string'&&a.note){const note=document.createElement('span');note.textContent=' Source: '+a.note+'.';box.append(note);}
|
|
@@ -11334,6 +11551,7 @@ function panel(){
|
|
|
11334
11551
|
}
|
|
11335
11552
|
}}
|
|
11336
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
|
|
11337
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;}
|
|
11338
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
|
|
11339
11557
|
if(dimStyleMode){renderDimStylePanel(p);return;}
|
|
@@ -11680,7 +11898,7 @@ function panel(){
|
|
|
11680
11898
|
user their click did nothing. */
|
|
11681
11899
|
const onlyIds=new Set(sourceOnlyIds(canon.map(m=>m.id),inspectorPresence)),onlyRows=canon.filter(m=>onlyIds.has(m.id));
|
|
11682
11900
|
if(onlyRows.length){
|
|
11683
|
-
p.innerHTML='<h3>
|
|
11901
|
+
p.innerHTML='<h3>Not on a plan</h3><div class="dmsg" style="margin-top:8px;flex:none">'
|
|
11684
11902
|
+esc(sourceOnlyLead(onlyRows.length,[...sourceOnlyViewsFor([...onlyIds],inspectorPresence).values()]))+'</div>'
|
|
11685
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’t yet edit a member shown only on an elevation or section.</div>'
|
|
11686
11904
|
+refusedSheetPropsHtml(onlyRows);
|
|
@@ -12040,27 +12258,38 @@ function panel(){
|
|
|
12040
12258
|
// Bottom = BOS, Top = TOS (respecting the "follow default" flag). A beam's two ends can differ in all of X/Y/Z.
|
|
12041
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));
|
|
12042
12260
|
const _dpZmm=i=>col?_dpColZ(i):effEndTos(m.ends[i]); // WORLD MM, both branches
|
|
12043
|
-
|
|
12044
|
-
const
|
|
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])
|
|
12045
12271
|
const _dpToLocal=g=>{ // world-MM [x,y,z] → local-MM, or null
|
|
12046
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
|
|
12047
|
-
if(_dp2d){const o=P.frame.o,u=P.frame.u,
|
|
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];
|
|
12048
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)
|
|
12049
12275
|
return null;};
|
|
12050
12276
|
const _dpFromLocal=l=>{ // local-MM [x,y,z] → world-MM, or null
|
|
12051
12277
|
if(_dp3d)return SteelCore.localToWorld(l,_dpFI);
|
|
12052
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];
|
|
12053
|
-
return [
|
|
12279
|
+
const w=_dpPx2W(px,py);return [w[0],w[1],l[2]];}
|
|
12054
12280
|
return null;};
|
|
12055
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
|
|
12056
12282
|
// point's elevation (Bottom→col.bosMm, Top→col.tosMm). Touch the elevation ONLY when world Z actually changed, so a
|
|
12057
12283
|
// plain X/Y move keeps a default-following Top on the sheet default (a tilted-frame local edit that really moves
|
|
12058
12284
|
// Z still clears it). Same per-end TOS rule for a beam.
|
|
12059
|
-
|
|
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;
|
|
12060
12289
|
const mc=MC();
|
|
12061
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]
|
|
12062
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
|
|
12063
|
-
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]);}});};
|
|
12064
12293
|
const _dpAxes=['X','Y','Z'];
|
|
12065
12294
|
const _dpPH=esc(lenExample()); // a coordinate component is a LENGTH, so its example follows the project's units
|
|
12066
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)
|
|
@@ -12115,7 +12344,7 @@ function panel(){
|
|
|
12115
12344
|
${memberTypeField('mTypeS',[m])}
|
|
12116
12345
|
<div class="f"><div class=elab>Profile</div><div style="display:flex;gap:6px"><input data-command-id="steel.member-profile" aria-label="Profile" id=pf class=combo data-src=profiles value="${esc(m.profile)}" style="flex:1" autocomplete=off><button data-command-id="steel.browse-profile-catalog" id=profileBrowseS class=ghost aria-label="Search the profile catalog" data-tip="Search the profile catalog — 4,516 profiles, by designation or alias"><svg viewBox="0 0 16 16" aria-hidden=true width=13 height=13 fill=none stroke=currentColor stroke-width=1.4 stroke-linecap=round><circle cx="6.9" cy="6.9" r="4.3"/><path d="M10.1 10.1 13.7 13.7"/></svg></button><button data-command-id="steel.pick-profile" id=pickProf class="ghost${(picking&&pickKind==='profile')?' on':''}" aria-pressed="${(picking&&pickKind==='profile')?'true':'false'}" aria-label="Pick profile from a drawing label" data-tip="Pick profile from drawing labels by click, Enter, or Space">⌖</button></div>${(picking&&pickKind==='profile')?'<div class="hint" data-profile-pick-status role=status aria-live=polite style="margin-top:4px;font-style:italic;color:var(--brand)">'+esc(profilePickGuidance())+'</div>':''}</div>
|
|
12117
12346
|
<div class="f"><div class=elab>Material grade</div><div style="display:flex;gap:6px"><input data-command-id="steel.member-material" aria-label="Material grade" id=mat class=combo data-src=materials value="${esc(m.material||'')}" placeholder="Profile default · ${esc(profileDefaultMaterial(m.profile))}" style="flex:1" autocomplete=off data-tip="${m.material?'This member carries its own grade, so it will not follow a profile change':'Empty — follows the profile’s default grade. Type or browse to give this member its own.'}"><button data-command-id="steel.browse-material-catalog" id=materialBrowseS class=ghost aria-label="Search material grades" data-tip="Search the material catalog by name or alias"><svg viewBox="0 0 16 16" aria-hidden=true width=13 height=13 fill=none stroke=currentColor stroke-width=1.4 stroke-linecap=round><circle cx="6.9" cy="6.9" r="4.3"/><path d="M10.1 10.1 13.7 13.7"/></svg></button><span class=pslot aria-hidden=true></span></div></div>
|
|
12118
|
-
<div class="row hint">Length <b>${L}</b> · ${wpf==null?'<span id=rfiPill class="pill pill-clickable" role=button tabindex=0 data-tip="Open the RFI list, focused on this member" style="background:var(--err-bg)">RFI — size unresolved</span>':
|
|
12347
|
+
<div class="row hint">Length <b>${L}</b> · ${wpf==null?'<span id=rfiPill class="pill pill-clickable" role=button tabindex=0 data-tip="Open the RFI list, focused on this member" style="background:var(--err-bg)">RFI — size unresolved</span>':_memberWeightHint(m,wpf)}</div>
|
|
12119
12348
|
<div class=elab>Verified</div><span class=vwrap data-panel-control><button data-command-id="steel.member-verified" id=verifyBtn class="vbtn${m.verified?' on':''}" aria-pressed="${m.verified?'true':'false'}" data-tip="Mark this member human-confirmed">${m.verified?'✓ Human-confirmed':'Mark verified'}</button></span>
|
|
12120
12349
|
${mfSect}
|
|
12121
12350
|
${appearanceSect}
|
|
@@ -12428,6 +12657,7 @@ function foldRowButtons(row){
|
|
|
12428
12657
|
}
|
|
12429
12658
|
function applyPanelRows(){
|
|
12430
12659
|
const p=document.getElementById('panel');if(!p)return;
|
|
12660
|
+
const labels=[];
|
|
12431
12661
|
const STOP=el=>el.classList&&(el.classList.contains('elab')||el.classList.contains('sect')||el.classList.contains('divrow'));
|
|
12432
12662
|
for(const lab of [...p.querySelectorAll('.elab')]){
|
|
12433
12663
|
if(!lab.parentElement||lab.closest('.prow'))continue;
|
|
@@ -12474,8 +12704,11 @@ function applyPanelRows(){
|
|
|
12474
12704
|
for(const nEl of notes){nEl.classList.add('phint');row.appendChild(nEl);}
|
|
12475
12705
|
}
|
|
12476
12706
|
if(!row.classList.contains('stack'))foldRowButtons(row);
|
|
12477
|
-
if(lab.
|
|
12707
|
+
if(!lab.dataset.tip)labels.push(lab);
|
|
12478
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();
|
|
12479
12712
|
}
|
|
12480
12713
|
function applyPanelFolding(){
|
|
12481
12714
|
const p=document.getElementById('panel');if(!p)return;
|
|
@@ -12588,7 +12821,8 @@ const selGridOK=()=>selFilter.grid!==false;
|
|
|
12588
12821
|
const selDimOK=()=>selFilter.dim!==false;
|
|
12589
12822
|
const selReferenceOK=()=>selFilter.reference!==false;
|
|
12590
12823
|
// classify any id already in / entering selIds — connection part, placed detail, or plain member — → allowed?
|
|
12591
|
-
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=
|
|
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));}
|
|
12592
12826
|
// a type fires when a transient override forces exactly it (override ignores running-snaps, AutoCAD-style), else when its running-snap is on
|
|
12593
12827
|
const snapAllowed=k=>snapOnly?snapOnly===k:snapEnabled[k]!==false;
|
|
12594
12828
|
const _mid=(a,b)=>[(a[0]+b[0])/2,(a[1]+b[1])/2];
|
|
@@ -12988,7 +13222,8 @@ function syncActiveViewLabels(){refreshPropLabels3d();updPlToggle();}
|
|
|
12988
13222
|
function labelTargetName(is3d){if(!is3d)return '2D plan';const v=viewById(activeViewId);
|
|
12989
13223
|
return v?'3D · '+(String(v.name||'').trim()||'Untitled view'):'3D default';}
|
|
12990
13224
|
function propLabelMembers(is3d=false,target=labelTarget(is3d,is3d?activeViewId:null)){const pl=C.prop_labels;if(!pl||!pl.props.length)return [];
|
|
12991
|
-
|
|
13225
|
+
const lookup=is3d?projectedMemberLookup():null;
|
|
13226
|
+
let base=is3d?allMembers().map(m=>lookup(m.id)||m):P.members.filter(visible2d);
|
|
12992
13227
|
const sc=target.scope;
|
|
12993
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));}
|
|
12994
13229
|
return base.filter(m=>propLabelLinesFor(m).length>0);}
|
|
@@ -13059,8 +13294,8 @@ function renderPropLabels(){const pl=C.prop_labels;propLabelsHidden=0;if(!pl||!p
|
|
|
13059
13294
|
const anc=pl.placement==='start'?a:pl.placement==='end'?b:[(a[0]+b[0])/2,(a[1]+b[1])/2];
|
|
13060
13295
|
const n=lines.length,hide=show?'':';display:none';
|
|
13061
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;
|
|
13062
|
-
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}"/>`
|
|
13063
|
-
+`<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>`;});}
|
|
13064
13299
|
propLabelsHidden=hidden;
|
|
13065
13300
|
return `<g class="pllabels">${s}</g>`;}
|
|
13066
13301
|
// fixed-screen corner note when the zoom threshold is hiding labels (an HTML pill, outside the zoomed SVG)
|
|
@@ -13075,14 +13310,14 @@ function updatePropHint(){let el=document.getElementById('plHint');
|
|
|
13075
13310
|
if(!show){if(el)el.style.display='none';return;}
|
|
13076
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);}
|
|
13077
13312
|
const st=document.getElementById('stage').getBoundingClientRect();
|
|
13078
|
-
el.textContent='
|
|
13313
|
+
el.textContent='Some labels hidden — zoom in to see more';el.style.display='block';
|
|
13079
13314
|
el.style.left=(st.left+st.width/2-70)+'px';el.style.top=(st.bottom-30)+'px';}
|
|
13080
13315
|
|
|
13081
13316
|
// ---- 3D bridge: hand the label spec to the 3D view (it owns projection/placement over member geometry) ----
|
|
13082
13317
|
function refreshPropLabels3d(){const V=window.Steel3DView;if(!V||!V.setPropLabels)return;
|
|
13083
13318
|
const pl=C.prop_labels,t=pl&&labelTarget(true,activeViewId); // resolved ONCE, so visibility and scope come from the same set
|
|
13084
13319
|
if(!pl||!pl.props.length||!t.vis){V.setPropLabels(null);return;}
|
|
13085
|
-
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)
|
|
13086
13321
|
|
|
13087
13322
|
// ---- The floating Properties popup ----
|
|
13088
13323
|
let propPopPinned=false;
|
|
@@ -14084,6 +14319,7 @@ svg.addEventListener('pointerdown',e=>{if(e.button!==0)return;const t=e.target;
|
|
|
14084
14319
|
if(releaseViewProps())panel(); // a click on the plan is about the model, not the saved view the panel was showing
|
|
14085
14320
|
const provisional=t&&typeof t.closest==='function'?t.closest('[data-provisional-id]'):null;
|
|
14086
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
|
|
14087
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;}
|
|
14088
14324
|
if(csaxisMode){csClick(e);e.preventDefault();return;} // set-local-axes armed → clicks define origin then X-direction
|
|
14089
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)
|
|
@@ -14400,6 +14636,10 @@ document.getElementById('csArm3dB').onclick=()=>{const d3=window.Steel3DView;if(
|
|
|
14400
14636
|
below zero, over 100 ft) says what is wrong and KEEPS the old one: nothing refuses, and nothing throws. */
|
|
14401
14637
|
function reachEls(){const $=id=>document.getElementById(id);return {inp:$('reachInput'),def:$('reachDef'),reset:$('reachReset'),echo:$('reachEcho'),stat:$('reachStatus')};}
|
|
14402
14638
|
function reachNow(){return SteelCore.columnBelowReachOf(C);}
|
|
14639
|
+
/* THIS project's default reach, which is 300 mm on a metric standard and 304.8 (1'-0") on an imperial one
|
|
14640
|
+
(owner ruling, 2026-10-23). Read through the same resolver the sheets use, so "is this the default?",
|
|
14641
|
+
the Reset tooltip and the toast cannot name a different number from the one Reset actually restores. */
|
|
14642
|
+
function reachDefault(){return SteelCore.defaultColumnBelowReach(C&&C.environment);}
|
|
14403
14643
|
function reachExample(){return displayUnits()===DisplayUnits.MM?'150 · 0.3 m · 6"':'6" · 2\'-0" · 150 mm';}
|
|
14404
14644
|
/** What a typed distance reads as: {ok, mm} or {ok:false, text} (the sentence that says what is wrong, ending with the value kept). */
|
|
14405
14645
|
function reachRead(typed){
|
|
@@ -14436,11 +14676,11 @@ function syncReachRow(){
|
|
|
14436
14676
|
const ready=!!C&&!!SteelCore; // boot() resolves the units before the first render; with no project and none stored, ft-in is the documented default
|
|
14437
14677
|
e.inp.disabled=!ready;
|
|
14438
14678
|
if(!ready)return; // the markup's "Loading…" placeholder stands: never a plausible guess
|
|
14439
|
-
const mm=reachNow(),isDefault=mm===
|
|
14679
|
+
const mm=reachNow(),isDefault=mm===reachDefault();
|
|
14440
14680
|
if(document.activeElement!==e.inp){e.inp.value=fmtDisp(mm);e.echo.textContent='';e.inp.removeAttribute('aria-invalid');}
|
|
14441
14681
|
e.inp.placeholder=reachExample().split(' · ')[0];
|
|
14442
14682
|
e.def.hidden=!isDefault;e.reset.hidden=isDefault;
|
|
14443
|
-
e.reset.dataset.tip='Back to the default, '+underFloorText(
|
|
14683
|
+
e.reset.dataset.tip='Back to the default, '+underFloorText(reachDefault())+'.';}
|
|
14444
14684
|
/** Enter or blur: apply what is typed. A bad value keeps the old one and says why; the same value writes nothing. */
|
|
14445
14685
|
function commitReach(){
|
|
14446
14686
|
const e=reachEls();if(!e.inp||e.inp.disabled)return false;
|
|
@@ -14457,7 +14697,7 @@ function resetReach(){
|
|
|
14457
14697
|
reachTouched=true;
|
|
14458
14698
|
if(!edit(()=>V2_SESSION.setColumnBelowReach(null)))return false;
|
|
14459
14699
|
reachSay('');
|
|
14460
|
-
toast('Columns ending below a floor are back to the default of '+underFloorText(
|
|
14700
|
+
toast('Columns ending below a floor are back to the default of '+underFloorText(reachDefault())+'. Ctrl+Z undoes it.');
|
|
14461
14701
|
syncReachRow();const e=reachEls();if(e.inp)e.inp.focus(); // the Reset button hides itself, so focus goes to the field
|
|
14462
14702
|
return true;}
|
|
14463
14703
|
{const e=reachEls();
|
|
@@ -14801,7 +15041,8 @@ addEventListener('keydown',e=>{
|
|
|
14801
15041
|
if(e.key==='Escape'&&detailsOpen()){closeDetails();return;}
|
|
14802
15042
|
if(e.key==='Escape'&&connLibOpen()){closeConnLib();return;}
|
|
14803
15043
|
if(e.key==='Escape'&&framesOpen()){closeFrames();return;}
|
|
14804
|
-
|
|
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;
|
|
14805
15046
|
if(e.key==='Escape'&&confOpen()){closeConf();return;}
|
|
14806
15047
|
if(e.key==='Escape'&&snapMenuOpen()){closeSnapMenu();return;}
|
|
14807
15048
|
if(e.key==='Escape'&&selFly.classList.contains('open')){closeSelFly();return;} // close the Select-filter type flyout first
|
|
@@ -14848,6 +15089,8 @@ addEventListener('keydown',e=>{
|
|
|
14848
15089
|
if(view3d){escLadderIdle=!leftAdd;return;} // the later-mounted 3D CAD arbiter owns the final selection-Escape rung (it marks what it uses)
|
|
14849
15090
|
escLadderIdle=!leftAdd&&!picking&&!selIds.size&&!selGridIds.size; // nothing to cancel and nothing to deselect: the Esc goes up to the overlay (#1571)
|
|
14850
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;}
|
|
14851
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)
|
|
14852
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
|
|
14853
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
|
|
@@ -14900,7 +15143,7 @@ addEventListener('keydown',e=>{
|
|
|
14900
15143
|
e.preventDefault();
|
|
14901
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.
|
|
14902
15145
|
const objectIds=view3d?(window.Steel3DView&&window.Steel3DView.visibleObjectIds?window.Steel3DView.visibleObjectIds():[]):P.members.filter(visible2d).map(m=>m.id);
|
|
14903
|
-
modelSelection.replaceMembers(objectIds
|
|
15146
|
+
modelSelection.replaceMembers(selectableIds(objectIds));
|
|
14904
15147
|
selDimIds.clear();sel3dDimIds.clear();modelSelection.clearGrids();
|
|
14905
15148
|
if(selGridOK())modelSelection.replaceGrids(view3d?(window.Steel3DView&&window.Steel3DView.visibleGridIds?window.Steel3DView.visibleGridIds():[]):gridSelectables().map(g=>g.id));
|
|
14906
15149
|
if(!view3d){ // the 2D-drawable dimensions join the sweep
|
|
@@ -15728,13 +15971,13 @@ const view3dApi={
|
|
|
15728
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
|
|
15729
15972
|
|
|
15730
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.
|
|
15731
|
-
onSelectMany:(ids,additive)=>{const ids2=(ids||[])
|
|
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)
|
|
15732
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
|
|
15733
15976
|
releaseViewProps();if(ids2.length)clearWholeReferenceSelection();selDimIds.clear();sel3dDimIds.clear();
|
|
15734
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
|
|
15735
15978
|
else{modelSelection.replaceMembers(ids2);modelSelection.clearGrids();}
|
|
15736
15979
|
if(mode==='add'){mode='sel';setMode();}render();if(window.Steel3DView&&window.Steel3DView.refreshDims)window.Steel3DView.refreshDims();}, // 3D box-select → shared selection
|
|
15737
|
-
onSelectBatch:({memberIds=[],gridIds=[]},additive)=>{const mids=memberIds
|
|
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.
|
|
15738
15981
|
onVisibilitySelectionHidden:()=>{modelSelection.clearMembers();modelSelection.clearGrids();render();},
|
|
15739
15982
|
// THE MEMBER LIST lives once at the document root, which is the whole model. The view takes ids and hands
|
|
15740
15983
|
// the records back to `model().geometryOf`, keeping geometry reads on the native adapter boundary.
|
|
@@ -15757,6 +16000,7 @@ const view3dApi={
|
|
|
15757
16000
|
snap3dFree:()=>snap3dFree, // SNAP-bar "3D snapping" mode — ON: free 3D snap; OFF: 3D placement snap constrained to the working plane
|
|
15758
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
|
|
15759
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.
|
|
15760
16004
|
canSelectGrid:()=>selGridOK(), // Grid line/bubble picks and area selection obey the same Select switch as 2D.
|
|
15761
16005
|
canSelectReference:()=>selReferenceOK(), // Reference picks/drills obey their 3D-only Select switch; visibility and snapping stay independent.
|
|
15762
16006
|
gridScopeKey:()=>'model',
|
|
@@ -15964,7 +16208,7 @@ const view3dApi={
|
|
|
15964
16208
|
const m=byId(basePickColId); if(!m||m.role!=='column'||!m.col){toast('No column to trim');return;}
|
|
15965
16209
|
const tos=(m.col.tosMm!=null?m.col.tosMm:defaultTosMm); // WORLD MM, like the pick itself — there is no conversion on this axis any more
|
|
15966
16210
|
if(tos==null){toast('Set the column top (TOS) first');return;}
|
|
15967
|
-
const want=p.z, cap=tos-
|
|
16211
|
+
const want=p.z, cap=tos-minColStubMm();
|
|
15968
16212
|
const bosMm=Math.min(want, cap); // clamp so the column keeps a min stub (bos<tos)
|
|
15969
16213
|
const clamped=want>cap+0.5; // the pick was above the min-stub cap → we seated at the cap, not the picked level
|
|
15970
16214
|
const cur=(m.col.bosMm!=null?m.col.bosMm:0);
|
|
@@ -16177,12 +16421,12 @@ window.ModelSelectionCoordinator=modelSelection;
|
|
|
16177
16421
|
// The selection as model objects (#1653). Raw ids include connection parts and `det:` placement tokens; this is
|
|
16178
16422
|
// the one place they become {kind, id}: a part is its connection, `det:<id>` a placed detail, a member itself.
|
|
16179
16423
|
// Anything else (grid, dimension, reference) is not an object a question can be about. Shared with Ask AI.
|
|
16180
|
-
function canonicalTargetItems(ids){
|
|
16424
|
+
function canonicalTargetItems(ids,members=new Map((C.members||[]).filter(Boolean).map(m=>[m.id,m]))){
|
|
16181
16425
|
const items=[],seen=new Set();let ignored=0,total=0;
|
|
16182
16426
|
for(const id of (ids||[])){total++;let item=null;const part=(partsById||{})[id];
|
|
16183
16427
|
if(part&&typeof part.conn==='string'&&part.conn)item={kind:'joint',id:part.conn};
|
|
16184
16428
|
else if(typeof id==='string'&&id.startsWith('det:')&&id.slice(4))item={kind:'detail',id:id.slice(4)};
|
|
16185
|
-
else if(
|
|
16429
|
+
else if(members.has(id))item={kind:'member',id};
|
|
16186
16430
|
else{ignored++;continue;}
|
|
16187
16431
|
const key=item.kind+'\0'+item.id;if(seen.has(key))continue;seen.add(key);items.push(item);
|
|
16188
16432
|
}
|
|
@@ -16190,17 +16434,18 @@ function canonicalTargetItems(ids){
|
|
|
16190
16434
|
}
|
|
16191
16435
|
// A label exactly as the server stores it, and the selection's key: both shared with every model viewer.
|
|
16192
16436
|
function subjectLabelText(text){return ChatQuestions.subjectLabelText(text);}
|
|
16193
|
-
function subjectLabel(item){
|
|
16194
|
-
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;}
|
|
16195
16439
|
if(item.kind==='joint')return 'Connection '+item.id; // a placed joint (C.joints), never a connection-library row
|
|
16196
|
-
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);
|
|
16197
16441
|
}
|
|
16198
16442
|
function subjectsKeyOf(items){return ChatQuestions.subjectsKeyOf(items);}
|
|
16199
16443
|
function modelSubjects(){
|
|
16200
|
-
const
|
|
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;
|
|
16201
16446
|
if(!items.length)return null;
|
|
16202
16447
|
return {source:'steel',revision:serverRevision>=0?serverRevision:null,total:items.length,key:subjectsKeyOf(items),
|
|
16203
|
-
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}))};
|
|
16204
16449
|
}
|
|
16205
16450
|
// Announced again whenever the objects it names change — a relabel or a new server revision included — so AI Chat
|
|
16206
16451
|
// never reads a stale label at Send. A replay of the same selection is not announced.
|
|
@@ -23037,9 +23282,22 @@ function exportPayload(){
|
|
|
23037
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,
|
|
23038
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
|
|
23039
23284
|
ends:m.role==='column'?undefined:(m.ends||[]).map(wireEnd), column:m.role==='column'?wireCol(m.col):undefined};})};}
|
|
23040
|
-
document.
|
|
23041
|
-
|
|
23042
|
-
|
|
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();};
|
|
23043
23301
|
// --- details gallery (preview = crop of detail N from its sheet; .preview base64 when available) ---
|
|
23044
23302
|
// per-detail thumbnail = the bubble's cell cropped client-side from the full-sheet preview (no extra crops stored)
|
|
23045
23303
|
const THUMBS={};
|
|
@@ -24441,6 +24699,9 @@ async function refreshRfiRecords(opts){
|
|
|
24441
24699
|
}catch(e){
|
|
24442
24700
|
if(mine!==rfiFetchSeq)return false;
|
|
24443
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;
|
|
24444
24705
|
// Bind and log it. A dead server, a DNS failure and a TypeError thrown by our own code inside the
|
|
24445
24706
|
// try all render the same banner, and a bug report cannot tell them apart from that banner alone.
|
|
24446
24707
|
console.error('[steel] could not read the filed RFIs', e);
|
|
@@ -26023,7 +26284,7 @@ function rfiRestoreFocus(want){
|
|
|
26023
26284
|
if(target)break;
|
|
26024
26285
|
}
|
|
26025
26286
|
if(!target&&want.ctl&&want.ctl!=='*first')target=_rfiByAttr(modal,'data-rfi-ctl',want.ctl);
|
|
26026
|
-
if(!target)target=document.getElementById('
|
|
26287
|
+
if(!target)target=document.getElementById('rfiTitle');
|
|
26027
26288
|
if(target&&target.focus)target.focus({preventScroll:true});
|
|
26028
26289
|
}
|
|
26029
26290
|
/**
|
|
@@ -26252,7 +26513,7 @@ function paintRfiBanner(){
|
|
|
26252
26513
|
// The loading repaint removes Retry, so its ordinary focus capture falls back to Close. Restore the
|
|
26253
26514
|
// exact action when the read settles and Retry returns, but only while focus remains on that
|
|
26254
26515
|
// temporary fallback. A user who moves to a filter or row keeps the focus they chose.
|
|
26255
|
-
rfiFocusOverride={rows:[],ctl:'retry',whenFocused:document.getElementById('
|
|
26516
|
+
rfiFocusOverride={rows:[],ctl:'retry',whenFocused:document.getElementById('rfiTitle')};
|
|
26256
26517
|
refreshRfiRecords();
|
|
26257
26518
|
};
|
|
26258
26519
|
}
|
|
@@ -26313,7 +26574,7 @@ async function runEditorFocus(req,current){
|
|
|
26313
26574
|
// #2471: a member an answer cited. The shell checked the project is the cited one; this frame shows that project.
|
|
26314
26575
|
if(req.memberId){
|
|
26315
26576
|
const m=await focusMember(req.memberId,{current,
|
|
26316
|
-
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.':'',
|
|
26317
26578
|
beforeFrame:()=>{if(rfiOpen())closeRFI();}});
|
|
26318
26579
|
if(!m||!current())return null;
|
|
26319
26580
|
if(!m.ok){
|
|
@@ -26324,7 +26585,7 @@ async function runEditorFocus(req,current){
|
|
|
26324
26585
|
return {ok:true};
|
|
26325
26586
|
}
|
|
26326
26587
|
const r=await focusConnection(req.jointId,{current,fallbackToMain:true,
|
|
26327
|
-
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.':'',
|
|
26328
26589
|
beforeFrame:()=>{if(rfiOpen())closeRFI();}});
|
|
26329
26590
|
if(!r||!current())return null;
|
|
26330
26591
|
// #2450: "Raise an RFI" opens its dialog whether or not the connection could be selected — a hidden or
|
|
@@ -26439,7 +26700,7 @@ async function focusConnection(jointId,opts){
|
|
|
26439
26700
|
}
|
|
26440
26701
|
if(!ready||!window.Steel3DView)return {ok:false,reason:'view',said:'The 3D view could not show connection '+jointId+'.'};
|
|
26441
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.'};
|
|
26442
|
-
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.'};
|
|
26443
26704
|
if(viewMode==='split')setActivePane('3d'); // as above: the 3D pane holds the selection and its tools
|
|
26444
26705
|
const selectedThisAttempt=treeSelectConn(jointId,{});
|
|
26445
26706
|
const selected=connSelInfo();
|
|
@@ -27034,7 +27295,8 @@ async function rfiCommitProfileRepair(inp,rawValue){
|
|
|
27034
27295
|
const mismatch=record&&rfiProfileTruthMismatch(record);if(mismatch)rfiSay(rfiProfileTruthMessage(mismatch));
|
|
27035
27296
|
const modal=document.getElementById('rfiModal');
|
|
27036
27297
|
const replacement=rfiProfileInputFor(modal,rowKey,m.id);
|
|
27037
|
-
|
|
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});
|
|
27038
27300
|
}
|
|
27039
27301
|
|
|
27040
27302
|
/** A failed save/read remains explicit and recoverable. Retrying the same value deliberately enters
|
|
@@ -27044,8 +27306,8 @@ const rfiGestureFailure=e=>{console.error('[steel] an RFI gesture failed',e);toa
|
|
|
27044
27306
|
/** Keep a catalogue selection inside the parent dialog when resolving it removes an unfiled symptom row. */
|
|
27045
27307
|
function rfiFocusAfterSymptomProfilePick(modal,rowKey,memberId){
|
|
27046
27308
|
if(!rfiRowIsSize(rowKey)||rfiProfileInputFor(modal,rowKey,memberId))return false;
|
|
27047
|
-
const close=modal&&modal.querySelector&&modal.querySelector('#
|
|
27048
|
-
const fallback=close||document.getElementById('
|
|
27309
|
+
const close=modal&&modal.querySelector&&modal.querySelector('#rfiTitle');
|
|
27310
|
+
const fallback=close||document.getElementById('rfiTitle');
|
|
27049
27311
|
if(!fallback||!fallback.focus)return false;
|
|
27050
27312
|
fallback.focus({preventScroll:true});return true;
|
|
27051
27313
|
}
|
|
@@ -27266,8 +27528,10 @@ const liveRfiSubjects=owner=>owner&&owner.occurrence&&owner.occurrence.liveGap&&
|
|
|
27266
27528
|
async function openActiveProvisional(memberId,openSource,invoker){
|
|
27267
27529
|
const members=provisionalMembersForActiveView();
|
|
27268
27530
|
const member=memberId?selectedProvisionalTrace(members,memberId):(new Set(members.map(row=>row.id)).size===1?members[0]:null);if(!member&&!members.length)return;
|
|
27269
|
-
|
|
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;
|
|
27270
27533
|
if(PROJECT)await refreshRfiRecords({force:true});
|
|
27534
|
+
if(!rfiOpen())return;
|
|
27271
27535
|
if(!member){
|
|
27272
27536
|
rfiStatusFilter='open';renderRfiList();
|
|
27273
27537
|
const ids=new Set(members.map(row=>row.id));
|
|
@@ -27331,7 +27595,7 @@ function openRaiseRfi(jointId,checkId,invoker){
|
|
|
27331
27595
|
// A filing still out keeps the dialog: replacing it would drop that filing's answer unsaid.
|
|
27332
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.';
|
|
27333
27597
|
// A form being typed in the RFI list is never closed under the person.
|
|
27334
|
-
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.';
|
|
27335
27599
|
if(rfiOpen())closeRFI();
|
|
27336
27600
|
rfiRaiseReturn=invoker&&invoker.isConnected?invoker:(document.activeElement instanceof Element?document.activeElement:null);
|
|
27337
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};
|
|
@@ -27610,55 +27874,162 @@ document.getElementById('rfiRaiseModal').addEventListener('keydown',e=>{
|
|
|
27610
27874
|
if(e.shiftKey&&document.activeElement===first){e.preventDefault();last.focus();}
|
|
27611
27875
|
else if(!e.shiftKey&&document.activeElement===last){e.preventDefault();first.focus();}
|
|
27612
27876
|
});
|
|
27613
|
-
|
|
27614
|
-
|
|
27615
|
-
|
|
27616
|
-
|
|
27617
|
-
|
|
27618
|
-
|
|
27619
|
-
|
|
27620
|
-
|
|
27621
|
-
|
|
27622
|
-
|
|
27623
|
-
|
|
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));
|
|
27624
27896
|
if(row){row.scrollIntoView({block:'center'});const f=row.querySelector('button,input,[tabindex]');if(f)f.focus({preventScroll:true});return;}
|
|
27625
27897
|
}
|
|
27626
|
-
if(focusId){
|
|
27627
|
-
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);
|
|
27628
27900
|
const row=inp&&inp.closest('.rfirow');
|
|
27629
27901
|
if(row){row.scrollIntoView({block:'center'});inp.focus({preventScroll:true});return;}
|
|
27630
27902
|
}
|
|
27631
|
-
//
|
|
27632
|
-
|
|
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});
|
|
27633
27912
|
}
|
|
27634
|
-
|
|
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){
|
|
27635
27929
|
rfiCancelTarget();if(rfiLightboxReturn)closeLightbox();
|
|
27636
|
-
|
|
27637
|
-
// the user pressed Escape on and a failure they have already read — and `rfiDispatch`'s own
|
|
27638
|
-
// ownership check is what stops a settle that lands after this from putting either of them back.
|
|
27639
|
-
rfiFormFor=null;rfiOutcome=null;rfiFocusOverride=null;
|
|
27930
|
+
rfiOutcome=null;rfiFocusOverride=null;
|
|
27640
27931
|
paintRfiFail();
|
|
27641
27932
|
document.getElementById('rfiModal').style.display='none';
|
|
27642
|
-
|
|
27643
|
-
if(b)b.setAttribute('aria-expanded','false');
|
|
27644
|
-
|
|
27933
|
+
rfiSetModelInert(false);rfiSurface=to;
|
|
27934
|
+
const b=document.getElementById('rfiStat');if(b)b.setAttribute('aria-expanded','false');
|
|
27935
|
+
rfiDialogReturn=null;
|
|
27645
27936
|
}
|
|
27646
|
-
|
|
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
|
+
});
|
|
27952
|
+
}
|
|
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
|
+
});
|
|
27647
28025
|
document.getElementById('rfiStat').onclick=openRFI;
|
|
27648
|
-
document.getElementById('
|
|
27649
|
-
document.getElementById('
|
|
27650
|
-
// The
|
|
27651
|
-
//
|
|
27652
|
-
document.getElementById('rfiModal').addEventListener('keydown',e=>{e.stopPropagation();if(e.key
|
|
27653
|
-
|
|
27654
|
-
|
|
27655
|
-
// it) the draft came back on the next open, so Escape neither closed the form nor discarded it.
|
|
27656
|
-
// A form mid-flight is not cancellable: the request is already out. It used to fall through and
|
|
27657
|
-
// close the whole DIALOG, which is not what the command's own escLabel narrates and not what anybody
|
|
27658
|
-
// pressing Escape over a form expects.
|
|
27659
|
-
if(rfiFormFor&&rfiFormFor.busy){toast('Still recording — wait for it to finish, or close the dialog and check the row.');return;}
|
|
27660
|
-
if(rfiFormFor){rfiCloseForm();return;}
|
|
27661
|
-
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;}});
|
|
27662
28033
|
// ===== Section weights, and the unit words a quantity is spelled with =====
|
|
27663
28034
|
// The AISC catalogue weight — the only way most of the catalogue can be weighed at all. Nothing in
|
|
27664
28035
|
// "HSS4X4X3/8" encodes 17.27 lb/ft (40.9 kg/m), so before the table carried weights every hollow section, angle
|
|
@@ -27701,6 +28072,10 @@ function _wtBill(profile){const kgm=_wtKgM(profile);
|
|
|
27701
28072
|
const UNIT_WORDS={'ft-in':{weight:'lb',tonnage:'tons'},
|
|
27702
28073
|
mm:{weight:'kg',tonnage:'t'}};
|
|
27703
28074
|
const _uw=()=>UNIT_WORDS[displayUnits()]||UNIT_WORDS['ft-in'];
|
|
28075
|
+
// The word after a UNIT weight, per system: `bom-units.ts` `labels.unitWeight`, kept beside `UNIT_WORDS` so
|
|
28076
|
+
// the Inspect panel and the bill spell kg/m and lb/ft the same way (#2674).
|
|
28077
|
+
const UNIT_WEIGHT_LABELS={'ft-in':'lb/ft',mm:'kg/m'};
|
|
28078
|
+
const _uwPer=()=>UNIT_WEIGHT_LABELS[displayUnits()]||UNIT_WEIGHT_LABELS['ft-in'];
|
|
27704
28079
|
/*
|
|
27705
28080
|
* A MEMBER'S DISPLAYED MASS, from the member itself and the unit weight `_wtBill` returned.
|
|
27706
28081
|
*
|
|
@@ -27721,6 +28096,10 @@ const _propMass=(m,unitWeight)=>
|
|
|
27721
28096
|
// printed as 26.000000000000004 — and `bom-format` rounds its own column for exactly this reason.
|
|
27722
28097
|
// The ARITHMETIC keeps full precision: only what is rendered is rounded.
|
|
27723
28098
|
const _plf2=(plf)=>plf==null?null:Math.round(plf*100)/100;
|
|
28099
|
+
// The Inspect panel's member weight, in the project's own units. #2674: this was inlined as feet x the unit
|
|
28100
|
+
// weight, labelled lb and lb/ft, so a metric member printed feet x kg/m as pounds (81 lb beside a bill's
|
|
28101
|
+
// 25 kg). Mass comes from `_propMass` and both words from the server's tables, like every other surface.
|
|
28102
|
+
const _memberWeightHint=(m,wpf)=>'Weight <b>'+Math.round(_propMass(m,wpf)).toLocaleString('en-US')+' '+_uw().weight+'</b> · '+_plf2(wpf)+' '+_uwPer();
|
|
27724
28103
|
// The same weight for the EXPORTED FILE, where two decimals would be a lie rather than a rounding.
|
|
27725
28104
|
// `_plf2` is right for a label — the catalogue tabulates unit weight to 2 dp — but `contract_edited`
|
|
27726
28105
|
// is machine-readable and round-trips, and not every weight is a catalogue weight: a document's own
|
|
@@ -27765,7 +28144,7 @@ function yourAnswersHtml(){const rows=[];
|
|
|
27765
28144
|
const said=a.how==='typed'?'you typed '+(a.typed||fmtDispElev(z.known)):'you confirmed '+(a.shownAs||fmtDispElev(z.known));
|
|
27766
28145
|
const when=typeof a.answeredAt==='string'&&!Number.isNaN(Date.parse(a.answeredAt))?', '+new Date(a.answeredAt).toLocaleDateString():'';
|
|
27767
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('');
|
|
27768
|
-
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>');}
|
|
27769
28148
|
return rows.length?'<h3>Your answers</h3><ul>'+rows.join('')+'</ul>':'';}
|
|
27770
28149
|
/** A button that opens a picture the person attached to an answer (#1906), served only after its digest check. */
|
|
27771
28150
|
function answerPictureButton(requestId,ref,instance){const b=document.createElement('button');b.type='button';b.className='answer-picture';
|
|
@@ -27783,7 +28162,7 @@ function rememberConfControl(control,kind){confRestoreControl={kind,value:contro
|
|
|
27783
28162
|
function restoreConfControl(){if(!confRestoreControl)return false;const pending=confRestoreControl;confRestoreControl=null;
|
|
27784
28163
|
const selectors={readBand:'#confFilter [data-read-band]',readCat:'#confFilter [data-read-cat]'};
|
|
27785
28164
|
const selector=selectors[pending.kind];if(!selector)return false;const next=[...document.querySelectorAll(selector)].find(control=>control.dataset[pending.kind]===pending.value);if(!next)return false;next.focus();return true;}
|
|
27786
|
-
function renderConf(){const projection=readConfidenceProjection(),target=effectiveTarget(),summary=ReadConfidence.summarizeReadConfidence(projection,target);
|
|
28165
|
+
function renderConf(){const projection=readConfidenceProjection(),target=effectiveTarget(),summary=ReadConfidence.summarizeReadConfidence(projection,target);renderConfQuick();
|
|
27787
28166
|
if(!['all','beams','columns'].includes(confCat))confCat='all';if(target==null)confReadBand='all';readTargetControl();
|
|
27788
28167
|
const metric=(label,value,note)=>'<div class=ccard><div class=cc-label>'+label+'</div><div class=cc-score>'+value+'</div><div class=cc-counts><span>'+note+'</span></div></div>';
|
|
27789
28168
|
document.getElementById('confCats').innerHTML=metric('Recorded fields',summary.totalFields,'immutable drawing values')+metric('Below target',target==null?'—':summary.belowFields,target==null?'No target set':('strictly below '+target+'%'))+metric('Members affected',target==null?'—':summary.affectedMembers,'review destinations')+metric('Not recorded',summary.notRecordedMembers,'members without field confidence');
|
|
@@ -27883,7 +28262,7 @@ function closeLightbox(){
|
|
|
27883
28262
|
const lightbox=document.getElementById('lightbox'),close=document.getElementById('lbClose');
|
|
27884
28263
|
lightbox.removeAttribute('role');lightbox.removeAttribute('aria-modal');lightbox.removeAttribute('aria-labelledby');close.removeAttribute('aria-label');
|
|
27885
28264
|
document.getElementById('rfiModal').inert=held.inert;URL.revokeObjectURL(held.objectUrl);
|
|
27886
|
-
if(held.button.isConnected)held.button.focus();else if(rfiOpen())document.getElementById('
|
|
28265
|
+
if(held.button.isConnected)held.button.focus();else if(rfiOpen())document.getElementById('rfiTitle').focus();
|
|
27887
28266
|
}
|
|
27888
28267
|
}
|
|
27889
28268
|
function lightboxOpen(){return document.getElementById('lightbox').style.display==='flex';}
|
|
@@ -29040,7 +29419,7 @@ function setPlan(i){
|
|
|
29040
29419
|
NO_PLAN_VIEW=true;C.active=0;P={sheet:'',members:[],segments:[],dims:[],details:[],callouts:[],tos_callouts:[],grid:null,default_tos_mm:0};
|
|
29041
29420
|
resetPlanViewState(0);return;
|
|
29042
29421
|
}
|
|
29043
|
-
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
|
|
29044
29423
|
const kind=canonical.viewKind||'unknown',current=C.plans[C.active];
|
|
29045
29424
|
const hasProvisionals=provisionalMembersForView(viewIdOf(canonical)).length>0;
|
|
29046
29425
|
if(((kind==='elevation'||kind==='section')&&hasProvisionals)||!current||current.viewKind!=='plan'){
|
|
@@ -29056,8 +29435,8 @@ function setPlan(i){
|
|
|
29056
29435
|
syncPlanSwitcher(C.active);return;}
|
|
29057
29436
|
C.active=i;
|
|
29058
29437
|
NO_PLAN_VIEW=false;
|
|
29059
|
-
svg.setAttribute('aria-label','2D model plan '+viewLabel(canonical));
|
|
29060
|
-
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));
|
|
29061
29440
|
P=projectPlan();
|
|
29062
29441
|
syncElevationContext();
|
|
29063
29442
|
// clip = the drawing's display-space crop. A contract may ship WITHOUT a raster/clip (a shared or
|
|
@@ -30535,6 +30914,9 @@ modelPanelBridge=ModelPanelBridge.createModelPanelBridge({win:window,origin:loca
|
|
|
30535
30914
|
panel:showLegendTab});
|
|
30536
30915
|
modelPanelBridge.ready(String(PROJECT||APP_ID));modelPanelGeneration=modelEditGeneration;
|
|
30537
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'});
|
|
30538
30920
|
} // end main()
|
|
30539
30921
|
/* -- Structure / Quality: the two expandable stat groups ---------------------------------------------
|
|
30540
30922
|
The row used to state six numbers at once. It now states two, each a button over a panel holding the
|