@floless/app 0.170.0 → 0.171.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/floless-server.cjs +33000 -22928
  2. package/dist/schemas/steel.model.v2.schema.json +194 -3
  3. package/dist/skills/floless-app-bridge/SKILL.md +3 -3
  4. package/dist/skills/floless-app-knowledge/SKILL.md +4 -3
  5. package/dist/skills/floless-app-onboarding/SKILL.md +5 -4
  6. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +0 -3
  7. package/dist/skills/floless-app-queue/SKILL.md +2 -3
  8. package/dist/skills/floless-app-report-issue/SKILL.md +2 -2
  9. package/dist/skills/floless-app-steel-model/SKILL.md +35 -35
  10. package/dist/skills/floless-app-steel-model/references/custom-connections.md +47 -0
  11. package/dist/skills/floless-app-steel-model/references/custom-sections.md +32 -0
  12. package/dist/skills/floless-app-ui/SKILL.md +71 -126
  13. package/dist/web/add-ons.js +407 -0
  14. package/dist/web/analytics.js +1 -1
  15. package/dist/web/app.css +108 -189
  16. package/dist/web/app.js +11 -12
  17. package/dist/web/aware.js +49 -29
  18. package/dist/web/chat.css +6 -1
  19. package/dist/web/chat.js +133 -18
  20. package/dist/web/commands-filter.js +23 -0
  21. package/dist/web/commands-shell.js +39 -67
  22. package/dist/web/commands-steel.js +9 -1
  23. package/dist/web/commands-tekla-parser.js +23 -0
  24. package/dist/web/connections.js +14 -3
  25. package/dist/web/failure-copy.js +1 -0
  26. package/dist/web/guide.js +3 -3
  27. package/dist/web/index.html +29 -56
  28. package/dist/web/instructor.js +2 -2
  29. package/dist/web/kb-categories.js +64 -7
  30. package/dist/web/model-change-findings.js +430 -0
  31. package/dist/web/model-change-review.js +414 -0
  32. package/dist/web/model-editor-steel-adapter.js +2 -2
  33. package/dist/web/project-history.js +7 -1
  34. package/dist/web/revit-editor.css +85 -0
  35. package/dist/web/revit-editor.js +36 -1
  36. package/dist/web/sha256-sync.js +62 -0
  37. package/dist/web/steel-3d-core.js +7 -0
  38. package/dist/web/steel-3d-flo.js +127 -3
  39. package/dist/web/steel-3d-view.js +25 -2
  40. package/dist/web/steel-custom-connection.js +161 -0
  41. package/dist/web/steel-custom-sections.js +1796 -0
  42. package/dist/web/steel-editor.html +279 -41
  43. package/dist/web/steel-filter-usage.js +299 -0
  44. package/dist/web/steel-filter.html +101 -4
  45. package/dist/web/steel-model-v2-client-validation.js +3 -0
  46. package/dist/web/steel-model-v2-commands.js +95 -6
  47. package/dist/web/steel-model-v2-projection.js +1 -1
  48. package/dist/web/steel-read-confidence.js +1 -56
  49. package/dist/web/tekla-editor.html +1 -0
  50. package/dist/web/workspaces.js +263 -28
  51. package/launch.mjs +87 -9
  52. package/package.json +1 -1
  53. package/dist/web/panels.js +0 -831
@@ -4207,7 +4207,8 @@ let GridDisplay = null; // grid-display.js — the Grid pane's ONE boundary betw
4207
4207
  let ViewGen = null; // steel-view-generation.js pure F11 helpers — loaded before saved views are sanitised
4208
4208
  let ModelCmd = null; // steel-model-commands.js — the model boundary's WRITE half (unit 5, P3a); the read half is steel-model-adapter.js
4209
4209
  let AiMarks = null; // steel-ai-marks.js (#2521 row 6): which members rest on an AI decision
4210
- let V2Projection = null, V2Commands = null, V2Validation = null, FilterCore = null, ProfileColours = null, ReferenceSheet = null, ReadConfidence = null;
4210
+ let CustomConn = null; // steel-custom-connection.js (#2303 slice A): what Inspect says about a custom connection built from standard parts
4211
+ let V2Projection = null, V2Commands = null, V2Validation = null, FilterCore = null, ProfileColours = null, ReferenceSheet = null, ReadConfidence = null, CustomSections = null;
4211
4212
  let ChatQuestions = null; // model-chat-questions.js — the Questions in chat card and chat labels, shared with every model viewer
4212
4213
  let FramesCore = null; // steel-frames-core.js — the moment-frame schedule rules the server shares: what a frame row is, which girder sizes a sheet shows, how a read may add (#2210)
4213
4214
  let MarksCore = null; // steel-marks-core.js — the callout rules the server shares: where a callout leads, what a new one must say, when two marks are the same (#2211)
@@ -4430,6 +4431,8 @@ let reviewCycle = null; // the in-flight ref
4430
4431
  function reviewEventMatches(m){return m&&typeof m==='object'&&m.type==='review-changed'&&m.appId===APP_ID&&((m.project||'')===PROJECT);}
4431
4432
  /* #2449: an assumption on one of this project's connections was recorded or withdrawn. */
4432
4433
  function aiDecisionsEventMatches(m){return m&&typeof m==='object'&&m.type==='ai-decisions-changed'&&m.appId===APP_ID&&((m.project||'')===PROJECT);}
4434
+ /* #2303 slice A: the AI-assisted label switches changed (here, in another tab, or from AI Chat). */
4435
+ function connectionDisplayEventMatches(m){return m&&typeof m==='object'&&m.type==='connection-display-changed'&&m.appId===APP_ID&&((m.project||'')===PROJECT);}
4433
4436
  function assumptionEventMatches(m){return m&&typeof m==='object'&&m.type==='connection-assumptions-changed'&&m.appId===APP_ID&&((m.project||'')===PROJECT);}
4434
4437
  function reviewFrameOrderable(m){return Number.isSafeInteger(m.reviewRevision)&&m.reviewRevision>=0;}
4435
4438
  function editorHasUnsavedWork(){const sv=document.getElementById('saveStat');return !!sv&&(sv.classList.contains('dirty')||sv.classList.contains('err')||sv.classList.contains('conflict'));}
@@ -4692,6 +4695,7 @@ function startContractEvents(){
4692
4695
  // #2521 row 6: the AI-decision record changed. Forget what Inspect was told (a late answer from before is dropped by the epoch).
4693
4696
  if(aiDecisionsEventMatches(m)){if(contractEventReady&&window.aiMarksRecordChanged)window.aiMarksRecordChanged();return;}
4694
4697
  if(assumptionEventMatches(m)){if(contractEventReady&&window.forgetConnectionAssumptions)window.forgetConnectionAssumptions();return;}
4698
+ if(connectionDisplayEventMatches(m)){if(window.reloadConnectionDisplay)window.reloadConnectionDisplay(m.rev);return;}
4695
4699
  if(reviewEventMatches(m)){if(!contractEventReady){if(reviewFrameOrderable(m)&&(!reviewEventWatermark||m.reviewRevision>=reviewEventWatermark.reviewRevision))reviewEventWatermark=m;}else handleReviewChanged(m);return;}
4696
4700
  if(!contractEventMatches(m))return;if(!contractEventReady)bufferContractEvent(m);else handleContractChanged(m);};
4697
4701
  source.onerror=()=>{if(source!==contractEventSource)return;contractEventReady=false;if(source.readyState===EventSource.CLOSED){ownWrites.length=0;uncertainWrites.clear();console.warn('steel-editor: SSE channel closed — live updates paused');showAiUpdateBanner('Live updates disconnected — reload to resume change detection.');}};
@@ -4965,7 +4969,7 @@ async function boot() {
4965
4969
  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; }
4966
4970
  armEarlyViewToggle(); // BEFORE the first await — that is the whole point; see above
4967
4971
  startContractEvents(); // subscribe first; contract events buffer until the atomic snapshot is installed
4968
- [DisplayUnits, GridDisplay, SteelCore, ViewGen, ModelCmd, DetailRefs, V2Projection, V2Commands, V2Validation, SplitView, FilterCore, PlanXf, CatalogPicker, ModelEditor, ViewportToolbar, ModelLighting, PointerDock, EditorShell, ReviewClient, ProfileColours, ReferenceSheet, ReadConfidence, CkStd, SteelEnv, ModelPanelBridge, ChatQuestions, SteelSlim, LastSeen, MarksCore, FramesCore, AiMarks] = await Promise.all([
4972
+ [DisplayUnits, GridDisplay, SteelCore, ViewGen, ModelCmd, DetailRefs, V2Projection, V2Commands, V2Validation, SplitView, FilterCore, PlanXf, CatalogPicker, ModelEditor, ViewportToolbar, ModelLighting, PointerDock, EditorShell, ReviewClient, ProfileColours, ReferenceSheet, ReadConfidence, CkStd, SteelEnv, ModelPanelBridge, ChatQuestions, SteelSlim, LastSeen, MarksCore, FramesCore, AiMarks, CustomSections, CustomConn] = await Promise.all([
4969
4973
  import('./display-units.js'), import('./grid-display.js'),
4970
4974
  import('./steel-3d-core.js'), import('./steel-view-generation.js'), import('./steel-model-commands.js'),
4971
4975
  import('./steel-detail-refs.js'), import('./steel-model-v2-projection.js'),
@@ -4977,6 +4981,8 @@ async function boot() {
4977
4981
  import('./steel-reference-sheet.js'), import('./steel-read-confidence.js'),
4978
4982
  import('./checkpoint-standard.js'), import('./steel-environments.js'), import('./model-panel-bridge.js'), import('./model-chat-questions.js'),
4979
4983
  import('./steel-model-slim.js'), import('./steel-last-seen.js'), import('./steel-marks-core.js'), import('./steel-frames-core.js'), import('./steel-ai-marks.js'),
4984
+ import('./steel-custom-sections.js'),
4985
+ import('./steel-custom-connection.js'),
4980
4986
  ]);
4981
4987
  ({ FT_TO_MM, IN_TO_MM, LB_PER_FT_TO_KG_PER_M } = SteelCore); // the shared unit constants, bound before main() and every reader of them
4982
4988
  // BEFORE the first paint, deliberately. Every length on this page reads through it, so resolving it
@@ -7162,7 +7168,7 @@ function posHDefault(m){return SteelCore.effectiveWidthPosition(m.positionH);}
7162
7168
  // refusal the bake no longer makes: `partFrame`'s degenerate branch hands a plumb member the frame's own X
7163
7169
  // as its width axis (Tekla's column convention), so a plumb column or brace has a determinate left and
7164
7170
  // right after all. KEEP IN LOCK-STEP: the inspector must offer the control exactly where the bake honours it.
7165
- function posEligible(m,dimensions=profileDimsIn(m&&m.profile)){return dimensions!=null||!!(m&&m.section&&m.section.w>0&&m.section.d>0);}
7171
+ function posEligible(m,dimensions=memberDimsIn(m)){if(m&&typeof m.customSectionId==='string'&&CustomSections)return dimensions!=null;return dimensions!=null||!!(m&&m.section&&m.section.w>0&&m.section.d>0);}
7166
7172
  // Profile Position copy, in ONE place so the single- and multi-select panels cannot drift (they already
7167
7173
  // described the same control two different ways). Per-button tips, not one heading tip carrying
7168
7174
  // everything: with two axes under one heading the two "Middle" buttons sit adjacent, and each button
@@ -7228,11 +7234,11 @@ function posStored(m){
7228
7234
  */
7229
7235
  let posSecOpen=false; // survives the panel's innerHTML rebuild — module-scoped, like geoMode and picking
7230
7236
  function posSectionSvg(m){
7231
- const dims=profileDimsIn(m&&m.profile);
7232
- 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);
7237
+ const dims=memberDimsIn(m);
7238
+ const sec=dims?{w:dims.w,d:dims.d}:((m&&!customOf(m)&&m.section&&m.section.w>0&&m.section.d>0)?{w:m.section.w/25.4,d:m.section.d/25.4}:null);
7233
7239
  if(!sec)return '';
7234
7240
  const round=!!(dims&&dims.round);
7235
- const local=sectionShapeComponents(m.profile,sec.w,sec.d,12,round),localAll=local.flat();
7241
+ const local=memberShapeComponents(m,sec.w,sec.d,12,round),localAll=local.flat();
7236
7242
  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]))]};
