@floless/app 0.132.1 → 0.132.2

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.
@@ -2406,6 +2406,7 @@ function claimMutation(id) { ownWrites.push(id); while (ownWrites.length > OWN_W
2406
2406
  * forever, where the only thing it can do is wrongly suppress somebody else's event. */
2407
2407
  function releaseMutation(id) { const i = ownWrites.indexOf(id); if (i >= 0) ownWrites.splice(i, 1); }
2408
2408
  let C, PAL, WT;
2409
+ let CatalogPicker = null; // steel-catalog-picker.js — provider-neutral Profile and Material catalogue dialogs
2409
2410
  let SteelCore = null; // steel-3d-core.js module namespace — boot() awaits its dynamic import before main() so the classic script can call its pure helpers (sanitizeDims3d) at load
2410
2411
  let ViewGen = null; // steel-view-generation.js pure F11 helpers — loaded before saved views are sanitised
2411
2412
  let ModelCmd = null; // steel-model-commands.js — the model boundary's WRITE half (unit 5, P3a); the read half is steel-model-adapter.js
@@ -2625,11 +2626,12 @@ function contractFailureState(status, code, serverError, projectScoped) {
2625
2626
  async function boot() {
2626
2627
  if (!APP_ID) { showEmpty('⊞', 'No workflow selected', 'Open a workflow in the FloLess canvas, then open the contract editor from that workflow’s node.'); return; }
2627
2628
  armEarlyViewToggle(); // BEFORE the first await — that is the whole point; see above
2628
- [SteelCore, ViewGen, ModelCmd, DetailRefs, V2Projection, V2Commands, V2Validation, SplitView, FilterCore, PlanXf] = await Promise.all([
2629
+ [SteelCore, ViewGen, ModelCmd, DetailRefs, V2Projection, V2Commands, V2Validation, SplitView, FilterCore, PlanXf, CatalogPicker] = await Promise.all([
2629
2630
  import('./steel-3d-core.js'), import('./steel-view-generation.js'), import('./steel-model-commands.js'),
2630
2631
  import('./steel-detail-refs.js'), import('./steel-model-v2-projection.js'),
2631
2632
  import('./steel-model-v2-commands.js'), import('./steel-model-v2-client-validation.js'),
2632
2633
  import('./steel-split-view.js'), import('./steel-filter-core.js'), import('./steel-plan-transform.js'),
2634
+ import('./steel-catalog-picker.js'),
2633
2635
  ]);
2634
2636
  const res = await fetch('/api/contract/' + encodeURIComponent(APP_ID) + CONTRACT_QS);
2635
2637
  // 204 = the project-scoped "nothing stored yet", the quiet twin of the generic 404 below. It carries
@@ -2767,6 +2769,8 @@ async function boot() {
2767
2769
  if (!_sj.weights || typeof _sj.weights !== 'object' || !_sj.sections || typeof _sj.sections !== 'object') throw new Error('payload missing weights/sections');
2768
2770
  window.__AISC_WEIGHTS = _sj.weights;
2769
2771
  window.__AISC_SECTIONS = _sj.sections;
2772
+ window.__STEEL_PROFILE_CATALOG = _sj.catalog;
2773
+ window.__STEEL_MATERIAL_CATALOG = _sj.materials;
2770
2774
  } catch (e) {
2771
2775
  window.__AISC_LOAD_FAILED = true;
2772
2776
  console.warn('AISC shape table failed to load — sizes and weights are unavailable:', e && e.message ? e.message : e);
@@ -3237,12 +3241,13 @@ function posSectionSvg(m){
3237
3241
  const sec=dims?{w:dims.w,d:dims.d}:((m&&m.section&&m.section.w>0&&m.section.d>0)?{w:m.section.w/25.4,d:m.section.d/25.4}:null);
3238
3242
  if(!sec)return '';
3239
3243
  const round=!!(dims&&dims.round);
3240
- const ex=SteelCore.sectionExtents(SteelCore.outlineFor(m.profile,sec.w,sec.d,null,round));
3244
+ const local=sectionShapeComponents(m.profile,sec.w,sec.d,12,round),localAll=local.flat();
3245
+ const ex={lo:[Math.min(...localAll.map(p=>p[0])),Math.min(...localAll.map(p=>p[1]))],hi:[Math.max(...localAll.map(p=>p[0])),Math.max(...localAll.map(p=>p[1]))]};
3241
3246
  const oy=SteelCore.faceOffset(posHDefault(m),ex.lo[0],ex.hi[0])+(+m.positionHOffset||0)/25.4;
3242
3247
  const oz=SteelCore.faceOffset(posDefault(m),ex.lo[1],ex.hi[1])+(+m.positionOffset||0)/25.4;
3243
3248
  const th=(+m.rot||0)*Math.PI/180,c=Math.cos(th),s=Math.sin(th);
3244
3249
  const map=(u,v)=>[-(u*c-v*s),-(u*s+v*c)];
3245
- const out=sectionShapePts(m.profile,sec.w,sec.d,12,round).map(([x,y])=>map(x+oy,y+oz));
3250
+ const outs=local.map(points=>points.map(([x,y])=>map(x+oy,y+oz))),out=outs.flat();
3246
3251
  const stub=Math.max(sec.w,sec.d)*0.45,pad=Math.max(sec.w,sec.d)*0.16;
3247
3252
  const all=out.concat([[-stub,0],[0,-stub],[0,0]]);
3248
3253
  const xs=all.map(p=>p[0]),ys=all.map(p=>p[1]);
@@ -3255,7 +3260,7 @@ function posSectionSvg(m){
3255
3260
  <line x1="0" y1="${f(-stub)}" x2="0" y2="0" stroke="var(--brand)" stroke-width="${f(sw)}"/>
3256
3261
  <text x="${f(-stub)}" y="${f(-sw*2.5)}" fill="var(--cyan)" font-size="${f(sw*8)}" text-anchor="middle">+W</text>
3257
3262
  <text x="${f(sw*3)}" y="${f(-stub)}" fill="var(--brand)" font-size="${f(sw*8)}">+D</text>
3258
- <polygon points="${out.map(p=>f(p[0])+','+f(p[1])).join(' ')}" fill="var(--brand-wash)" stroke="var(--text)" stroke-width="${f(sw)}" stroke-linejoin="round"/>
3263
+ ${outs.map(points=>`<polygon points="${points.map(p=>f(p[0])+','+f(p[1])).join(' ')}" fill="var(--brand-wash)" stroke="var(--text)" stroke-width="${f(sw)}" stroke-linejoin="round"/>`).join('')}
3259
3264
  <circle cx="0" cy="0" r="${f(sw*2.6)}" fill="var(--warn)"/>
3260
3265
  </svg>`;}
3261
3266
  // The two numeric offsets: stored in MILLIMETRES (contracts are canonical metric), shown and typed in the
@@ -3526,7 +3531,38 @@ function parseVec(s){s=String(s==null?'':s).trim();if(!s)return null;
3526
3531
  // explicit overrides shift by Δ so relative offsets survive. Columns keep their height (bos shifts by Δ).
3527
3532
  // best-effort: framing plans carry TOS at the level UNO — assume the L2 datum +16'-6" (198"); each end's
3528
3533
  // 'default' checkbox links it to this value (auto-updates when changed); uncheck to override.
3529
- let defaultTOS=198, addProfile='', addType='beam'; // addType = the member type new members are drawn with (Add-member panel)
3534
+ let defaultTOS=198, addProfile='', addMaterial='', addType='beam'; // addProfile/addMaterial/addType are independent defaults for newly drawn members
3535
+ const profileCatalog=window.__STEEL_PROFILE_CATALOG||{environment:'US',standard:'Profile catalog',families:[],rows:[]};
3536
+ const profileCatalogRows=CatalogPicker.buildProfileRows(profileCatalog,window.__AISC_SECTIONS||{},window.__AISC_WEIGHTS||{});
3537
+ const materialCatalog=CatalogPicker.materialCatalogDescriptorFor(profileCatalog.environment||'US',window.__STEEL_MATERIAL_CATALOG);
3538
+ const materialCatalogRows=materialCatalog?.rows||[];
3539
+ const profilePicker=CatalogPicker.createCatalogPicker({
3540
+ kind:'profile',catalog:profileCatalog,rows:profileCatalogRows,onRetry:()=>location.reload(),document
3541
+ });
3542
+ const materialPicker=CatalogPicker.createCatalogPicker({
3543
+ kind:'material',catalog:materialCatalog||{environment:profileCatalog.environment||'US',standard:'Material catalog',navigation:[]},rows:materialCatalogRows,document
3544
+ });
3545
+ function profileCatalogValues(){return profileCatalogRows.flatMap(r=>[r.designation,...(r.aliases||[])]);}
3546
+ function profileDefaultMaterial(profile){const p=_canonDes(profile);return /^W\d/.test(p)?'A992':p.startsWith('HSS')?'A500-GR.B':'A36';}
3547
+ function applyProfileChoice(ids,value){
3548
+ const v=_canonDes(value);if(!v)return;
3549
+ edit(()=>{for(const id of ids){const m=byId(id);if(m)ModelCmd.patchMember(m,{profile:v,rfi:_wt(v)==null});}if(!profs.includes(v)){profs.push(v);profs.sort(CatalogPicker.naturalProfileCompare);}});
3550
+ }
3551
+ function applyMaterialChoice(ids,value){
3552
+ const v=value===CatalogPicker.MATERIAL_DEFAULT?undefined:String(value||'').trim();if(value!==CatalogPicker.MATERIAL_DEFAULT&&!v)return;
3553
+ edit(()=>{for(const id of ids){const m=byId(id);if(m)ModelCmd.patchMember(m,{material:v});}});
3554
+ }
3555
+ function openProfilePicker({ids=[],current=null,scope='',invoker,onApply}={}){
3556
+ const targets=[...ids];
3557
+ profilePicker.open({current,scope,count:targets.length||1,invoker,error:window.__AISC_LOAD_FAILED?'The active environment catalog could not be loaded.':null,
3558
+ source:`${profileCatalog.standard||'Profile catalog'} · ${profileCatalogRows.length.toLocaleString()} profiles · ${profileCatalog.environment||'US'}`,
3559
+ onApply:onApply||((value)=>applyProfileChoice(targets,value))});
3560
+ }
3561
+ function openMaterialPicker({ids=[],current=null,scope='',invoker,onApply}={}){
3562
+ const targets=[...ids],env=profileCatalog.environment||'US';
3563
+ materialPicker.open({current,scope,count:targets.length||1,invoker,error:materialCatalogRows.length?null:`No material catalog is installed for the ${env} environment.`,
3564
+ source:`${materialCatalog?.provider?.label||'Material catalog'} · ${env}`,onApply:onApply||((value)=>applyMaterialChoice(targets,value))});
3565
+ }
3530
3566
  let basePickColId=null; // Mode B: the column whose base an armed 3D level-pick retargets
3531
3567
  const MIN_COL_STUB_IN=12; // never trim a column below a 1' stub (keeps bos < tos)
3532
3568
  // Mode B: arm the 3D column-base pick on `colId` (a level-snapped elevation → col.bos). 3D-view only.
@@ -4198,8 +4234,36 @@ function _canonDes(s){return String(s==null?'':s).trim().toUpperCase()
4198
4234
  .replace(/[×✕✖]/g,'X').replace(/[‐-―−]/g,'-').replace(/[‘’ʹ′]/g,"'").replace(/[“”ʺ″]/g,'"')
4199
4235
  .replace(/ /g,' ').replace(/(\d)\s+(\d+\/\d+)/g,'$1-$2').replace(/\s+/g,'');}
4200
4236
  function _aiscSec(key){return (window.__AISC_SECTIONS||{})[key];}
4237
+ function _parseDoubleAngleIn(profile){
4238
+ const p=_canonDes(profile);if(!p.startsWith('2L'))return null;
4239
+ const orientation=p.endsWith('SLBB')?'slbb':p.endsWith('LLBB')?'llbb':null;
4240
+ const body=p.slice(2).replace(/(LLBB|SLBB)$/,'');
4241
+ const pd=t=>{const s=String(t).trim();if(!/^(?:\d+(?:\.\d+)?|\d+(?:\s+|-)\d+\/\d+|\d+\/\d+)$/.test(s))return null;let mm=s.match(/^(\d+)(?:\s+|-)(\d+)\/(\d+)$/);if(mm)return +mm[1]+ +mm[2]/+mm[3];mm=s.match(/^(\d+)\/(\d+)$/);if(mm)return +mm[1]/+mm[2];const d=Number(s);return isFinite(d)?d:null;};
4242
+ const toks=body.split('X');if(toks.length!==3&&toks.length!==4)return null;
4243
+ const v=toks.map(pd);if(v.some(n=>n==null||n<=0)||(!orientation&&Math.abs(v[0]-v[1])>1e-9))return null;
4244
+ return{d:v[0],b:v[1],t:v[2],gap:toks.length===4?v[3]:0,orientation:orientation||'llbb'};
4245
+ }
4246
+ function _profileCatalogRow(profile){return CatalogPicker.resolveProfileCatalogRow(profileCatalogRows,profile);}
4247
+ function _profileDisplaySectionIn(profile){
4248
+ const row=_profileCatalogRow(profile);if(!row)return _parseDoubleAngleIn(profile)?{shape:'double-angle',..._parseDoubleAngleIn(profile)}:null;
4249
+ const sec=_aiscSec(_canonDes(row.designation)),shape=row.sectionShape;
4250
+ if(shape==='double-angle'){const pair=_parseDoubleAngleIn(row.designation);return pair?{shape,...pair}:null;}
4251
+ if(shape==='solid-circle')return sec&&sec[0]>0?{shape,diameter:sec[0]}:null;
4252
+ if(shape==='tee')return sec&&sec[2]>0&&sec[3]>0?{shape,tw:sec[2],tf:sec[3]}:null;
4253
+ if(shape==='chs')return sec&&sec[0]>0&&sec[2]>0?{shape,od:sec[0],t:sec[2]}:null;
4254
+ if(shape==='rhs'||shape==='angle')return sec&&sec[2]>0?{shape,t:sec[2]}:null;
4255
+ if(shape==='i'||shape==='channel')return sec&&sec[2]>0&&sec[3]>0?{shape,tw:sec[2],tf:sec[3]}:null;
4256
+ return null;
4257
+ }
4201
4258
  function profileDimsIn(profile){
4202
4259
  if(!profile)return null;
4260
+ const display=_profileDisplaySectionIn(profile);
4261
+ if(display&&display.shape==='double-angle'){
4262
+ return display.orientation==='slbb'
4263
+ ?{d:2*display.d+display.gap,w:display.b,round:false}
4264
+ :{d:display.d,w:2*display.b+display.gap,round:false};
4265
+ }
4266
+ if(display&&display.shape==='solid-circle')return{d:display.diameter,w:display.diameter,round:true};
4203
4267
  const p=String(profile).trim().toUpperCase().replace(/[×✕✖]/g,'X'); // separator may be x / X / × / ✕ / ✖ — the SAME fold as server contract-to-scene profileDimsIn, or the two disagree about which designations resolve
4204
4268
  if(p===''||/(^|[^A-Z])MF($|[^A-Z])/.test(p))return null;
4205
4269
  const m=p.match(/^([A-Z]+)\s*(.+)$/);if(!m)return null;
@@ -4253,7 +4317,7 @@ function sectionKindOf(profile){return SteelCore.sectionKindOf(profile);}
4253
4317
  // 3D solid and the IFC/Tekla export carry:
4254
4318
  // • the DESIGNATION states it outright for an angle and a rectangular/round HSS — L4X4X3/8 is a 3/8" leg,
4255
4319
  // HSS8X4X3/8 a 3/8" wall — and no table is needed to read it;
4256
- // • the AISC table carries web+flange for the open rolled shapes (W/S/M/HP, C/MC), served in the
4320
+ // • the AISC table carries web+flange for the open rolled shapes (W/S/M/HP, C/MC, WT/ST/MT), served in the
4257
4321
  // /api/aisc-shapes mirror as elements 2 and 3.
4258
4322
  // Returns nulls freely: an untabulated or imported section has no real thickness anywhere, and
4259
4323
  // sectionOutlinePts falls back to its estimate rather than inventing one here.
@@ -4273,29 +4337,42 @@ function profileThkIn(profile){
4273
4337
  // character would not change a single answer today. It is here so the two folds are the same fold, which
4274
4338
  // is the property that stops them drifting — not because anything currently depends on it.
4275
4339
  const p=String(profile).trim().toUpperCase().replace(/[×✕✖]/g,'X').replace(/[‐-―−]/g,'-').replace(/ /g,' ');
4340
+ // A double angle starts with a digit, so it deliberately does not enter the rolled-family prefix parser
4341
+ // below. Its third dimension is the shared leg thickness; the optional fourth token is the gap and the
4342
+ // LLBB/SLBB suffix is orientation. This is the same designation source used by server parseDoubleAngle.
4343
+ if(p.startsWith('2L')){
4344
+ const body=p.slice(2).replace(/(LLBB|SLBB)$/,'');
4345
+ const _pd=t=>{const s=String(t).trim();let mm=s.match(/^(\d+)(?:\s+|-)(\d+)\/(\d+)$/);if(mm)return +mm[1]+ +mm[2]/+mm[3];mm=s.match(/^(\d+)\/(\d+)$/);if(mm)return +mm[1]/+mm[2];const d=parseFloat(s);return isFinite(d)?d:null;};
4346
+ const toks=body.split('X').map(_pd);
4347
+ return toks.length>=3&&toks[2]>0?{t:toks[2]}:null;
4348
+ }
4276
4349
  const m=p.match(/^([A-Z]+)\s*(.+)$/);if(!m)return null;
4277
4350
  const prefix=m[1],sec=_aiscSec(_canonDes(profile));
4278
4351
  // parseDim, not parseFloat: a fractional thickness token is the WHOLE point here, and parseFloat('3/8')
4279
4352
  // is 3 — a 3" leg on a 4" angle. Same fold and same parse as profileDimsIn above.
4280
4353
  const _pd=t=>{const s=String(t).trim();let mm=s.match(/^(\d+)(?:\s+|-)(\d+)\/(\d+)$/);if(mm)return +mm[1]+ +mm[2]/+mm[3];mm=s.match(/^(\d+)\/(\d+)$/);if(mm)return +mm[1]/+mm[2];const d=parseFloat(s);return isFinite(d)?d:null;};
4281
4354
  const toks=m[2].split('X').map(_pd);
4282
- if(prefix==='L'||prefix==='HSS'||prefix==='TUBE'){
4283
- if(toks.length>=3&&toks[2]>0)return {t:toks[2]}; // A×B×t
4284
- if(prefix==='HSS'&&toks.length===2&&toks[1]>0)return {t:toks[1]}; // round HSS OD×wall
4285
- return null; // a PIPE names its NPS, not its wall
4355
+ if(prefix==='L'){
4356
+ return toks.length>=3&&toks[2]>0?{t:toks[2]}:null; // A×B×t
4286
4357
  }
4287
- // EXACTLY the families the server's `xsectionFor` types — ^(W|S|M|HP)$ and ^(C|MC)$ — and deliberately
4288
- // NOT the tees (WT/ST/MT), even though the catalogue does carry their web and flange. `xsectionFor`
4289
- // answers `rect` for a tee, so the 3D solid and the IFC/Tekla export draw it from the ESTIMATE; a plan
4290
- // that read the real value here would be the only truthful view, which is just the old disagreement
4291
- // pointing the other way. The plan's job is to show the member that gets fabricated. Widening this means
4292
- // widening `xsectionFor` first, and that changes exported geometry — its own change, with its own review.
4358
+ if(prefix==='HSS'||prefix==='TUBE'||prefix==='PIPE'){
4359
+ // HSS and PIPE table rows carry the provider's design wall. That is the physical thickness used by
4360
+ // the 3D annulus/RHS and canonical CHS; reading the nominal label token here would make the plan the
4361
+ // only view drawing a different wall. PIPE cannot be parsed from its NPS/schedule name at all.
4362
+ if(sec&&sec[2]!=null&&sec[2]>0)return {t:sec[2]};
4363
+ if(toks.length>=3&&toks[2]>0)return {t:toks[2]};
4364
+ if(prefix==='HSS'&&toks.length===2&&toks[1]>0)return {t:toks[1]};
4365
+ return null;
4366
+ }
4367
+ // EXACTLY the table-backed open families the server's `xsectionFor` types. Tees are included now that
4368
+ // AWARE v0.125 carries their canonical descriptor; leaving them out would make the plan the sole view
4369
+ // still estimating a member whose 3D solid and export both use the provider web and flange.
4293
4370
  // BOTH or neither, because `xsectionFor` gates on both (`twtf = tw != null && tf != null`) and drops the
4294
4371
  // whole section to `rect` otherwise. Returning a lone `tw` would hand the plan a real web against a 3D
4295
4372
  // estimating both — the same disagreement in miniature. No row in today's catalogue has exactly one of
4296
4373
  // the pair, so no designation can currently reach it; this is a guard on the table GENERATOR, which is
4297
4374
  // why the agreement matrix cannot see it and this line has to say it instead. (Found by code review.)
4298
- if(/^(W|S|M|HP|C|MC)$/.test(prefix)&&sec)return (sec[2]!=null&&sec[3]!=null)?{tw:sec[2],tf:sec[3]}:null;
4375
+ if(/^(W|S|M|HP|C|MC|WT|ST|MT)$/.test(prefix)&&sec)return (sec[2]!=null&&sec[3]!=null)?{tw:sec[2],tf:sec[3]}:null;
4299
4376
  return null;
4300
4377
  }
4301
4378
  // Local section outline (centred at origin), w/d in PX. The POINTS come from SteelCore.sectionOutlinePts —
@@ -4316,6 +4393,24 @@ function sectionShapePts(profile,w,d,ppf,round){
4316
4393
  return SteelCore.sectionOutlinePts(round===true?'ROUND':sectionKindOf(profile),w,d,
4317
4394
  thk?{tw:px(thk.tw),tf:px(thk.tf),t:px(thk.t)}:null).outer;
4318
4395
  }
4396
+ // The plan needs every physical component, not only the legacy single outline above: tees are not I-shapes,
4397
+ // solid rounds are not boxes, and a 2L is two separate angles with air between them. Values returned by
4398
+ // _profileDisplaySectionIn are inches, so scale the descriptor into the same sheet-pixel unit as w/d before
4399
+ // handing it to the topology builder shared with the 3D renderer.
4400
+ function sectionShapeComponents(profile,w,d,ppf,round){
4401
+ const k=ppf>0?ppf/12:0,xs=_profileDisplaySectionIn(profile);
4402
+ const scaled=xs?Object.fromEntries(Object.entries(xs).map(([key,value])=>[
4403
+ key,typeof value==='number'&&['d','b','t','gap','diameter','od','tw','tf'].includes(key)?value*k:value,
4404
+ ])):null;
4405
+ const topology=SteelCore.sectionTopology(scaled,w,d,round===true?'ROUND':sectionKindOf(profile));
4406
+ const pathPoints=path=>{
4407
+ if(path&&path.kind==='polygon')return path.points;
4408
+ if(path&&path.kind==='circle')return Array.from({length:SteelCore.ROUND_SEGMENTS||48},(_,i)=>{const a=i/(SteelCore.ROUND_SEGMENTS||48)*Math.PI*2;return[path.cx+path.radius*Math.cos(a),path.cy+path.radius*Math.sin(a)];});
4409
+ return[];
4410
+ };
4411
+ const components=topology.map(component=>pathPoints(component.outer)).filter(points=>points.length>=3);
4412
+ return components.length?components:[sectionShapePts(profile,w,d,ppf,round)];
4413
+ }
4319
4414
  // Column plan polygon (absolute px). Primary: derive from profile + pt_per_ft + rot. Fallback: a small
4320
4415
  // square footprint so an unresolved (RFI) column still reads as a section, never a bare point.
4321
4416
  // ponytail: filter-traced fallback (the saved section linework) deferred — the marker covers the rare
@@ -4386,7 +4481,7 @@ function columnSectionPoly(m){
4386
4481
  // registration angle). Applied raw here, as it was, the plan drew every section as the MIRROR of the
4387
4482
  // 3D solid and the export — see sectionOutlinePx for the measurement and the algebra.
4388
4483
  const xf=planRegistration(),rotN=+m.rot||0,wPx=sec.w/12*ppf,dPx=sec.d/12*ppf;
4389
- const pts=SteelCore.sectionOutlinePx(sectionShapePts(m.profile,wPx,dPx,ppf,dims&&dims.round),rotN,xf.rad,xf.fitScale);
4484
+ const localComponents=sectionShapeComponents(m.profile,wPx,dPx,ppf,dims&&dims.round);
4390
4485
  // A column now takes a Profile Position like every other member, so the FOOTPRINT has to move with it —
4391
4486
  // otherwise the plan draws the section centred on a work point the 3D and the export put it off.
4392
4487
  // The offset is built in the SAME local frame and the SAME px units as the outline and pushed through
@@ -4395,12 +4490,14 @@ function columnSectionPoly(m){
4395
4490
  // true 3D location while the outline stayed in this function's own (battered-column-approximate) frame,
4396
4491
  // which is a NEW contradiction in the one place this is meant to remove one. And the swing is left to
4397
4492
  // sectionOutlinePx, which applies the identical roll — applying it here as well would double the angle.
4398
- const exPx=SteelCore.sectionExtents(SteelCore.outlineFor(m.profile,wPx,dPx,null,!!(dims&&dims.round)));
4493
+ const allLocal=localComponents.flat(),xs=allLocal.map(p=>p[0]),ys=allLocal.map(p=>p[1]);
4494
+ const exPx={lo:[Math.min(...xs),Math.min(...ys)],hi:[Math.max(...xs),Math.max(...ys)]};
4399
4495
  const mmToPx=ppf/(12*25.4); // px per foot ÷ mm per foot: the two offsets are stored in MILLIMETRES
4400
4496
  const oy=SteelCore.faceOffset(posHDefault(m),exPx.lo[0],exPx.hi[0])+(+m.positionHOffset||0)*mmToPx;
4401
4497
  const oz=SteelCore.faceOffset(posDefault(m),exPx.lo[1],exPx.hi[1])+(+m.positionOffset||0)*mmToPx;
4402
4498
  const [dx,dy]=SteelCore.sectionOutlinePx([[oy,oz]],rotN,xf.rad,xf.fitScale)[0];
4403
- return pts.map(([x,y])=>[cx+dx+x,cy+dy+y]);
4499
+ const components=localComponents.map(points=>SteelCore.sectionOutlinePx(points,rotN,xf.rad,xf.fitScale).map(([x,y])=>[cx+dx+x,cy+dy+y]));
4500
+ const pts=components[0];if(components.length>1)pts.components=components;return pts;
4404
4501
  }
4405
4502
  const r=ppf?Math.max(6,(6/12)*ppf):8; // ~6" or a floor, so it stays visible even unscaled
4406
4503
  // Tagged, because this square claims no size and the caller cannot tell that by looking at it. It used
@@ -5663,7 +5760,7 @@ function render(){
5663
5760
  // A placeholder footprint on a member that is NOT an RFI reads as a real, small section — the size is
5664
5761
  // the one thing on this canvas it cannot be trusted for, so it says so rather than looking resolved.
5665
5762
  const _ph=(pts&&pts.placeholder&&!rfi)?` data-tip="Footprint shown as a placeholder — the AISC table gives no footprint for this shape. Its weight and length are still exact."`:'';
5666
- if(pts){s+=`<polygon class="member${rfi?' rfi':''}${sel?' sel':''}${fh?' find-hit':''}" data-id="${m.id}" points="${_polyStr(pts)}" fill="${c}" stroke="${c}"${g}${_ph}/>`;continue;}}
5763
+ if(pts){const components=pts.components||[pts];s+=components.map((part,index)=>`<polygon class="member${rfi?' rfi':''}${sel?' sel':''}${fh?' find-hit':''}" data-id="${m.id}" data-part="${index}" points="${_polyStr(part)}" fill="${c}" stroke="${c}"${g}${_ph}/>`).join('');continue;}}
5667
5764
  const ls=memberLineStyle(m); // F5: category line weight/dash. Inline style (NOT a presentation attr) so it beats line.member/.sel CSS width; the glow still cues selection.
5668
5765
  const _fx=on?`filter:drop-shadow(0 0 3px ${c}) drop-shadow(0 0 8px ${c});`:'', _sw=(ls&&ls.w)?`stroke-width:${ls.w}px;`:'', _sd=(ls&&ls.d&&!rfi)?`stroke-dasharray:${ls.d};`:''; // RFI keeps its semantic 10 6 dash
5669
5766
  const _sty=(_fx||_sw||_sd)?` style="${_fx}${_sw}${_sd}"`:'';
@@ -5747,8 +5844,8 @@ function updateHandles(m){svg.querySelectorAll(`circle.handle[data-mid="${m.id}"
5747
5844
  function updateLine(m){
5748
5845
  if(isBrace(m)){const g=svg.querySelector(`g.bracesym[data-id="${m.id}"]`); // a brace is a symbol group — re-serialize the whole glyph so it follows the drag live (moves off true WPs, redraws offset)
5749
5846
  if(g){const glow=selIds.has(m.id)||findHits.has(m.id);const c=colorFor(m.profile);g.outerHTML=braceSymbol(m,c,glow?` style="filter:drop-shadow(0 0 3px ${c}) drop-shadow(0 0 8px ${c})"`:'');}return;}
5750
- if(m.role==='column'){const pg=svg.querySelector(`polygon.member[data-id="${m.id}"]`); // columns are polygons — re-derive their footprint from the moved centroid so they follow the drag live
5751
- if(pg){const pts=columnSectionPoly(m);if(pts)pg.setAttribute('points',_polyStr(pts));}return;}
5847
+ if(m.role==='column'){const pgs=svg.querySelectorAll(`polygon.member[data-id="${m.id}"]`); // columns may be multi-component polygons (2L) — re-derive every footprint part from the moved centroid
5848
+ if(pgs.length){const pts=columnSectionPoly(m),components=pts&&(pts.components||[pts]);if(components)pgs.forEach((pg,index)=>{if(components[index])pg.setAttribute('points',_polyStr(components[index]));});}return;}
5752
5849
  const ln=svg.querySelector(`line.member[data-id="${m.id}"]`);
5753
5850
  if(ln){ln.setAttribute('x1',m.wp[0][0]);ln.setAttribute('y1',m.wp[0][1]);ln.setAttribute('x2',m.wp[1][0]);ln.setAttribute('y2',m.wp[1][1]);}}
5754
5851
  /** The four header readouts computed from the ACTIVE PLAN's member list. Named once — see stats(). */
@@ -6050,13 +6147,18 @@ function panel(){
6050
6147
  p.innerHTML=`<span class=badge>Add member</span>
6051
6148
  ${memberTypeField('mTypeA',[{memberType:addType}])}
6052
6149
  <div class=sect style="margin-top:8px">Current profile</div>
6053
- <div style="display:flex;gap:6px"><input data-command-id="steel.add-profile" aria-label="Current profile" id=addProf class=combo data-src=profiles placeholder="type or pick (e.g. W16X26)" value="${esc(addProfile)}" style="flex:1" autocomplete=off><button data-command-id="steel.pick-profile" id=addPick class="ghost${pk?' on':''}" data-tip="Pick profile by clicking a label in the drawing">⌖ pick</button></div>
6150
+ <div style="display:flex;gap:6px"><input data-command-id="steel.add-profile" aria-label="Current profile" id=addProf class=combo data-src=profiles placeholder="type or pick (e.g. W16X26)" value="${esc(addProfile)}" style="flex:1" autocomplete=off><button data-command-id="steel.browse-profile-catalog" id=profileBrowseA class=ghost data-tip="Browse the active environment profile catalog">Browse</button><button data-command-id="steel.pick-profile" id=addPick class="ghost${pk?' on':''}" data-tip="Pick profile by clicking a label in the drawing">⌖ pick</button></div>
6054
6151
  <div class=hint id=pickHint style="margin-top:4px;font-style:italic${pk?';color:var(--brand)':''}">${pk?'Click a profile label in the drawing…':'or click a label in the drawing'}</div>
6152
+ <div class=elab style="margin-top:9px">Material grade</div>
6153
+ <div style="display:flex;gap:6px"><input data-command-id="steel.add-material" aria-label="Material grade" id=addMat class=combo data-src=materials placeholder="Profile default · ${esc(profileDefaultMaterial(addProfile))}" value="${esc(addMaterial)}" style="flex:1" autocomplete=off><button data-command-id="steel.browse-material-catalog" id=materialBrowseA class=ghost data-tip="Browse structural member grades">Browse</button></div>
6055
6154
  <div class=divrow><hr></div>
6056
6155
  <div class=sect>Draw a member</div>
6057
6156
  <div class=hint id=drawHint>${view3d?'✏️ Click the start then the end — both land on the <b>working plane</b>. A near-vertical pick pair becomes a column. <b>Shift</b> = straight, <b>Esc</b> = exit.':drawHintText()}</div>`;
6058
6157
  const ap=document.getElementById('addProf');
6059
6158
  ap.oninput=ap.onchange=e=>{addProfile=_canonDes(e.target.value);};
6159
+ const am=document.getElementById('addMat');am.oninput=am.onchange=e=>{addMaterial=String(e.target.value||'').trim().toUpperCase();};
6160
+ document.getElementById('profileBrowseA').onclick=e=>openProfilePicker({current:addProfile||null,scope:'New members',invoker:e.currentTarget,onApply:v=>{addProfile=_canonDes(v);render();}});
6161
+ document.getElementById('materialBrowseA').onclick=e=>openMaterialPicker({current:addMaterial||'',scope:'New members',invoker:e.currentTarget,onApply:v=>{addMaterial=v===CatalogPicker.MATERIAL_DEFAULT?'':String(v);render();}});
6060
6162
  document.getElementById('addPick').onclick=()=>{picking=!pk;pickKind='profile';pickEnd=null;render();}; // labels are already hot in Add mode — this arms the same highlighted "pick a label" state as the member inspector
6061
6163
  document.getElementById('mTypeA').onchange=e=>{const v=e.target.value;
6062
6164
  if(!normMemberTypeKey(v)){e.target.value=memberTypeLabel(addType);return;} // blank or punctuation-only ("!!!") normalises to no key → mints nothing, so don't burn an undo step on it
@@ -6258,7 +6360,7 @@ function panel(){
6258
6360
  const allKnown=arr.every(m=>_wt(m.profile)!=null);
6259
6361
  const totalW=allKnown?Math.round(arr.reduce((t,m)=>t+_lenFt(m)*_wt(m.profile),0)):null;
6260
6362
  const dupSet=new Set(redundantDups()), dupSel=arr.filter(m=>dupSet.has(m.id)).length;
6261
- const profAgg=agg(arr,m=>m.profile), allVerified=arr.every(m=>m.verified===true);
6363
+ const profAgg=agg(arr,m=>m.profile), matAgg=agg(arr,m=>m.material||''), allVerified=arr.every(m=>m.verified===true);
6262
6364
  const VV=v=>v===VARIES, valOf=v=>VV(v)||v==null?'':esc(fmtFtIn(v)), decOf=v=>VV(v)||v==null?'':esc(fmtDecIn(v));
6263
6365
  const exPH='5 3/4&quot; · 1&#39;-0 1/4&quot;';
6264
6366
  const endName=id=>({bos:'column bottom',tosC:'column top',ntC:'column top',dtC:'column top',cnC:'column top',tosA:'start end',ntA:'start end',dtA:'start end',cnA:'start end',tosB:'end end',ntB:'end end',dtB:'end end',cnB:'end end'})[id]||id;
@@ -6304,7 +6406,8 @@ function panel(){
6304
6406
  ${typeFilterHTML()}
6305
6407
  <div class="row hint" style="margin-top:0">Edits apply to <b>all ${arr.length}</b> selected · a blank <b>Varies</b> field is left unchanged.</div>
6306
6408
  ${memberTypeField('mTypeM',arr)}
6307
- <div class="f"><div class=elab>Profile</div><input data-command-id="steel.selection-profile" aria-label="Profile" id=pf class=combo data-src=profiles placeholder="${VV(profAgg)?'Varies':''}" value="${VV(profAgg)?'':esc(profAgg||'')}" autocomplete=off></div>
6409
+ <div class="f"><div class=elab>Profile</div><div style="display:flex;gap:6px"><input data-command-id="steel.selection-profile" aria-label="Profile" id=pf class=combo data-src=profiles placeholder="${VV(profAgg)?'Varies':''}" value="${VV(profAgg)?'':esc(profAgg||'')}" style="flex:1" autocomplete=off><button data-command-id="steel.browse-profile-catalog" id=profileBrowseM class=ghost data-tip="Browse the active environment profile catalog">Browse</button></div></div>
6410
+ <div class="f"><div class=elab>Material grade</div><div style="display:flex;gap:6px"><input data-command-id="steel.selection-material" aria-label="Material grade" id=mat class=combo data-src=materials placeholder="${VV(matAgg)?'Varies':VV(profAgg)?'Profile default · per member':'Profile default · '+esc(profileDefaultMaterial(profAgg))}" value="${VV(matAgg)?'':esc(matAgg||'')}" style="flex:1" autocomplete=off><button data-command-id="steel.browse-material-catalog" id=materialBrowseM class=ghost data-tip="Browse structural member grades">Browse</button></div></div>
6308
6411
  <div class="row hint">Total length <b>${totalL} ft</b>${totalW!=null?` · <b>${totalW.toLocaleString()} lb</b>`:''}${dupSel?` · <span style="color:var(--err)">${dupSel} duplicate${dupSel>1?'s':''}</span> (overlap a kept member — deleting these dedupes)`:''}</div>
6309
6412
  <div class=row><button data-command-id="steel.selection-verified" class=ghostw id=verifyBtn${allVerified?' style="border-color:var(--ok-edge);color:var(--ok)"':''}>${allVerified?'✓ All verified — click to unverify':'Mark all verified'}</button></div>
6310
6413
  ${elev}
@@ -6331,6 +6434,9 @@ function panel(){
6331
6434
  wireTypeFilter(p);
6332
6435
  // wiring — every commit applies to the whole selection; a blank field is a no-op (leaves each member's own value).
6333
6436
  document.getElementById('pf').onchange=e=>{const v=_canonDes(e.target.value);if(!v)return;edit(()=>{for(const m of selArr())ModelCmd.patchMember(m,{profile:v,rfi:_wt(v)==null});if(!profs.includes(v)){profs.push(v);profs.sort();}});};
6437
+ document.getElementById('profileBrowseM').onclick=e=>openProfilePicker({ids:arr.map(m=>m.id),current:VV(profAgg)?null:profAgg,scope:`${arr.length} selected members`,invoker:e.currentTarget});
6438
+ document.getElementById('mat').onchange=e=>{const v=String(e.target.value||'').trim();if(VV(matAgg)&&!v)return;applyMaterialChoice(arr.map(m=>m.id),v||CatalogPicker.MATERIAL_DEFAULT);};
6439
+ document.getElementById('materialBrowseM').onclick=e=>openMaterialPicker({ids:arr.map(m=>m.id),current:VV(matAgg)?null:(matAgg||''),scope:`${arr.length} selected members`,invoker:e.currentTarget});
6334
6440
  document.getElementById('mTypeM').onchange=e=>{const v=e.target.value;if(!normMemberTypeKey(v)){e.target.value=memberTypeValueFor(selArr());return;}edit(()=>{const k=memberTypeFromInput(v);if(!k)return;applyMemberType(selArr(),k);});}; // type owns Column-vs-beam-style role and legend category
6335
6441
  document.getElementById('verifyBtn').onclick=()=>edit(()=>{const v=!allVerified;for(const m of selArr())ModelCmd.patchMember(m,{verified:v});});
6336
6442
  {const _gel=document.getElementById('geoEL');if(_gel)_gel.onclick=()=>{geoMode=(geoMode==='el'?null:'el');setGeo();render();};}
@@ -6586,7 +6692,8 @@ function panel(){
6586
6692
  p.innerHTML=`<h3>Member ${esc(m.id)}</h3>
6587
6693
  ${typeFilterHTML()}
6588
6694
  ${memberTypeField('mTypeS',[m])}
6589
- <div class="f"><div class=elab>Profile</div><div style="display:flex;gap:6px"><input data-command-id="steel.member-profile" aria-label="Profile" id=pf class=combo data-src=profiles value="${esc(m.profile)}" style="flex:1" autocomplete=off><button data-command-id="steel.pick-profile" id=pickProf class="ghost${(picking&&pickKind==='profile')?' on':''}" data-tip="Pick profile by clicking a label in the drawing">⌖ pick</button></div>${(picking&&pickKind==='profile')?'<div class="hint" style="margin-top:4px;font-style:italic;color:var(--brand)">Click a profile label in the drawing…</div>':(picking&&pickKind==='detail')?'<div class="hint" style="margin-top:4px;font-style:italic;color:var(--purple)">Click a detail callout in the drawing…</div>':''}</div>
6695
+ <div class="f"><div class=elab>Profile</div><div style="display:flex;gap:6px"><input data-command-id="steel.member-profile" aria-label="Profile" id=pf class=combo data-src=profiles value="${esc(m.profile)}" style="flex:1" autocomplete=off><button data-command-id="steel.browse-profile-catalog" id=profileBrowseS class=ghost data-tip="Browse the active environment profile catalog">Browse</button><button data-command-id="steel.pick-profile" id=pickProf class="ghost${(picking&&pickKind==='profile')?' on':''}" data-tip="Pick profile by clicking a label in the drawing">⌖ pick</button></div>${(picking&&pickKind==='profile')?'<div class="hint" style="margin-top:4px;font-style:italic;color:var(--brand)">Click a profile label in the drawing…</div>':(picking&&pickKind==='detail')?'<div class="hint" style="margin-top:4px;font-style:italic;color:var(--purple)">Click a detail callout in the drawing…</div>':''}</div>
6696
+ <div class="f"><div class=elab>Material grade</div><div style="display:flex;gap:6px"><input data-command-id="steel.member-material" aria-label="Material grade" id=mat class=combo data-src=materials value="${esc(m.material||'')}" placeholder="Profile default · ${esc(profileDefaultMaterial(m.profile))}" style="flex:1" autocomplete=off><button data-command-id="steel.browse-material-catalog" id=materialBrowseS class=ghost data-tip="Browse structural member grades">Browse</button></div><div class=hint>${m.material?esc(m.material)+' · explicit':'Follows the selected profile automatically'}</div></div>
6590
6697
  ${appearanceSect}
6591
6698
  ${braceSect}
6592
6699
  <div class="row hint">Length <b>${L} ft</b> · ${wpf==null?'<span id=rfiPill class="pill pill-clickable" role=button tabindex=0 data-tip="Open the RFI list, focused on this member" style="background:var(--err-bg)">RFI — size unresolved</span>':'Weight <b>'+(_lenFt(m)*wpf).toFixed(0)+' lb</b> · '+wpf+' lb/ft'}</div>
@@ -6614,6 +6721,9 @@ function panel(){
6614
6721
  <div class="row f"><button data-command-id="steel.member-delete" class=danger id=del>Delete member</button></div>`;
6615
6722
  wireTypeFilter(p);
6616
6723
  document.getElementById('pf').onchange=e=>edit(()=>{const v=_canonDes(e.target.value);ModelCmd.patchMember(m,{profile:v,rfi:_wt(v)==null});if(v&&!profs.includes(v)){profs.push(v);profs.sort();}});
6724
+ document.getElementById('profileBrowseS').onclick=e=>openProfilePicker({ids:[m.id],current:m.profile,scope:`Member ${m.id}`,invoker:e.currentTarget});
6725
+ document.getElementById('mat').onchange=e=>applyMaterialChoice([m.id],String(e.target.value||'').trim()||CatalogPicker.MATERIAL_DEFAULT);
6726
+ document.getElementById('materialBrowseS').onclick=e=>openMaterialPicker({ids:[m.id],current:m.material||'',scope:`Member ${m.id}`,invoker:e.currentTarget});
6617
6727
  {const rp=document.getElementById('rfiPill');if(rp){const go=()=>openRFI(m.id);rp.onclick=go;rp.onkeydown=e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();e.stopPropagation();go();}};}} // F12: the RFI pill opens the list focused on THIS member (role=button span → keydown for Enter/Space). stopPropagation so idle Space/Enter doesn't ALSO hit the global repeat-last handler (:3804) — matches the editor's local-keydown convention (:1738,:4212)
6618
6728
  document.getElementById('pickProf').onclick=()=>{if(picking&&pickKind==='profile'){picking=false;}else{picking=true;pickKind='profile';pickEnd=null;}render();};
6619
6729
  document.getElementById('mTypeS').onchange=e=>{const v=e.target.value;if(!normMemberTypeKey(v)){e.target.value=memberTypeLabel(memberTypeOf(m));return;}edit(()=>{const k=memberTypeFromInput(v);if(k&&memberTypeOf(m)!==k)applyMemberType([m],k);});}; // retype → role + legend recategorize (edit() → sync3D → build3DLegend); undoable
@@ -6759,7 +6869,7 @@ function panel(){
6759
6869
  {const vb=document.getElementById('verifyBtn');if(vb)vb.onclick=()=>edit(()=>{ModelCmd.patchMember(m,{verified:!m.verified});});}
6760
6870
  }
6761
6871
  function addFromSeg(sid){const sg=P.segments.find(s=>s.id===sid);if(!sg)return;const prof=addProfile;const id='m'+Date.now();const pv=snapshot();
6762
- const nm=ensureMeta({id,profile:prof,wp:[sg.a.slice(),sg.b.slice()],angle:sg.o,rfi:(_wt(prof)==null)});
6872
+ const nm=ensureMeta({id,profile:prof,material:addMaterial||undefined,wp:[sg.a.slice(),sg.b.slice()],angle:sg.o,rfi:(_wt(prof)==null)});
6763
6873
  applyMemberType([nm],addType);MC().addMembers(P,[nm]); // applyMemberType writes role/memberType, not geometry — it stays here
6764
6874
  if(prof&&!profs.includes(prof)){profs.push(prof);profs.sort();}pushUndo(pv);render();sync3D();}
6765
6875
  // --- marquee hit-test (crossing selection): does segment ab touch rect [x0,y0,x1,y1]? ---
@@ -7447,7 +7557,7 @@ function drawClick(e){const s=dimSnapAt(e,drawDraft);const p=[s.x,s.y]; // dim
7447
7557
  const a=drawDraft,b=e.shiftKey?orthoLock(a[0],a[1],p[0],p[1]):p; // Shift = straight (ortho, local-frame aware)
7448
7558
  if(len(a,b)<=6){drawPrev(e);return;} // sub-6px 2nd pick (double-click / near-miss) → KEEP the start, don't commit (mirrors dimClick's zero-length guard)
7449
7559
  const dx=Math.abs(b[0]-a[0]),dy=Math.abs(b[1]-a[1]),o=dx>3*dy?'H':(dy>3*dx?'V':'D'); // classify H/V/diagonal like the old drag-commit
7450
- const id='m'+Date.now(),pv=snapshot();const nm=ensureMeta({id,profile:addProfile,wp:[a,b],angle:o,rfi:(_wt(addProfile)==null)});
7560
+ const id='m'+Date.now(),pv=snapshot();const nm=ensureMeta({id,profile:addProfile,material:addMaterial||undefined,wp:[a,b],angle:o,rfi:(_wt(addProfile)==null)});
7451
7561
  applyMemberType([nm],addType);MC().addMembers(P,[nm]); // the Add-member panel's type owns role + legend category
7452
7562
  if(addProfile&&!profs.includes(addProfile)){profs.push(addProfile);profs.sort();}pushUndo(pv);
7453
7563
  drawDraft=null;render();drawPrev(e);} // commit → clear the draft, keep the tool armed for the next member
@@ -9140,10 +9250,10 @@ const view3dApi={
9140
9250
  const hpx=Math.hypot(wpB[0]-wpA[0],wpB[1]-wpA[1]),hIn=hpx/FT*12,dzIn=Math.abs(zB-zA);
9141
9251
  const id='m'+Date.now();
9142
9252
  edit(()=>{let m;
9143
- if(hIn<6&&dzIn>6){m=ensureMeta({id,profile:addProfile,wp:[wpA.slice(),wpA.slice()],role:'column'}); // near-vertical run → a column at the plan point
9253
+ if(hIn<6&&dzIn>6){m=ensureMeta({id,profile:addProfile,material:addMaterial||undefined,wp:[wpA.slice(),wpA.slice()],role:'column'}); // near-vertical run → a column at the plan point
9144
9254
  m.col={bos:Math.min(zA,zB),tos:Math.max(zA,zB),note:'',tosDef:false,detail:''};}
9145
9255
  else{const near=z=>Math.abs(z-defaultTOS)<0.5; // a pick ON the level stays default-linked
9146
- m=ensureMeta({id,profile:addProfile,wp:[wpA,wpB],role:'beam',angle:_mAngle([wpA,wpB])}); // classify H/V/D from the PLAN delta — same rule as _mAngle + the 2D add path (all three agree)
9256
+ m=ensureMeta({id,profile:addProfile,material:addMaterial||undefined,wp:[wpA,wpB],role:'beam',angle:_mAngle([wpA,wpB])}); // classify H/V/D from the PLAN delta — same rule as _mAngle + the 2D add path (all three agree)
9147
9257
  const mfNote=/(^|[^A-Z])MF/i.test(addProfile||'')?'moment':''; // a moment-frame profile keeps the auto note ensureMeta gives 2D-drawn members
9148
9258
  m.ends=[{tos:near(zA)?null:zA,note:mfNote,tosDef:near(zA),detail:''},{tos:near(zB)?null:zB,note:mfNote,tosDef:near(zB),detail:''}];}
9149
9259
  if((addType==='column')===(m.role==='column'))ModelCmd.setMemberType(m,addType); // 3D geometry decides column-vs-beam; only stamp the panel's type when it agrees with that role
@@ -15619,13 +15729,14 @@ function openRFI(focusId){focusId=(typeof focusId==='string')?focusId:null; //
15619
15729
  g.innerHTML=list.length?('<div class=hint style="margin-bottom:10px">'+list.length+' member'+(list.length>1?'s have':' has')+' no resolved AISC size, so their weight is excluded from the BOM. A green <b>✓ Verified</b> means someone has already confirmed that designation by hand — it is right, it just isn’t in the AISC table. Assign a profile to clear it; for <b>MF/BF</b> marks use the <b>Frames</b> schedule. Edits here update the contract.</div><table class=ftab><thead><tr><th>#</th><th>Profile / mark</th><th>Role</th><th>Length</th><th>Why it’s flagged</th><th>Verified</th><th></th></tr></thead><tbody>'+
15620
15730
  list.map((m,i)=>{ensureMeta(m);const L=_lenFt(m).toFixed(1);const v=m.verified===true; // #628: verified ≠ resolved — a hand-confirmed member with no AISC size STAYS on this list (its weight is still out of the BOM); the marker only says a human has been here, so "checked, the library just can’t price it" stops reading like "not looked at yet"
15621
15731
  return `<tr${v?' class=rfi-verified':''}><td><span class="rfichip${v?' verified':''}"${v?` data-tip="${RFI_VTIP}"`:''}>${i+1}</span></td>
15622
- <td><input data-command-id="steel.rfi-profile#${esc(m.id)}" aria-label="Profile for ${esc(m.id)}" class=combo data-src=profiles data-mid="${esc(m.id)}" value="${esc(m.profile||'')}" placeholder="e.g. W16X26" autocomplete=off style="width:124px"></td>
15732
+ <td><div style="display:flex;gap:5px"><input data-command-id="steel.rfi-profile#${esc(m.id)}" aria-label="Profile for ${esc(m.id)}" class=combo data-src=profiles data-mid="${esc(m.id)}" value="${esc(m.profile||'')}" placeholder="e.g. W16X26" autocomplete=off style="width:124px"><button data-command-id="steel.browse-profile-catalog#${esc(m.id)}" class="ghost rfiProfileBrowse" data-mid="${esc(m.id)}" data-tip="Browse the active environment profile catalog">Browse</button></div></td>
15623
15733
  <td>${m.role==='column'?'Column':'Beam'}</td><td>${L} ft</td><td class=rea>${esc(rfiReason(m))}</td>
15624
15734
  <td class=vcell>${v?`<span class="chip verified" data-tip="${RFI_VTIP}">✓ Verified</span>`:''}</td>
15625
15735
  <td><button data-command-id="steel.locate-member#${esc(m.id)}" class=ghost data-loc="${esc(m.id)}">Locate</button></td></tr>`;}).join('')+'</tbody></table>')
15626
15736
  :'<div class=hint>No unresolved members — every member has a resolved AISC size. ✓</div>';
15627
15737
  g.querySelectorAll('input.combo[data-mid]').forEach(inp=>inp.onchange=e=>{const m=byId(inp.dataset.mid);if(!m)return;
15628
15738
  const v=_canonDes(e.target.value);edit(()=>{ModelCmd.patchMember(m,{profile:v,rfi:_wt(v)==null});if(v&&!profs.includes(v)){profs.push(v);profs.sort();}});openRFI();});
15739
+ g.querySelectorAll('button.rfiProfileBrowse').forEach(b=>b.onclick=()=>{const m=byId(b.dataset.mid);if(!m)return;openProfilePicker({ids:[m.id],current:m.profile,scope:`Resolve ${m.id}`,invoker:b,onApply:v=>{applyProfileChoice([m.id],v);openRFI(m.id);}});});
15629
15740
  g.querySelectorAll('button[data-loc]').forEach(b=>b.onclick=()=>{const m=byId(b.dataset.loc);if(!m)return;selDimIds.clear();selIds=new Set([m.id]);geoMode=null;setGeo();closeRFI();render();zoomToMember(m);});
15630
15741
  document.getElementById('rfiModal').style.display='flex';
15631
15742
  if(focusId){const inp=[...g.querySelectorAll('input.combo[data-mid]')].find(i=>i.dataset.mid===focusId);const row=inp&&inp.closest('tr'); // find via the row's profile input — avoids CSS-escaping the id
@@ -15850,6 +15961,7 @@ lbView.addEventListener('dblclick',lbReset);
15850
15961
  // --- custom dark combobox (replaces the native white datalist dropdown) ---
15851
15962
  const COMBO_SRC={
15852
15963
  profiles:()=>profs,
15964
+ materials:()=>materialCatalogRows.map(r=>r.value),
15853
15965
  membertypes:()=>memberTypeRecords().map(t=>t.label),
15854
15966
  conntypes:()=>['moment','drag','shear','braced','pinned','fixed'],
15855
15967
  details:()=>detTexts(), // the SAME list the Details modal shows — see detTexts (#397)
@@ -16308,7 +16420,7 @@ function resetPlanViewState(i){
16308
16420
  // The profile list, read from the native document root. Deriving it from
16309
16421
  // `P.members` would be the silent-empty this design refuses; deriving it from `weights` alone would be a
16310
16422
  // truthful-but-partial list, which is the same defect one size down.
16311
- profs=[...new Set([...(C.members||[]).map(m=>m&&m.profile).filter(Boolean),...Object.keys(WT)])].sort();
16423
+ profs=[...new Set([...profileCatalogValues(),...(C.members||[]).map(m=>m&&m.profile).filter(Boolean)])].sort(CatalogPicker.naturalProfileCompare);
16312
16424
  selIds=new Set();findHits=new Set();selGridIds=new Set();picking=false;pickKind='profile';pickEnd=null;mode='sel';geoMode=null;setGeo();qdPick=null;setQdPickCls();
16313
16425
  dimMode=false;dimChain=false;dimSplitMode=false;selDimIds=new Set();setDimMode();
16314
16426
  setMode();
@@ -16350,7 +16462,7 @@ function setPlan(i){
16350
16462
  else clip=[0,0,1000,1000];}
16351
16463
  X0=clip[0];Y0=clip[1];X1=clip[2];Y1=clip[3];FT=P.pt_per_ft||12;RB64=P.raster_b64||'';EXTX=X1-X0;EXTY=Y1-Y0;
16352
16464
  svg.setAttribute('viewBox',`${X0} ${Y0} ${X1-X0} ${Y1-Y0}`);
16353
- profs=[...new Set([...P.members.map(m=>m.profile), ...Object.keys(WT)])].sort();
16465
+ profs=[...new Set([...profileCatalogValues(),...P.members.map(m=>m.profile).filter(Boolean)])].sort(CatalogPicker.naturalProfileCompare);
16354
16466
  // undo/redo is one GLOBAL stack (module-level, declared once) — NOT swapped per plane. A plane switch
16355
16467
  // must not reset or re-scope undo, since snapshots are whole-model and selection/edits span sheets.
16356
16468
  selIds=new Set();findHits=new Set();selGridIds=new Set();picking=false;pickKind='profile';pickEnd=null;mode='sel';geoMode=null;setGeo();qdPick=null;setQdPickCls(); // findHits + selGridIds reset per plan like selIds — a stale highlight (or, for grids, an index-based id) must not bleed onto another sheet (grids are per-plan). setGeo() clears body.geo/geoel so an armed Extend/Trim tool doesn't leave the grid crosshair on the next sheet; the F7 station pick is plan-local too
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.132.1",
3
+ "version": "0.132.2",
4
4
  "type": "module",
5
5
  "description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
6
6
  "bin": {