@floless/app 0.135.1 → 0.137.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 +634 -274
- package/dist/schemas/steel.model.v2.schema.json +18 -17
- package/dist/skills/floless-app-report-issue/SKILL.md +46 -9
- package/dist/skills/floless-app-steel-model/SKILL.md +13 -12
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +61 -65
- package/dist/skills/floless-app-steel-takeoff/references/elevation-registration.md +119 -0
- package/dist/templates/steel-model.flo +44 -4
- package/dist/web/commands-steel.js +6 -0
- package/dist/web/instructor.js +1 -0
- package/dist/web/steel-editor.html +609 -56
- package/dist/web/steel-model-v2-client-validation.js +36 -17
- package/dist/web/steel-model-v2-commands.js +82 -86
- package/dist/web/steel-model-v2-projection.js +179 -22
- package/dist/web/steel-plan-transform.js +82 -29
- package/dist/web/steel-plan-view-id.js +140 -0
- package/dist/web/steel-view-generation.js +2 -1
- package/dist/web/workspaces.js +7 -2
- package/package.json +2 -1
|
@@ -257,6 +257,43 @@
|
|
|
257
257
|
#detOpacity{flex:1;min-width:0} /* SIZING only — the theming is the global input[type=range] rule below */
|
|
258
258
|
#zoombar #zPct{min-width:40px;text-align:right;color:var(--mut);font-variant-numeric:tabular-nums}
|
|
259
259
|
/* Connection Component breadcrumb (Slice A) — a floating chip over the 3D canvas, same recipe as #zoombar. */
|
|
260
|
+
/* #935 — the plan-registration refusal, said out loud on the canvas the wrong geometry is drawn on.
|
|
261
|
+
Floats over #pane2d the way #connCrumb floats over #pane3d (same recipe: absolute chip, themed
|
|
262
|
+
chrome, its own z above the canvas), and wears .read-diag's amber triple because it reports
|
|
263
|
+
something the AUTHORED contract got wrong rather than a mistake the user made here. Amber, not
|
|
264
|
+
--err: this file reserves red for faults the user can fix IN the editor, and this one they cannot
|
|
265
|
+
(the fix is a contract edit, which their terminal AI makes). Left+right inset rather than centred
|
|
266
|
+
because it carries a sentence, not a breadcrumb, and must wrap rather than ellipsize.
|
|
267
|
+
z:58 sits above the SVG and below toasts (60) and #tooltip (80), matching #connCrumb's reasoning. */
|
|
268
|
+
/* The pill only ever counts sheets whose registration is STATED and does not hold, so it always carries
|
|
269
|
+
the amber tone — `#reviewStat.has` does the same for its own fault count. Without this it inherits
|
|
270
|
+
`.stat{color:var(--mut)}` and sits in the nothing-to-see-here tone beside a banner saying the model
|
|
271
|
+
is metres out. */
|
|
272
|
+
#regStat b{color:var(--warn)}
|
|
273
|
+
#regBanner{position:absolute;left:12px;right:12px;top:12px;display:none;z-index:58;border:1px solid var(--warn-edge);border-radius:8px;background:var(--warn-bg);color:var(--warn);padding:8px 10px;font-size:12px;line-height:1.5;box-shadow:0 4px 14px rgba(0,0,0,.45)}
|
|
274
|
+
#regBanner.on{display:block}
|
|
275
|
+
/* …and the tone that is NOT a fault. A sheet still being registered is ordinary unfinished work, so it
|
|
276
|
+
recedes to the neutral tier in the same two tokens #rcIssues' own `.rcban.plain` uses. TWO classes,
|
|
277
|
+
which beats the single-class rule above on specificity — the trap that rule's own comment records. */
|
|
278
|
+
#regBanner.on.plain{border-color:var(--line);background:var(--panel);color:var(--mut)}
|
|
279
|
+
#regBanner.on.plain button{border-color:var(--line);color:var(--mut)}
|
|
280
|
+
#regBanner.on.plain .rgdet{border-top-color:var(--line)}
|
|
281
|
+
#regBanner .rgline{overflow-wrap:anywhere}
|
|
282
|
+
#regBanner .rgact{display:flex;gap:6px;align-items:center;margin-top:6px;flex-wrap:wrap}
|
|
283
|
+
#regBanner .rgcta{color:var(--mut);font-size:11px;flex:1;min-width:0}
|
|
284
|
+
/* `--warn-edge` and `--warn-bg` are the SAME token value in both dark palettes, so a border drawn in
|
|
285
|
+
the edge colour ON this banner's own background is invisible — the two buttons rendered as bare
|
|
286
|
+
amber text with no affordance, and the details separator vanished entirely. `.read-diag` carries
|
|
287
|
+
the same triple and never exposed it, because it holds no controls. The border is the amber INK
|
|
288
|
+
instead, which reads against the fill in both themes. */
|
|
289
|
+
#regBanner button{background:transparent;border:1px solid var(--warn);color:var(--warn);border-radius:6px;padding:2px 8px;font:11px system-ui;cursor:pointer}
|
|
290
|
+
#regBanner button:hover{background:rgba(148,163,184,.12)}
|
|
291
|
+
#regBanner button:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
|
|
292
|
+
/* The exact planTransform sentence, verbatim and as REAL DOM text — never a tooltip. It names the
|
|
293
|
+
contract fields the terminal AI has to change, so it must be selectable, copyable and reachable by
|
|
294
|
+
a screen reader. Collapsed by default so the plain-English lead reads first. */
|
|
295
|
+
#regBanner .rgdet{display:none;margin-top:6px;padding-top:6px;border-top:1px solid var(--warn);color:var(--mut);font:11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow-wrap:anywhere}
|
|
296
|
+
#regBanner.det .rgdet{display:block}
|
|
260
297
|
#connCrumb{position:absolute;left:50%;top:48px;transform:translateX(-50%);display:none;align-items:center;gap:1px;max-width:min(72%,560px);background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:4px 10px;box-shadow:0 4px 14px rgba(0,0,0,.45);z-index:58;font-size:12px;white-space:nowrap;overflow:hidden} /* below #m3dBar (top:12,h~29,z:59); z:58 keeps it clickable above the model-glued label chips, which sit under the 3D chrome at z:3-4 (#614) */
|
|
261
298
|
#connCrumb .seg{color:var(--mut);cursor:pointer;padding:1px 4px;border-radius:4px;background:none;border:0;font:inherit;max-width:260px;overflow:hidden;text-overflow:ellipsis}
|
|
262
299
|
#connCrumb .seg:hover{color:var(--text);text-decoration:underline}
|
|
@@ -1832,6 +1869,10 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
1832
1869
|
worse than one that is absent. But BOTH hidden while the server could not derive the state would
|
|
1833
1870
|
read as "all clear", so that one condition gets its own neutral marker instead of silence. -->
|
|
1834
1871
|
<span class=stat id=reviewUnavailStat data-tip="The server could not check connections for moved steel this time" hidden>Review check unavailable</span>
|
|
1872
|
+
<!-- #935. Hidden at zero like the readouts above. This one scans EVERY plan rather than the active one
|
|
1873
|
+
on purpose: the reported defect placed a 250-member model 18 m out while the author worked on other
|
|
1874
|
+
sheets, so a surface that only speaks when you happen to open the bad sheet repeats the bug. -->
|
|
1875
|
+
<button data-command-id="steel.registration-list" class=stat id=regStat data-tip="Sheets whose registration does not agree with the grid — click to list them" aria-haspopup="true" aria-expanded="false" aria-controls="reviewFly" hidden>Registration <b id=regCount>0</b></button>
|
|
1835
1876
|
<span class=stat id=csStat data-tip="Coordinate system — Global by default. Set a local frame from the ⋯ menu for skewed framing.">Axes <b>Global</b></span>
|
|
1836
1877
|
<span class=stat id=snapStat style="display:none" data-tip="Snap restricted for this operation — right-click the canvas to change; click here or press Esc to clear">Snap <b>—</b></span>
|
|
1837
1878
|
<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>
|
|
@@ -1954,6 +1995,18 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
1954
1995
|
<div id=stagewrap>
|
|
1955
1996
|
<div id=pane2d>
|
|
1956
1997
|
<div id=stage><svg id=svg tabindex=-1 aria-label="2D model plan"></svg></div>
|
|
1998
|
+
<!-- #935: this sheet's registration is present and REFUSED, so the steel on screen may be metres from
|
|
1999
|
+
where it belongs. role=status, not alert: it is a standing condition of the sheet you are looking
|
|
2000
|
+
at, not an event. No dismiss — a notice you can silence is the silent-wrongness this exists to end. -->
|
|
2001
|
+
<div id=regBanner role=status aria-live=polite>
|
|
2002
|
+
<div class=rgline id=regLead></div>
|
|
2003
|
+
<div class=rgdet id=regDetail></div>
|
|
2004
|
+
<div class=rgact>
|
|
2005
|
+
<span class=rgcta>This can't be fixed here — ask your terminal AI to correct the sheet's registration.</span>
|
|
2006
|
+
<button data-command-id="steel.registration-detail" id=regDetailBtn type=button aria-expanded=false aria-controls=regDetail>Details</button>
|
|
2007
|
+
<button data-command-id="steel.registration-copy" id=regCopyBtn type=button data-tip="Copy the exact reason for your AI">Copy reason</button>
|
|
2008
|
+
</div>
|
|
2009
|
+
</div>
|
|
1957
2010
|
<div id=zoombar>
|
|
1958
2011
|
<button data-command-id="steel.zoom" id=zOut data-tip="Zoom out">−</button>
|
|
1959
2012
|
<input data-command-id="steel.zoom" aria-label="Zoom level" id=zRange type=range min=10 max=400 step=1 value=100>
|
|
@@ -3408,7 +3461,7 @@ let memberEndScan=null;
|
|
|
3408
3461
|
let memberEndStatus={known:false,count:null,etag:null,revision:null,scopeSig:null};
|
|
3409
3462
|
const memberEndKey=f=>f.memberId+'\0'+f.end;
|
|
3410
3463
|
function memberEndHistoryAction(direction){return direction==='redo'?{label:'Redo',tip:'Redo the newest member-end resolution'}:{label:'Undo',tip:'Undo the newest member-end resolution'};}
|
|
3411
|
-
function memberEndScope(){const plan=C.plans&&C.plans[C.active];return view3d?{kind:'model-3d'}:{kind:'active-view',viewId:plan
|
|
3464
|
+
function memberEndScope(){const plan=C.plans&&C.plans[C.active];return view3d?{kind:'model-3d'}:{kind:'active-view',viewId:plan?viewIdOf(plan):''};}
|
|
3412
3465
|
function memberEndScopeSig(scope){return JSON.stringify(scope||memberEndScope());}
|
|
3413
3466
|
function memberEndUnresolved(report){const c=report&&report.counts||{};return (c.needsReview||0)+(c.stale||0)+(c.notCheckable||0);}
|
|
3414
3467
|
function updateMemberEndStatus(){
|
|
@@ -3418,7 +3471,7 @@ function updateMemberEndStatus(){
|
|
|
3418
3471
|
}
|
|
3419
3472
|
function invalidateMemberEndReview(message){memberEndStatus={known:false,count:null,etag:null,revision:null,scopeSig:null};if(memberEndReview||memberEndScan){memberEndReview=null;memberEndScan=null;document.body.classList.remove('member-end-review');selIds.clear();render();}updateMemberEndStatus();if(message)toast(message);}
|
|
3420
3473
|
window.invalidateMemberEndReview=invalidateMemberEndReview;
|
|
3421
|
-
function memberEndGroup(f){if(f.basis&&f.basis.kind==='drawing'){for(const p of C.plans||[])for(const o of p.memberObservations||[])if(f.basis.origins.some(x=>x.observationId===o.id))return p
|
|
3474
|
+
function memberEndGroup(f){if(f.basis&&f.basis.kind==='drawing'){for(const p of C.plans||[])for(const o of p.memberObservations||[])if(f.basis.origins.some(x=>x.observationId===o.id))return viewLabel(p)+(p.viewKind==='elevation'?' · elevation':'');}return f.basis&&f.basis.kind==='geometry-review'?'3D geometry review':'Model';}
|
|
3422
3475
|
function memberEndRole(f){return f.role==='horizontal-brace'?'Horizontal brace':f.role==='vertical-brace'?'Vertical brace':f.role==='brace-unknown'?'Brace':'Beam';}
|
|
3423
3476
|
function memberEndClassification(f){return ({'aligned-auto':'Aligned automatically','aligned-manual':'Aligned after review','kept-short':'Kept intentionally short','needs-review':'Needs review','stale':'Decision needs review','not-checkable':'Not checkable'})[f.classification]||f.classification;}
|
|
3424
3477
|
function memberEndReason(f){const words={
|
|
@@ -3447,11 +3500,13 @@ function memberEndChoicesForReport(report,previous){
|
|
|
3447
3500
|
return chosen;
|
|
3448
3501
|
}
|
|
3449
3502
|
function memberEndDistance(f,t){const a=f.currentPoint,z=a&&a.z&&Number.isFinite(a.z.known)?a.z.known:t.point.z.known;return Math.hypot(t.point.x-a.x,t.point.y-a.y,t.point.z.known-z);}
|
|
3450
|
-
|
|
3503
|
+
// `id` rides in the snapshot, not just in the restore lookup (#938): restoring BY view id from a
|
|
3504
|
+
// snapshot that only recorded the page still collapses two views on one sheet onto each other.
|
|
3505
|
+
function memberEndSnapshot(doc){return {v2:true,members:doc.members,grid:doc.grid||null,plans:(doc.plans||[]).map(p=>({id:p.id,sheet:p.sheet,dims:p.dims||[],memberRefs:p.memberRefs||[],memberObservations:p.memberObservations||[],frame:p.frame||null,datum_ref:p.datum_ref,control2_ref:p.control2_ref})),joints:doc.joints||[],connections:doc.connections||[],details:doc.detail_placements||[],views:doc.views||[],member_types:doc.member_types||[],dim_style:doc.dim_style||null,member_styles:doc.member_styles||{},...(Array.isArray(doc.reference_models)?{reference_models:doc.reference_models}:{})};}
|
|
3451
3506
|
function installMemberEndContract(doc,etag,revision){
|
|
3452
3507
|
V2_SESSION.restoreSnapshot(memberEndSnapshot(doc));V2_PROJECTIONS.clear();
|
|
3453
3508
|
const activePlan=C.plans&&C.plans[C.active];
|
|
3454
|
-
if(activePlan&&activePlan.viewKind==='plan'){NO_PLAN_VIEW=false;V2_PROJECTION=
|
|
3509
|
+
if(activePlan&&activePlan.viewKind==='plan'){NO_PLAN_VIEW=false;V2_PROJECTION=v2ProjectionForView(viewIdOf(activePlan));P=DEV_MODE?ModelCmd.deepFreezeProjection(V2_PROJECTION.plan):V2_PROJECTION.plan;}
|
|
3455
3510
|
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:Number.isFinite(activePlan.elevation_in)?activePlan.elevation_in:0}:{sheet:'',members:[],segments:[],dims:[],details:[],callouts:[],tos_callouts:[],grid:null,default_tos:0};resetPlanViewState(C.active);}
|
|
3456
3511
|
syncElevationContext();
|
|
3457
3512
|
// A server command replaces the model underneath the editor's local history. Retaining those snapshots
|
|
@@ -3495,23 +3550,91 @@ async function undoMemberEndResolution(){if(!memberEndReview||memberEndReview.bu
|
|
|
3495
3550
|
//
|
|
3496
3551
|
// Plan-space UI consumers receive a tagged projection; canonical commands resolve it back to the
|
|
3497
3552
|
// world-mm root member.
|
|
3498
|
-
function
|
|
3499
|
-
let projection=V2_PROJECTIONS.get(
|
|
3500
|
-
if(!projection){projection=V2Projection.createV2Projection(C,
|
|
3553
|
+
function v2ProjectionForView(viewId){
|
|
3554
|
+
let projection=V2_PROJECTIONS.get(viewId);
|
|
3555
|
+
if(!projection){projection=V2Projection.createV2Projection(C,viewId,{session:V2_SESSION});V2_SESSION.registerProjection(projection);V2_PROJECTIONS.set(viewId,projection);}
|
|
3501
3556
|
return projection;}
|
|
3557
|
+
/* This row's identity — `id`, or the sheet name for a page carrying one view (#938). One accessor, so
|
|
3558
|
+
nothing in this file has to decide whether `.sheet` means the page or the view. */
|
|
3559
|
+
const viewIdOf=pl=>V2Projection?V2Projection.planViewId(pl):((pl&&pl.id)||(pl&&pl.sheet)||'');
|
|
3560
|
+
/* How a view is NAMED to a human: the page, plus the view id when that page carries more than one.
|
|
3561
|
+
A single-view page reads exactly as it did before #938, so no existing copy churns. */
|
|
3562
|
+
function viewLabel(pl){
|
|
3563
|
+
if(!pl)return '';
|
|
3564
|
+
if(!V2Projection||!V2Projection.planViewLabels)return String(pl.sheet||'');
|
|
3565
|
+
return V2Projection.planViewLabels(C&&C.plans||[]).get(viewIdOf(pl))||String(pl.sheet||'');}
|
|
3566
|
+
/* The member's projected row, from the active sheet if it is on it and otherwise from whichever sheet
|
|
3567
|
+
HAS it.
|
|
3568
|
+
|
|
3569
|
+
Not `memberViewIds(...)[0]` any more. A view whose registration is refused projects no members at all
|
|
3570
|
+
(#935), so taking the first sheet blindly makes a member that is perfectly well drawn on a second,
|
|
3571
|
+
valid sheet disappear from every model-wide list that reads through here — `projectedAllMembers`,
|
|
3572
|
+
`byId`, shear-plate eligibility, property labels — and disappear SILENTLY, which is the failure mode
|
|
3573
|
+
this whole change exists to end. Walk the sheets and take the first projection that actually has the
|
|
3574
|
+
row. Stops at the first hit, so the ordinary one-sheet case still builds exactly one projection. */
|
|
3502
3575
|
function v2ProjectedMember(id){
|
|
3503
3576
|
const here=(P&&P.members||[]).find(m=>m&&m.id===id);if(here)return here;
|
|
3504
|
-
const
|
|
3505
|
-
|
|
3577
|
+
for(const viewId of V2Projection.memberViewIds(C,id)){
|
|
3578
|
+
const row=v2ProjectionForView(viewId).plan.members.find(m=>m&&m.id===id);
|
|
3579
|
+
if(row)return row;
|
|
3580
|
+
}
|
|
3581
|
+
return undefined;}
|
|
3506
3582
|
const allMembers=()=>modelMembersV2();
|
|
3507
3583
|
const projectedAllMembers=()=>(C.members||[]).map(m=>v2ProjectedMember(m.id)).filter(Boolean);
|
|
3508
3584
|
const byId=id=>v2ProjectedMember(id);
|
|
3509
|
-
|
|
3510
|
-
|
|
3585
|
+
// Same rule as v2ProjectedMember, for the same reason: a refused sheet's plan carries no usable
|
|
3586
|
+
// transform, so returning it would do coordinate maths against a registration the runtime just refused.
|
|
3587
|
+
/* WHICH PLANE a 3D edit happens in, stated rather than left to array order (#938).
|
|
3588
|
+
Two elevations on one page have DIFFERENT registrations, so "the first row that projects" is a coin
|
|
3589
|
+
flip between two different worlds. The rule: the ACTIVE view when it actually draws this member,
|
|
3590
|
+
otherwise the lowest view id in UTF-8 byte order among the views that can draw it — deterministic,
|
|
3591
|
+
and independent of the order `plans[]` happens to be in. A refused registration draws nothing
|
|
3592
|
+
(#935), so those rows are not eligible: doing coordinate maths against a registration the runtime
|
|
3593
|
+
just refused is the silent wrongness both issues exist to end. */
|
|
3594
|
+
const planeOf=id=>{
|
|
3595
|
+
const eligible=V2Projection.memberViewIds(C,id).filter(v=>!v2ProjectionForView(v).plan.registrationRefusal);
|
|
3596
|
+
if(!eligible.length)return P;
|
|
3597
|
+
const active=P&&viewIdOf(P);
|
|
3598
|
+
if(active&&eligible.includes(active))return v2ProjectionForView(active).plan;
|
|
3599
|
+
const utf8=(a,b)=>{const A=new TextEncoder().encode(a),B=new TextEncoder().encode(b);const n=Math.min(A.length,B.length);for(let i=0;i<n;i++){if(A[i]!==B[i])return A[i]-B[i];}return A.length-B.length;};
|
|
3600
|
+
return v2ProjectionForView([...eligible].sort(utf8)[0]).plan;};
|
|
3601
|
+
const planeOfMember=m=>{const link=V2Projection.projectionLink(m);return link?.viewId?v2ProjectionForView(link.viewId).plan:null;};
|
|
3511
3602
|
const selArr=()=>[...selIds].map(byId).filter(Boolean);
|
|
3512
3603
|
// The active-sheet subset of the selection — for 2D coordinate/decoration ops (handles, badges, move/copy,
|
|
3513
3604
|
// 2D drag/zoom) that draw or compute in THIS sheet's px space, where an off-sheet member's wp is meaningless.
|
|
3514
3605
|
const sel2d=()=>P.members.filter(m=>selIds.has(m.id));
|
|
3606
|
+
/* The THIRD accessor, and the one for consumers that need neither sheet (#942).
|
|
3607
|
+
`sel2d()` is the 2D coordinate accessor and `selArr()` the model-wide one — but `selArr()` still resolves
|
|
3608
|
+
through a PROJECTION, so on a model whose only sheet is refused it resolves nothing at all, while the 3D
|
|
3609
|
+
view stays fully populated from the canonical model. A member's own properties are knowable either way:
|
|
3610
|
+
they come from the canonical member, not from a registration.
|
|
3611
|
+
So this reads the canonical model directly and returns rows carrying NO `wp` — see `memberProperties`.
|
|
3612
|
+
It is READ-ONLY by construction: the rows are detached copies with no projection link, so they must
|
|
3613
|
+
never be handed to an editing command (`ModelCmd`/`V2Commands` resolve their target through that link).
|
|
3614
|
+
Use it where the question is "what IS this member", never "where is it drawn". */
|
|
3615
|
+
function canonicalMemberProps(id){const m=v2CanonicalMember(id);return (m&&V2Projection)?V2Projection.memberProperties(m):undefined;}
|
|
3616
|
+
function selCanonicalArr(){return [...selIds].map(canonicalMemberProps).filter(Boolean);}
|
|
3617
|
+
/* WHICH SHEETS ARE STOPPING THESE MEMBERS FROM BEING DRAWN — sheet -> its refusal, deduped.
|
|
3618
|
+
Derived from the MEMBERS' OWN sheets, never from the active projection, and that distinction is the
|
|
3619
|
+
whole point (Codex review). Selection is model-wide, so the member picked in 3D need have nothing to do
|
|
3620
|
+
with the sheet on screen:
|
|
3621
|
+
- active sheet VALID, member presented only on a refused one → `selArr()` still resolves nothing, so
|
|
3622
|
+
keying the explanation off `P.registrationRefusal` left exactly this issue's gap open;
|
|
3623
|
+
- active sheet REFUSED, member owned by a DIFFERENT refused sheet → it named the wrong sheet and the
|
|
3624
|
+
wrong remedy, which is worse than saying nothing.
|
|
3625
|
+
A member on no sheet at all yields an empty map: it is not a registration problem and is deliberately
|
|
3626
|
+
left to the caller's existing behaviour. */
|
|
3627
|
+
/* BY VIEW, not by page (#938, merging with #942). `memberSheets`/`v2ProjectionForSheet` no longer
|
|
3628
|
+
exist — a page can carry several views and a registration belongs to ONE of them, so asking a page
|
|
3629
|
+
whether it is refused has no single answer. Keyed by view id; the caller names them with
|
|
3630
|
+
`viewLabel` rather than printing the key, because a raw view id is the one string the author never
|
|
3631
|
+
typed. */
|
|
3632
|
+
function blockingViewsFor(ids){const out=new Map();
|
|
3633
|
+
if(!V2Projection)return out;
|
|
3634
|
+
for(const id of ids){for(const viewId of V2Projection.memberViewIds(C,id)){
|
|
3635
|
+
const plan=v2ProjectionForView(viewId).plan;
|
|
3636
|
+
if(plan.registrationRefusal)out.set(viewId,plan.registrationRefusal);}}
|
|
3637
|
+
return out;}
|
|
3515
3638
|
// elevation = canonical decimal INCHES. parseLen accepts 5.75 | 5 3/4 | 1'-0 1/4" | 16'-6"
|
|
3516
3639
|
function parseLen(str){if(str==null)return null;
|
|
3517
3640
|
let s=String(str).trim().replace(/[”″]/g,'"').replace(/[’′]/g,"'");
|
|
@@ -3657,9 +3780,24 @@ const posOffDisp=v=>(typeof v==='number'&&isFinite(v)&&v!==0)?fmtFtIn(v/25.4):''
|
|
|
3657
3780
|
const posOffSet=v=>typeof v==='number'&&isFinite(v)&&v!==0;
|
|
3658
3781
|
let positionBasisGeneration=0,positionBasisFingerprint='',positionBasisListeners=new Set();
|
|
3659
3782
|
let positionBasisViewUnsub=null;
|
|
3783
|
+
/* The shared gate for authoring geometry against the CURRENT surface — and, since #935, the one place
|
|
3784
|
+
that answers "can this sheet map pixels to the world at all".
|
|
3785
|
+
|
|
3786
|
+
A refused registration has no px<->world transform, so every write that starts from a sheet pixel
|
|
3787
|
+
throws out of `planTransform`. `drawClick` is the live one: it does its own `pushUndo` rather than
|
|
3788
|
+
going through `edit()`, and `edit()` only catches `V2CommandError` anyway, so the throw escaped to
|
|
3789
|
+
the console with no toast, no undo entry and the draw tool still armed. Refusing HERE fixes that at
|
|
3790
|
+
the source and costs nothing extra: this gate already disables the Profile Position controls, stamps
|
|
3791
|
+
`data-blocked-reason` on each, and narrates through `#posPositionStatus`, so the block is announced
|
|
3792
|
+
rather than merely enforced. 3D is untouched — it authors in world coordinates and does not care what
|
|
3793
|
+
any sheet's registration says. */
|
|
3660
3794
|
function positionAuthoringBasis(){
|
|
3661
3795
|
let raw;
|
|
3662
3796
|
if(view3d&&window.Steel3DView&&window.Steel3DView.positionAuthoringBasis){raw=window.Steel3DView.positionAuthoringBasis();}
|
|
3797
|
+
else if(P&&P.registrationRefusal)raw={ok:false,code:'position-authoring-basis-unavailable',
|
|
3798
|
+
message:P.registrationRefusal.registered
|
|
3799
|
+
?'This sheet’s registration does not fit the grid, so FloLess cannot turn a point on it into a model position. Ask your terminal AI to correct it.'
|
|
3800
|
+
:'This sheet is not registered to the grid yet, so FloLess cannot turn a point on it into a model position.'};
|
|
3663
3801
|
else if(!(P&&P.frame))raw={ok:true,kind:'global',x:[1,0,0],y:[0,1,0]};
|
|
3664
3802
|
else{
|
|
3665
3803
|
try{
|
|
@@ -3669,7 +3807,7 @@ function positionAuthoringBasis(){
|
|
|
3669
3807
|
raw=c?{ok:true,kind:'local',x:[...c.x],y:[...c.y]}:{ok:false,code:'position-authoring-basis-unavailable',message:'Profile Position unavailable: this plan’s local axes are not fully registered.'};
|
|
3670
3808
|
}catch(_){raw={ok:false,code:'position-authoring-basis-unavailable',message:'Profile Position unavailable: this plan’s local axes are not fully registered.'};}
|
|
3671
3809
|
}
|
|
3672
|
-
const fingerprint=JSON.stringify([view3d?'3d':'2d',P&&P
|
|
3810
|
+
const fingerprint=JSON.stringify([view3d?'3d':'2d',P&&viewIdOf(P),raw.ok,raw.kind,raw.x,raw.y,raw.code]);
|
|
3673
3811
|
if(fingerprint!==positionBasisFingerprint){positionBasisFingerprint=fingerprint;positionBasisGeneration++;for(const fn of positionBasisListeners)try{fn();}catch(_){}}
|
|
3674
3812
|
return Object.freeze({...raw,generation:positionBasisGeneration,capabilityVersion:SteelCore.POSITION_BASIS_CAPABILITY_VERSION,x:raw.x?Object.freeze([...raw.x]):undefined,y:raw.y?Object.freeze([...raw.y]):undefined});
|
|
3675
3813
|
}
|
|
@@ -4186,7 +4324,7 @@ function syncDefaults(){for(const m of P.members)ModelCmd.syncToDefault(m,defaul
|
|
|
4186
4324
|
// authored statement ("this control point is the model origin"), and JSON drops the undefined key, so
|
|
4187
4325
|
// absence survives the round trip rather than being materialised.
|
|
4188
4326
|
function snapshot(){
|
|
4189
|
-
return JSON.stringify({v2:true,members:C.members,grid:C.grid||null,plans:C.plans.map(p=>({sheet:p.sheet,dims:p.dims||[],memberRefs:p.memberRefs||[],memberObservations:p.memberObservations||[],frame:p.frame||null,datum_ref:p.datum_ref,control2_ref:p.control2_ref})),joints:C.joints||[],connections:C.connections||[],details:C.detail_placements||[],views:C.views||[],member_types:C.member_types||[],dim_style:C.dim_style||null,member_styles:C.member_styles||{},...(Array.isArray(C.reference_models)?{reference_models:C.reference_models}:{})});
|
|
4327
|
+
return JSON.stringify({v2:true,members:C.members,grid:C.grid||null,plans:C.plans.map(p=>({id:p.id,sheet:p.sheet,dims:p.dims||[],memberRefs:p.memberRefs||[],memberObservations:p.memberObservations||[],frame:p.frame||null,datum_ref:p.datum_ref,control2_ref:p.control2_ref})),joints:C.joints||[],connections:C.connections||[],details:C.detail_placements||[],views:C.views||[],member_types:C.member_types||[],dim_style:C.dim_style||null,member_styles:C.member_styles||{},...(Array.isArray(C.reference_models)?{reference_models:C.reference_models}:{})});
|
|
4190
4328
|
}
|
|
4191
4329
|
// Undo/redo is a SINGLE GLOBAL stack (not per-plane): snapshot() above captures EVERY plane's
|
|
4192
4330
|
// members, so one whole-model stack is coherent — undo restores all planes at once, and a cross-
|
|
@@ -4207,7 +4345,7 @@ function pushUndo(prev){undo.push(prev);if(undo.length>200)undo.shift();redo.len
|
|
|
4207
4345
|
function apply(json){
|
|
4208
4346
|
const d=JSON.parse(json);
|
|
4209
4347
|
V2_SESSION.restoreSnapshot(d);
|
|
4210
|
-
V2_PROJECTION=
|
|
4348
|
+
V2_PROJECTION=v2ProjectionForView(viewIdOf(C.plans[C.active]));
|
|
4211
4349
|
P=DEV_MODE?ModelCmd.deepFreezeProjection(V2_PROJECTION.plan):V2_PROJECTION.plan;
|
|
4212
4350
|
syncElevationContext();
|
|
4213
4351
|
updCS();
|
|
@@ -4270,7 +4408,7 @@ const LSKEY = draftKey(); // app + project + type — see draftKey() in the ou
|
|
|
4270
4408
|
// different server contracts routinely produce the same string (members change; segment counts do not).
|
|
4271
4409
|
// `baseEtag` is what decides whether the server moved; this decides whether the per-sheet overlay below is
|
|
4272
4410
|
// even meaningful.
|
|
4273
|
-
function dataSig(){return C.plans.map(p=>p
|
|
4411
|
+
function dataSig(){return C.plans.map(p=>viewIdOf(p)+':'+((p.segments||[]).length)).join('|');} // ignore stored edits if the dataset changed
|
|
4274
4412
|
let saveT=null, saveSeq=0; // saveSeq: monotonic id per server save. Only the LATEST save's response may set the pill — an older in-flight PUT that resolves late must not overwrite a newer verdict (e.g. a stale 'ok' clobbering a fresh 'err').
|
|
4275
4413
|
function setSaved(state,msg){const el=document.getElementById('saveStat');if(!el)return;el.classList.remove('dirty','ok','err','conflict');
|
|
4276
4414
|
el.removeAttribute('data-tip'); el.onclick=null;
|
|
@@ -4828,8 +4966,10 @@ function applyDraftFields(d){
|
|
|
4828
4966
|
// reference somebody else removed.
|
|
4829
4967
|
if(Array.isArray(d.reference_models))candidate.reference_models=reconcileReferences(candidate.reference_models,d.reference_models);
|
|
4830
4968
|
if(Array.isArray(d.plans)){
|
|
4831
|
-
|
|
4832
|
-
|
|
4969
|
+
// By VIEW ID (#938): a page-keyed map holds one of a page's views, and every sibling would be
|
|
4970
|
+
// restored from its neighbour's geometry.
|
|
4971
|
+
const byView=new Map(d.plans.filter(p=>p&&typeof p.sheet==='string').map(p=>[viewIdOf(p),p]));
|
|
4972
|
+
candidate.plans=candidate.plans.map(p=>byView.has(viewIdOf(p))?structuredClone(byView.get(viewIdOf(p))):p);
|
|
4833
4973
|
}
|
|
4834
4974
|
if(d.active!=null)candidate.active=d.active;
|
|
4835
4975
|
try{
|
|
@@ -5268,7 +5408,6 @@ function sectionShapeComponents(profile,w,d,ppf,round){
|
|
|
5268
5408
|
// This must never throw: it runs inside render(), where an exception costs the whole canvas, not one
|
|
5269
5409
|
// footprint.
|
|
5270
5410
|
const _PLAN_XF_IDENTITY={rad:0,fitScale:1};
|
|
5271
|
-
const _PLAN_XF_UNREGISTERED=['registration-incomplete','view-kind-unsupported','scale-invalid','grid-unavailable'];
|
|
5272
5411
|
let _planXfCache={key:null,xf:_PLAN_XF_IDENTITY};
|
|
5273
5412
|
function planRegistration(){
|
|
5274
5413
|
if(!PlanXf||!P)return _PLAN_XF_IDENTITY;
|
|
@@ -5277,7 +5416,7 @@ function planRegistration(){
|
|
|
5277
5416
|
// resolves to a grid intersection, so relabelling an axis can turn the sheet a half-turn with the spacings
|
|
5278
5417
|
// and the control pixels untouched — and a key that missed them left an asymmetric section 180° wrong
|
|
5279
5418
|
// until something else happened to change. (Found by adversarial review.)
|
|
5280
|
-
const key=JSON.stringify([P.sheet,P.viewKind,P.datum_at,P.control2_at,P.datum_ref,P.control2_ref,P.pt_per_ft,
|
|
5419
|
+
const key=JSON.stringify([viewIdOf(P),P.sheet,P.viewKind,P.datum_at,P.control2_at,P.datum_ref,P.control2_ref,P.pt_per_ft,
|
|
5281
5420
|
g&&g.origin,g&&g.x,g&&g.y,g&&g.labels_x,g&&g.labels_y,g&&g.axes]);
|
|
5282
5421
|
if(key===_planXfCache.key)return _planXfCache.xf; // memoised: render() draws every column through here, and planTransform re-parses the grid on each call
|
|
5283
5422
|
let xf=_PLAN_XF_IDENTITY;
|
|
@@ -5285,11 +5424,29 @@ function planRegistration(){
|
|
|
5285
5424
|
const t=PlanXf.planTransform(P);
|
|
5286
5425
|
if(Number.isFinite(t.rotation)&&t.fitScale>0&&Number.isFinite(t.fitScale))xf={rad:t.rotation,fitScale:t.fitScale};
|
|
5287
5426
|
}catch(e){
|
|
5288
|
-
|
|
5289
|
-
|
|
5427
|
+
// Nothing reads a refusal off this cache — the banner takes the sheet-level one from the projection.
|
|
5428
|
+
// Carrying it here as a third cache field only invited the next reader to believe otherwise.
|
|
5429
|
+
const refusal=planRefusalFor(P);
|
|
5430
|
+
// Kept beside the visible surfaces, not replaced by them: the console line is what a developer greps
|
|
5431
|
+
// for in a bug report, and it costs nothing. Mid-authoring stays quiet; the footprint just falls back.
|
|
5432
|
+
if(refusal&&refusal.registered)
|
|
5433
|
+
console.warn('[steel] '+(viewLabel(P)||P.sheet||'?')+' has a registration this editor cannot use ('+refusal.code+') — column footprints are drawn unrotated and at the sheet’s stated scale, which may not be where the steel is.');
|
|
5290
5434
|
}
|
|
5291
5435
|
_planXfCache={key,xf};return xf;
|
|
5292
5436
|
}
|
|
5437
|
+
/* The same question asked of ANY plan, not just the active one — what the header pill scans.
|
|
5438
|
+
|
|
5439
|
+
Delegates to the projection module's classifier rather than deciding again here. It was decided twice
|
|
5440
|
+
for a while, and the two answers drifted the moment one of them learned that `grid-unavailable` covers
|
|
5441
|
+
both a missing grid and a broken one: the banner called a sheet a fault while the pill counted it as
|
|
5442
|
+
unfinished and stayed silent about it. One classifier, one answer. Never throws — it runs over every
|
|
5443
|
+
plan, including ones this editor would refuse to open. */
|
|
5444
|
+
function planRefusalFor(plan){
|
|
5445
|
+
if(!PlanXf||!plan||plan.viewKind!=='plan')return null;
|
|
5446
|
+
// Named here, not in the projection: `viewLabel` needs `C.plans` to count siblings (#938).
|
|
5447
|
+
try{ return V2Projection.registrationRefusal({...plan,grid:plan.grid||(C&&C.grid)||null,modelGrid:plan.modelGrid||(C&&C.grid)||null},viewLabel(plan)); }
|
|
5448
|
+
catch(_){ return null; }
|
|
5449
|
+
}
|
|
5293
5450
|
// The member's stored roll RE-EXPRESSED into `target` (a positionAuthoringBasis snapshot; null/global →
|
|
5294
5451
|
// world). ONE copy of the roll math — the 2D plan footprint targets global (positionEffectiveWorldRot),
|
|
5295
5452
|
// the Profile Position panel + 3D gizmo target the current authoring frame (positionAuthoringRoll). The
|
|
@@ -5560,7 +5717,7 @@ function reanchorDim(plan,d){let dropped=false;
|
|
|
5560
5717
|
function reanchorAllPlans(){let dropped=false;
|
|
5561
5718
|
if(P){const dims=JSON.parse(JSON.stringify(P.dims||[])),before=JSON.stringify(dims);
|
|
5562
5719
|
for(const d of dims)if(d&&(d.aRef||d.bRef)){if(reanchorDim({...P,dims},d))dropped=true;}
|
|
5563
|
-
if(JSON.stringify(dims)!==before)V2_SESSION.patchPlan(P
|
|
5720
|
+
if(JSON.stringify(dims)!==before)V2_SESSION.patchPlan(viewIdOf(P),{dims});
|
|
5564
5721
|
}
|
|
5565
5722
|
if(dropped)toast('A dimension lost its link to a removed member or grid line');}
|
|
5566
5723
|
// Live path for the 2D member/endpoint drag, which updateLine()s WITHOUT a full render (:4135/:4141): reanchor
|
|
@@ -5568,7 +5725,7 @@ function reanchorAllPlans(){let dropped=false;
|
|
|
5568
5725
|
function refreshMagneticDims2D(){
|
|
5569
5726
|
{const dims=JSON.parse(JSON.stringify(P.dims||[])),before=JSON.stringify(dims);
|
|
5570
5727
|
for(const d of dims)if(d&&(d.aRef||d.bRef))reanchorDim({...P,dims},d);
|
|
5571
|
-
if(JSON.stringify(dims)!==before)V2_SESSION.patchPlan(P
|
|
5728
|
+
if(JSON.stringify(dims)!==before)V2_SESSION.patchPlan(viewIdOf(P),{dims});
|
|
5572
5729
|
}
|
|
5573
5730
|
const dg=svg.querySelector('g.dimsg');if(dg)dg.innerHTML=renderDimsInner();}
|
|
5574
5731
|
// F9 (QA 2026-07-16): the ref a hand-dragged dim anchor should carry after landing at pt — so magnetism
|
|
@@ -6033,7 +6190,7 @@ function gridReadFromDrawing(keep){
|
|
|
6033
6190
|
function gridAskAiLabels(){
|
|
6034
6191
|
const geo=gridGeo();if(!geo)return;
|
|
6035
6192
|
const t=document.getElementById('askAiText');
|
|
6036
|
-
t.value='Read the structural grid bubble labels on
|
|
6193
|
+
t.value='Read the structural grid bubble labels on '+(viewLabel(P)||P.sheet)+' from the source drawing and set them on the model grid. '
|
|
6037
6194
|
+'Write each name to its axis row as grid.axes[].label — that is what the bubbles print and what sheet registration matches — and mirror the same tokens into grid.labels_x / grid.labels_y. '
|
|
6038
6195
|
+'The grid line positions are already detected: '+geo.v.length+' X lines (labels run left→right) and '+geo.h.length+' Y lines (labels run bottom→up). '
|
|
6039
6196
|
+'Give each as whitespace-separated tokens in that order, exactly as printed on the bubbles (e.g. "K J H G F.2 F D C B A").';
|
|
@@ -6065,11 +6222,11 @@ function setDimStyleMode(on){if(!C||(on&&view3d))return;dimStyleMode=!!on; //
|
|
|
6065
6222
|
function updatePlanDims(fn){
|
|
6066
6223
|
const dims=JSON.parse(JSON.stringify((P&&P.dims)||[])),before=JSON.stringify(dims);fn(dims);
|
|
6067
6224
|
if(JSON.stringify(dims)===before)return false;
|
|
6068
|
-
V2_SESSION.patchPlan(P
|
|
6225
|
+
V2_SESSION.patchPlan(viewIdOf(P),{dims});
|
|
6069
6226
|
return true;}
|
|
6070
6227
|
function updatePlanDim(id,fn){return updatePlanDims(dims=>{const d=dims.find(row=>row&&row.id===id);if(d)fn(d);});}
|
|
6071
6228
|
function deleteV2Selection(args){
|
|
6072
|
-
const effect=V2_SESSION.deleteSelection(P
|
|
6229
|
+
const effect=V2_SESSION.deleteSelection(viewIdOf(P),args),n=effect&&effect.value&&effect.value.presentationOnly?effect.value.presentationOnly.length:0;
|
|
6073
6230
|
if(n)toast(`${n} crossing column${n===1?' is':'s are'} derived from this sheet's cut and remain visible; no geometry was deleted.`);
|
|
6074
6231
|
return effect;}
|
|
6075
6232
|
function renderDimStylePanel(p){
|
|
@@ -6512,7 +6669,7 @@ function snapEndMulti(ms,tA,tB){const pv=snapshot();let n=0,skipped=0;
|
|
|
6512
6669
|
if(n){pushUndo(pv);render();sync3D();}return n;}
|
|
6513
6670
|
function doSplit(m,pt){if(isBrace(m)){toast('Braces can’t be split — edit them from the inspector');return;} // split/extend/trim disabled on braces (offset would create off-℄ WPs · Codex round-2)
|
|
6514
6671
|
const link=V2Projection.projectionLink(m);let made=[];
|
|
6515
|
-
const ok=edit(()=>{made=V2_SESSION.splitMember(link.
|
|
6672
|
+
const ok=edit(()=>{made=V2_SESSION.splitMember(link.viewId,link.memberId,pt).value;selIds=new Set(made);selDimIds.clear();});
|
|
6516
6673
|
if(ok!==false){geoMode=null;setGeo();}
|
|
6517
6674
|
}
|
|
6518
6675
|
// --- duplicates: members with coincident geometry (same two work-points, order-independent, ~3px tol) ---
|
|
@@ -6717,12 +6874,34 @@ function partReviewChipFor(jointId){
|
|
|
6717
6874
|
return '';}
|
|
6718
6875
|
function closeReviewFly(){
|
|
6719
6876
|
const fly=document.getElementById('reviewFly');if(fly)fly.classList.remove('open');
|
|
6720
|
-
for(const id of ['reviewStat','untrackedStat']){const b=document.getElementById(id);if(b)b.setAttribute('aria-expanded','false');}
|
|
6877
|
+
for(const id of ['reviewStat','untrackedStat','regStat']){const b=document.getElementById(id);if(b)b.setAttribute('aria-expanded','false');}
|
|
6721
6878
|
reviewFlyKind=null;}
|
|
6722
6879
|
function paintReviewFly(kind){
|
|
6723
6880
|
const list=document.getElementById('reviewFlyList'),title=document.getElementById('reviewFlyTitle'),
|
|
6724
6881
|
cnt=document.getElementById('reviewFlyCount'),more=document.getElementById('reviewFlyMore');
|
|
6725
|
-
if(!list
|
|
6882
|
+
if(!list)return;
|
|
6883
|
+
/* #935's list rides this popover rather than a fourth one — the comment on the two review stats already
|
|
6884
|
+
says a second, differently-behaving header popover is exactly the drift the baseline prevents. It is
|
|
6885
|
+
checked BEFORE the `reviewSummary` guard on purpose: registration comes from the contract in the
|
|
6886
|
+
browser, so it must still list when the SERVER could not derive the connection review. */
|
|
6887
|
+
if(kind==='registration'){
|
|
6888
|
+
title.textContent='Registration does not fit the grid';
|
|
6889
|
+
cnt.textContent=String(regRefusals.length);
|
|
6890
|
+
const shownReg=regRefusals.slice(0,REVIEW_LIST_CAP);
|
|
6891
|
+
// The whole tag on ONE line, literal attributes and all, exactly as the review rows above build theirs.
|
|
6892
|
+
// TWO guards require it and they require different things: verify:carrier-escaping matches per line, so
|
|
6893
|
+
// a data-command-id whose closing quote lands on the next line reads as unterminated; and the runtime
|
|
6894
|
+
// command-id scan reads the opening tag's own text, so an id assembled into a variable and concatenated
|
|
6895
|
+
// in reads as a runtime control with no id at all.
|
|
6896
|
+
list.innerHTML=shownReg.map(r=>{const name=esc(r.sheet||('view '+r.index));
|
|
6897
|
+
return '<button data-command-id="steel.registration-select#'+name+'" data-command-instance-label="'+name+'" class=frow data-plan="'+r.index+'"><span class=nm>'+name+'</span><span class=sub>'+esc(r.refusal.code)+'</span></button>';
|
|
6898
|
+
}).join('');
|
|
6899
|
+
more.hidden=regRefusals.length<=REVIEW_LIST_CAP;
|
|
6900
|
+
if(!more.hidden)more.textContent='Showing '+shownReg.length+' of '+regRefusals.length+'.';
|
|
6901
|
+
for(const b of list.querySelectorAll('.frow'))b.onclick=()=>{const i=+b.getAttribute('data-plan');closeReviewFly();setPlan(i);};
|
|
6902
|
+
return;
|
|
6903
|
+
}
|
|
6904
|
+
if(!reviewSummary)return;
|
|
6726
6905
|
const rows=kind==='needs-review'?(reviewSummary.needsReview||[]):(reviewSummary.untracked||[]);
|
|
6727
6906
|
title.textContent=kind==='needs-review'?'Needs review':'Not watched';
|
|
6728
6907
|
cnt.textContent=String(rows.length);
|
|
@@ -6740,13 +6919,15 @@ function paintReviewFly(kind){
|
|
|
6740
6919
|
if(!more.hidden)more.textContent='Showing '+shown.length+' of '+rows.length+'.';
|
|
6741
6920
|
for(const b of list.querySelectorAll('.frow'))b.onclick=()=>selectReviewedJoint(b.getAttribute('data-joint'),kind);}
|
|
6742
6921
|
function openReviewFly(kind,trigger){
|
|
6743
|
-
if(!
|
|
6922
|
+
if(kind==='registration'){if(!regRefusals.length)return;}
|
|
6923
|
+
else if(!reviewSummary||reviewUnavailable)return;
|
|
6744
6924
|
if(reviewFlyKind===kind){closeReviewFly();return;} // the trigger toggles
|
|
6745
6925
|
reviewFlyKind=kind;paintReviewFly(kind);
|
|
6746
6926
|
const fly=document.getElementById('reviewFly');if(!fly||!trigger)return;
|
|
6747
6927
|
const r=trigger.getBoundingClientRect();fly.style.left=Math.max(8,Math.min(r.left,window.innerWidth-266))+'px';fly.style.top=(r.bottom+6)+'px';
|
|
6748
6928
|
fly.classList.add('open');
|
|
6749
|
-
|
|
6929
|
+
{const owner=kind==='needs-review'?'reviewStat':kind==='untracked'?'untrackedStat':'regStat';
|
|
6930
|
+
for(const id of ['reviewStat','untrackedStat','regStat']){const b=document.getElementById(id);if(b)b.setAttribute('aria-expanded',String(id===owner));}}
|
|
6750
6931
|
const first=fly.querySelector('.frow');if(first)first.focus();}
|
|
6751
6932
|
/* A needs-review row selects the MEMBERS the user named — they exist in the contract, so this works in
|
|
6752
6933
|
Plan view where the joint itself has no representation. An untracked row has no members recorded, so
|
|
@@ -6925,7 +7106,7 @@ function render(){
|
|
|
6925
7106
|
// `profs` and `detTexts()` live — so the combobox offers the same list with no mirror to keep filled.
|
|
6926
7107
|
// Deleting the elements while these two writes stayed made render() throw on null here, which also
|
|
6927
7108
|
// killed every call after it on this line (stats/panel/upd*/syncDisplayRows). Measured in Chromium.
|
|
6928
|
-
svg.innerHTML=s; stats(); panel(); updUR(); updDup(); updateMemberEndStatus(); updConf(); updCS(); updConnBtn(); updBpBtn(); updSpBtn(); syncDisplayRows();restoreProfilePickerFocus(profileFocusToken);
|
|
7109
|
+
svg.innerHTML=s; stats(); panel(); updUR(); updDup(); updRegistration(); updateMemberEndStatus(); updConf(); updCS(); updConnBtn(); updBpBtn(); updSpBtn(); syncDisplayRows();restoreProfilePickerFocus(profileFocusToken);
|
|
6929
7110
|
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()).
|
|
6930
7111
|
if(view3dShown&&window.Steel3DView){window.Steel3DView.setSelection(selIds);if(window.Steel3DView.setGridSelection)window.Steel3DView.setGridSelection(selGridIds);updateIsolateBtn();if((selIds.size||selGridIds.size)&&window.Steel3DView.selectedClips&&window.Steel3DView.selectedClips().length)window.Steel3DView.setSelectedClips([]);refreshLegendSel();} // keep the 3D member + grid highlight in sync; selecting geometry clears any clip selection (exclusive)
|
|
6931
7112
|
try{updateConnCrumb();}catch(_){} // Connection Component breadcrumb follows the selection (3D-only; hidden at root)
|
|
@@ -6935,6 +7116,82 @@ function updDup(){const n=redundantDups().length;
|
|
|
6935
7116
|
document.getElementById('dpc').textContent=n;document.getElementById('dupStat').classList.toggle('has',n>0);
|
|
6936
7117
|
const b=document.getElementById('dupB');if(b.dataset.flash)return; // don't clobber transient "none" feedback
|
|
6937
7118
|
b.disabled=false;b.classList.toggle('alert',n>0);b.textContent=n>0?('Duplicates ('+n+')'):'Check duplicates';}
|
|
7119
|
+
/* #935 — the plan-registration refusal, made VISIBLE.
|
|
7120
|
+
|
|
7121
|
+
Two surfaces, deliberately, because one of them cannot do the other's job:
|
|
7122
|
+
|
|
7123
|
+
- The CANVAS banner speaks for the sheet you are looking at, because that is the sheet whose steel is
|
|
7124
|
+
being drawn in the wrong place right now.
|
|
7125
|
+
- The HEADER pill counts EVERY plan. The reported defect placed a 250-member model a median of 18 m
|
|
7126
|
+
out while its author worked on other sheets, so a surface that only speaks when you happen to open
|
|
7127
|
+
the bad one repeats the bug in miniature.
|
|
7128
|
+
|
|
7129
|
+
Neither is dismissible. A notice you can silence is the silent-wrongness this exists to end, one click
|
|
7130
|
+
later. Both disappear on their own the moment the contract stops being refused. */
|
|
7131
|
+
let regRefusals=[],regBannerSheet=null;
|
|
7132
|
+
function updRegistration(){
|
|
7133
|
+
// Every plan, not the active one. Cheap: planTransform parses one grid per plan and this runs on
|
|
7134
|
+
// model change, not per frame.
|
|
7135
|
+
regRefusals=(C&&Array.isArray(C.plans)?C.plans:[]).map((plan,index)=>{
|
|
7136
|
+
const refusal=planRefusalFor(plan);
|
|
7137
|
+
// `registered:false` sheets are excluded: the pill exists to chase FAULTS across the set, and a count
|
|
7138
|
+
// that also totals every half-authored sheet is a number the reader learns to ignore. Those sheets
|
|
7139
|
+
// still explain themselves on their own canvas.
|
|
7140
|
+
// `sheet` here is the LABEL a human clicks, so it must disambiguate: five refused elevations on one
|
|
7141
|
+
// page all called "S5.1" is a list nobody can act on (#938).
|
|
7142
|
+
return refusal&&refusal.registered?{index,sheet:viewLabel(plan)||((plan&&plan.sheet)||''),refusal}:null;
|
|
7143
|
+
}).filter(Boolean);
|
|
7144
|
+
const pill=document.getElementById('regStat'),count=document.getElementById('regCount');
|
|
7145
|
+
if(pill&&count){count.textContent=String(regRefusals.length);pill.hidden=regRefusals.length===0;
|
|
7146
|
+
if(!regRefusals.length&&reviewFlyKind==='registration')closeReviewFly();}
|
|
7147
|
+
paintRegBanner();}
|
|
7148
|
+
/** The active sheet's banner. Reads the memoised `_planXfCache.refusal` rather than transforming again —
|
|
7149
|
+
render() already asked planRegistration() for this exact key. */
|
|
7150
|
+
function paintRegBanner(){
|
|
7151
|
+
const bar=document.getElementById('regBanner');if(!bar)return;
|
|
7152
|
+
// The ACTIVE PROJECTION's refusal, which is the sheet-level question: can this plan be mapped into
|
|
7153
|
+
// display pixels at all. `_planXfCache` answers a narrower one (can a column footprint be rotated), and
|
|
7154
|
+
// reading that here would leave the banner silent on a sheet carrying no columns.
|
|
7155
|
+
const refusal=(P&&P.registrationRefusal)||null;
|
|
7156
|
+
// A banner that carried over from the sheet you just left would accuse the wrong drawing, so the text
|
|
7157
|
+
// AND the expanded/collapsed state reset on every sheet change.
|
|
7158
|
+
// By VIEW (#938). Page-keyed, this banner did not reset when you switched between two refused
|
|
7159
|
+
// elevations on ONE page — the exact carry-over its own comment says would accuse the wrong drawing.
|
|
7160
|
+
// TWO DIFFERENT THINGS, and they were one variable until review separated them (#938). The RESET KEY
|
|
7161
|
+
// is the view id: page-keyed, this banner did not reset when you switched between two refused
|
|
7162
|
+
// elevations on ONE page, which is the carry-over its comment above says would accuse the wrong
|
|
7163
|
+
// drawing. The NAME is `viewLabel`, because a raw view id is not what this view is called anywhere
|
|
7164
|
+
// else — and using the id here was a regression on the ordinary case too: a lone view legitimately
|
|
7165
|
+
// named `E-A` on page `S5.1` read `Sheet "E-A"` where every other surface says `S5.1`.
|
|
7166
|
+
const sheet=(P&&viewIdOf(P))||'';
|
|
7167
|
+
const sheetName=viewLabel(P)||sheet;
|
|
7168
|
+
if(sheet!==regBannerSheet){regBannerSheet=sheet;bar.classList.remove('det');
|
|
7169
|
+
const t=document.getElementById('regDetailBtn');if(t)t.setAttribute('aria-expanded','false');}
|
|
7170
|
+
if(!refusal){bar.classList.remove('on');bar.classList.remove('plain');return;}
|
|
7171
|
+
// textContent, never innerHTML: a sheet name and an axis id are author-written strings that reach here
|
|
7172
|
+
// unescaped.
|
|
7173
|
+
document.getElementById('regLead').textContent=regLeadText(sheetName,refusal);
|
|
7174
|
+
document.getElementById('regDetail').textContent=refusal.message;
|
|
7175
|
+
// Amber only for a registration that IS stated and does not hold. A sheet still being authored recedes
|
|
7176
|
+
// to the neutral tier, exactly as #rcIssues' own `.rcban.plain` does: this file uses amber to mean
|
|
7177
|
+
// “needs review”, and colouring ordinary unfinished work that way misreports it as a fault.
|
|
7178
|
+
bar.classList.toggle('plain',!refusal.registered);
|
|
7179
|
+
bar.classList.add('on');}
|
|
7180
|
+
/** The plain-English lead. A steel detailer reads this one; the exact `$.`-path sentence is under Details. */
|
|
7181
|
+
function regLeadText(sheet,refusal){
|
|
7182
|
+
const name='Sheet “'+(sheet||'this sheet')+'”';
|
|
7183
|
+
/* The neutral lead names WHAT IS MISSING rather than asserting one remedy. It used to say "the sheet
|
|
7184
|
+
just needs its two registration points" for every neutral code, which is false when the missing thing
|
|
7185
|
+
is the grid or the drawing scale — and the reassurance "nothing is wrong" is worse than useless when
|
|
7186
|
+
it is aimed at the wrong field. */
|
|
7187
|
+
if(!refusal.registered){
|
|
7188
|
+
const missing=refusal.code==='grid-unavailable'?'there is no model grid yet for it to register against'
|
|
7189
|
+
:refusal.code==='scale-invalid'?'its drawing scale has not been set yet'
|
|
7190
|
+
:'its two registration points have not been set yet';
|
|
7191
|
+
return name+' cannot be placed on the model: '+missing+', so FloLess has nowhere to put its steel. '
|
|
7192
|
+
+'Nothing is wrong — this part of the read is simply not finished.';}
|
|
7193
|
+
return name+' states a registration that does not hold: its two registration points do not agree with the grid lines they name, '
|
|
7194
|
+
+'so steel taken off this sheet would be metres out of place. No steel is placed on it until that is corrected.';}
|
|
6938
7195
|
// keep selection-number badges constant on screen while zooming; the end dots grow with zoom (epR) so
|
|
6939
7196
|
// they stay readable against the thick member line — both must track zoom live as the user zooms.
|
|
6940
7197
|
function updateBadges(){const R=12/zoom,F=13/zoom,ox=el=>(+el.dataset.fi-(+el.dataset.gn-1)/2)*R*2;
|
|
@@ -7098,9 +7355,12 @@ function syncV2SelectionNotice(p){
|
|
|
7098
7355
|
const ids=[...selIds].filter(id=>!!(C.members||[]).find(m=>m&&m.id===id));
|
|
7099
7356
|
if(!ids.length)return;
|
|
7100
7357
|
const other=[];
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7358
|
+
// Membership is asked by VIEW and answered by PAGE (#938): "also on S5.1" must say the page once,
|
|
7359
|
+
// however many of its views draw the member, while whether it is drawn there is a per-view question.
|
|
7360
|
+
// `memberPhysicalSheets` owns the dedupe so this file and the projection cannot drift apart on it.
|
|
7361
|
+
const herePage=(P&&P.sheet)||'';
|
|
7362
|
+
for(const id of ids)for(const page of V2Projection.memberPhysicalSheets(C,id)){
|
|
7363
|
+
if(page!==herePage&&!other.includes(page))other.push(page);
|
|
7104
7364
|
}
|
|
7105
7365
|
const anchor=p.querySelector(':scope > h3,:scope > .badge');
|
|
7106
7366
|
let after=anchor;
|
|
@@ -7109,6 +7369,32 @@ function syncV2SelectionNotice(p){
|
|
|
7109
7369
|
n.textContent=(ids.length===1?'Also on ':'Selected members also appear on ')+[...new Set(other)].join(', ')+'.';
|
|
7110
7370
|
if(after)after.after(n);else p.prepend(n);after=n;
|
|
7111
7371
|
}
|
|
7372
|
+
/*
|
|
7373
|
+
* A PARTLY-resolvable selection, which is the case the refused-sheet panel branch cannot see (#942).
|
|
7374
|
+
*
|
|
7375
|
+
* That branch fires only when NOTHING resolves. Select one member drawn on a valid sheet and another
|
|
7376
|
+
* that exists only on the refused one and `selArr()` returns just the first, so the ordinary editable
|
|
7377
|
+
* inspector renders for it — correctly, but describing one member while the 3D view shows two selected,
|
|
7378
|
+
* and saying nothing at all about the one it dropped. Silently losing a member from a model-wide
|
|
7379
|
+
* selection is the exact failure #935 and #942 exist to end, so it is reported HERE, on the notice
|
|
7380
|
+
* surface that already runs on every render, rather than by widening the panel branch: merging
|
|
7381
|
+
* unprojected rows INTO the editable panel means handing a dozen `wp` call sites a row without one,
|
|
7382
|
+
* which is the audit-and-split refactor #942 deliberately defers. (Codex review.)
|
|
7383
|
+
*/
|
|
7384
|
+
{const resolved=new Set(selArr().map(m=>m&&m.id));
|
|
7385
|
+
const lost=ids.filter(id=>!resolved.has(id));
|
|
7386
|
+
if(lost.length&&resolved.size){
|
|
7387
|
+
const row=document.createElement('div');row.className='drow v2-selection-notice';row.setAttribute('role','status');row.setAttribute('aria-live','polite');row.style.marginTop='8px';
|
|
7388
|
+
const msg=document.createElement('div');msg.className='dmsg warn';
|
|
7389
|
+
// The reason comes from the LOST members' own sheets, not from `P` — the active sheet may be perfectly
|
|
7390
|
+
// valid while the member that vanished belongs to a refused one, and naming `P` there would blame the
|
|
7391
|
+
// wrong drawing. See `blockingViewsFor` — keyed by VIEW since #938, and NAMED with `viewLabel`,
|
|
7392
|
+
// because the key is a view id and a bare view id is not what any other surface calls this view.
|
|
7393
|
+
const blocking=blockingViewsFor(lost),reason=blocking.size
|
|
7394
|
+
?(' '+[...blocking.keys()].map(v=>{const pl=(C&&C.plans||[]).find(x=>viewIdOf(x)===v);
|
|
7395
|
+
return regLeadText((pl&&viewLabel(pl))||v,blocking.get(v));}).join(' ')):'';
|
|
7396
|
+
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;
|
|
7397
|
+
row.appendChild(msg);if(after)after.after(row);else p.prepend(row);after=row;}}
|
|
7112
7398
|
const selected=(C.members||[]).filter(m=>ids.includes(m.id));
|
|
7113
7399
|
const unknown=selected.reduce((n,m)=>n+(!Number.isFinite(m?.from?.z?.known)?1:0)+(!Number.isFinite(m?.to?.z?.known)?1:0),0);
|
|
7114
7400
|
if(unknown){
|
|
@@ -7207,6 +7493,140 @@ function nativeElevationContextHtml(){
|
|
|
7207
7493
|
'<div class=hint style="margin:0 0 5px;font-size:11px">Visible member endpoints <b>'+esc(range)+'</b>'+ (unknown?' · '+unknown+' unknown':'') +'</div>'+
|
|
7208
7494
|
'<div class=hint style="margin:0;font-size:11px">Member elevations are explicit in this model. Select a member to inspect or edit its endpoints.</div></div>';
|
|
7209
7495
|
}
|
|
7496
|
+
/*
|
|
7497
|
+
* The refused-sheet inspector's READ-ONLY property list (#942).
|
|
7498
|
+
*
|
|
7499
|
+
* Takes CANONICAL rows (`selCanonicalArr()`), never projected ones — that is the whole point: this runs
|
|
7500
|
+
* exactly when the active sheet's registration is refused and there are no projected rows to read.
|
|
7501
|
+
*
|
|
7502
|
+
* The values come from `PROP_DEFS`, the same registry the plan label chips and the property-label popup
|
|
7503
|
+
* read, so what the inspector says here and what a label would say elsewhere cannot disagree. A row whose
|
|
7504
|
+
* value is `undefined` (a column has no start TOS; a member with no resolved section has no placement) or
|
|
7505
|
+
* empty is skipped rather than printed blank, matching `propLabelLinesFor`.
|
|
7506
|
+
*
|
|
7507
|
+
* MATERIAL is added on top, because it is a member property the user asked for and is deliberately NOT a
|
|
7508
|
+
* PROP_DEFS row — that registry drives the plan-label picker, and adding a key to it would add a label
|
|
7509
|
+
* option, which is a different change.
|
|
7510
|
+
*
|
|
7511
|
+
* It renders NO control. Every row is text: these rows are detached copies with no projection link, so an
|
|
7512
|
+
* editing command handed one would resolve nothing (see `selCanonicalArr`). The panel says where to edit
|
|
7513
|
+
* instead.
|
|
7514
|
+
*/
|
|
7515
|
+
function refusedSheetPropsHtml(rows){
|
|
7516
|
+
const kv=(l,val)=>`<div style="display:flex;justify-content:space-between;gap:8px;font-size:12px;margin:3px 0"><span style="color:var(--mut)">${esc(l)}</span><span style="font-variant-numeric:tabular-nums">${val}</span></div>`;
|
|
7517
|
+
const sec=t=>`<div class=divrow><hr><span class=sect style="margin:0">${esc(t)}</span><hr></div>`;
|
|
7518
|
+
// NOT pre-escaped: `kv` escapes its own label, so escaping here rendered a legal mark like `A&B` as
|
|
7519
|
+
// `A&B` — the panel misquoting the user's own id, which is the small untruth this whole issue is about.
|
|
7520
|
+
const mark=m=>(m.id==null?'—':String(m.id));
|
|
7521
|
+
// A multi-selection gets one identifying line each rather than N full property lists — a box-select can
|
|
7522
|
+
// carry hundreds, and a panel that long is not a readout. CAP keeps it a panel; the count says what was cut.
|
|
7523
|
+
if(rows.length!==1){
|
|
7524
|
+
const CAP=12,shown=rows.slice(0,CAP);
|
|
7525
|
+
return sec('Selected members')
|
|
7526
|
+
+shown.map(m=>kv(mark(m),esc((m.profile||'—')+' · '+memberTypeLabel(memberTypeOf(m))))).join('')
|
|
7527
|
+
+(rows.length>CAP?'<div class=hint style="margin-top:6px">…and '+(rows.length-CAP)+' more.</div>':'')
|
|
7528
|
+
+'<div class=hint style="margin-top:6px">Select a single member to see its full properties.</div>';}
|
|
7529
|
+
const m=ensureMeta(rows[0]);
|
|
7530
|
+
// The mark is a DATA row, not the section header. `.sect` uppercases, and a mark is the member's stored
|
|
7531
|
+
// id — rendering `m-beam-1` as `M-BEAM-1` would be the panel restating the user's own data as something
|
|
7532
|
+
// it is not. Section headers are labels and may be uppercased; ids may not.
|
|
7533
|
+
let out=sec('Properties');
|
|
7534
|
+
out+=kv('Mark',esc(m.id==null?'—':String(m.id)));
|
|
7535
|
+
out+=kv('Profile',esc(m.profile||'—'));
|
|
7536
|
+
out+=kv('Material',m.material?esc(m.material):esc(profileDefaultMaterial(m.profile))+' <span style="color:var(--mut);font-size:11px">· profile default</span>');
|
|
7537
|
+
const withheld=[];
|
|
7538
|
+
for(const def of PROP_DEFS){
|
|
7539
|
+
if(def.key==='id'||def.key==='profile')continue; // the mark heads the block; the profile leads it
|
|
7540
|
+
// A row that really is coordinate-derived is NAMED as withheld, never quietly dropped: a property
|
|
7541
|
+
// missing without explanation reads as "this member has none", which is the class of silence #935 and
|
|
7542
|
+
// #942 both exist to end. `canonicalGet` first, though — see `needsPlan` in PROP_DEFS: a stored
|
|
7543
|
+
// position is not an inference, and withholding it would be its own small untruth.
|
|
7544
|
+
//
|
|
7545
|
+
// `labelGet` over `get`, exactly as `propLabelLinesFor` does, and for exactly its reason: `_lenFt`
|
|
7546
|
+
// answers a fail-soft 0 for a member whose elevations are unknown, so `get` alone prints
|
|
7547
|
+
// "Length 0.0 ft · Weight 0 lb" as fact under a heading that says these come from the model itself.
|
|
7548
|
+
// They were never read. `labelGet` answers undefined there, and the row is skipped. (Codex review.)
|
|
7549
|
+
//
|
|
7550
|
+
// A COLUMN's `col_note`/`col_detail` are skipped and re-rendered per-end below, for the same reason the
|
|
7551
|
+
// connections are: `col` mirrors end 1 only, so those two rows show the TOP annotation and silently drop
|
|
7552
|
+
// the base one — and the fixture column's own `ends[0].note` ("base plate") is exactly the kind of thing
|
|
7553
|
+
// that disappeared, while its base CONNECTION was shown right beneath it. (Codex review.)
|
|
7554
|
+
if(m.role==='column'&&(def.key==='col_note'||def.key==='col_detail'))continue;
|
|
7555
|
+
const raw=def.needsPlan?(def.canonicalGet?def.canonicalGet(m):undefined):(def.labelGet||def.get)(m);
|
|
7556
|
+
if(raw===undefined){if(def.needsPlan)withheld.push(def.label);continue;}
|
|
7557
|
+
const t=def.fmt(raw);if(t==='')continue;
|
|
7558
|
+
out+=kv(def.label,esc(t));}
|
|
7559
|
+
if(m.role==='column'){const endTxt=(label,v)=>((v==null||v==='')?'':kv(label,esc(String(v))));
|
|
7560
|
+
out+=endTxt('Note (base)',m.ends&&m.ends[0]&&m.ends[0].note)+endTxt('Note (top)',m.ends&&m.ends[1]&&m.ends[1].note)
|
|
7561
|
+
+endTxt('Detail (base)',m.ends&&m.ends[0]&&m.ends[0].detail)+endTxt('Detail (top)',m.ends&&m.ends[1]&&m.ends[1].detail);}
|
|
7562
|
+
// The connection LIBRARY rows the ends point at. `note`/`detail` above are the annotation; this is the
|
|
7563
|
+
// row it resolves to, and an id that resolves to nothing says so rather than printing a bare token.
|
|
7564
|
+
//
|
|
7565
|
+
// BOTH ENDS, read off `ends[]` rather than through `col` — including for a column. The projected `col`
|
|
7566
|
+
// block mirrors end 1 only (`projectMember`), so a column's BASE-PLATE connection, which is the one a
|
|
7567
|
+
// column usually has, is not reachable through it at all. The canonical row carries the whole `ends`
|
|
7568
|
+
// array, so there is no reason to inherit that blind spot here.
|
|
7569
|
+
//
|
|
7570
|
+
// …and `C.joints` as well as `ends[].conn`, because the two are INDEPENDENT records and either can
|
|
7571
|
+
// stand alone. A contract carrying only the joint — `{kind:'base-plate', main:'m-col-1', at:'base',
|
|
7572
|
+
// conn:'cx-1'}` with no `conn` mirrored onto the member's end — is fully valid: the schema and
|
|
7573
|
+
// `checkModelReferences` both pass it (measured), and `jointAtEnd` resolves it, so the 3D draws the built
|
|
7574
|
+
// base plate. Reading only `ends[].conn` would have shown that member no connections at all. (Codex.)
|
|
7575
|
+
const cite=cid=>{const r=connRowById(cid);return r?esc(connLabel(r)):esc(cid)+' <span style="color:var(--mut);font-size:11px">· not in the connection library</span>';};
|
|
7576
|
+
const conn=(label,endCid,joint)=>{
|
|
7577
|
+
const jCid=joint&&joint.conn,kind=joint?esc(connKindLabel(joint.kind)):'';
|
|
7578
|
+
if(!endCid&&!jCid&&!joint)return '';
|
|
7579
|
+
/* The two records can DISAGREE, and neither may then be silently preferred. `checkModelReferences`
|
|
7580
|
+
validates `$.joints[i].conn` and `members[].ends[].conn` independently, so a contract where the end
|
|
7581
|
+
cites cx-1 and its base-plate joint cites cx-2 reaches the editor intact. Folding that to
|
|
7582
|
+
`endCid || jCid` printed "Base plate · cx-1" — the joint's KIND beside the end's ROW, a hybrid true
|
|
7583
|
+
of neither record, with the joint's own library row nowhere on screen. Show both and name the
|
|
7584
|
+
conflict; picking a winner here is the panel deciding something the model has not. (Codex review.) */
|
|
7585
|
+
if(endCid&&jCid&&endCid!==jCid)
|
|
7586
|
+
return kv(label,[kind,cite(jCid)].filter(Boolean).join(' · ')
|
|
7587
|
+
+' <span style="color:var(--warn-soft);font-size:11px">· conflicting references</span>')
|
|
7588
|
+
+kv(label+' · member end',cite(endCid));
|
|
7589
|
+
const only=endCid||jCid;
|
|
7590
|
+
// `name` BEFORE the library row, and it is often the only thing there is: the Favourites and import
|
|
7591
|
+
// bakes store `{kind:'custom', name:'…', geometry}` with NO `conn` at all, so a renderer reading only
|
|
7592
|
+
// the kind and the library reference showed such a connection as a bare "Imported" and dropped its one
|
|
7593
|
+
// identifying value. (Codex review — which also noted the first fixture invented a `conn` and so never
|
|
7594
|
+
// exercised the shape the product actually writes.)
|
|
7595
|
+
return kv(label,[kind,(joint&&joint.name)?esc(String(joint.name)):'',only?cite(only):''].filter(Boolean).join(' · '));};
|
|
7596
|
+
const isCol=m.role==='column';
|
|
7597
|
+
const endLabels=isCol?['Connection (base)','Connection (top)']:['Connection (start)','Connection (end)'];
|
|
7598
|
+
// The editor's own end vocabulary: a column's BASE is 'col' (`jointAtFor` maps it to at:'base'), every
|
|
7599
|
+
// other end is its index. Using it here is what keeps this readout and `jointAtEnd` in agreement.
|
|
7600
|
+
const cx=[0,1].map(i=>{const e=(m.ends||[])[i]||{},j=jointAtEnd(m.id,(isCol&&i===0)?'col':i);
|
|
7601
|
+
return conn(endLabels[i],e.conn||(j&&j.conn),j);}).join('')
|
|
7602
|
+
/* …plus the MEMBER-LEVEL custom joint, which no end lookup can reach. An imported (IFC) joint carries
|
|
7603
|
+
`main` but never an `at` — the import and favourite bakes both omit it, which is why `customJointOn`
|
|
7604
|
+
exists at all — so `jointAtEnd` is blind to one by construction. Without a mirrored `ends[].conn` the
|
|
7605
|
+
panel then showed a member with real imported connection geometry no connections whatsoever.
|
|
7606
|
+
Reported against the MEMBER rather than an end, deliberately and for the same reason `customJointOn`
|
|
7607
|
+
matches by member alone: with no `at` we cannot say where on the member it sits, and naming it
|
|
7608
|
+
without placing it is the honest side of that ignorance. (Codex review.) */
|
|
7609
|
+
// EVERY one of them, not `customJointOn`'s first. Both placement paths `C.joints.push` a custom joint
|
|
7610
|
+
// without filtering out an earlier one on the same member — unlike the brace-gusset and shear-plate
|
|
7611
|
+
// paths, which explicitly replace — so a member can legitimately carry several, and the 3D draws them
|
|
7612
|
+
// all. `customJointOn` uses `.find()` because its own job is a yes/no refusal; a readout needs the list.
|
|
7613
|
+
+(C.joints||[]).filter(j=>j&&j.kind==='custom'&&j.main===m.id)
|
|
7614
|
+
.map(j=>conn('Connection (imported)',null,j)).join('');
|
|
7615
|
+
/* The SUPPORT side. `toggleShearPlates` (and the detail bake) both write the joint with the BEAM as
|
|
7616
|
+
`main` and the supporting column in `secondaries`, so every lookup above — all of which match `main` —
|
|
7617
|
+
is blind to it: select the column and its six framing-in shear plates were all absent, though the 3D
|
|
7618
|
+
draws every one. Labelled distinctly rather than folded in with the member's own ends, because it is a
|
|
7619
|
+
different fact: this connection lands ON the member, it is not one the member's end declares, and the
|
|
7620
|
+
editable inspector does not show it either. Naming it that way is what keeps the extra honest.
|
|
7621
|
+
(Codex review.) */
|
|
7622
|
+
const framing=(C.joints||[]).filter(j=>j&&Array.isArray(j.secondaries)&&j.secondaries.includes(m.id))
|
|
7623
|
+
.map(j=>kv('Framing in',[esc(connKindLabel(j.kind)),j.main?('from '+esc(String(j.main))):'',
|
|
7624
|
+
j.name?esc(String(j.name)):'',j.conn?cite(j.conn):''].filter(Boolean).join(' · '))).join('');
|
|
7625
|
+
if(cx||framing)out+=sec('Connections')+cx+framing;
|
|
7626
|
+
// Worded without naming a refusal, because this block is also rendered for a sheet whose registration is
|
|
7627
|
+
// merely UNFINISHED — where "the refusal" would be an accusation about work nobody has done yet.
|
|
7628
|
+
if(withheld.length)out+='<div class=hint style="margin-top:8px">'+esc(withheld.join(' and '))+(withheld.length>1?' are':' is')+' not shown here — '+(withheld.length>1?'they are':'it is')+' derived from how the member is drawn on this sheet, and that is the part no sheet can supply right now.</div>';
|
|
7629
|
+
return out;}
|
|
7210
7630
|
function panel(){
|
|
7211
7631
|
const p=document.getElementById('panel');
|
|
7212
7632
|
p.removeAttribute('aria-busy');p.removeAttribute('aria-labelledby');
|
|
@@ -7530,6 +7950,57 @@ function panel(){
|
|
|
7530
7950
|
{const qb=document.getElementById('qdPlaceG');if(qb)qb.onclick=()=>quickDimSpacing(qdAnchorPt);}
|
|
7531
7951
|
return;}
|
|
7532
7952
|
const arr=selArr();
|
|
7953
|
+
/* A selection that resolved to NOTHING is not an empty selection, and showing the legend for it tells
|
|
7954
|
+
the user their click did nothing. It happens on a sheet whose registration is refused: the plan
|
|
7955
|
+
projects no members, so a member picked in the 3D view — which draws from the canonical model and is
|
|
7956
|
+
unaffected — has no plan-space twin for `selArr()` to return. Say that, rather than go quiet.
|
|
7957
|
+
#942: and then say WHAT IT IS. The member's own properties never depended on the registration, so they
|
|
7958
|
+
are read from the canonical model (`selCanonicalArr`) and shown read-only beneath the reason. Only the
|
|
7959
|
+
coordinate-dependent half — drawing it, dragging it, dimensioning it — is genuinely blocked here. */
|
|
7960
|
+
{const canon=(arr.length===0&&selIds.size)?selCanonicalArr():[];
|
|
7961
|
+
const blocking=canon.length?blockingViewsFor(canon.map(m=>m.id)):new Map();
|
|
7962
|
+
/* Keyed on the SELECTION's own views, not on `P` — see `blockingViewsFor`. An empty map means this is
|
|
7963
|
+
not a registration problem, so the existing behaviour below is left exactly as it was. */
|
|
7964
|
+
if(blocking.size){
|
|
7965
|
+
/* Keys are view ids; `nameOfView` is what a human is shown (#938). Printing the key here would
|
|
7966
|
+
put a bare view id in front of the author, which is the defect this change removed from six
|
|
7967
|
+
other surfaces. */
|
|
7968
|
+
const sheets=[...blocking.keys()];
|
|
7969
|
+
const nameOfView=(v)=>{const pl=(C&&C.plans||[]).find(x=>viewIdOf(x)===v);return (pl&&viewLabel(pl))||v;};
|
|
7970
|
+
/* UNFINISHED IS NOT A FAULT, and saying otherwise here would undo #935's own tone rule one surface
|
|
7971
|
+
over. `registrationRefusal.registered === false` means nothing has been STATED yet — no control
|
|
7972
|
+
points, no grid, no scale — and `regLeadText` duly says "Nothing is wrong … simply not finished".
|
|
7973
|
+
Following that with a remedy that calls the registration "refused" and demands it be "corrected"
|
|
7974
|
+
contradicts the sentence directly above it and points the author at repairing data they never
|
|
7975
|
+
entered. So the tone AND the verb both follow the flag: the fault tier only when some blocking sheet
|
|
7976
|
+
really states a registration that does not hold. (Codex review.) */
|
|
7977
|
+
/* PARTITIONED, not collapsed. A selection can span both kinds at once — one sheet stating a
|
|
7978
|
+
registration that does not hold, another simply unfinished — and a single `some()` verdict then
|
|
7979
|
+
called BOTH refused and told the author to correct both, contradicting the neutral `regLeadText`
|
|
7980
|
+
sentence printed for the unfinished one a line above. Each group states its own status and its own
|
|
7981
|
+
remedy; the TONE is still the fault tier if any real fault is present, because an amber panel that
|
|
7982
|
+
also mentions unfinished work is honest, while a muted one hiding a real fault is not.
|
|
7983
|
+
(Codex review, which reproduced the mixed case.) */
|
|
7984
|
+
const faultSheets=sheets.filter(s=>blocking.get(s).registered!==false);
|
|
7985
|
+
const openSheets=sheets.filter(s=>blocking.get(s).registered===false);
|
|
7986
|
+
const faulted=faultSheets.length>0;
|
|
7987
|
+
const clause=(list,state,verb)=>list.length?(' The registration'+(list.length>1?'s':'')+' on '+esc(list.map(nameOfView).join(', '))
|
|
7988
|
+
+(list.length>1?' are ':' is ')+state+' — '+verb+(list.length>1?' them':' it')+' is what brings its editing controls back.'):'';
|
|
7989
|
+
p.innerHTML='<h3>Selected on another view</h3><div class="dmsg'+(faulted?' warn':'')+'" style="margin-top:8px">'
|
|
7990
|
+
+esc(selIds.size===1?'That member cannot be shown here.':'Those '+selIds.size+' members cannot be shown here.')
|
|
7991
|
+
+' '+sheets.map(s=>esc(regLeadText(nameOfView(s),blocking.get(s)))).join(' ')+'</div>'
|
|
7992
|
+
/* The remedy sentence names the ONE route that works, and that is a correction rather than a polish.
|
|
7993
|
+
It used to offer "or in the 3D view", which is unreachable for precisely the members that get here:
|
|
7994
|
+
every 3D write path — onMoveMember, onMoveEndpoint, onElevateMember, onSplit, commitMemberPosition —
|
|
7995
|
+
resolves its target through `byId`, i.e. `v2ProjectedMember`, and this branch is entered only when
|
|
7996
|
+
that returns nothing for the whole selection. So the drag would have silently done nothing, which is
|
|
7997
|
+
the failure mode this issue exists to end, printed as advice. Nor can another sheet help: `byId`
|
|
7998
|
+
already walks every sheet, so reaching here means NO sheet can draw it. Correcting the registration
|
|
7999
|
+
is the only true remedy — and it NAMES the sheet, because that sheet need not be the one on screen. */
|
|
8000
|
+
+'<div class="row hint" style="margin-top:8px">Read-only — these come from the model itself, so nothing about the sheets’ registration changes them. No sheet can draw this member yet.'
|
|
8001
|
+
+clause(faultSheets,'refused','correcting')+clause(openSheets,'not finished yet','finishing')+'</div>'
|
|
8002
|
+
+refusedSheetPropsHtml(canon);
|
|
8003
|
+
return;}}
|
|
7533
8004
|
if(arr.length===0){const elevationContext=nativeElevationModel()?nativeElevationContextHtml():
|
|
7534
8005
|
'<div style="border-top:1px solid var(--line);margin-top:12px;padding-top:12px"><div class=sect>Project defaults</div>'+
|
|
7535
8006
|
'<div class=hint style="margin:0 0 6px;font-size:11px">Level <b>'+esc(fmtFtIn(defaultTOS))+'</b> ('+esc(P.sheet)+'). '+((P.tos_callouts&&P.tos_callouts.length)?'Per-zone T.O. STEEL callouts from the drawing applied to each member; ':'')+'ends ticked <b>default</b> follow the level.</div>'+
|
|
@@ -8383,7 +8854,50 @@ const PROP_DEFS=[
|
|
|
8383
8854
|
{key:'weight', label:'Weight', get:m=>{const w=_wt(m.profile);return w==null?undefined:_lenFt(m)*w;}, labelGet:m=>{const w=_wt(m.profile),l=_lenFtLabel(m);return (w==null||l==null)?undefined:l*w;}, fmt:v=>v==null?'':Math.round(v).toLocaleString('en-US')+' lb'},
|
|
8384
8855
|
// The column suppression is GONE: a column takes the same Profile Position as every other member now
|
|
8385
8856
|
// (design §4), so hiding its depth face would be the label lying about geometry the bake applies.
|
|
8386
|
-
|
|
8857
|
+
//
|
|
8858
|
+
// `needsPlan` MARKS A GETTER THAT MAY NEED A PLAN COORDINATE (#942), and it is declared here, beside the
|
|
8859
|
+
// getter, rather than as a list somewhere else the next author would not think to update. `posDefault`
|
|
8860
|
+
// derives the depth face from the member's PLAN RUN (`m.wp`) measured in the active sheet's px scale, so
|
|
8861
|
+
// on the canonical read path — which carries no `wp` at all — there is nothing to derive it from. This is
|
|
8862
|
+
// the ONLY getter here that needs one: `posHDefault` reads `m.positionH` alone, so the width face stays
|
|
8863
|
+
// knowable and is still shown.
|
|
8864
|
+
//
|
|
8865
|
+
// `canonicalGet` is the answer for the cases where it does NOT need one, and it exists because "may" is
|
|
8866
|
+
// doing real work in that first sentence. `effectiveDepthPosition` returns an explicit top/middle/bottom
|
|
8867
|
+
// BEFORE it looks at any coordinate — so for a member that stores one, the value the coordinate path
|
|
8868
|
+
// would compute is identical to the stored one, and withholding it as "derived from the drawing" would be
|
|
8869
|
+
// the panel stating something untrue about data it is holding. Only the DEFAULT is an inference. So a
|
|
8870
|
+
// consumer reading canonical rows asks `canonicalGet` first and withholds — by name, never silently —
|
|
8871
|
+
// only when it answers undefined. (Codex review.)
|
|
8872
|
+
// `steel-refused-sheet-properties.test.ts` runs every getter against a canonical row and fails if the
|
|
8873
|
+
// mark and the behaviour disagree in either direction, and asserts `canonicalGet` itself never throws.
|
|
8874
|
+
{key:'position', label:'Position', needsPlan:true, get:m=>posEligible(m)?posDefault(m):((m.position==='top'||m.position==='middle'||m.position==='bottom')?m.position+' (not applied)':undefined),
|
|
8875
|
+
/* The canonical answer, which turns out to cover almost everything (Codex review). Three tiers, and
|
|
8876
|
+
NONE of them needs a plan coordinate:
|
|
8877
|
+
1. An explicit top/middle/bottom short-circuits `effectiveDepthPosition` before it reads either
|
|
8878
|
+
slope argument, so the stored value is exactly what the coordinate path would compute.
|
|
8879
|
+
2. A COLUMN — or a vertical brace — returns `middle` from the very next line, likewise before the
|
|
8880
|
+
arguments are read (`web/steel-3d-core.js`), and the scene bake applies that same rule from the
|
|
8881
|
+
canonical member. Withholding it as "derived from the drawing" was false for the commonest
|
|
8882
|
+
refused-sheet case there is.
|
|
8883
|
+
3. Everything else needs the member's slope, and the slope is world-mm geometry: `posDefault`
|
|
8884
|
+
measures it off `m.wp` in the active sheet's px scale only because that is what a projected row
|
|
8885
|
+
carries. Read from `from`/`to` instead and the same `effectiveDepthPosition` decides — ONE
|
|
8886
|
+
shared rule, measured two ways, exactly as `_lenFt` resolves length canonically.
|
|
8887
|
+
Only an unknown ENDPOINT ELEVATION is left undecidable, and a default must never be invented for one
|
|
8888
|
+
(the schema's own rule, and what the scene bake refuses on). That alone is withheld, by name. */
|
|
8889
|
+
canonicalGet:m=>{
|
|
8890
|
+
const explicit=(m.position==='top'||m.position==='middle'||m.position==='bottom')?m.position:null;
|
|
8891
|
+
if(explicit)return posEligible(m)?explicit:explicit+' (not applied)';
|
|
8892
|
+
if(!posEligible(m))return undefined; // no section to place — `get` answers undefined here too
|
|
8893
|
+
const role=m.role==='column'?'column':'beam',vBrace=!!(isBrace(m)&&m.brace&&m.brace.type==='vertical');
|
|
8894
|
+
if(role==='column'||vBrace)return SteelCore.effectiveDepthPosition(undefined,role,0,0,vBrace); // the two slope args are unread on this path
|
|
8895
|
+
const g=v2CanonicalMember(m.id),a=g&&g.from,b=g&&g.to;
|
|
8896
|
+
if(!a||!b)return undefined;
|
|
8897
|
+
const az=(a.z&&Number.isFinite(a.z.known))?a.z.known:null,bz=(b.z&&Number.isFinite(b.z.known))?b.z.known:null;
|
|
8898
|
+
if(az==null||bz==null)return undefined; // an unread elevation is not a default we may invent
|
|
8899
|
+
return SteelCore.effectiveDepthPosition(undefined,role,Math.abs(bz-az),Math.hypot(b.x-a.x,b.y-a.y),false);},
|
|
8900
|
+
fmt:v=>v?v[0].toUpperCase()+v.slice(1):''},
|
|
8387
8901
|
// undefined wherever the concept itself is undefined (a profile that resolves to no section) — the label
|
|
8388
8902
|
// must never print a placement the bake ignores.
|
|
8389
8903
|
// A member that is ineligible but still CARRIES a value prints it as "not applied" rather than blank:
|
|
@@ -9330,12 +9844,13 @@ function openLevelModal(tool){ // works from 2D and 3D — the commit is plan-
|
|
|
9330
9844
|
function toLevelCommit(tool,ti){const sel=selArr();const T=C.plans[ti];
|
|
9331
9845
|
if(!sel.length){toast('Selection is empty — nothing to '+(tool==='move'?'move':'copy'));return;}
|
|
9332
9846
|
if(!T)return;
|
|
9333
|
-
const
|
|
9334
|
-
|
|
9335
|
-
|
|
9847
|
+
const targetView=viewIdOf(T),hereView=viewIdOf(P),targetName=viewLabel(T);
|
|
9848
|
+
const entries=sel.map(m=>{const views=V2Projection.memberViewIds(C,m.id),sourceViewId=views.includes(hereView)?hereView:views[0];return sourceViewId?{id:m.id,sourceViewId}:null;})
|
|
9849
|
+
.filter(row=>row&&row.sourceViewId!==targetView);
|
|
9850
|
+
if(!entries.length){toast('Selection is already on '+targetName);return;}
|
|
9336
9851
|
let effect=null;
|
|
9337
|
-
const ok=edit(()=>{effect=V2_SESSION.
|
|
9338
|
-
if(ok)toast((tool==='move'?'Moved ':'Copied ')+entries.length+' member'+(entries.length===1?'':'s')+' to '+
|
|
9852
|
+
const ok=edit(()=>{effect=V2_SESSION.moveOrCopyToView(targetView,entries,tool==='copy');if(tool==='copy')selIds=new Set(effect.value||[]);});
|
|
9853
|
+
if(ok)toast((tool==='move'?'Moved ':'Copied ')+entries.length+' member'+(entries.length===1?'':'s')+' to '+targetName+(tool==='move'?' — source evidence, where present, remains visible':''));
|
|
9339
9854
|
}
|
|
9340
9855
|
// --- Local coordinate system "set axes" tool: two snapped clicks (origin, then X-direction) define
|
|
9341
9856
|
// P.frame={o,u}. Shares buildSnap/snap/snapMark; preview lives in its own <g> (render() rebuilds wholesale). ---
|
|
@@ -9767,7 +10282,7 @@ document.getElementById('mrgB').onclick=()=>{const r=mergeCollinearJS(P.members)
|
|
|
9767
10282
|
// edit() returns FALSE on a refusal (and has already toasted the reason). The success toast must be
|
|
9768
10283
|
// gated on it: toast() writes into one shared #toast element, so an unconditional success call erased
|
|
9769
10284
|
// the refusal text within a frame and told the user a merge had happened when the batch had rolled back.
|
|
9770
|
-
if(edit(()=>{V2_SESSION.mergeMemberGroups(P
|
|
10285
|
+
if(edit(()=>{V2_SESSION.mergeMemberGroups(viewIdOf(P),r.merges);
|
|
9771
10286
|
selIds=new Set();selDimIds.clear();}))
|
|
9772
10287
|
toast('Merged '+r.mergedAway+' segment'+(r.mergedAway===1?'':'s')+' into '+r.runs+' member'+(r.runs===1?'':'s'));};
|
|
9773
10288
|
document.getElementById('undoB').onclick=doUndo;
|
|
@@ -10138,8 +10653,31 @@ document.addEventListener('click',e=>{if(selFly.classList.contains('open')&&!sel
|
|
|
10138
10653
|
/* The two review stats open the same popover. Wired here beside #selFly's own wiring because they are the
|
|
10139
10654
|
same interaction — a stat that toggles a capped list — and a second, differently-behaving popover in the
|
|
10140
10655
|
header is exactly the drift the baseline is meant to prevent. */
|
|
10656
|
+
/* #935's two banner buttons. Details EXPANDS the exact planTransform sentence — it is already real DOM
|
|
10657
|
+
text, so this only reveals it; it is never the tooltip, which a keyboard or screen-reader user cannot
|
|
10658
|
+
reach. Copy hands that same sentence to the clipboard because it names the contract fields verbatim
|
|
10659
|
+
($.datum_ref, $.pt_per_ft) and the user's next move is to paste it to their terminal AI. */
|
|
10660
|
+
{const detBtn=document.getElementById('regDetailBtn'),copyBtn=document.getElementById('regCopyBtn'),
|
|
10661
|
+
bar=document.getElementById('regBanner');
|
|
10662
|
+
if(detBtn&&bar)detBtn.onclick=()=>{const open=bar.classList.toggle('det');detBtn.setAttribute('aria-expanded',String(open));};
|
|
10663
|
+
if(copyBtn&&bar)copyBtn.onclick=async()=>{
|
|
10664
|
+
const text=(document.getElementById('regDetail')||{}).textContent||'';
|
|
10665
|
+
if(!text)return;
|
|
10666
|
+
try{ await navigator.clipboard.writeText(text); }
|
|
10667
|
+
catch(err){
|
|
10668
|
+
// Bind and log it — an insecure context and a denied permission are different problems and a bug
|
|
10669
|
+
// report cannot tell them apart from the toast alone. Then FALL BACK to showing the sentence rather
|
|
10670
|
+
// than only apologising: it is already on the page, so expanding it costs nothing and leaves the user
|
|
10671
|
+
// able to select it by hand.
|
|
10672
|
+
console.error('[steel] could not copy the registration reason', err);
|
|
10673
|
+
bar.classList.add('det');if(detBtn)detBtn.setAttribute('aria-expanded','true');
|
|
10674
|
+
toast('Could not reach the clipboard — the reason is shown below; copy it by hand.');return;
|
|
10675
|
+
}
|
|
10676
|
+
const was=copyBtn.textContent;copyBtn.textContent='Copied';
|
|
10677
|
+
setTimeout(()=>{copyBtn.textContent=was;},1600);
|
|
10678
|
+
};}
|
|
10141
10679
|
{const rf=document.getElementById('reviewFly');
|
|
10142
|
-
for(const [id,kind] of [['reviewStat','needs-review'],['untrackedStat','untracked']]){
|
|
10680
|
+
for(const [id,kind] of [['reviewStat','needs-review'],['untrackedStat','untracked'],['regStat','registration']]){
|
|
10143
10681
|
const b=document.getElementById(id);if(b)b.onclick=(e)=>{e.stopPropagation();openReviewFly(kind,b);};}
|
|
10144
10682
|
// Esc returns focus to the trigger it came from, so a keyboard user is not dropped at the top of the page.
|
|
10145
10683
|
/* ONE Esc, ONE action. Without stopPropagation the global Escape ladder still runs to its terminal
|
|
@@ -10149,7 +10687,11 @@ document.addEventListener('click',e=>{if(selFly.classList.contains('open')&&!sel
|
|
|
10149
10687
|
if(e.key!=='Escape'||!rf||!rf.classList.contains('open'))return;
|
|
10150
10688
|
/* Consume it ONLY while the popover or its trigger owns focus. Swallowing every Escape just because the
|
|
10151
10689
|
list happens to be open would steal it from whatever the user Tabbed to next. */
|
|
10152
|
-
|
|
10690
|
+
/* The trigger that OPENED this list, all three of them. It used to be a two-way ternary, so the
|
|
10691
|
+
registration kind fell into the `untrackedStat` arm and Escape focused a button that is `hidden`
|
|
10692
|
+
whenever there are no untracked connections — dropping the user on <body>, which is the exact
|
|
10693
|
+
thing the comment above says this code exists to prevent. */
|
|
10694
|
+
const back=reviewFlyKind==='needs-review'?'reviewStat':reviewFlyKind==='registration'?'regStat':'untrackedStat',t=document.getElementById(back);
|
|
10153
10695
|
const mine=rf.contains(document.activeElement)||document.activeElement===t;
|
|
10154
10696
|
closeReviewFly();
|
|
10155
10697
|
if(!mine)return;
|
|
@@ -10546,7 +11088,7 @@ const view3dApi={
|
|
|
10546
11088
|
// that member's own projected-plan scale before writing canonical world coordinates.
|
|
10547
11089
|
if(!tm)return;
|
|
10548
11090
|
const own=planeOfMember(tm),sel=sel2d(),off=selArr().filter(m=>!P.members.includes(m)); // off-sheet by OBJECT identity — a length comparison would false-refuse whenever two sheets share a bare member id
|
|
10549
|
-
if(own&&own!==P){geoMode=null;setGeo();toast('Trim/Extend needs the target on the open sheet — switch to '+(own.sheet||'its sheet')+' first');return;}
|
|
11091
|
+
if(own&&own!==P){geoMode=null;setGeo();toast('Trim/Extend needs the target on the open sheet — switch to '+(viewLabel(own)||own.sheet||'its sheet')+' first');return;}
|
|
10550
11092
|
if(off.length){geoMode=null;setGeo();toast('Trim/Extend needs every selected member on the open sheet — '+off.length+' '+(off.length===1?'is':'are')+' on another sheet. Deselect them or switch sheets.');return;}
|
|
10551
11093
|
geoMode=null;setGeo();snapEndMulti(sel,tm.wp[0],tm.wp[1]);}, // 3D Trim/Extend → every selected member's nearest end to the target line (snapEndMulti skips braces)
|
|
10552
11094
|
onSplit:(id,wp)=>{const m=byId(id);if(m){doSplit(m,wp);sync3D();}}, // 3D Split → cut at the clicked point on the member
|
|
@@ -11733,7 +12275,7 @@ function openViewGenerator(launcher){const geo=gridGeo(),gc=GC();if(!geo||!gc){t
|
|
|
11733
12275
|
const selected=ViewGen.preselectedSourceKeys(selGridIds,sources),ignoredFree=ViewGen.unsupportedFreeGridCount(selGridIds);
|
|
11734
12276
|
viewGenLauncher=launcher||document.activeElement;viewGenState={tab:'grid',look:'positive',selected,lastAnchor:null,sources,ignoredFree,
|
|
11735
12277
|
depths:{grid:{ahead:'2\'-0"',behind:'2\'-0"'},levels:{above:'2\'-0"',below:'2\'-0"'}},committedDepths:{grid:{ahead:'2\'-0"',behind:'2\'-0"'},levels:{above:'2\'-0"',below:'2\'-0"'}}};
|
|
11736
|
-
document.getElementById('vgContext').textContent='Active plan · '+(P
|
|
12278
|
+
document.getElementById('vgContext').textContent='Active plan · '+(viewLabel(P)||'Untitled sheet')+(ignoredFree?' · '+ignoredFree+' selected free-angle grid'+(ignoredFree===1?' is':'s are')+' not a view source; use regular X/Y grids or levels.':'');
|
|
11737
12279
|
document.getElementById('viewGenModal').style.display='flex';renderViewGenerator();document.getElementById('vgGridTab').focus();}
|
|
11738
12280
|
function viewGenSetTab(tab){if(!viewGenState)return;viewGenState.tab=tab;viewGenState.lastAnchor=null;renderViewGenerator();}
|
|
11739
12281
|
function viewGenSyncInputs(){if(!viewGenState)return;const level=viewGenState.tab==='levels',raw=viewGenState.depths[viewGenState.tab];
|
|
@@ -17646,14 +18188,20 @@ function readTargetControl(){const ct=document.getElementById('confTarget'),stat
|
|
|
17646
18188
|
if(ct&&document.activeElement!==ct){ct.value=typeof C.target_confidence==='number'?C.target_confidence:'';ct.placeholder='—';}
|
|
17647
18189
|
if(state)state.textContent=tgt==null?'No target set':(typeof C.target_confidence==='number'?'Saved target':('Workflow default '+tgt+'%'));}
|
|
17648
18190
|
function readPlanIndex(row){const member=(C.members||[]).find(m=>m&&m.id===row.memberId);if(!member)return -1;
|
|
17649
|
-
|
|
17650
|
-
|
|
17651
|
-
|
|
18191
|
+
// An observation cites the PAGE it was read off, which on a multi-view page names several rows. The
|
|
18192
|
+
// one that owns it is the row the observation actually lives on, so look for that first and fall back
|
|
18193
|
+
// to the page only when the observation is not found (an unbound confidence row). (#938)
|
|
18194
|
+
for(const observation of row.observations||[]){
|
|
18195
|
+
const owning=(C.plans||[]).findIndex(p=>p&&p.viewKind==='plan'&&(p.memberObservations||[]).some(o=>o&&o.id===observation.observationId));
|
|
18196
|
+
if(owning>=0)return owning;
|
|
18197
|
+
const i=(C.plans||[]).findIndex(p=>p&&p.viewKind==='plan'&&p.sheet===observation.sheet);if(i>=0)return i;}
|
|
18198
|
+
const views=V2Projection&&V2Projection.memberViewIds?V2Projection.memberViewIds(C,row.memberId):[];
|
|
18199
|
+
return (C.plans||[]).findIndex(p=>p&&p.viewKind==='plan'&&views.includes(viewIdOf(p)));}
|
|
17652
18200
|
function readValueText(field){if(field.kind!=='elevation')return String(field.value);
|
|
17653
18201
|
const value=field.value||{};if(typeof value.known==='number'&&isFinite(value.known))return fmtFtIn(value.known/25.4)+' ('+String(value.known)+' mm)';
|
|
17654
18202
|
return 'Unknown'+(typeof value.rfiRef==='string'&&value.rfiRef.trim()?(' · '+value.rfiRef.trim()):'');}
|
|
17655
18203
|
function readNotesHtml(){const groups=[];const add=(label,notes)=>{const unique=[...new Set((Array.isArray(notes)?notes:[]).filter(n=>typeof n==='string'&&n.trim()).map(n=>n.trim()))];if(unique.length)groups.push({label,notes:unique});};
|
|
17656
|
-
add('Model notes',C.read_notes);for(const p of C.plans||[])add('Sheet '+String(p.sheet||'—'),p.read_notes);
|
|
18204
|
+
add('Model notes',C.read_notes);for(const p of C.plans||[])add('Sheet '+(viewLabel(p)||String(p.sheet||'—')),p.read_notes);
|
|
17657
18205
|
if(!groups.length)return '';return '<section class=read-notes aria-label="Sheet read notes">'+groups.map(g=>'<h3>'+esc(g.label)+'</h3><ul>'+g.notes.map(n=>'<li>'+esc(n)+'</li>').join('')+'</ul>').join('')+'</section>';}
|
|
17658
18206
|
function readFieldsHtml(row,target){return (row.observations||[]).map(observation=>{
|
|
17659
18207
|
const flags=[observation.provenanceLabel];if(observation.inherited)flags.push('Shared evidence — inherited after split');if(observation.verified)flags.push('✓ Human-confirmed observation');
|
|
@@ -17693,7 +18241,7 @@ function wireReadConf(projection){document.querySelectorAll('#confFilter [data-r
|
|
|
17693
18241
|
document.querySelectorAll('#confBody [data-read-loc]').forEach(b=>b.onclick=()=>locateReadMember(b.dataset.readLoc,projection));}
|
|
17694
18242
|
async function locateReadMember(id,projection){const row=projection.rows.find(r=>r.memberId===id),canonical=(C.members||[]).find(member=>member&&member.id===id);if(!row||!canonical)return;const pi=readPlanIndex(row);
|
|
17695
18243
|
selDimIds.clear();selIds=new Set([id]);geoMode=null;setGeo();closeConf(false);
|
|
17696
|
-
if(pi>=0){if(pi!==C.active)setPlan(pi);const projected=byId(id);if(projected){render();zoomToMember(projected);if(view3d)document.getElementById('stage3d').focus();else svg.focus();toast('Selected '+id+' on '+
|
|
18244
|
+
if(pi>=0){if(pi!==C.active)setPlan(pi);const projected=byId(id);if(projected){render();zoomToMember(projected);if(view3d)document.getElementById('stage3d').focus();else svg.focus();toast('Selected '+id+' on '+viewLabel(C.plans[pi])+'.');return;}}
|
|
17697
18245
|
render();await setView('3d');if(!view3d){svg.focus();toast('Selected '+id+', but it has no editable 2D plan view and 3D is unavailable.');return;}
|
|
17698
18246
|
if(window.Steel3DView)window.Steel3DView.setSelection(selIds);document.getElementById('stage3d').focus();toast('Selected '+id+' in 3D — no editable 2D plan view is available.');}
|
|
17699
18247
|
function updConf(){const el=document.getElementById('confStat');if(!el)return;
|
|
@@ -18302,7 +18850,7 @@ function resetPlanViewState(i){
|
|
|
18302
18850
|
// --- multi-plan: switch between all steel plan views ---
|
|
18303
18851
|
function setPlan(i){
|
|
18304
18852
|
if(memberEndReview&&memberEndReview.busy){memberEndReview.live='Finish the current member-end action before changing views.';panel();return;}
|
|
18305
|
-
if(memberEndReview&&C.plans&&C.plans[i]&&memberEndReview.scope.kind==='active-view'&&memberEndReview.scope.viewId!==C.plans[i]
|
|
18853
|
+
if(memberEndReview&&C.plans&&C.plans[i]&&memberEndReview.scope.kind==='active-view'&&memberEndReview.scope.viewId!==viewIdOf(C.plans[i]))invalidateMemberEndReview('The view changed — check member ends again.');
|
|
18306
18854
|
const canonical=C.plans[i];
|
|
18307
18855
|
if(!canonical){
|
|
18308
18856
|
NO_PLAN_VIEW=true;C.active=0;P={sheet:'',members:[],segments:[],dims:[],details:[],callouts:[],tos_callouts:[],grid:null,default_tos:0};
|
|
@@ -18316,12 +18864,14 @@ function setPlan(i){
|
|
|
18316
18864
|
resetPlanViewState(i);return;
|
|
18317
18865
|
}
|
|
18318
18866
|
toast(kind==='unknown'
|
|
18319
|
-
?`FloLess couldn’t determine ${canonical
|
|
18320
|
-
|
|
18867
|
+
?`FloLess couldn’t determine ${viewLabel(canonical)||'this sheet'}’s view type, so it can’t safely map it into 2D.`
|
|
18868
|
+
// `an elevation`, not `a elevation` — a pre-existing slip in this sentence, fixed while it was in
|
|
18869
|
+
// hand rather than left in copy #938 makes five times as likely to be read.
|
|
18870
|
+
:`${viewLabel(canonical)||'This sheet'} is ${/^[aeiou]/i.test(kind)?'an':'a'} ${kind} view. ${kind[0].toUpperCase()+kind.slice(1)} views aren’t editable in 2D yet; stayed on ${viewLabel(current)||'the current plan'}.`);
|
|
18321
18871
|
syncPlanSwitcher(C.active);return;}
|
|
18322
18872
|
C.active=i;
|
|
18323
18873
|
NO_PLAN_VIEW=false;
|
|
18324
|
-
V2_PROJECTION=
|
|
18874
|
+
V2_PROJECTION=v2ProjectionForView(viewIdOf(canonical));
|
|
18325
18875
|
P=DEV_MODE?ModelCmd.deepFreezeProjection(V2_PROJECTION.plan):V2_PROJECTION.plan;
|
|
18326
18876
|
syncElevationContext();
|
|
18327
18877
|
// clip = the drawing's display-space crop. A contract may ship WITHOUT a raster/clip (a shared or
|
|
@@ -18394,7 +18944,10 @@ function planLabel(pl,i){
|
|
|
18394
18944
|
const p=(pl&&typeof pl==='object')?pl:{};
|
|
18395
18945
|
const text=v=>(v==null||typeof v==='object')?'':String(v).trim();
|
|
18396
18946
|
const n=Number.isFinite(Number(i))?Math.max(0,Math.trunc(Number(i))):0; // 1-based for humans; the floor keeps "Plan 0" out
|
|
18397
|
-
|
|
18947
|
+
// The PAGE names the row, and the view id joins it only when that page carries more than one view
|
|
18948
|
+
// (#938) — otherwise five braced-frame elevations on S5.1 render five identical rows and the switcher
|
|
18949
|
+
// stops being a way to choose. A single-view page reads exactly as it always did.
|
|
18950
|
+
const name=text(viewLabel(p))||text(p.sheet)||('Plan '+(n+1));
|
|
18398
18951
|
const title=text(p.title);
|
|
18399
18952
|
return title?(name+' · '+title):name;
|
|
18400
18953
|
}
|