7237
7243
  const oy=SteelCore.faceOffset(posHDefault(m),ex.lo[0],ex.hi[0])+(+m.positionHOffset||0)/25.4;
7238
7244
  const oz=SteelCore.faceOffset(posDefault(m),ex.lo[1],ex.hi[1])+(+m.positionOffset||0)/25.4;
@@ -7302,6 +7308,8 @@ function refreshPositionFrameUI(){const s=positionAuthoringBasis(),frame=documen
7302
7308
  onPositionAuthoringBasisChange(refreshPositionFrameUI);
7303
7309
  function positionRefuse(message,source){const el=document.getElementById('posPositionStatus');if(el){el.style.display='block';el.style.border='1px solid var(--line)';el.style.borderRadius='6px';el.style.padding='7px 8px';el.textContent=message;}toast(message,false,5200);if(source&&source.focus)source.focus();return false;}
7304
7310
  function positionRebaseInput(m){const c=v2CanonicalMember(m.id),z0=c&&SteelCore.knownZ(c.from&&c.from.z),z1=c&&SteelCore.knownZ(c.to&&c.to.z);if(!c||z0==null||z1==null)return null;
7311
+ // Add-ons S1a: a custom section's extents come from its own outline in mm, as the export computes them.
7312
+ const cs=customOf(c);if(cs)return {canonical:c,from:[c.from.x,c.from.y,z0],to:[c.to.x,c.to.y,z1],extents:cs.usable&&cs.section?SteelCore.sectionExtents({outer:cs.section.outline}):null};
7305
7313
  const dims=profileDimsIn(c.profile),sec=dims?{w:dims.w*25.4,d:dims.d*25.4,round:!!dims.round}:((c.section&&c.section.w>0&&c.section.d>0)?{w:c.section.w,d:c.section.d,round:false}:null);
7306
7314
  const extents=sec?SteelCore.sectionExtents(SteelCore.outlineFor(c.profile,sec.w,sec.d,null,sec.round)):null;
7307
7315
  return {canonical:c,from:[c.from.x,c.from.y,z0],to:[c.to.x,c.to.y,z1],extents};}
@@ -7909,7 +7917,7 @@ function snapshot(){
7909
7917
  // `library` is the FIRST key on purpose: prunePictures reads which pictures a step needs from the front of the string without parsing the whole model.
7910
7918
  // `marks` / `rootMarks` (#2211): the sheet's callouts, details and top-of-steel callouts and the root detail anchors, each
7911
7919
  // recorded as present-with-value or ABSENT, so undoing the first mark added to a sheet puts the missing key back.
7912
- return JSON.stringify({library:libraryPrints(),v2:true,members:C.members,provisional_members:C.provisional_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||[],...(Object.hasOwn(p,'frame')?{frame:p.frame||null}:{}),marks:V2Commands.captureAnnotations(p),datum_ref:p.datum_ref,control2_ref:p.control2_ref})),rootMarks:V2Commands.captureRootAnnotations(C),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||{},clips:window.Steel3DView?.clipState?.()??null,...(Array.isArray(C.reference_models)?{reference_models:C.reference_models}:{})});
7920
+ return JSON.stringify({library:libraryPrints(),v2:true,members:C.members,provisional_members:C.provisional_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||[],...(Object.hasOwn(p,'frame')?{frame:p.frame||null}:{}),marks:V2Commands.captureAnnotations(p),datum_ref:p.datum_ref,control2_ref:p.control2_ref})),rootMarks:V2Commands.captureRootAnnotations(C),customSections:V2Commands.captureCustomSections(C),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||{},clips:window.Steel3DView?.clipState?.()??null,...(Array.isArray(C.reference_models)?{reference_models:C.reference_models}:{})});
7913
7921
  }
7914
7922
  // Undo/redo is a SINGLE GLOBAL stack (not per-plane): snapshot() above captures EVERY plane's
7915
7923
  // members, so one whole-model stack is coherent — undo restores all planes at once, and a cross-
@@ -8107,7 +8115,7 @@ function sanitizeViews(arr){return ViewGen.sanitizeViews(arr);}
8107
8115
  // a refused save, or behind "Show my earlier edits" simply did not come back. The annotation roots the undo snapshot records
8108
8116
  // (`ANNOTATION_ROOT_KEYS`: the moment-frame schedule, detail bubbles) ride along by construction, so the next one added there
8109
8117
  // cannot be forgotten here (#2210 review). `reference_models` and `plans` are written below and restored by their own rules.
8110
- function draftRootKeys(){return ['members','grid','custom_details','profile_colors','member_styles','member_types','target_confidence','dims3d','dim_overlays','dim_style','prop_labels','joints','connections','detail_placements','views',...((V2Commands&&V2Commands.ANNOTATION_ROOT_KEYS)||[])];}
8118
+ function draftRootKeys(){return ['members','grid','custom_details','profile_colors','member_styles','member_types','target_confidence','dims3d','dim_overlays','dim_style','prop_labels','joints','connections','detail_placements','views',...((V2Commands&&V2Commands.CUSTOM_SECTION_ROOT_KEYS)||[]),...((V2Commands&&V2Commands.ANNOTATION_ROOT_KEYS)||[])];}
8111
8119
  // Set once the person changes or resets the "columns below a floor" setting on this page, or a restored draft carried a Reset.
8112
8120
  let reachTouched=false;
