@floless/app 0.136.0 → 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 +341 -139
- package/dist/schemas/steel.model.v2.schema.json +7 -6
- package/dist/skills/floless-app-steel-model/SKILL.md +13 -12
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +14 -16
- package/dist/skills/floless-app-steel-takeoff/references/elevation-registration.md +28 -1
- package/dist/web/steel-editor.html +388 -60
- package/dist/web/steel-model-v2-client-validation.js +16 -3
- package/dist/web/steel-model-v2-commands.js +74 -63
- package/dist/web/steel-model-v2-projection.js +86 -22
- package/dist/web/steel-plan-transform.js +34 -20
- 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
|
@@ -3461,7 +3461,7 @@ let memberEndScan=null;
|
|
|
3461
3461
|
let memberEndStatus={known:false,count:null,etag:null,revision:null,scopeSig:null};
|
|
3462
3462
|
const memberEndKey=f=>f.memberId+'\0'+f.end;
|
|
3463
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'};}
|
|
3464
|
-
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):''};}
|
|
3465
3465
|
function memberEndScopeSig(scope){return JSON.stringify(scope||memberEndScope());}
|
|
3466
3466
|
function memberEndUnresolved(report){const c=report&&report.counts||{};return (c.needsReview||0)+(c.stale||0)+(c.notCheckable||0);}
|
|
3467
3467
|
function updateMemberEndStatus(){
|
|
@@ -3471,7 +3471,7 @@ function updateMemberEndStatus(){
|
|
|
3471
3471
|
}
|
|
3472
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);}
|
|
3473
3473
|
window.invalidateMemberEndReview=invalidateMemberEndReview;
|
|
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 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';}
|
|
3475
3475
|
function memberEndRole(f){return f.role==='horizontal-brace'?'Horizontal brace':f.role==='vertical-brace'?'Vertical brace':f.role==='brace-unknown'?'Brace':'Beam';}
|
|
3476
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;}
|
|
3477
3477
|
function memberEndReason(f){const words={
|
|
@@ -3500,11 +3500,13 @@ function memberEndChoicesForReport(report,previous){
|
|
|
3500
3500
|
return chosen;
|
|
3501
3501
|
}
|
|
3502
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);}
|
|
3503
|
-
|
|
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}:{})};}
|
|
3504
3506
|
function installMemberEndContract(doc,etag,revision){
|
|
3505
3507
|
V2_SESSION.restoreSnapshot(memberEndSnapshot(doc));V2_PROJECTIONS.clear();
|
|
3506
3508
|
const activePlan=C.plans&&C.plans[C.active];
|
|
3507
|
-
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;}
|
|
3508
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);}
|
|
3509
3511
|
syncElevationContext();
|
|
3510
3512
|
// A server command replaces the model underneath the editor's local history. Retaining those snapshots
|
|
@@ -3548,14 +3550,23 @@ async function undoMemberEndResolution(){if(!memberEndReview||memberEndReview.bu
|
|
|
3548
3550
|
//
|
|
3549
3551
|
// Plan-space UI consumers receive a tagged projection; canonical commands resolve it back to the
|
|
3550
3552
|
// world-mm root member.
|
|
3551
|
-
function
|
|
3552
|
-
let projection=V2_PROJECTIONS.get(
|
|
3553
|
-
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);}
|
|
3554
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||'');}
|
|
3555
3566
|
/* The member's projected row, from the active sheet if it is on it and otherwise from whichever sheet
|
|
3556
3567
|
HAS it.
|
|
3557
3568
|
|
|
3558
|
-
Not `
|
|
3569
|
+
Not `memberViewIds(...)[0]` any more. A view whose registration is refused projects no members at all
|
|
3559
3570
|
(#935), so taking the first sheet blindly makes a member that is perfectly well drawn on a second,
|
|
3560
3571
|
valid sheet disappear from every model-wide list that reads through here — `projectedAllMembers`,
|
|
3561
3572
|
`byId`, shear-plate eligibility, property labels — and disappear SILENTLY, which is the failure mode
|
|
@@ -3563,8 +3574,8 @@ function v2ProjectionForSheet(sheet){
|
|
|
3563
3574
|
row. Stops at the first hit, so the ordinary one-sheet case still builds exactly one projection. */
|
|
3564
3575
|
function v2ProjectedMember(id){
|
|
3565
3576
|
const here=(P&&P.members||[]).find(m=>m&&m.id===id);if(here)return here;
|
|
3566
|
-
for(const
|
|
3567
|
-
const row=
|
|
3577
|
+
for(const viewId of V2Projection.memberViewIds(C,id)){
|
|
3578
|
+
const row=v2ProjectionForView(viewId).plan.members.find(m=>m&&m.id===id);
|
|
3568
3579
|
if(row)return row;
|
|
3569
3580
|
}
|
|
3570
3581
|
return undefined;}
|
|
@@ -3573,12 +3584,57 @@ const projectedAllMembers=()=>(C.members||[]).map(m=>v2ProjectedMember(m.id)).fi
|
|
|
3573
3584
|
const byId=id=>v2ProjectedMember(id);
|
|
3574
3585
|
// Same rule as v2ProjectedMember, for the same reason: a refused sheet's plan carries no usable
|
|
3575
3586
|
// transform, so returning it would do coordinate maths against a registration the runtime just refused.
|
|
3576
|
-
|
|
3577
|
-
|
|
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;};
|
|
3578
3602
|
const selArr=()=>[...selIds].map(byId).filter(Boolean);
|
|
3579
3603
|
// The active-sheet subset of the selection — for 2D coordinate/decoration ops (handles, badges, move/copy,
|
|
3580
3604
|
// 2D drag/zoom) that draw or compute in THIS sheet's px space, where an off-sheet member's wp is meaningless.
|
|
3581
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;}
|
|
3582
3638
|
// elevation = canonical decimal INCHES. parseLen accepts 5.75 | 5 3/4 | 1'-0 1/4" | 16'-6"
|
|
3583
3639
|
function parseLen(str){if(str==null)return null;
|
|
3584
3640
|
let s=String(str).trim().replace(/[”″]/g,'"').replace(/[’′]/g,"'");
|
|
@@ -3751,7 +3807,7 @@ function positionAuthoringBasis(){
|
|
|
3751
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.'};
|
|
3752
3808
|
}catch(_){raw={ok:false,code:'position-authoring-basis-unavailable',message:'Profile Position unavailable: this plan’s local axes are not fully registered.'};}
|
|
3753
3809
|
}
|
|
3754
|
-
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]);
|
|
3755
3811
|
if(fingerprint!==positionBasisFingerprint){positionBasisFingerprint=fingerprint;positionBasisGeneration++;for(const fn of positionBasisListeners)try{fn();}catch(_){}}
|
|
3756
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});
|
|
3757
3813
|
}
|
|
@@ -4268,7 +4324,7 @@ function syncDefaults(){for(const m of P.members)ModelCmd.syncToDefault(m,defaul
|
|
|
4268
4324
|
// authored statement ("this control point is the model origin"), and JSON drops the undefined key, so
|
|
4269
4325
|
// absence survives the round trip rather than being materialised.
|
|
4270
4326
|
function snapshot(){
|
|
4271
|
-
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}:{})});
|
|
4272
4328
|
}
|
|
4273
4329
|
// Undo/redo is a SINGLE GLOBAL stack (not per-plane): snapshot() above captures EVERY plane's
|
|
4274
4330
|
// members, so one whole-model stack is coherent — undo restores all planes at once, and a cross-
|
|
@@ -4289,7 +4345,7 @@ function pushUndo(prev){undo.push(prev);if(undo.length>200)undo.shift();redo.len
|
|
|
4289
4345
|
function apply(json){
|
|
4290
4346
|
const d=JSON.parse(json);
|
|
4291
4347
|
V2_SESSION.restoreSnapshot(d);
|
|
4292
|
-
V2_PROJECTION=
|
|
4348
|
+
V2_PROJECTION=v2ProjectionForView(viewIdOf(C.plans[C.active]));
|
|
4293
4349
|
P=DEV_MODE?ModelCmd.deepFreezeProjection(V2_PROJECTION.plan):V2_PROJECTION.plan;
|
|
4294
4350
|
syncElevationContext();
|
|
4295
4351
|
updCS();
|
|
@@ -4352,7 +4408,7 @@ const LSKEY = draftKey(); // app + project + type — see draftKey() in the ou
|
|
|
4352
4408
|
// different server contracts routinely produce the same string (members change; segment counts do not).
|
|
4353
4409
|
// `baseEtag` is what decides whether the server moved; this decides whether the per-sheet overlay below is
|
|
4354
4410
|
// even meaningful.
|
|
4355
|
-
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
|
|
4356
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').
|
|
4357
4413
|
function setSaved(state,msg){const el=document.getElementById('saveStat');if(!el)return;el.classList.remove('dirty','ok','err','conflict');
|
|
4358
4414
|
el.removeAttribute('data-tip'); el.onclick=null;
|
|
@@ -4910,8 +4966,10 @@ function applyDraftFields(d){
|
|
|
4910
4966
|
// reference somebody else removed.
|
|
4911
4967
|
if(Array.isArray(d.reference_models))candidate.reference_models=reconcileReferences(candidate.reference_models,d.reference_models);
|
|
4912
4968
|
if(Array.isArray(d.plans)){
|
|
4913
|
-
|
|
4914
|
-
|
|
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);
|
|
4915
4973
|
}
|
|
4916
4974
|
if(d.active!=null)candidate.active=d.active;
|
|
4917
4975
|
try{
|
|
@@ -5358,7 +5416,7 @@ function planRegistration(){
|
|
|
5358
5416
|
// resolves to a grid intersection, so relabelling an axis can turn the sheet a half-turn with the spacings
|
|
5359
5417
|
// and the control pixels untouched — and a key that missed them left an asymmetric section 180° wrong
|
|
5360
5418
|
// until something else happened to change. (Found by adversarial review.)
|
|
5361
|
-
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,
|
|
5362
5420
|
g&&g.origin,g&&g.x,g&&g.y,g&&g.labels_x,g&&g.labels_y,g&&g.axes]);
|
|
5363
5421
|
if(key===_planXfCache.key)return _planXfCache.xf; // memoised: render() draws every column through here, and planTransform re-parses the grid on each call
|
|
5364
5422
|
let xf=_PLAN_XF_IDENTITY;
|
|
@@ -5372,7 +5430,7 @@ function planRegistration(){
|
|
|
5372
5430
|
// Kept beside the visible surfaces, not replaced by them: the console line is what a developer greps
|
|
5373
5431
|
// for in a bug report, and it costs nothing. Mid-authoring stays quiet; the footprint just falls back.
|
|
5374
5432
|
if(refusal&&refusal.registered)
|
|
5375
|
-
console.warn('[steel]
|
|
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.');
|
|
5376
5434
|
}
|
|
5377
5435
|
_planXfCache={key,xf};return xf;
|
|
5378
5436
|
}
|
|
@@ -5385,7 +5443,8 @@ function planRegistration(){
|
|
|
5385
5443
|
plan, including ones this editor would refuse to open. */
|
|
5386
5444
|
function planRefusalFor(plan){
|
|
5387
5445
|
if(!PlanXf||!plan||plan.viewKind!=='plan')return null;
|
|
5388
|
-
|
|
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)); }
|
|
5389
5448
|
catch(_){ return null; }
|
|
5390
5449
|
}
|
|
5391
5450
|
// The member's stored roll RE-EXPRESSED into `target` (a positionAuthoringBasis snapshot; null/global →
|
|
@@ -5658,7 +5717,7 @@ function reanchorDim(plan,d){let dropped=false;
|
|
|
5658
5717
|
function reanchorAllPlans(){let dropped=false;
|
|
5659
5718
|
if(P){const dims=JSON.parse(JSON.stringify(P.dims||[])),before=JSON.stringify(dims);
|
|
5660
5719
|
for(const d of dims)if(d&&(d.aRef||d.bRef)){if(reanchorDim({...P,dims},d))dropped=true;}
|
|
5661
|
-
if(JSON.stringify(dims)!==before)V2_SESSION.patchPlan(P
|
|
5720
|
+
if(JSON.stringify(dims)!==before)V2_SESSION.patchPlan(viewIdOf(P),{dims});
|
|
5662
5721
|
}
|
|
5663
5722
|
if(dropped)toast('A dimension lost its link to a removed member or grid line');}
|
|
5664
5723
|
// Live path for the 2D member/endpoint drag, which updateLine()s WITHOUT a full render (:4135/:4141): reanchor
|
|
@@ -5666,7 +5725,7 @@ function reanchorAllPlans(){let dropped=false;
|
|
|
5666
5725
|
function refreshMagneticDims2D(){
|
|
5667
5726
|
{const dims=JSON.parse(JSON.stringify(P.dims||[])),before=JSON.stringify(dims);
|
|
5668
5727
|
for(const d of dims)if(d&&(d.aRef||d.bRef))reanchorDim({...P,dims},d);
|
|
5669
|
-
if(JSON.stringify(dims)!==before)V2_SESSION.patchPlan(P
|
|
5728
|
+
if(JSON.stringify(dims)!==before)V2_SESSION.patchPlan(viewIdOf(P),{dims});
|
|
5670
5729
|
}
|
|
5671
5730
|
const dg=svg.querySelector('g.dimsg');if(dg)dg.innerHTML=renderDimsInner();}
|
|
5672
5731
|
// F9 (QA 2026-07-16): the ref a hand-dragged dim anchor should carry after landing at pt — so magnetism
|
|
@@ -6131,7 +6190,7 @@ function gridReadFromDrawing(keep){
|
|
|
6131
6190
|
function gridAskAiLabels(){
|
|
6132
6191
|
const geo=gridGeo();if(!geo)return;
|
|
6133
6192
|
const t=document.getElementById('askAiText');
|
|
6134
|
-
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. '
|
|
6135
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. '
|
|
6136
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). '
|
|
6137
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").';
|
|
@@ -6163,11 +6222,11 @@ function setDimStyleMode(on){if(!C||(on&&view3d))return;dimStyleMode=!!on; //
|
|
|
6163
6222
|
function updatePlanDims(fn){
|
|
6164
6223
|
const dims=JSON.parse(JSON.stringify((P&&P.dims)||[])),before=JSON.stringify(dims);fn(dims);
|
|
6165
6224
|
if(JSON.stringify(dims)===before)return false;
|
|
6166
|
-
V2_SESSION.patchPlan(P
|
|
6225
|
+
V2_SESSION.patchPlan(viewIdOf(P),{dims});
|
|
6167
6226
|
return true;}
|
|
6168
6227
|
function updatePlanDim(id,fn){return updatePlanDims(dims=>{const d=dims.find(row=>row&&row.id===id);if(d)fn(d);});}
|
|
6169
6228
|
function deleteV2Selection(args){
|
|
6170
|
-
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;
|
|
6171
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.`);
|
|
6172
6231
|
return effect;}
|
|
6173
6232
|
function renderDimStylePanel(p){
|
|
@@ -6610,7 +6669,7 @@ function snapEndMulti(ms,tA,tB){const pv=snapshot();let n=0,skipped=0;
|
|
|
6610
6669
|
if(n){pushUndo(pv);render();sync3D();}return n;}
|
|
6611
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)
|
|
6612
6671
|
const link=V2Projection.projectionLink(m);let made=[];
|
|
6613
|
-
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();});
|
|
6614
6673
|
if(ok!==false){geoMode=null;setGeo();}
|
|
6615
6674
|
}
|
|
6616
6675
|
// --- duplicates: members with coincident geometry (same two work-points, order-independent, ~3px tol) ---
|
|
@@ -7078,7 +7137,9 @@ function updRegistration(){
|
|
|
7078
7137
|
// `registered:false` sheets are excluded: the pill exists to chase FAULTS across the set, and a count
|
|
7079
7138
|
// that also totals every half-authored sheet is a number the reader learns to ignore. Those sheets
|
|
7080
7139
|
// still explain themselves on their own canvas.
|
|
7081
|
-
|
|
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;
|
|
7082
7143
|
}).filter(Boolean);
|
|
7083
7144
|
const pill=document.getElementById('regStat'),count=document.getElementById('regCount');
|
|
7084
7145
|
if(pill&&count){count.textContent=String(regRefusals.length);pill.hidden=regRefusals.length===0;
|
|
@@ -7094,13 +7155,22 @@ function paintRegBanner(){
|
|
|
7094
7155
|
const refusal=(P&&P.registrationRefusal)||null;
|
|
7095
7156
|
// A banner that carried over from the sheet you just left would accuse the wrong drawing, so the text
|
|
7096
7157
|
// AND the expanded/collapsed state reset on every sheet change.
|
|
7097
|
-
|
|
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;
|
|
7098
7168
|
if(sheet!==regBannerSheet){regBannerSheet=sheet;bar.classList.remove('det');
|
|
7099
7169
|
const t=document.getElementById('regDetailBtn');if(t)t.setAttribute('aria-expanded','false');}
|
|
7100
7170
|
if(!refusal){bar.classList.remove('on');bar.classList.remove('plain');return;}
|
|
7101
7171
|
// textContent, never innerHTML: a sheet name and an axis id are author-written strings that reach here
|
|
7102
7172
|
// unescaped.
|
|
7103
|
-
document.getElementById('regLead').textContent=regLeadText(
|
|
7173
|
+
document.getElementById('regLead').textContent=regLeadText(sheetName,refusal);
|
|
7104
7174
|
document.getElementById('regDetail').textContent=refusal.message;
|
|
7105
7175
|
// Amber only for a registration that IS stated and does not hold. A sheet still being authored recedes
|
|
7106
7176
|
// to the neutral tier, exactly as #rcIssues' own `.rcban.plain` does: this file uses amber to mean
|
|
@@ -7285,9 +7355,12 @@ function syncV2SelectionNotice(p){
|
|
|
7285
7355
|
const ids=[...selIds].filter(id=>!!(C.members||[]).find(m=>m&&m.id===id));
|
|
7286
7356
|
if(!ids.length)return;
|
|
7287
7357
|
const other=[];
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
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);
|
|
7291
7364
|
}
|
|
7292
7365
|
const anchor=p.querySelector(':scope > h3,:scope > .badge');
|
|
7293
7366
|
let after=anchor;
|
|
@@ -7296,6 +7369,32 @@ function syncV2SelectionNotice(p){
|
|
|
7296
7369
|
n.textContent=(ids.length===1?'Also on ':'Selected members also appear on ')+[...new Set(other)].join(', ')+'.';
|
|
7297
7370
|
if(after)after.after(n);else p.prepend(n);after=n;
|
|
7298
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;}}
|
|
7299
7398
|
const selected=(C.members||[]).filter(m=>ids.includes(m.id));
|
|
7300
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);
|
|
7301
7400
|
if(unknown){
|
|
@@ -7394,6 +7493,140 @@ function nativeElevationContextHtml(){
|
|
|
7394
7493
|
'<div class=hint style="margin:0 0 5px;font-size:11px">Visible member endpoints <b>'+esc(range)+'</b>'+ (unknown?' · '+unknown+' unknown':'') +'</div>'+
|
|
7395
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>';
|
|
7396
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;}
|
|
7397
7630
|
function panel(){
|
|
7398
7631
|
const p=document.getElementById('panel');
|
|
7399
7632
|
p.removeAttribute('aria-busy');p.removeAttribute('aria-labelledby');
|
|
@@ -7720,14 +7953,54 @@ function panel(){
|
|
|
7720
7953
|
/* A selection that resolved to NOTHING is not an empty selection, and showing the legend for it tells
|
|
7721
7954
|
the user their click did nothing. It happens on a sheet whose registration is refused: the plan
|
|
7722
7955
|
projects no members, so a member picked in the 3D view — which draws from the canonical model and is
|
|
7723
|
-
unaffected — has no plan-space twin for `selArr()` to return. Say that, rather than go quiet.
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
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;}}
|
|
7731
8004
|
if(arr.length===0){const elevationContext=nativeElevationModel()?nativeElevationContextHtml():
|
|
7732
8005
|
'<div style="border-top:1px solid var(--line);margin-top:12px;padding-top:12px"><div class=sect>Project defaults</div>'+
|
|
7733
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>'+
|
|
@@ -8581,7 +8854,50 @@ const PROP_DEFS=[
|
|
|
8581
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'},
|
|
8582
8855
|
// The column suppression is GONE: a column takes the same Profile Position as every other member now
|
|
8583
8856
|
// (design §4), so hiding its depth face would be the label lying about geometry the bake applies.
|
|
8584
|
-
|
|
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):''},
|
|
8585
8901
|
// undefined wherever the concept itself is undefined (a profile that resolves to no section) — the label
|
|
8586
8902
|
// must never print a placement the bake ignores.
|
|
8587
8903
|
// A member that is ineligible but still CARRIES a value prints it as "not applied" rather than blank:
|
|
@@ -9528,12 +9844,13 @@ function openLevelModal(tool){ // works from 2D and 3D — the commit is plan-
|
|
|
9528
9844
|
function toLevelCommit(tool,ti){const sel=selArr();const T=C.plans[ti];
|
|
9529
9845
|
if(!sel.length){toast('Selection is empty — nothing to '+(tool==='move'?'move':'copy'));return;}
|
|
9530
9846
|
if(!T)return;
|
|
9531
|
-
const
|
|
9532
|
-
|
|
9533
|
-
|
|
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;}
|
|
9534
9851
|
let effect=null;
|
|
9535
|
-
const ok=edit(()=>{effect=V2_SESSION.
|
|
9536
|
-
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':''));
|
|
9537
9854
|
}
|
|
9538
9855
|
// --- Local coordinate system "set axes" tool: two snapped clicks (origin, then X-direction) define
|
|
9539
9856
|
// P.frame={o,u}. Shares buildSnap/snap/snapMark; preview lives in its own <g> (render() rebuilds wholesale). ---
|
|
@@ -9965,7 +10282,7 @@ document.getElementById('mrgB').onclick=()=>{const r=mergeCollinearJS(P.members)
|
|
|
9965
10282
|
// edit() returns FALSE on a refusal (and has already toasted the reason). The success toast must be
|
|
9966
10283
|
// gated on it: toast() writes into one shared #toast element, so an unconditional success call erased
|
|
9967
10284
|
// the refusal text within a frame and told the user a merge had happened when the batch had rolled back.
|
|
9968
|
-
if(edit(()=>{V2_SESSION.mergeMemberGroups(P
|
|
10285
|
+
if(edit(()=>{V2_SESSION.mergeMemberGroups(viewIdOf(P),r.merges);
|
|
9969
10286
|
selIds=new Set();selDimIds.clear();}))
|
|
9970
10287
|
toast('Merged '+r.mergedAway+' segment'+(r.mergedAway===1?'':'s')+' into '+r.runs+' member'+(r.runs===1?'':'s'));};
|
|
9971
10288
|
document.getElementById('undoB').onclick=doUndo;
|
|
@@ -10771,7 +11088,7 @@ const view3dApi={
|
|
|
10771
11088
|
// that member's own projected-plan scale before writing canonical world coordinates.
|
|
10772
11089
|
if(!tm)return;
|
|
10773
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
|
|
10774
|
-
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;}
|
|
10775
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;}
|
|
10776
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)
|
|
10777
11094
|
onSplit:(id,wp)=>{const m=byId(id);if(m){doSplit(m,wp);sync3D();}}, // 3D Split → cut at the clicked point on the member
|
|
@@ -11958,7 +12275,7 @@ function openViewGenerator(launcher){const geo=gridGeo(),gc=GC();if(!geo||!gc){t
|
|
|
11958
12275
|
const selected=ViewGen.preselectedSourceKeys(selGridIds,sources),ignoredFree=ViewGen.unsupportedFreeGridCount(selGridIds);
|
|
11959
12276
|
viewGenLauncher=launcher||document.activeElement;viewGenState={tab:'grid',look:'positive',selected,lastAnchor:null,sources,ignoredFree,
|
|
11960
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"'}}};
|
|
11961
|
-
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.':'');
|
|
11962
12279
|
document.getElementById('viewGenModal').style.display='flex';renderViewGenerator();document.getElementById('vgGridTab').focus();}
|
|
11963
12280
|
function viewGenSetTab(tab){if(!viewGenState)return;viewGenState.tab=tab;viewGenState.lastAnchor=null;renderViewGenerator();}
|
|
11964
12281
|
function viewGenSyncInputs(){if(!viewGenState)return;const level=viewGenState.tab==='levels',raw=viewGenState.depths[viewGenState.tab];
|
|
@@ -17871,14 +18188,20 @@ function readTargetControl(){const ct=document.getElementById('confTarget'),stat
|
|
|
17871
18188
|
if(ct&&document.activeElement!==ct){ct.value=typeof C.target_confidence==='number'?C.target_confidence:'';ct.placeholder='—';}
|
|
17872
18189
|
if(state)state.textContent=tgt==null?'No target set':(typeof C.target_confidence==='number'?'Saved target':('Workflow default '+tgt+'%'));}
|
|
17873
18190
|
function readPlanIndex(row){const member=(C.members||[]).find(m=>m&&m.id===row.memberId);if(!member)return -1;
|
|
17874
|
-
|
|
17875
|
-
|
|
17876
|
-
|
|
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)));}
|
|
17877
18200
|
function readValueText(field){if(field.kind!=='elevation')return String(field.value);
|
|
17878
18201
|
const value=field.value||{};if(typeof value.known==='number'&&isFinite(value.known))return fmtFtIn(value.known/25.4)+' ('+String(value.known)+' mm)';
|
|
17879
18202
|
return 'Unknown'+(typeof value.rfiRef==='string'&&value.rfiRef.trim()?(' · '+value.rfiRef.trim()):'');}
|
|
17880
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});};
|
|
17881
|
-
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);
|
|
17882
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>';}
|
|
17883
18206
|
function readFieldsHtml(row,target){return (row.observations||[]).map(observation=>{
|
|
17884
18207
|
const flags=[observation.provenanceLabel];if(observation.inherited)flags.push('Shared evidence — inherited after split');if(observation.verified)flags.push('✓ Human-confirmed observation');
|
|
@@ -17918,7 +18241,7 @@ function wireReadConf(projection){document.querySelectorAll('#confFilter [data-r
|
|
|
17918
18241
|
document.querySelectorAll('#confBody [data-read-loc]').forEach(b=>b.onclick=()=>locateReadMember(b.dataset.readLoc,projection));}
|
|
17919
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);
|
|
17920
18243
|
selDimIds.clear();selIds=new Set([id]);geoMode=null;setGeo();closeConf(false);
|
|
17921
|
-
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;}}
|
|
17922
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;}
|
|
17923
18246
|
if(window.Steel3DView)window.Steel3DView.setSelection(selIds);document.getElementById('stage3d').focus();toast('Selected '+id+' in 3D — no editable 2D plan view is available.');}
|
|
17924
18247
|
function updConf(){const el=document.getElementById('confStat');if(!el)return;
|
|
@@ -18527,7 +18850,7 @@ function resetPlanViewState(i){
|
|
|
18527
18850
|
// --- multi-plan: switch between all steel plan views ---
|
|
18528
18851
|
function setPlan(i){
|
|
18529
18852
|
if(memberEndReview&&memberEndReview.busy){memberEndReview.live='Finish the current member-end action before changing views.';panel();return;}
|
|
18530
|
-
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.');
|
|
18531
18854
|
const canonical=C.plans[i];
|
|
18532
18855
|
if(!canonical){
|
|
18533
18856
|
NO_PLAN_VIEW=true;C.active=0;P={sheet:'',members:[],segments:[],dims:[],details:[],callouts:[],tos_callouts:[],grid:null,default_tos:0};
|
|
@@ -18541,12 +18864,14 @@ function setPlan(i){
|
|
|
18541
18864
|
resetPlanViewState(i);return;
|
|
18542
18865
|
}
|
|
18543
18866
|
toast(kind==='unknown'
|
|
18544
|
-
?`FloLess couldn’t determine ${canonical
|
|
18545
|
-
|
|
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'}.`);
|
|
18546
18871
|
syncPlanSwitcher(C.active);return;}
|
|
18547
18872
|
C.active=i;
|
|
18548
18873
|
NO_PLAN_VIEW=false;
|
|
18549
|
-
V2_PROJECTION=
|
|
18874
|
+
V2_PROJECTION=v2ProjectionForView(viewIdOf(canonical));
|
|
18550
18875
|
P=DEV_MODE?ModelCmd.deepFreezeProjection(V2_PROJECTION.plan):V2_PROJECTION.plan;
|
|
18551
18876
|
syncElevationContext();
|
|
18552
18877
|
// clip = the drawing's display-space crop. A contract may ship WITHOUT a raster/clip (a shared or
|
|
@@ -18619,7 +18944,10 @@ function planLabel(pl,i){
|
|
|
18619
18944
|
const p=(pl&&typeof pl==='object')?pl:{};
|
|
18620
18945
|
const text=v=>(v==null||typeof v==='object')?'':String(v).trim();
|
|
18621
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
|
|
18622
|
-
|
|
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));
|
|
18623
18951
|
const title=text(p.title);
|
|
18624
18952
|
return title?(name+' · '+title):name;
|
|
18625
18953
|
}
|