8113
8121
  function persist(){try{const draft={sig:dataSig(),baseEtag:serverEtag,ts:Date.now(),active:C.active};
@@ -8889,7 +8897,7 @@ function updUR(){document.getElementById('undoB').disabled=!undo.length;document
8889
8897
  // render() top so it tracks edits without touching every profs.push site.
8890
8898
  let colorRank=null; // the ProfileColours.profileColourContext of the last render
8891
8899
  const canonProfile=s=>ProfileColours.canonicalProfile(s);
8892
- function buildColorRank(){colorRank=ProfileColours.profileColourContext(C,WT,profileColourSpellings);} // rank + per-section member spellings, rebuilt per render (#2877)
8900
+ function buildColorRank(){refreshCustomLabels();customColourLabels=currentCustomLabels();colorRank=ProfileColours.profileColourContext(colourModelNow(),WT,editorColourSpellings());} // rank + per-section member spellings, rebuilt per render (#2877)
8893
8901
  // #2877: every spelling the editor's catalogue lists for a member's section, minus aliases that are another
8894
8902
  // section's own name (ProfileColours.catalogueSpellings, the same rule the scene bake applies to the server
8895
8903
  // catalogue), so a colour keyed `UC305X97` or `UC305*305*97` resolves identically in 2D, the Inspector, the
@@ -8900,8 +8908,12 @@ function profileColourSpellings(p){const k=String(p==null?'':p);if(_colourSpelli
8900
8908
  function colorFor(p){return ProfileColours.profileColour(p,C.profile_colors,colorRank,PAL,message=>console.warn('steel-editor: '+message));}
8901
8909
  // Removes every key a lookup for this section reads (its members' spellings, its catalogue spellings), from a
8902
8910
  // context built now so an edit since the last render cannot leave a stale spelling that outranks the new key.
8903
- function setProfileColour(profile,colour){ProfileColours.setCanonicalProfileColour(C.profile_colors,profile,colour,
8904
- ProfileColours.sectionSpellings(ProfileColours.profileColourContext(C,WT,profileColourSpellings),profile));}
8911
+ function setProfileColour(profile,colour){
8912
+ // A custom section not yet named by FloLess is shown under its stored designation; a colour saved under that would
8913
+ // be read by no 3D group or bill line once its name arrives, so it waits (add-ons S1a).
8914
+ if(customColourPending(profile)){refreshCustomLabels();toast('FloLess is still naming the custom sections in this model. Try the colour again in a moment.');return false;}
8915
+ ProfileColours.setCanonicalProfileColour(C.profile_colors,profile,colour,
8916
+ ProfileColours.sectionSpellings(ProfileColours.profileColourContext(colourModelNow(),WT,editorColourSpellings()),profile));return true;}
8905
8917
  // F5: per member-type 2D line style. Tokens → px; dashes chosen to avoid the reserved semantic patterns
8906
8918
  // (RFI 10 6, brace 30 8 6 8, grid 12 4 2 4). med+solid (or absent) = today's default (line.member stroke-width:6).
8907
8919
  const MS_W={thin:3,med:6,thick:9},MS_D={solid:'',dashed:'14 8',dotted:'2 8',dashdot:'18 7 3 7'};
@@ -9339,7 +9351,8 @@ function positionAuthoringRoll(m){
9339
9351
  function columnSectionPoly(m){
9340
9352
  const wp=m&&m.wp;if(!wp||!wp.length)return null;
9341
9353
  const a=wp[0],b=wp[wp.length-1],cx=(a[0]+b[0])/2,cy=(a[1]+b[1])/2;
9342
- const ppf=(P&&P.mm_per_px>0)?ppfOf(P):0,dims=profileDimsIn(m.profile);
9354
+ // Add-ons S1a: a usable custom section is drawn from its own evaluated outline, never a catalogue row of the same name.
9355
+ const ppf=(P&&P.mm_per_px>0)?ppfOf(P):0,dims=memberDimsIn(m);
9343
9356
  // Both arms hand INCHES to the one conversion below. profileDimsIn already returns inches; the
9344
9357
  // reader's traced `section` is MILLIMETRES — contract-to-scene feeds those very numbers into a
9345
9358
  // scene declared `units:'mm'`, and the steel-takeoff skill tells readers to trace in mm. Neither
@@ -9363,7 +9376,7 @@ function columnSectionPoly(m){
9363
9376
  // registration angle). Applied raw here, as it was, the plan drew every section as the MIRROR of the
9364
9377
  // 3D solid and the export — see sectionOutlinePx for the measurement and the algebra.
9365
9378
  const xf=planRegistration(),rotN=positionEffectiveWorldRot(m),wPx=sec.w/12*ppf,dPx=sec.d/12*ppf;if(rotN==null)return null;
9366
- const localComponents=sectionShapeComponents(m.profile,wPx,dPx,ppf,dims&&dims.round);
9379
+ const localComponents=memberShapeComponents(m,wPx,dPx,ppf,dims&&dims.round);
9367
9380
  // A column now takes a Profile Position like every other member, so the FOOTPRINT has to move with it —
9368
9381
  // otherwise the plan draws the section centred on a work point the 3D and the export put it off.
9369
9382
  // The offset is built in the SAME local frame and the SAME px units as the outline and pushed through
@@ -10779,7 +10792,7 @@ function snapEndMulti(ms,tA,tB){const pv=snapshot();let n=0,skipped=0;
10779
10792
  for(const m of ms){
10780
10793
  if(isBrace(m)){skipped++;continue;} // extend/trim never moves a brace work point (it must stay on the column ℄) — matches doSplit
10781
10794
  const I=lineX(m.wp[0],m.wp[1],tA,tB);if(!I)continue;
10782
- const h=len(m.wp[0],I)<=len(m.wp[1],I)?0:1;mc.setEndpoint(m,h,I);ModelCmd.patchMember(m,{rfi:_wtPlf(m.profile)==null});n++;} // h is DATA — the end nearer the intersection
10795
+ const h=len(m.wp[0],I)<=len(m.wp[1],I)?0:1;mc.setEndpoint(m,h,I);ModelCmd.patchMember(m,{rfi:_memberPlf(m)==null});n++;} // h is DATA — the end nearer the intersection
10783
10796
  if(skipped)toast(n?(skipped+' brace'+(skipped>1?'s':'')+' skipped — braces can’t be extended/trimmed'):'Braces can’t be extended/trimmed — edit them in the Properties panel');
10784
10797
  if(n){pushUndo(pv);render();sync3D();}return n;}
10785
10798
  function doSplit(m,pt){if(isBrace(m)){toast('Braces can’t be split — edit them in the Properties panel');return;} // split/extend/trim disabled on braces (offset would create off-℄ WPs · Codex round-2)
@@ -10817,7 +10830,7 @@ function dupFoot(m){if(!m||!m.wp||m.wp.length<2)return null;const r=p=>Math.roun
10817
10830
  function dupElev(m){const q=v=>(typeof v==='number'&&isFinite(v))?Math.round(v/IN_TO_MM):null;
10818
10831
  const sig=(m&&m.role==='column')?[q(m.col&&m.col.tosMm),q(m.col&&m.col.bosMm)]:[q(m&&m.ends&&m.ends[0]&&m.ends[0].tosMm),q(m&&m.ends&&m.ends[1]&&m.ends[1].tosMm)];
10819
10832
  return sig.every(v=>v==null)?'na':sig.map(v=>v==null?'':v).join(':');}
10820
- function dupScore(m){let s=0;if(_wtPlf(m.profile)!=null)s+=2;if(m.profile&&!/^MF/i.test(m.profile))s+=1;return s;} // keep the most-resolved copy
10833
+ function dupScore(m){let s=0;if(_memberPlf(m)!=null)s+=2;if(m.profile&&!/^MF/i.test(m.profile))s+=1;return s;} // keep the most-resolved copy
10821
10834
  // Coincident-member dedupe → the redundant ids. Group by 2D footprint; within a footprint: ≤1 distinct EXPLICIT
10822
10835
  // elevation ⇒ all copies of one member ⇒ keep the best (highest rankFn; an elevation-tagged copy wins ties), rest
10823
10836
  // redundant; ≥2 explicit elevations ⇒ distinct levels ⇒ keep the best per level, unset copies kept (ambiguous).
@@ -10986,6 +10999,43 @@ function reviewSignedOff(jointId){
10986
10999
  already was "what kind of connection is this", and a second chip would make the row say two things.
10987
11000
  Amber only for needs-review: untracked keeps the neutral colours and changes only its leading word, so
10988
11001
  it is distinguishable on read without ever suggesting a fault. */
11002
+ /* #2303 slice A: the person's "AI-assisted connection" label switches (connection-display.json, its own revision).
11003
+ Read once on demand and again whenever the server says they changed; a failed read shows every label (the honest
11004
+ default), and a failed write says so and puts the box back. */
11005
+ let connDisplay={rev:0,model:'shown',joints:{}},connDisplayState='idle',connDisplayBusy=false,ccShowAllChecks=null;
11006
+ /* What a label switch said and where focus belongs, re-applied on each repaint for a moment: the scene refresh a switch
11007
+ starts repaints the panel again, and a repaint must not drop the person's focus or the announcement. */
11008
+ let ccAfterRender=null;
11009
+ // Kept until the person acts again (a click or a key elsewhere), however late the scene refresh's repaint lands.
11010
+ document.addEventListener('pointerdown',e=>{if(ccAfterRender&&!(e.target&&e.target.closest&&e.target.closest('#panel label.gck')))ccAfterRender=null;},true);
11011
+ document.addEventListener('keydown',e=>{if(ccAfterRender&&e.key!=='Tab'&&!(e.target&&e.target.closest&&e.target.closest('#panel label.gck')))ccAfterRender=null;},true);
11012
+ async function loadConnectionDisplay(){
11013
+ if(!PROJECT)return;
11014
+ connDisplayState='loading';
11015
+ try{const r=await fetch('/api/projects/'+encodeURIComponent(PROJECT)+'/connection-display');const d=await r.json();
11016
+ if(d&&d.ok===true){connDisplay={rev:d.rev,model:d.model,joints:d.joints||{}};connDisplayState=d.unreadable?'unreadable':'ok';}else{connDisplay={rev:connDisplay.rev,model:'shown',joints:{}};connDisplayState='unavailable';}}
11017
+ catch(e){connDisplay={rev:connDisplay.rev,model:'shown',joints:{}};connDisplayState='unavailable';console.warn('steel-editor: could not read the AI-assisted label settings',e&&e.message?e.message:e);}
11018
+ if(selCustomPartsJoint())panel();}
11019
+ window.reloadConnectionDisplay=(rev)=>{if(Number.isInteger(rev)&&rev===connDisplay.rev&&connDisplayState==='ok')return;loadConnectionDisplay();};
11020
+ function selCustomPartsJoint(){const cs=typeof connSelInfo==='function'?connSelInfo():null;return cs&&cs.whole&&cs.joint&&cs.joint.kind==='custom-parts'?cs.joint:null;}
11021
+ function connLabelSaid(change){return change.model?(change.model==='hidden'?'AI-assisted label hidden on every connection.':'AI-assisted label shown on every connection.'):(change.joint&&change.joint.label==='hidden'?'AI-assisted label hidden on this connection.':'AI-assisted label shown on this connection.');}
11022
+ async function setConnectionLabel(change,focusId){
11023
+ if(connDisplayBusy||!PROJECT)return;connDisplayBusy=true;
11024
+ let saved=false;
11025
+ try{const r=await fetch('/api/projects/'+encodeURIComponent(PROJECT)+'/connection-display',{method:'PUT',headers:{'content-type':'application/json'},body:JSON.stringify(Object.assign({rev:connDisplay.rev},change))});
11026
+ const d=await r.json().catch(()=>null);
11027
+ if(r.ok&&d&&d.ok===true){connDisplay={rev:d.rev,model:d.model,joints:d.joints||{}};connDisplayState='ok';saved=true;}
11028
+ else{await loadConnectionDisplay();toast(r.status===409?'The label settings changed somewhere else. They are shown as they are now; switch again if you still want to.':'FloLess could not save the label setting just now, so it was put back. Try again in a moment.');}
11029
+ }catch(e){toast('FloLess could not save the label setting just now, so it was put back. Try again in a moment.');console.warn('steel-editor: label setting not saved',e&&e.message?e.message:e);}
11030
+ finally{connDisplayBusy=false;}
11031
+ ccAfterRender={focus:focusId,said:saved?connLabelSaid(change):''};
11032
+ panel();
11033
+ if(saved&&typeof sync3D==='function')sync3D();}
11034
+ function applyCcAfterRender(){
11035
+ if(!ccAfterRender)return;
11036
+ const a=document.activeElement;
11037
+ if(!a||a===document.body||!a.isConnected){const f=document.getElementById(ccAfterRender.focus)||document.getElementById('ccLabelModel');if(f)f.focus();}
11038
+ const l=document.getElementById('ccLabelLive');if(l&&ccAfterRender.said)l.textContent=ccAfterRender.said;}
10989
11039
  function reviewChipFor(jointId){
10990
11040
  const st=reviewStateOf(jointId);
10991
11041
  if(st==='needs-review')return '<span class=chip style="border-color:var(--warn-edge);color:var(--warn)" data-tip="The steel this connection is watching has moved since it was placed">Needs review — the steel it sits on moved</span>';
@@ -11295,14 +11345,14 @@ function render(){
11295
11345
  s+=provisionalMembersSvg();
11296
11346
  for(const sg of P.segments) s+=`<line class=seg data-seg="${sg.id}" x1="${sg.a[0]}" y1="${sg.a[1]}" x2="${sg.b[0]}" y2="${sg.b[1]}"/>`;
11297
11347
  for(const m of P.members){if(!visible2d(m))continue; // hidden or isolated away in this sheet's Objects list
11298
- const c=colorFor(m.profile);const sel=selIds.has(m.id);const fh=findHits.has(m.id);const on=sel||fh;const g=on?` style="filter:drop-shadow(0 0 3px ${c}) drop-shadow(0 0 8px ${c})"`:'';
11348
+ const c=memberColour(m);const sel=selIds.has(m.id);const fh=findHits.has(m.id);const on=sel||fh;const g=on?` style="filter:drop-shadow(0 0 3px ${c}) drop-shadow(0 0 8px ${c})"`:'';
11299
11349
  // RFI is DERIVED here, not read off the member. `m.rfi` is a persisted contract field, written at
11300
11350
  // edit time and never recomputed on load — so every HSS/L/2L/PIPE profiled before the catalogue was
11301
11351
  // completed still carries rfi:true (#627). The RFI pill, the RFI list and the confidence panel all
11302
11352
  // recompute through _wt, so reading the stored flag here drew those members dashed-and-unresolved
11303
11353
  // on a canvas whose own counter said there were none, with no row anywhere to clear it. One source
11304
11354
  // of truth for "is this an RFI", and it is the same one everything else already uses. (code review)
11305
- const rfi=_wtPlf(m.profile)==null;
11355
+ const rfi=_memberPlf(m)==null;
11306
11356
  if(!P.elevationView&&isBrace(m)){s+=braceSymbol(m,c,g);continue;} // (an elevation draws every member as its true line: the plan symbols are plan conventions, #2780) a brace draws as its distinct symbol (dashed=below-floor + hi/lo arrows), not a plain line (B4)
11307
11357
  if(!P.elevationView&&m.role==='column'){const pts=columnSectionPoly(m); // a column draws as its profile-section footprint, not a line
11308
11358
  // A placeholder footprint on a member that is NOT an RFI reads as a real, small section — the size is
@@ -11311,14 +11361,14 @@ function render(){
11311
11361
  // #2214: a column that ends under this sheet's floor is drawn dashed and lighter. It has ONE tooltip, so the
11312
11362
  // below-the-floor sentence and the placeholder sentence are composed rather than competing attributes.
11313
11363
  const _cb=m.belowCut?colBelowInfo(m):null;
11314
- const _tipText=[_cb&&_cb.tip,_phText,aiTipFor(m)].filter(Boolean).join(' ');
11364
+ const _tipText=[_cb&&_cb.tip,_phText,customTipFor(m),aiTipFor(m)].filter(Boolean).join(' ');
11315
11365
  const _ph=_tipText?` data-tip="${esc(_tipText)}"`:'';
11316
11366
  if(pts){const components=pts.components||[pts];s+=components.map((part,index)=>`<polygon class="member${rfi?' rfi':''}${m.belowCut?' colbelow':''}${sel?' sel':''}${fh?' find-hit':''}" data-id="${m.id}" data-part="${index}" points="${_polyStr(part)}" fill="${c}" stroke="${c}"${g}${_ph}/>`).join('');continue;}}
11317
11367
  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.
11318
11368
  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};stroke-linecap:butt;`:''; /* butt WITH a dash: line.member's round cap adds half the stroke width at EACH end of every dash, so at thick (9px) it ate every gap — dashed 14/8 and dotted 2/8 both left -1px of gap and drew solid. Round caps stay on solid lines, where they have nothing to close. */ // RFI keeps its semantic 10 6 dash
11319
11369
  const _sty=(_fx||_sw||_sd)?` style="${_fx}${_sw}${_sd}"`:'';
11320
11370
  // A column below the floor whose footprint cannot be built falls to this line, and must still say what it is (#2214).
11321
- const _lcb=(m.role==='column'&&m.belowCut)?colBelowInfo(m):null,_ltText=[_lcb&&_lcb.tip,aiTipFor(m)].filter(Boolean).join(' '),_lt=_ltText?` data-tip="${esc(_ltText)}"`:'';
11371
+ const _lcb=(m.role==='column'&&m.belowCut)?colBelowInfo(m):null,_ltText=[_lcb&&_lcb.tip,customTipFor(m),aiTipFor(m)].filter(Boolean).join(' '),_lt=_ltText?` data-tip="${esc(_ltText)}"`:'';
11322
11372
  s+=`<line class="member${rfi?' rfi':''}${_lcb?' colbelow':''}${sel?' sel':''}${fh?' find-hit':''}" data-id="${m.id}"${_lt} x1="${m.wp[0][0]}" y1="${m.wp[0][1]}" x2="${m.wp[1][0]}" y2="${m.wp[1][1]}" stroke="${c}"${_sty}/>`;}
11323
11373
  {const hsel=sel2d().filter(visible2d);if(hsel.length>=1&&!P.elevationView){const HR=epR();for(const sm of hsel)for(let i=0;i<2;i++) s+=`<circle class="handle ${i===0?'ep-start':'ep-end'}" data-mid="${sm.id}" data-h="${i}" cx="${sm.wp[i][0]}" cy="${sm.wp[i][1]}" r="${HR}"/>`;}} // end 1 (start) yellow, end 2 (end) magenta · shown for every selected member · radius grows with zoom (epR) so it stays visible against the thick line
11324
11374
  if(mode==='add'||(picking&&pickKind==='profile')){
@@ -11725,7 +11775,7 @@ function layoutPropLabels2d(){
11725
11775
  function updateHandles(m){svg.querySelectorAll(`circle.handle[data-mid="${m.id}"]`).forEach(h=>{const i=+h.dataset.h;h.setAttribute('cx',m.wp[i][0]);h.setAttribute('cy',m.wp[i][1]);});}
11726
11776
  function updateLine(m){
11727
11777
  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)
11728
- 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;}
11778
+ if(g){const glow=selIds.has(m.id)||findHits.has(m.id);const c=memberColour(m);g.outerHTML=braceSymbol(m,c,glow?` style="filter:drop-shadow(0 0 3px ${c}) drop-shadow(0 0 8px ${c})"`:'');}return;}
11729
11779
  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
11730
11780
  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;}
11731
11781
  const ln=svg.querySelector(`line.member[data-id="${m.id}"]`);
@@ -11786,7 +11836,7 @@ function stats(){
11786
11836
  const metric=displayUnits()===DisplayUnits.MM;
11787
11837
  // Model scope walks the CANONICAL members: _lenMm/_lenFt resolve through the model by id, so every member weighs,
11788
11838
  // not just the ones projected onto this sheet — and ensureMeta (which mutates) stays out of a read-only repaint.
11789
- let w=0; for(const m of counted){const wpf=_wtBill(m.profile); if(wpf!=null)w+=_propMass(scope==='model'?m:ensureMeta(m),wpf);}
11839
+ let w=0; for(const m of counted){const wpf=_memberBill(m); if(wpf!=null)w+=_propMass(scope==='model'?m:ensureMeta(m),wpf);}
11790
11840
  document.getElementById('wt').textContent=(w/(metric?1000:2000)).toFixed(1);
11791
11841
  document.getElementById('wtlb').textContent=Math.round(w).toLocaleString();
11792
11842
  document.getElementById('wtT').textContent=_uw().tonnage;
@@ -12833,6 +12883,63 @@ function panel(){
12833
12883
  {const b=document.getElementById('cmpFav');if(b)b.onclick=()=>openFavModalFor(j);}
12834
12884
  return;
12835
12885
  }
12886
+ // #2303 slice A: a custom connection built from standard parts — what it is, how it fits, and its AI-assisted label.
12887
+ if(j.kind==='custom-parts'&&CustomConn){
12888
+ if(connDisplayState==='idle')loadConnectionDisplay();
12889
+ const entry=(C.connection_definitions||[]).find(r=>r&&j.def&&r.id===j.def.id&&r.version===j.def.version)||null;
12890
+ const v=CustomConn.customConnectionView({joint:j,entry,evidence:connectionFitByJoint.get(j.id)||null,parts:connectionPartsByJoint.get(j.id)||[],display:connDisplay,fmt:mm=>fmtDisp(Number(mm))});
12891
+ 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;text-align:right">${val}</span></div>`;
12892
+ const sec=t=>`<div class=divrow><hr><span class=sect style="margin:0">${esc(t)}</span><hr></div>`;
12893
+ const tone={neutral:'border-color:var(--line);color:var(--mut)',warn:'border-color:var(--warn-edge);color:var(--warn)',info:'border-color:var(--cyan-edge);color:var(--cyan);background:var(--cyan-soft)'};
12894
+ const chips=(v.chip?`<span class=chip id=ccAiChip style="${v.labelShown?tone.info:tone.neutral}" data-tip="${esc(v.chip.tip)}">${esc(v.chip.text)}</span>`:'')
12895
+ +`<span class=chip id=ccFitChip style="${tone[v.verdict.tone]||tone.neutral}" data-tip="${esc(v.verdict.tip)}">${esc(v.verdict.text)}</span>`;
12896
+ const onLine=`On <button data-command-id="steel.connection-select-member" class=pilllink id=cmpMember data-tip="Select ${esc(j.main)}">${esc(j.main)}</button> · ${cs.childIds.length} parts${v.source?` · from ${esc(v.source)}`:''}`;
12897
+ const verdictWord=r=>r.verdict==='outside'?'<span style="color:var(--warn)">✗ outside its rule</span>':r.verdict==='unmeasured'?`<span style="color:var(--warn)">not proven${r.estimated?' (estimated face)':''}</span>`:'<span style="color:var(--mut)">✓ within its rule</span>';
12898
+ const failRows=v.notMet.map(r=>kv(r.label,verdictWord(r))).join('');
12899
+ const showPassing=v.passing.length<=6||ccShowAllChecks===j.id;
12900
+ const passRows=v.passing.map(r=>kv(r.label,verdictWord(r))).join('');
12901
+ const passToggle=v.passing.length>6?`<button class=ghostw id=ccChecksToggle data-command-id="steel.connection-fit-checks-toggle" aria-expanded="${showPassing}" aria-controls=ccChecks data-tip="${showPassing?'Show only the checks that need attention':'Show every check FloLess measured'}">${showPassing?'Hide the checks within their rule':`Show ${v.passing.length} checks within their rule`}</button>`:'';
12902
+ const summaryRow=kv(`${v.passing.length} checks`,'<span style="color:var(--mut)">within their rules</span>');
12903
+ const checks=v.notMet.length||v.passing.length
12904
+ ?`<div id=ccChecks>${failRows}${showPassing?passRows:summaryRow}</div>${passToggle?`<div class=row style="margin:4px 0 0">${passToggle}</div>`:''}`
12905
+ :`<div class="row hint" style="margin:0">${v.verdict.tone==='info'?'Checked when the model is rebuilt.':'No placement checks were measured.'}</div>`;
12906
+ const unmeasured=v.unmeasured.length?`<div class="row hint" style="margin:4px 0 0;font-size:11px">Not measured: ${v.unmeasured.map(esc).join('; ')}</div>`:'';
12907
+ const features=v.definitionMissing?`<div class="row hint" style="margin:0;color:var(--warn)">The custom connection this uses is no longer saved with the model, so it cannot be described or built.</div>`
12908
+ :v.features.map(t=>`<div class=row style="margin:2px 0;font-size:12px">${esc(t)}</div>`).join('');
12909
+ const assumptions=v.assumptions.length?sec('Assumed values')+v.assumptions.map(a=>kv(a.param,`${esc(a.value)} <span style="color:var(--mut)">· ${esc(a.clause||a.basis)}</span>`)).join('')
12910
+ +'<div class="row hint" style="margin:2px 0 0;font-size:11px">Only values a detailing rule sets are filled in. Sizes and shapes come from the drawing.</div>':'';
12911
+ const unreadable=connDisplayState==='unreadable'||connDisplayState==='unavailable';
12912
+ const labelBlock=v.aiAssisted?sec('Label')
12913
+ +`<label class=gck style="margin:3px 0"><input type=checkbox id=ccLabelModel data-command-id="steel.connection-ai-label-model" ${v.modelShown?'checked':''}><span>Show the AI-assisted label on every connection in this model</span></label>`
12914
+ +(v.modelShown?`<label class=gck style="margin:3px 0"><input type=checkbox id=ccLabelJoint data-command-id="steel.connection-ai-label-joint" ${v.labelShown?'checked':''}><span>Show it on this connection</span></label>`
12915
+ :'<div class="row hint" style="margin:2px 0;font-size:11px">Hidden for every connection in this model.</div>')
12916
+ +'<div class="row hint" style="margin:2px 0 0;font-size:11px">Turning it off removes the label from exports and part names only. FloLess keeps the record that the AI built it.</div>'
12917
+ +(unreadable?'<div class="row hint" style="margin:2px 0 0;font-size:11px;color:var(--warn)">FloLess could not read the label settings just now, so the label is shown.</div>':'')
12918
+ +'<div id=ccLabelLive class=sr-only aria-live=polite></div>':'';
12919
+ p.innerHTML=`<span class=badge>Custom connection</span>
12920
+ <div class="row f" style="margin:0 0 6px;gap:4px;flex-wrap:wrap">${chips}</div>
12921
+ ${v.verdict.hint?`<div class="row hint" style="margin:0 0 4px;font-size:11px">${esc(v.verdict.hint)}</div>`:''}
12922
+ ${assumptionChipFor(j.id)}
12923
+ <div class="row hint" style="margin:0 0 2px">${onLine}</div>
12924
+ <div class="row hint" style="margin:0 0 6px;font-size:11px">${esc(v.name)} — built from standard parts. <b>Esc</b> steps back.</div>
12925
+ ${sec('What it is')}${features}
12926
+ ${sec('Fit checks')}${checks}${unmeasured}
12927
+ ${assumptions}
12928
+ ${labelBlock}
12929
+ <div class=divrow><hr></div>
12930
+ <div class="row f" style="gap:6px;flex-wrap:wrap">
12931
+ <button data-command-id="steel.connection-modify-request" class=ghostw id=cmpAsk data-tip="Record a request for your terminal AI to change or rebuild this connection">Modify connection…</button>
12932
+ <button data-command-id="steel.connection-delete" class=danger id=cmpDel data-tip="Remove this whole connection (Ctrl+Z puts it back)">Delete connection</button>
12933
+ </div>`;
12934
+ {const b=document.getElementById('cmpMember');if(b)b.onclick=()=>{if(modelEditor.isReady()&&modelEditor.steel.clearConnSel)modelEditor.steel.clearConnSel();modelSelection.replaceMembers([j.main]);selDimIds.clear();sel3dDimIds.clear();modelSelection.clearGrids();render();};}
12935
+ {const b=document.getElementById('ccChecksToggle');if(b)b.onclick=()=>{ccShowAllChecks=ccShowAllChecks===j.id?null:j.id;panel();const t=document.getElementById('ccChecksToggle');if(t)t.focus();};}
12936
+ {const b=document.getElementById('ccLabelModel');if(b)b.onchange=()=>setConnectionLabel({model:b.checked?'shown':'hidden'},'ccLabelModel');}
12937
+ {const b=document.getElementById('ccLabelJoint');if(b)b.onchange=()=>setConnectionLabel({joint:{id:j.id,label:b.checked?'shown':'hidden'}},'ccLabelJoint');}
12938
+ requestAnimationFrame(applyCcAfterRender); // after the frame: the same render pass may rewrite the panel again around this branch
12939
+ {const b=document.getElementById('cmpAsk');if(b)b.onclick=()=>connModifyRequest(j);}
12940
+ {const b=document.getElementById('cmpDel');if(b)b.onclick=()=>edit(()=>{C.joints=(C.joints||[]).filter(x=>x!==j);modelSelection.clearMembers();});}
12941
+ return;
12942
+ }
12836
12943
  const isBP=j.kind==='base-plate',pp=j.params||{};const savedFav=favMatch(j);
12837
12944
  const plate=(partsById||{})[cs.conn+':plate']||(partsById||{})[cs.conn+':plateA']||null; // a gusset carries plateA/plateB, not a single :plate
12838
12945
  const dim=(n)=>(n==null?'<span style="color:var(--mut)">auto</span>':esc(fmtDisp(Number(n))));
@@ -13040,11 +13147,11 @@ function panel(){
13040
13147
  const totalL=fmtLenSummary(displayUnits()===DisplayUnits.MM
13041
13148
  ?arr.reduce((t,m)=>t+_lenMm(m),0)
13042
13149
  :arr.reduce((t,m)=>t+_lenFt(m),0)*FT_TO_MM);
13043
- const allKnown=arr.every(m=>_wtPlf(m.profile)!=null);
13150
+ const allKnown=arr.every(m=>_memberPlf(m)!=null);
13044
13151
  // In the project's own units, through the ONE helper — this line used to inline the conversion and
13045
13152
  // then print the result as `lb` whatever the project was set to, so a UK box-select of twelve beams
13046
13153
  // read "9,340 lb" for 9,340 kg: a 2.2x error on a lifting figure, stated as fact.
13047
- const totalW=allKnown?Math.round(arr.reduce((t,m)=>t+_propMass(m,_wtBill(m.profile)),0)):null;
13154
+ const totalW=allKnown?Math.round(arr.reduce((t,m)=>t+_propMass(m,_memberBill(m)),0)):null;
13048
13155
  const dupSet=new Set(redundantDups()), dupSel=arr.filter(m=>dupSet.has(m.id)).length;
13049
13156
  const profAgg=agg(arr,m=>m.profile), matAgg=agg(arr,m=>m.material||''), allVerified=arr.every(m=>m.verified===true);
13050
13157
  const VV=v=>v===VARIES, valOf=v=>VV(v)||v==null?'':esc(fmtDispElev(v)), decOf=v=>VV(v)||v==null?'':esc(fmtEcho(v));
@@ -13073,7 +13180,7 @@ function panel(){
13073
13180
  // Resolve each distinct designation once in this synchronous refresh; no result survives a repaint.
13074
13181
  const profileDimensions=new Map();
13075
13182
  const dimensionsFor=profile=>{if(!profileDimensions.has(profile))profileDimensions.set(profile,profileDimsIn(profile));return profileDimensions.get(profile);};
13076
- const hOk=arr,hSkip=arr.filter(m=>!posEligible(m,dimensionsFor(m&&m.profile))).length;
13183
+ const hOk=arr,hSkip=arr.filter(m=>!posEligible(m,m&&m.customSectionId?memberDimsIn(m):dimensionsFor(m&&m.profile))).length;
13077
13184
  const posA=hOk.length?agg(hOk,m=>posDefault(m)):null;
13078
13185
  const posHA=hOk.length?agg(hOk,m=>posHDefault(m)):null;
13079
13186
  // A mixed selection must read BLANK, not the first member's value — an offset silently inherited across a
@@ -13103,6 +13210,7 @@ function panel(){
13103
13210
  <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>
13104
13211
  ${memberTypeField('mTypeM',arr)}
13105
13212
  <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>
13213
+ ${customSectionPickerHTML(arr,'customSecM')}
13106
13214
  <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>
13107
13215
  <div class="row hint">Total length <b>${totalL}</b>${totalW!=null?` · <b>${totalW.toLocaleString()} ${_uw().weight}</b>`:''}${dupSel?` · <span style="color:var(--err)">${dupSel} duplicate${dupSel>1?'s':''}</span> (overlap a kept member — deleting these dedupes)`:''}</div>
13108
13216
  <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>
@@ -13132,6 +13240,7 @@ function panel(){
13132
13240
  wireTypeFilter(p);wirePositionAvailability();
13133
13241
  // wiring — every commit applies to the whole selection; a blank field is a no-op (leaves each member's own value).
13134
13242
  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:_wtPlf(v)==null});if(!profs.includes(v)){profs.push(v);profs.sort();}});};
13243
+ {const cs=document.getElementById('customSecM');if(cs)cs.onchange=e=>{const v=String(e.target.value||'');if(v)applyCustomSectionChoice(arr.map(m=>m.id),v);};}
13135
13244
  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});
13136
13245
  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);};
13137
13246
  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});
@@ -13192,7 +13301,7 @@ function panel(){
13192
13301
  if(sk)toast(sk+' brace'+(sk>1?'s':'')+' skipped — matching ends would flatten the slope its arrows encode');};}}
13193
13302
  return;}
13194
13303
  // Same as the multi-selection total above: the imperial reading keeps its old expression exactly.
13195
- const m=ensureMeta(arr[0]), wpf=_wtBill(m.profile),
13304
+ const m=ensureMeta(arr[0]), wpf=_memberBill(m),
13196
13305
  L=fmtLenSummary(displayUnits()===DisplayUnits.MM?_lenMm(m):_lenFt(m)*FT_TO_MM), col=(m.role==='column'), pos=posDefault(m);
13197
13306
  // The named faces are offered only where the bake honours them, and when they are not, the hint names both
13198
13307
  // the reason AND any placement still stored on the member — that placement keeps applying the moment the
@@ -13438,7 +13547,7 @@ function panel(){
13438
13547
  </div>
13439
13548
  </div>`:'';
13440
13549
  const appearanceSect=(_hasProf||_lineCtl)?`<div class=divrow><hr><span class=sect style="margin:0" data-tip="Colour is per profile — recolours everywhere that profile is drawn, 2D and 3D. Line weight and dash are per member type, 2D only.">Appearance</span><hr></div>`
13441
- +(_hasProf?`<div style="display:flex;align-items:center;gap:8px;margin-top:2px"><span class=elab style="margin:0;flex:none">Colour</span><input data-command-id="steel.profile-colour#${esc(m.profile)}" aria-label="Colour for ${esc(m.profile)}" type=color id=msColor class=swc value="${colorFor(m.profile)}" data-tip="Colour for ${esc(m.profile)} — recolours every ${esc(m.profile)} (2D + 3D)"><span class=hint style="margin:0;opacity:.6">${esc(m.profile)} · everywhere</span></div>`:'')
13550
+ +(_hasProf?`<div style="display:flex;align-items:center;gap:8px;margin-top:2px"><span class=elab style="margin:0;flex:none">Colour</span><input data-command-id="steel.profile-colour#${esc(memberShownKey(m))}" aria-label="Colour for ${esc(memberShownKey(m))}" type=color id=msColor class=swc value="${memberColour(m)}" data-tip="Colour for ${esc(memberShownKey(m))} — recolours every ${esc(memberShownKey(m))} (2D + 3D)"><span class=hint style="margin:0;opacity:.6">${esc(memberShownKey(m))} · everywhere</span></div>`:'')
13442
13551
  +_lineCtl:'';
13443
13552
  // ONE size fact, stated where the profile it describes is. The merge left two of this row, which is
13444
13553
  // also why Mark verified and id=verifyBtn appeared twice. The surviving text is master's: L already
@@ -13455,9 +13564,11 @@ function panel(){
13455
13564
  ${typeFilterHTML(arr)}
13456
13565
  ${memberTypeField('mTypeS',[m])}
13457
13566
  <div class="f"><div class=elab>Profile</div><div style="display:flex;gap:6px"><input data-command-id="steel.member-profile" aria-label="Profile" id=pf class=combo data-src=profiles value="${esc(m.profile)}" style="flex:1" autocomplete=off><button data-command-id="steel.browse-profile-catalog" id=profileBrowseS class=ghost aria-label="Search the profile catalog" data-tip="Search the profile catalog — 4,516 profiles, by designation or alias"><svg viewBox="0 0 16 16" aria-hidden=true width=13 height=13 fill=none stroke=currentColor stroke-width=1.4 stroke-linecap=round><circle cx="6.9" cy="6.9" r="4.3"/><path d="M10.1 10.1 13.7 13.7"/></svg></button><button data-command-id="steel.pick-profile" id=pickProf class="ghost${(picking&&pickKind==='profile')?' on':''}" aria-pressed="${(picking&&pickKind==='profile')?'true':'false'}" aria-label="Pick profile from a drawing label" data-tip="Pick profile from drawing labels by click, Enter, or Space">⌖</button></div>${(picking&&pickKind==='profile')?'<div class="hint" data-profile-pick-status role=status aria-live=polite style="margin-top:4px;font-style:italic;color:var(--brand)">'+esc(profilePickGuidance())+'</div>':''}</div>
13567
+ ${customSectionPickerHTML([m],'customSecS')}
13568
+ ${customSectionInspectHTML(m)}
13458
13569
  ${profileBasisText(m)?`<div class="row hint" id=profileBasis role=note>Section basis: ${esc(profileBasisText(m))}</div>`:''}
13459
13570
  <div class="f"><div class=elab>Material grade</div><div style="display:flex;gap:6px"><input data-command-id="steel.member-material" aria-label="Material grade" id=mat class=combo data-src=materials value="${esc(m.material||'')}" placeholder="Profile default · ${esc(profileDefaultMaterial(m.profile))}" style="flex:1" autocomplete=off data-tip="${m.material?'This member carries its own grade, so it will not follow a profile change':'Empty — follows the profile’s default grade. Type or browse to give this member its own.'}"><button data-command-id="steel.browse-material-catalog" id=materialBrowseS class=ghost aria-label="Search material grades" data-tip="Search the material catalog by name or alias"><svg viewBox="0 0 16 16" aria-hidden=true width=13 height=13 fill=none stroke=currentColor stroke-width=1.4 stroke-linecap=round><circle cx="6.9" cy="6.9" r="4.3"/><path d="M10.1 10.1 13.7 13.7"/></svg></button><span class=pslot aria-hidden=true></span></div></div>
13460
- <div class="row hint">Length <b>${L}</b> · ${wpf==null?'<span id=rfiPill class="pill pill-clickable" role=button tabindex=0 data-tip="Open the RFI list, focused on this member" style="background:var(--err-bg)">RFI — size unresolved</span>':_memberWeightHint(m,wpf)}</div>
13571
+ <div class="row hint">Length <b>${L}</b> · ${wpf==null&&customOf(m)?(customOf(m).assumable===false?'<span class=pill data-tip="FloLess cannot weigh this member’s custom section yet, so the member is left out of weights and quantities. The Custom section above says why and what to do." style="background:var(--err-bg)">No weight — custom section not counted</span>':'<span class=pill data-tip="This member’s custom section is unreadable, so it has no weight until you proceed on an assumption or it is fixed." style="background:var(--err-bg)">No weight — custom section unreadable</span>'):wpf==null?'<span id=rfiPill class="pill pill-clickable" role=button tabindex=0 data-tip="Open the RFI list, focused on this member" style="background:var(--err-bg)">RFI — size unresolved</span>':_memberWeightHint(m,wpf)}</div>
13461
13572
  <div class=elab>Verified</div><span class=vwrap data-panel-control><button data-command-id="steel.member-verified" id=verifyBtn class="vbtn${m.verified?' on':''}" aria-pressed="${m.verified?'true':'false'}" data-tip="Mark this member human-confirmed">${m.verified?'✓ Human-confirmed':'Mark verified'}</button></span>
13462
13573
  ${mfSect}
13463
13574
  ${appearanceSect}
@@ -13487,12 +13598,14 @@ function panel(){
13487
13598
  wireTypeFilter(p);wirePositionAvailability();
13488
13599
  document.getElementById('pf').onchange=e=>edit(()=>{const v=_canonDes(e.target.value);ModelCmd.patchMember(m,{profile:v,rfi:_wtPlf(v)==null});if(v&&!profs.includes(v)){profs.push(v);profs.sort();}});
13489
13600
  document.getElementById('profileBrowseS').onclick=e=>openProfilePicker({ids:[m.id],current:m.profile,scope:`Member ${m.id}`,invoker:e.currentTarget});
13601
+ {const cs=document.getElementById('customSecS');if(cs)cs.onchange=e=>applyCustomSectionChoice([m.id],String(e.target.value||''));}
13602
+ wireCustomSectionInspect(m);
13490
13603
  document.getElementById('mat').onchange=e=>applyMaterialChoice([m.id],String(e.target.value||'').trim()||CatalogPicker.MATERIAL_DEFAULT);
13491
13604
  document.getElementById('materialBrowseS').onclick=e=>openMaterialPicker({ids:[m.id],current:m.material||'',scope:`Member ${m.id}`,invoker:e.currentTarget});
13492
13605
  {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)
13493
13606
  document.getElementById('pickProf').onclick=()=>{if(picking&&pickKind==='profile'){picking=false;}else{picking=true;pickKind='profile';pickEnd=null;}render();};
13494
13607
  document.getElementById('mTypeS').onchange=e=>{const v=e.target.value;if(!normMemberTypeKey(v)){e.target.value=memberTypeLabel(memberTypeOf(m));return;}const live=byId(m.id)||m;if(memberTypeSettled(live,memberTypeKnownKey(v))){e.target.value=memberTypeLabel(memberTypeOf(live));return;}edit(()=>{const k=memberTypeFromInput(v);if(k&&!memberTypeSettled(byId(m.id)||m,k))applyMemberType([m],k);});}; // retype → role + legend recategorize (edit() → sync3D → build3DLegend); undoable. Re-entering the CURRENT type opens no edit(), so it pushes no empty undo step (#1429)
13495
- {const _cc=document.getElementById('msColor');if(_cc)_cc.onchange=e=>{setProfileColour(m.profile,e.target.value);scheduleSave();render();sync3D();};} // F1: recolour this member's profile (same write as the legend swatch) — sync3D() repaints a live 3D scene (no-op in 2D) so colour is truly 2D+3D
13608
+ {const _cc=document.getElementById('msColor');if(_cc)_cc.onchange=e=>{if(!setProfileColour(memberShownKey(m),e.target.value)){render();return;}scheduleSave();render();sync3D();};} // F1: recolour this member's profile (same write as the legend swatch) — sync3D() repaints a live 3D scene (no-op in 2D) so colour is truly 2D+3D
13496
13609
  // Every value-face dropdown in the pane is wired the same way — the Line control and the three
13497
13610
  // placement faces — so this walks .linewrap rather than naming one id.
13498
13611
  for(const wrap of document.querySelectorAll('#panel .linewrap')){
@@ -14222,7 +14335,7 @@ const PROP_DEFS=[
14222
14335
  // popup's aggregate, read one member at a time within a single render, so they never mix systems.
14223
14336
  {key:'length', label:'Length', get:m=>displayUnits()===DisplayUnits.MM?_lenMm(m):_lenFt(m), labelGet:m=>_lenFtLabel(m)==null?undefined:(displayUnits()===DisplayUnits.MM?_lenMm(m):_lenFt(m)),
14224
14337
  fmt:v=>v==null?'':(displayUnits()===DisplayUnits.MM?Math.round(v).toLocaleString('en-US')+' mm':v.toFixed(1)+' ft')},
14225
- {key:'weight', label:'Weight', get:m=>{const w=_wtBill(m.profile);return w==null?undefined:_propMass(m,w);}, labelGet:m=>{const w=_wtBill(m.profile);return (w==null||_lenFtLabel(m)==null)?undefined:_propMass(m,w);}, fmt:v=>v==null?'':Math.round(v).toLocaleString('en-US')+' '+_uw().weight},
14338
+ {key:'weight', label:'Weight', get:m=>{const w=_memberBill(m);return w==null?undefined:_propMass(m,w);}, labelGet:m=>{const w=_memberBill(m);return (w==null||_lenFtLabel(m)==null)?undefined:_propMass(m,w);}, fmt:v=>v==null?'':Math.round(v).toLocaleString('en-US')+' '+_uw().weight},
14226
14339
  // The column suppression is GONE: a column takes the same Profile Position as every other member now
14227
14340
  // (design §4), so hiding its depth face would be the label lying about geometry the bake applies.
14228
14341
  //
@@ -15061,7 +15174,7 @@ function cmPrevSvg(v,cur){const sel=sel2d(),offs=cmOffsetsFor(v);let s='';
15061
15174
  const many=sel.length*offs.length>600,bb=many?cmSelBbox():null;
15062
15175
  for(const off of offs){
15063
15176
  if(many){s+=`<rect class=cmghostbox x="${bb[0]+off[0]}" y="${bb[1]+off[1]}" width="${bb[2]-bb[0]}" height="${bb[3]-bb[1]}"/>`;continue;}
15064
- for(const m of sel)s+=`<line class=cmghost stroke="${esc(colorFor(m.profile))}" x1="${+m.wp[0][0]+off[0]}" y1="${+m.wp[0][1]+off[1]}" x2="${+m.wp[1][0]+off[0]}" y2="${+m.wp[1][1]+off[1]}"/>`;} // + coerces: a malformed contract string can't reach the attribute
15177
+ for(const m of sel)s+=`<line class=cmghost stroke="${esc(memberColour(m))}" x1="${+m.wp[0][0]+off[0]}" y1="${+m.wp[0][1]+off[1]}" x2="${+m.wp[1][0]+off[0]}" y2="${+m.wp[1][1]+off[1]}"/>`;} // + coerces: a malformed contract string can't reach the attribute
15065
15178
  const b=cmDraft.base;
15066
15179
  if(cmArrayMode&&cmDraft.vA)s+=cmRubSvg(b,[b[0]+cmDraft.vA[0],b[1]+cmDraft.vA[1]],true);
15067
15180
  s+=cmRubSvg(b,cur,false);
@@ -16564,7 +16677,7 @@ let modelShellMount=null;
16564
16677
  const selBar=document.getElementById('selBar'),selFly=document.getElementById('selFly');
16565
16678
  const pointerSelectionListeners=new Set();
16566
16679
  var selFilterReady=false; // armed by the deferred first reflect below; render() checks it so its per-edit reflect only runs once the Select-bar is initialised. In the current flow the first paint runs after this line (reads false); `var` (not let/const) is defensive — render() is defined earlier, so if it ever ran before this line it would read undefined (falsy), not throw a TDZ error.
16567
- const CONN_KIND_LABEL={'base-plate':'Base plate','shear-plate':'Shear plate','brace-gusset':'Gusset plate','custom':'Imported'};
16680
+ const CONN_KIND_LABEL={'base-plate':'Base plate','shear-plate':'Shear plate','brace-gusset':'Gusset plate','custom':'Imported','custom-parts':'Custom connection'};
16568
16681
  // Every connection label in this file goes through here. They used to be open-coded ternaries whose ELSE
16569
16682
  // branch said 'Shear plate', so the moment a third parametric kind existed the inspector announced a
16570
16683
  // brace gusset as a shear plate — the right geometry under the wrong name, which is worse than no label.
@@ -16679,6 +16792,7 @@ document.getElementById('cpLevelB').onclick=()=>openLevelModal('copy');
16679
16792
  // fetches the SAME scene the bake uses (/api/contract/:id/scene) so 2D and 3D show one contract. ---
16680
16793
  // Coped beams (auto, clash-driven) — cache the cut labels per member as the scene is fetched so the
16681
16794
  // member Inspector can show a read-only "Cope (auto)" note (a coped beam otherwise looks like an error).
16795
+ let connectionFitByJoint=new Map(), connectionPartsByJoint=new Map(); // #2303 slice A: a custom connection's fit and built parts, from the last connection bake
16682
16796
  let copesByMember={}, partsById={}, connectionDiagnostics=[], connectionDiagnosticsStatus='pending', connectionDiagnosticsSeq=0, connectionDiagnosticsTimer=null, connectionPreviewJointByEnd=new WeakMap(), shownConnectionDiagnosticSignatures=new Set();
16683
16797
  const connectionDiagnosticSignature=d=>[d.jointId,d.code,d.severity,d.field||'',d.authored==null?'':d.authored,d.built==null?'':d.built,d.supportId||''].join('|');
16684
16798
  function announceConnectionTruth(message,busy){
@@ -16754,7 +16868,10 @@ function connectionRefusalCopy(d,m){
16754
16868
  // is and that this detail does not model it.
16755
16869
  'main-rolled-unsupported':{head:'Not built · This member is rolled off vertical',detail:main+' is turned away from plumb, and this detail is only modelled for an upright section. No geometry or member trim was created.'},
16756
16870
  'support-rolled-unsupported':{head:'Not built · The supporting member is rolled off vertical',detail:support+' is turned away from plumb, so its bearing face cannot be placed by this detail. No geometry or member trim was created.'},
16757
- 'support-positioned-unsupported':{head:'Not built · The supporting member has been moved off its work line',detail:support+' has been moved off its work line, so the face this connection would bear on is no longer where that line puts it. No geometry or member trim was created.'}
16871
+ 'support-positioned-unsupported':{head:'Not built · The supporting member has been moved off its work line',detail:support+' has been moved off its work line, so the face this connection would bear on is no longer where that line puts it. No geometry or member trim was created.'},
16872
+ // Add-ons S1a. A custom section has no designation the connection details know, so a connection on one
16873
+ // is left unbuilt rather than placed against a guessed shape. Say which member and what to do instead.
16874
+ 'custom-section-unsupported':{head:'Not built · Connections on a custom section are not modelled yet',detail:(d.supportId?support:main)+' uses a custom section, and this connection detail is only modelled for catalogue sections. Draw this connection as a custom connection, or use a catalogue section for that member. No geometry or member trim was created.'}
16758
16875
  };
16759
16876
  return byCode[d.code]||{head:'Not built · Connection was refused',detail:'The connection engine refused '+(d.jointId||'this joint')+' ('+(d.code||'unknown reason')+'). No geometry or member trim was created.'};
16760
16877
  }
@@ -16789,6 +16906,8 @@ function updateConnectionDiagnostics(raw,announce=true){
16789
16906
  return fresh.length;
16790
16907
  }
16791
16908
  function applyConnectionBakeTruth(j,announce=true){
16909
+ connectionFitByJoint=new Map((Array.isArray(j&&j.fitEvidence)?j.fitEvidence:[]).filter(e=>e&&e.jointId).map(e=>[e.jointId,e])); // #2303 slice A: Inspect reads a custom connection's fit from the same bake
16910
+ {const byJoint=new Map();for(const el of ((j&&j.scene&&Array.isArray(j.scene.elements))?j.scene.elements:[]))if(el&&el.connKind==='custom-parts'&&el.conn){if(!byJoint.has(el.conn))byJoint.set(el.conn,[]);byJoint.get(el.conn).push(el);}connectionPartsByJoint=byJoint;}
16792
16911
  const fresh=updateConnectionDiagnostics(j&&j.diagnostics,false),sk=Array.isArray(j&&j.skipped)?j.skipped:[];
16793
16912
  const diagnosed=new Set(connectionDiagnostics.map(d=>d.jointId));
16794
16913
  const unreported=sk.filter(s=>String(s).startsWith('joint:')&&!diagnosed.has(String(s).slice(6))).length;
@@ -16870,6 +16989,7 @@ function hostBakeReasonLabel(reason){return ({
16870
16989
  'no-footprint':'No tabulated cross-section',unplaceable:'Geometry could not be placed',
16871
16990
  'unregistered-view':'Source view is not registered to the model','view-scale-invalid':'Source view has no valid drawing scale',
16872
16991
  'cross-view-conflict':'Source views disagree on placement','placement-evidence-conflict':'Invalid scale and conflicting placement evidence',
16992
+ 'custom-section-unverified':'Custom section cannot be checked','custom-section-not-exported':'Custom section is not carried by this send',
16873
16993
  'not-in-model':'No longer in the model'
16874
16994
  })[reason]||'Could not be built';}
16875
16995
 
@@ -18260,7 +18380,7 @@ function legendView(){return view3d?'3d':'2d';}
18260
18380
  function legendVis(){const k=legendView();return k==='3d'&&!window.Steel3DView?null:LEGEND_PORTS[k];}
18261
18381
  function legendMembers(){return legendView()==='3d'?allMembers():(P.members||[]);}
18262
18382
  // The sheet's profile groups, as the 3D scene builds its own: first-seen order, keyed and labelled by the canonical profile.
18263
- function planGroups(){const seen=new Map();for(const m of P.members||[]){const k=profileKeyOf(m);if(!seen.has(k))seen.set(k,{key:k,label:k||'No profile',color:colorFor(m.profile)});}return [...seen.values()];}
18383
+ function planGroups(){const seen=new Map();for(const m of P.members||[]){const k=profileKeyOf(m);if(!seen.has(k))seen.set(k,{key:k,label:k||'No profile',color:memberColour(m)});}return [...seen.values()];}
18264
18384
  // What the 2D list is drawn from, so render() rebuilds it only when that changed (a sheet switch, an edit, a toggle).
18265
18385
  let legendShownKey='';
18266
18386
  function legendKey(){return legendView()==='3d'?'3d':['2d',viewIdOf(P),planGroups().map(g=>{const c=categoryOfProfile(g.key);return g.key+':'+g.color+':'+(c===MIXED_TYPES?memberTypeSplit(g.key):c);}).join(','),(P.dims||[]).length,dimsVisible,!!gridOf(),gridOf()?gridOn():''].join('|');}
@@ -18430,7 +18550,7 @@ function wireTypeFilter(p){
18430
18550
  b.onkeydown=e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();e.stopPropagation();act(e.altKey);}}; // native button Enter/Space bubbles to the global idle-repeat-last handler (:3838, !inForm) which preventDefaults activation — activate here + stopPropagation, mirroring the F12 RFI pill (:2632). Alt+Enter/Space isolates (keyboard parity).
18431
18551
  });
18432
18552
  }
18433
- function profileKeyOf(m){return canonProfile(m&&m.profile);} // the spelling the member carries (UC305X97): the plan's own group key (planGroups)
18553
+ function profileKeyOf(m){return canonProfile(memberShownKey(m));} // the spelling the member carries (UC305X97): the plan's own group key (planGroups)
18434
18554
  // The key of the Objects row a member sits in. In 3D the rows are the scene's groups, and the bake keys a group by the
18435
18555
  // catalogue's name for the section (UC305*305*97, #2877) while the member carries the drawing's spelling (UC305X97),
18436
18556
  // so a 3D row is matched to its members through the scene itself. A member the scene did not draw keeps its own spelling,
@@ -18455,7 +18575,7 @@ let legendMode=(localStorage.getItem('floless.legendMode')==='type')?'type':'pro
18455
18575
  function legBuild(){const legMenu=document.getElementById('m3dLegendMenu');if(!legMenu)return;
18456
18576
  // Count as we go: the tally is the point of a legend, and it costs one pass either way.
18457
18577
  const tally=new Map();
18458
- for(const m of allMembers()){const pr=m.profile; if(pr)tally.set(pr,(tally.get(pr)||0)+1);}
18578
+ for(const m of allMembers()){const pr=memberShownKey(m); if(pr)tally.set(pr,(tally.get(pr)||0)+1);}
18459
18579
  if(!tally.size){legMenu.innerHTML='<div class=mlabel>No profiles in this model yet</div>';return;}
18460
18580
  // A steel designation is a family plus numbers. Sorting the whole string alphabetically put W14X176
18461
18581
  // ahead of W14X22, because '1' < '2' — nonsense to anyone reading section sizes. Compare the numeric
@@ -24656,8 +24776,8 @@ function exportPayload(){
24656
24776
  // be a function that carries what it needs.
24657
24777
  const wireEnd=e=>e?{tos:e.tosMm,note:e.note,tosDef:e.tosDef,detail:e.detail,conn:e.conn,connVerified:e.connVerified}:e;
24658
24778
  const wireCol=c=>c?{bos:c.bosMm,tos:c.tosMm,note:c.note,tosDef:c.tosDef,detail:c.detail,conn:c.conn,connVerified:c.connVerified}:c;
24659
- return {mm_per_px:(P&&P.mm_per_px>0)?P.mm_per_px:FT_TO_MM/12,elev_units:'mm',members:P.members.map(m=>{ensureMeta(m);return {profile:m.profile,workpoint:m.wp,role:m.role,rfi:_wtPlf(m.profile)==null,
24660
- length_ft:+_lenFt(m).toFixed(1),weight_plf:_plfWire(_wtPlf(m.profile)), // `_wtPlf`, never `_wtBill`: this field's NAME says pounds per foot // columns measure vertical height (TOS−BOS), not their ~0 plan-point distance
24779
+ return {mm_per_px:(P&&P.mm_per_px>0)?P.mm_per_px:FT_TO_MM/12,elev_units:'mm',members:P.members.map(m=>{ensureMeta(m);return {profile:m.profile,workpoint:m.wp,role:m.role,rfi:_memberPlf(m)==null,
24780
+ length_ft:+_lenFt(m).toFixed(1),weight_plf:_plfWire(_memberPlf(m)), // `_wtPlf`, never `_wtBill`: this field's NAME says pounds per foot // columns measure vertical height (TOS−BOS), not their ~0 plan-point distance
24661
24781
  ends:m.role==='column'?undefined:(m.ends||[]).map(wireEnd), column:m.role==='column'?wireCol(m.col):undefined};})};}
24662
24782
  /* #2521 row 5b: the downloaded file says what the EXACT document it was made from rests on. The live model (unsaved
24663
24783
  edits included) is labelled by the server: the /scene route answers `quick` for a Quick or possibly Quick candidate
@@ -25686,7 +25806,7 @@ document.getElementById('framesLevelNew').onclick=()=>frLevelNew();
25686
25806
  // to it — which is why a member no view can draw gets a sentence instead of them.
25687
25807
  function rfiSymptomMembersIn(scope){
25688
25808
  const src=scope==='sheet'?(P.members||[]):allMembers();
25689
- return src.filter(m=>m&&_wtPlf(m.profile)==null);
25809
+ return src.filter(m=>m&&_memberPlf(m)==null);
25690
25810
  }
25691
25811
  // A European/British designation, correctly spelled and simply not in a US catalogue. Telling its
25692
25812
  // author to "check the designation" sends them hunting a typo that is not there — which became the
@@ -26102,7 +26222,7 @@ function rfiOutstandingCount(){
26102
26222
  const live=rfiLiveByGap();
26103
26223
  let n=0;
26104
26224
  for(const r of rfiState.records)if(r&&(r.status!=='closed'||rfiRecordHasLiveGap(r)))n++;
26105
- for(const m of allMembers())if(m&&_wtPlf(m.profile)==null&&!live.has(rfiSizeGapKey(m.id)))n++;
26225
+ for(const m of allMembers())if(m&&_memberPlf(m)==null&&!live.has(rfiSizeGapKey(m.id)))n++;
26106
26226
  _rfiCount={key,n};
26107
26227
  return n;
26108
26228
  }
@@ -26413,7 +26533,7 @@ function rfiSubjectOf(r){
26413
26533
  /** Does the model ON SCREEN still say this member has no priceable size? The server checks the STORED
26414
26534
  * contract, so this is the local half of the same question — and it is why Apply and `resolved` are
26415
26535
  * withheld rather than offered-and-refused after somebody blanks the profile on the row itself. */
26416
- const rfiLocallyUnresolved=id=>{const m=allMembers().find(x=>x&&x.id===id);return !!m&&_wtPlf(m.profile)==null;};
26536
+ const rfiLocallyUnresolved=id=>{const m=allMembers().find(x=>x&&x.id===id);return !!m&&_memberPlf(m)==null;};
26417
26537
  /** Both actions the server decides against the model need it readable. */
26418
26538
  const rfiSizeTruthKnown=()=>rfiState.sizeTruth==='known';
26419
26539
  /** RFI correspondence preserves a trailing roll marker even though the accepted contract has already
@@ -29226,7 +29346,7 @@ function rfiRecordRowHtml(r){
29226
29346
  const copy=r.text?'<button data-command-id="steel.rfi-copy#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id+(kind?' — '+kind:''))+'" data-rfi-ctl=copy class=ghost data-rfi-copy="'+esc(r.id)+'" data-tip="Copy the whole RFI as text, to paste into an email">Copy whole RFI</button>':'';
29227
29347
  // A filed SIZE question keeps the control that answers it. See `rfiResolveControls`.
29228
29348
  const sizeOf=ids.length===1&&r.kind==='unknown-size'&&r.gapKey===rfiSizeGapKey(ids[0])?ids[0]:null;
29229
- const unresolved=sizeOf&&(()=>{const m=allMembers().find(x=>x&&x.id===sizeOf);return !!m&&_wtPlf(m.profile)==null;})();
29349
+ const unresolved=sizeOf&&(()=>{const m=allMembers().find(x=>x&&x.id===sizeOf);return !!m&&_memberPlf(m)==null;})();
29230
29350
  const profileMismatch=rfiProfileTruthMismatch(r);
29231
29351
  const answerMismatch=r.status==='answered'&&!r.applied&&r.answerResolution&&r.answerResolution.known===true
29232
29352
  &&r.answerResolution.resolved===false?r.answerResolution:null;
@@ -30298,6 +30418,123 @@ function _wtKgM(profile){if(!profile)return null;
30298
30418
  function _wtPlf(profile){const kgm=_wtKgM(profile);return kgm==null?null:kgm/LB_PER_FT_TO_KG_PER_M;}
30299
30419
  function _wtBill(profile){const kgm=_wtKgM(profile);
30300
30420
  return kgm==null?null:(displayUnits()===DisplayUnits.MM?kgm:kgm/LB_PER_FT_TO_KG_PER_M);}
30421
+ // Add-ons S1a: a member on a CUSTOM section weighs its own area times its material's density, never a catalogue row
30422
+ // that happens to share its designation (MIRRORS server/member-properties.ts). One FloLess cannot vouch for, and the
30423
+ // person has not accepted as an assumption, has no weight, so it reads as unpriced exactly like an unresolved size.
30424
+ function customOf(m){return m&&typeof m.customSectionId==='string'&&CustomSections?CustomSections.resolveCustomSection(C,m):null;}
30425
+ function _memberKgM(m){const c=customOf(m);if(c)return c.usable&&c.section?CustomSections.customKgPerM(c.section,CustomSections.densityFor(m.material)):null;return _wtKgM(m&&m.profile);}
30426
+ function _memberPlf(m){const kgm=_memberKgM(m);return kgm==null?null:kgm/LB_PER_FT_TO_KG_PER_M;}
30427
+ function _memberBill(m){const kgm=_memberKgM(m);return kgm==null?null:(displayUnits()===DisplayUnits.MM?kgm:kgm/LB_PER_FT_TO_KG_PER_M);}
30428
+ // The plan tooltip for a member whose custom section is not usable.
30429
+ // Placement maths (Profile Position, the frame rebase) reads the same section the export places: a usable custom
30430
+ // section's own outline (inches here, like profileDimsIn), none for one FloLess cannot vouch for, else the catalogue.
30431
+ function memberDimsIn(m){const c=customOf(m);if(c)return c.usable&&c.section?{w:c.section.width/IN_TO_MM,d:c.section.depth/IN_TO_MM,round:false}:null;return profileDimsIn(m&&m.profile);}
30432
+ function memberShapeComponents(m,w,d,scale,round){const c=customOf(m);if(c&&c.usable&&c.section)return [c.section.outline.map(([x,y])=>[x/IN_TO_MM/12*scale,y/IN_TO_MM/12*scale])];return sectionShapeComponents(m.profile,w,d,scale,round);}
30433
+ // A custom member is coloured and grouped by its unique label, never its designation, so two same-name sections
30434
+ // never share a colour or a legend row (the 3D groups use the same labels: server/contract-to-scene.ts).
30435
+ let customColourLabels=new Map();
30436
+ // THE NAMES ARE THE SERVER'S (POST /api/contract/:appId/custom-sections/labels: modelCustomSectionLabels, the one
30437
+ // function the bill and the 3D groups use). The editor never works one out: its catalogue resolves aliases the server's
30438
+ // does not (HSS20.000X0.500 for HSS20X.500), so a name made here could be one no 3D group or bill line carries. The
30439
+ // answer is kept with the model it was asked for (`sig`) and used only while the model still matches; a newer ask
30440
+ // wins over an older answer; a failed ask is retried on a later render, at most every 5 s. Until there is an answer
30441
+ // for this model, a custom member is drawn and listed under its stored designation and cannot be recoloured.
30442
+ let customLabelsState={sig:'',labels:new Map(),currentSig:'',pendingSig:'',seq:0,failedSig:'',failedAt:0};
30443
+ function customLabelFields(){
30444
+ const members=(Array.isArray(C&&C.members)?C.members:[]).filter(m=>m&&typeof m==='object').map(m=>{const o={};if(typeof m.profile==='string')o.profile=m.profile;if(typeof m.customSectionId==='string')o.customSectionId=m.customSectionId;return o;});
30445
+ const sections=(C.custom_sections||[]).filter(s=>s&&typeof s.sectionId==='string').map(s=>({ // a fresh request body, built whole: nothing in the model is written
30446
+ sectionId:s.sectionId,
30447
+ ...(typeof s.designation==='string'?{designation:s.designation}:{}),
30448
+ ...(s.params&&typeof s.params==='object'?{params:s.params}:{}),
30449
+ }));
30450
+ const o={members,custom_sections:sections};if(typeof C.environment==='string')o.environment=C.environment;return o;}
30451
+ function refreshCustomLabels(){
30452
+ const st=customLabelsState;
30453
+ if(!CustomSections||!Array.isArray(C&&C.custom_sections)||!C.custom_sections.length){st.currentSig='';if(st.pendingSig){st.seq++;st.pendingSig='';}return;}
30454
+ const model=customLabelFields(),sig=JSON.stringify(model);st.currentSig=sig;
30455
+ if(sig===st.sig||sig===st.pendingSig)return;
30456
+ if(sig===st.failedSig&&Date.now()-st.failedAt<5000)return;
30457
+ const seq=++st.seq;st.pendingSig=sig;
30458
+ fetch('/api/contract/'+encodeURIComponent(APP_ID)+'/custom-sections/labels'+PROJECT_QS,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({model})})
30459
+ .then(async r=>{let j=null;try{j=await r.json();}catch{}
30460
+ if(seq!==st.seq)return;
30461
+ if(!r.ok||!j||!j.ok||!j.labels||typeof j.labels!=='object')throw new Error((j&&j.error)||('the server answered '+r.status));
30462
+ st.sig=sig;st.pendingSig='';st.labels=new Map(Object.entries(j.labels).filter(([,v])=>typeof v==='string'));render();})
30463
+ .catch(e=>{if(seq!==st.seq)return;st.pendingSig='';st.failedSig=sig;st.failedAt=Date.now();
30464
+ console.warn('steel-editor: FloLess could not name the custom sections in this model; their members show the stored designation until it can.',(e&&e.message)||e);});
30465
+ }
30466
+ // The server's names for THIS model, or none while it has not answered for it.
30467
+ function currentCustomLabels(){const st=customLabelsState;return st.currentSig&&st.sig===st.currentSig?st.labels:new Map();}
30468
+ function editorCustomLabels(){return customColourLabels;}
30469
+ // The model and spellings the colours read: custom members under their names, and no name borrowing or lending a
30470
+ // catalogue spelling (CustomSections.labelSafeSpellings, the same rule the scene colours by).
30471
+ function colourModelNow(){return CustomSections?CustomSections.colourModel(C,customColourLabels):C;}
30472
+ function editorColourSpellings(){return CustomSections?CustomSections.labelSafeSpellings(customColourLabels,profileColourSpellings):profileColourSpellings;}
30473
+ // A custom member's colour key is its name, or null while FloLess has not named its section for this model.
30474
+ function memberColourKey(m){return m&&typeof m.customSectionId==='string'?(customColourLabels.get(m.customSectionId)||null):(m&&m.profile);}
30475
+ function memberShownKey(m){const k=memberColourKey(m);return k==null?(m&&m.profile):k;}
30476
+ // Whether `key` is the stored designation an unnamed custom member is shown under right now.
30477
+ function customColourPending(key){if(!CustomSections||!Array.isArray(C&&C.custom_sections)||!C.custom_sections.length)return false;
30478
+ const k=canonProfile(key);return (C.members||[]).some(m=>m&&typeof m.customSectionId==='string'&&!customColourLabels.has(m.customSectionId)&&canonProfile(m.profile)===k);}
30479
+ function memberColour(m){return colorFor(memberShownKey(m));}
30480
+ function customTipFor(m){const c=customOf(m);return !c||c.usable?'':c.assumable===false?'Custom section shown as a placeholder and not counted yet. Open the member to see why.':'Unreadable custom section. Open the member to proceed on an assumption or ask the AI to fix it.';}
30481
+ // Each custom section's unique label (the one the bill and the 3D legend use), and the reverse lookup.
30482
+ // Only sections FloLess has named for this model are offered: two may share a designation, so before the names arrive
30483
+ // there is no word that picks exactly one of them.
30484
+ function customSectionChoices(){if(!CustomSections||!Array.isArray(C&&C.custom_sections)||!C.custom_sections.length)return [];
30485
+ const labels=editorCustomLabels();return C.custom_sections.filter(x=>x&&labels.has(x.sectionId)).map(x=>({sectionId:x.sectionId,label:labels.get(x.sectionId)}));}
30486
+ const CUSTOM_NONE='— none (catalogue profile) —';
30487
+ // Put a custom section in this model on members (one undo step), or take it off them (the profile text stays).
30488
+ function applyCustomSectionChoice(ids,label){
30489
+ if(label===CUSTOM_NONE){edit(()=>{for(const id of ids){const m=byId(id);if(m&&m.customSectionId)ModelCmd.patchMember(m,{customSectionId:undefined,rfi:_wtPlf(m.profile)==null});}});return;}
30490
+ const pick=customSectionChoices().find(x=>x.label===label);if(!pick)return;
30491
+ const section=C.custom_sections.find(x=>x.sectionId===pick.sectionId),definition=(C.section_definitions||[]).find(d=>d&&d.id===section.definitionId);
30492
+ if(!definition){toast('That custom section has lost its definition, so it cannot be placed. Ask the AI to fix it.');return;}
30493
+ edit(()=>{V2_SESSION.placeCustomSection({definition,section,memberIds:ids});});
30494
+ }
30495
+ function customParamsText(sec){const p=sec&&sec.params||{};return Object.keys(p).sort().map(k=>k+' '+CustomSections.formatValue(p[k])).join(' · ');}
30496
+ // The Inspect block for one member on a custom section (add-ons S1a). Read-only facts plus, for a section FloLess
30497
+ // cannot vouch for, the two ways forward; an accepted assumption is named and can be withdrawn.
30498
+ function customSectionInspectHTML(m){
30499
+ const c=customOf(m);if(!c)return '';
30500
+ const sec=c.section,def=c.definition;
30501
+ const head=sec?`<b>${esc(sec.designation||m.profile||'Custom section')}</b>`:`<b>${esc(m.profile||'Custom section')}</b>`;
30502
+ const src=sec&&sec.definitionId?` · from <span data-tip="Made by the AI chat or an add-on. Nobody has checked this definition.">${esc(sec.definitionId)} · not reviewed</span>`:'';
30503
+ const pill=c.assumed?' <span class=pill data-tip="You chose to proceed on an assumption: this section is used as stored, and every bill and export says so.">Assumption</span>':'';
30504
+ let rows=`<div class=divrow><hr><span class=sect style="margin:0">Custom section</span><hr></div>
30505
+ <div class="row hint" id=customSecHead role=note>${head}${src}${pill}</div>`;
30506
+ if(sec){const d=CustomSections.densityFor(m.material);
30507
+ rows+=`<div class="row hint">${esc(customParamsText(sec))} mm${Number.isFinite(sec.area)?` · Area ${Number(sec.area).toLocaleString()} mm²`:sec.tapered?' · no single area (it tapers)':' · no area stored'}</div>
30508
+ <div class="row hint" role=note>Weight basis: ${esc(d.basis)}</div>`;}
30509
+ if(!c.usable){
30510
+ // A section an assumption cannot help (a parametric section this FloLess checks but does not draw yet, or one missing
30511
+ // a stored value) says why in the shared module's own words, and offers no "Proceed on assumption" that would do nothing.
30512
+ const why=c.assumable===false&&c.label?esc(c.label):'This section comes from a definition this FloLess cannot read (a newer kind or version), or its shape no longer matches its recipe. The member is left out of quantities and exports until you choose.';
30513
+ rows+=`<div class="row hint" id=customSecWhy role=note><span class=pill style="background:var(--err-bg)">${c.assumable===false?'Left out':'Left out — section unreadable'}</span> ${why}</div>
30514
+ <div class=row style="gap:6px;flex-wrap:wrap"><button type=button data-command-id="steel.custom-section-ask-ai" class=ghostw id=customSecAsk>Ask AI to fix</button>${sec&&c.assumable!==false?'<button type=button data-command-id="steel.custom-section-assume" class=ghostw id=customSecAssume data-tip="Use the stored shape as it is. The member counts in quantities and exports, labelled as an assumption.">Proceed on assumption</button>':''}</div>`;
30515
+ }else if(c.assumed){
30516
+ rows+=`<div class=row><button type=button data-command-id="steel.custom-section-withdraw" class=ghostw id=customSecWithdraw data-tip="Stop using this section until it can be checked. The member is left out of quantities and exports again.">Withdraw assumption</button></div>`;
30517
+ }
30518
+ return rows;
30519
+ }
30520
+ function wireCustomSectionInspect(m){
30521
+ const c=customOf(m);if(!c)return;
30522
+ const ask=document.getElementById('customSecAsk');
30523
+ const named=`Member ${m.id} uses the custom section ${(c.section&&c.section.designation)||m.profile} (definition ${(c.section&&c.section.definitionId)||'unknown'})`;
30524
+ if(ask)ask.onclick=()=>askAiOpen({mode:'modify',text:c.assumable===false&&c.label
30525
+ ?`${named}. FloLess says: ${c.label} Please fix it so FloLess can draw and count it, or tell me what is wrong with it.`
30526
+ :`${named}, which FloLess cannot check: its definition is of a kind or version this FloLess cannot read, or its stored shape no longer matches its recipe. Please fix the definition so the section can be checked, or tell me what is wrong with it.`});
30527
+ const setAssumption=accept=>edit(()=>{V2_SESSION.setCustomSectionAssumption(c.sectionId,accept?CustomSections.assumptionFor(c.section,new Date().toISOString()):null);});
30528
+ const assume=document.getElementById('customSecAssume');if(assume)assume.onclick=()=>setAssumption(true);
30529
+ const withdraw=document.getElementById('customSecWithdraw');if(withdraw)withdraw.onclick=()=>setAssumption(false);
30530
+ }
30531
+ // The "Custom section" picker row (only when the model holds custom sections). `members` share the label shown, or it reads "— mixed —".
30532
+ function customSectionPickerHTML(members,id){
30533
+ const choices=customSectionChoices();if(!choices.length)return '';
30534
+ const labels=editorCustomLabels(),of=m=>m.customSectionId?(labels.get(m.customSectionId)||''):CUSTOM_NONE;
30535
+ const vals=[...new Set(members.map(of))],mixed=vals.length>1;
30536
+ return `<div class="f"><div class=elab>Custom section</div><input ${members.length===1?'data-command-id="steel.member-custom-section"':'data-command-id="steel.selection-custom-section"'} aria-label="Custom section" id=${id} class=combo data-src=customsections value="${mixed?'':esc(vals[0]||CUSTOM_NONE)}" placeholder="${mixed?'— mixed —':''}" autocomplete=off data-tip="Pick a custom section in this model for ${members.length===1?'this member':'these members'}. None keeps the profile text."></div>`;
30537
+ }
30301
30538
  // The words a quantity is spelled with, per system — the same spellings `server/bom-units.ts` uses, so
30302
30539
  // a number and the sentence about it cannot disagree. `t` is the SI symbol for a tonne; `T` is a tesla.
30303
30540
  const UNIT_WORDS={'ft-in':{weight:'lb',tonnage:'tons'},
@@ -30948,6 +31185,7 @@ const COMBO_SRC={
30948
31185
  details:()=>detTexts(), // the SAME list the Details modal shows — see detTexts (#397)
30949
31186
  sheets:()=>[...new Set((C.plans||[]).map(p=>p&&p.sheet).filter(Boolean))], // the sheets this model has, for a callout's "Points to sheet" (free text is still allowed)
30950
31187
  favcats:()=>FAV_CAT_SUGGEST[favCatKind]||[],
31188
+ customsections:()=>[CUSTOM_NONE,...customSectionChoices().map(x=>x.label)], // add-ons S1a: pick only
30951
31189
  connrows:()=>['— none —',...(C.connections||[]).map(r=>connLabel(r))],
30952
31190
  framelevels:()=>['Not set',...(FramesCore?FramesCore.levelsOf(C.moment_frames).map(l=>l.name):[])] // the Frames dialog's "which level is this sheet?" picker (#2210): pick only
30953
31191
  };