@floless/app 0.169.0 → 0.170.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 (59) hide show
  1. package/dist/floless-server.cjs +71580 -59849
  2. package/dist/schemas/drawing-check.profile.v1.schema.json +12 -2
  3. package/dist/schemas/steel.model.v2.schema.json +2 -1
  4. package/dist/skills/floless-app-knowledge/SKILL.md +43 -13
  5. package/dist/skills/floless-app-new-workflow/SKILL.md +8 -1
  6. package/dist/skills/floless-app-routines/SKILL.md +2 -2
  7. package/dist/skills/floless-app-routines/references/routines-api.md +20 -8
  8. package/dist/skills/floless-app-steel-model/SKILL.md +8 -5
  9. package/dist/skills/floless-app-steel-takeoff/SKILL.md +31 -1
  10. package/dist/skills/floless-app-workflows/SKILL.md +22 -3
  11. package/dist/skills/floless-app-workflows/references/agent-steps.md +40 -6
  12. package/dist/skills/floless-app-workflows/references/exec-contract.md +27 -0
  13. package/dist/skills/floless-app-workflows/references/script-runner.md +105 -0
  14. package/dist/web/agent-steps.js +89 -18
  15. package/dist/web/agents.js +32 -22
  16. package/dist/web/app.css +223 -1
  17. package/dist/web/app.js +24 -3
  18. package/dist/web/aware.js +877 -189
  19. package/dist/web/chat.js +184 -95
  20. package/dist/web/checkpoint-standard.js +5 -3
  21. package/dist/web/commands-drawing-check.js +1 -0
  22. package/dist/web/commands-shell.js +440 -11
  23. package/dist/web/commands-steel.js +60 -1
  24. package/dist/web/drawing-check-editor.js +352 -88
  25. package/dist/web/failure-copy.js +32 -2
  26. package/dist/web/filter-ai-proposal.js +11 -8
  27. package/dist/web/flo-3d.js +1 -1
  28. package/dist/web/guide.js +33 -26
  29. package/dist/web/index.html +69 -1
  30. package/dist/web/instructor.js +99 -15
  31. package/dist/web/left-pane.js +4 -1
  32. package/dist/web/local-discovery.js +8 -7
  33. package/dist/web/missed-routines.js +239 -0
  34. package/dist/web/model-measure.js +6 -0
  35. package/dist/web/model-spatial-panel.js +19 -4
  36. package/dist/web/model-spatial-tools.js +3 -3
  37. package/dist/web/model-viewport-revit-adapter.js +3 -3
  38. package/dist/web/origin-rule.js +155 -0
  39. package/dist/web/project-access.js +1 -1
  40. package/dist/web/project-modules.js +2 -2
  41. package/dist/web/project-rfis.js +6 -1
  42. package/dist/web/project-workflows.js +2 -2
  43. package/dist/web/revit-editor.js +22 -8
  44. package/dist/web/run-history.js +12 -1
  45. package/dist/web/steel-3d-core.js +39 -9
  46. package/dist/web/steel-3d-flo.js +26 -4
  47. package/dist/web/steel-3d-view.js +8 -3
  48. package/dist/web/steel-ai-marks.js +3 -1
  49. package/dist/web/steel-editor.html +455 -122
  50. package/dist/web/steel-environments.js +297 -0
  51. package/dist/web/steel-filter.html +3 -2
  52. package/dist/web/steel-model-v2-client-validation.js +8 -1
  53. package/dist/web/steel-model-v2-commands.js +23 -9
  54. package/dist/web/steel-model-v2-projection.js +1 -1
  55. package/dist/web/step-rename.js +3 -2
  56. package/dist/web/terminal-requests.js +1 -1
  57. package/dist/web/tool-updates.js +7 -6
  58. package/dist/web/workspaces.js +1714 -119
  59. package/package.json +4 -1
@@ -1989,6 +1989,17 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1989
1989
  #panel .mp-more{width:100%;margin-top:6px;font-size:11px;padding:4px 7px}
1990
1990
  #panel .mp-sheet{font-weight:400;color:var(--mut)}
1991
1991
  #panel .mp-done{margin-top:12px;font-size:12px;line-height:1.5;color:var(--text)}
1992
+ /* #2554 slice 2b: Read the rest. The list scrolls inside the panel; the global * scrollbar rule themes it. */
1993
+ #panel .mp-rest{display:grid;gap:6px;margin:6px 0 4px;padding:7px 8px;border:1px solid var(--line);border-radius:6px;background:var(--hover-soft)}
1994
+ #panel .mp-rest-modes{display:grid;gap:3px}
1995
+ #panel .mp-rest-mode,#panel .mp-rest-file{display:flex;align-items:flex-start;gap:6px;font-size:11.5px;line-height:1.4;color:var(--text);text-transform:none;letter-spacing:0;cursor:pointer}
1996
+ #panel .mp-rest-mode input,#panel .mp-rest-file input{margin-top:2px}
1997
+ #panel .mp-rest-acts,#panel .mp-rest-head{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}
1998
+ #panel .mp-rest-acts{justify-content:flex-start}
1999
+ #panel .mp-rest-acts button{font-size:11px;padding:4px 10px}
2000
+ #panel .mp-rest-head .ghost{font-size:11px;padding:3px 8px}
2001
+ #panel .mp-rest-list{display:grid;gap:3px;max-height:180px;overflow:auto;padding:4px 2px;border-top:1px solid var(--line)}
2002
+ #panel .mp-rest-file span{overflow-wrap:anywhere}
1992
2003
  #panel .mp-done:focus:not(:focus-visible){outline:none}
1993
2004
  #panel .mp-done .hint{margin-top:4px}
1994
2005
  #quickStat.is-unknown{text-decoration:underline dashed;text-underline-offset:3px}
@@ -1996,6 +2007,8 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1996
2007
  full list is in its tip. */
1997
2008
  #coverageStat{white-space:nowrap;color:var(--mut);max-width:16ch;overflow:hidden;text-overflow:ellipsis}
1998
2009
  #coverageStat.is-unknown{text-decoration:underline dashed;text-underline-offset:3px}
2010
+ #coverageStat[role=button]{cursor:pointer}
2011
+ #coverageStat[role=button]:hover{color:var(--text)}
1999
2012
  .conf-quick{margin:0 0 8px;padding:6px 10px;border:1px solid var(--warn-edge);border-radius:6px;color:var(--mut);font-size:12px;line-height:1.45}
2000
2013
  .conf-quick b{color:var(--warn)}
2001
2014
  #srcStat b{display:inline-block;max-width:130px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
@@ -2879,6 +2892,8 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2879
2892
  #m3dLegend .lrow.sub{padding-left:34px} /* a row inside a nested category — indented one level deeper */
2880
2893
  #m3dLegend .drag-handle{font-size:11px;color:var(--mut);cursor:grab;opacity:0;transition:opacity .1s;flex:none;padding:0 1px;line-height:1}
2881
2894
  #m3dLegend .lrow:hover .drag-handle{opacity:1}
2895
+ #m3dLegend .drag-handle:focus{opacity:1}
2896
+ #m3dLegend .drag-handle:focus-visible,#m3dLegend .cat-hdr:focus-visible{outline:2px solid var(--brand);outline-offset:-2px} /* #3208: Instructor focuses these (tabindex -1, never a tab stop) */
2882
2897
  #m3dLegend .lrow.flash{background:rgba(59,130,246,.12)}
2883
2898
  .leg-drag-ghost{position:fixed;pointer-events:none;z-index:70;background:var(--panel);border:1px solid var(--brand);border-radius:5px;padding:3px 8px;display:flex;align-items:center;gap:7px;font:12px var(--ui);color:var(--text);width:200px;opacity:.88;box-shadow:0 4px 16px rgba(0,0,0,.6)}
2884
2899
  /* The Ctrl+Shift drag-out badge. Same recipe as .leg-drag-ghost but sized to its text (a fixed width
@@ -2902,6 +2917,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2902
2917
  #m3dLegend .lrow.qhide,#m3dLegend .cat-hdr.qhide{display:none} /* filtered OUT by search → gone (distinct from .off = hidden-in-3D, which only dims the swatch) */
2903
2918
  #m3dLegend .lsempty{color:var(--mut);font-size:11px;padding:10px 4px;text-align:center}
2904
2919
  #m3dLegend .lidhit{color:var(--mut);font-size:11px;margin-left:2px;min-width:0;overflow:hidden;text-overflow:ellipsis} /* #2998: the member id a search matched, after a profile row's label */
2920
+ #m3dLegend .lrow[data-mix]::after{content:attr(data-mix);color:var(--mut);font-size:11px;margin-left:2px;min-width:0;overflow:hidden;text-overflow:ellipsis} /* #3208: how a mixed row's members split — the .lidhit recipe; CSS content, so search never matches it */
2905
2921
  /* Show-all reset bar — panel-local entry to showAllGroups(); shown only when something is hidden/isolated. Clones the
2906
2922
  .lsearch full-width box recipe; brand border on hover only (a one-shot action, not a mode → no solid fill). */
2907
2923
  #m3dLegend .lreset{display:none;align-items:center;justify-content:center;gap:6px;height:26px;margin-bottom:6px;background:var(--bg);border:1px solid var(--line);border-radius:6px;color:var(--text);font:12px var(--ui);cursor:pointer;flex:none;user-select:none}
@@ -4206,6 +4222,7 @@ function legendBody(key){
4206
4222
  return legendBodies[key];
4207
4223
  }
4208
4224
  let PlanXf = null; // steel-plan-transform.js — the px↔world registration boundary. Already in the module graph (V2Projection imports it); named here so the classic script can read a sheet's registration angle and fit scale when it draws a rolled section footprint.
4225
+ let SteelEnv = null; // steel-environments.js — the ONE registry of steel-environment TRAITS (units, shapes route, scale grammar, default grade, catalogue noun…). Every behaviour that differs by standard reads a trait from it; nothing on this page compares an environment id. Dynamic import for the same reason DisplayUnits is one.
4209
4226
  let CkStd = null; // checkpoint-standard.js — the ONE place a steel standard is named for a reader. A
4210
4227
  // dynamic import for the same reason DisplayUnits is one: a `<script type=module>` is DEFERRED and
4211
4228
  // binds AFTER this classic script has already drawn. The Drawing Filter checkpoint imports the same
@@ -4590,10 +4607,18 @@ function handleReviewChanged(m){
4590
4607
  if(c===undefined)return;
4591
4608
  const el=document.getElementById('coverageStat');if(!el)return;
4592
4609
  const shown=c&&(c.state==='part'||c.state==='unknown')&&typeof c.short==='string'&&c.short?c:null;
4593
- if(!shown){el.style.display='none';el.textContent='';el.removeAttribute('data-tip');return;}
4610
+ if(!shown){el.style.display='none';el.textContent='';el.removeAttribute('data-tip');el.removeAttribute('role');el.onclick=el.onkeydown=null;return;}
4594
4611
  el.textContent=shown.short;
4595
4612
  el.classList.toggle('is-unknown',shown.state==='unknown');
4596
- el.setAttribute('data-tip',(shown.text||shown.short)+' Shown as last loaded.');
4613
+ // #2554 slice 2b: the way back to Read the rest once every AI decision is reviewed and the strip's Make precise is gone.
4614
+ const opens=!!PROJECT;
4615
+ el.setAttribute('data-tip',(shown.text||shown.short)+' Shown as last loaded.'+(opens?' Press to see the files left for later and what can read them.':''));
4616
+ if(opens){
4617
+ el.setAttribute('role','button');
4618
+ const open=()=>{if(window.openMakePrecise)window.openMakePrecise();};
4619
+ el.onclick=e=>{e.stopPropagation();open();};
4620
+ el.onkeydown=e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();open();}};
4621
+ }
4597
4622
  el.style.display='';
4598
4623
  }
4599
4624
  /* The confidence report's line: scoped to the last saved model, and it says so when the report shows unsaved edits. */
@@ -4889,26 +4914,39 @@ function replyFailureText(status, body, ctx) {
4889
4914
  return personText(body) || failureCopy({ status, body: body && typeof body === 'object' ? body : null }, ctx).text;
4890
4915
  }
4891
4916
 
4917
+ /* #3097 3b: the sentence for a caught error is failure-copy.js errorText(e, ctx): the server's reply read again when
4918
+ the error carries one, a sentence this page wrote when it is marked `forPerson`, else the shared sentence. */
4919
+
4892
4920
  /**
4893
- * #3097: the sentence for a caught error. An error this page threw FOR a person (`forPerson`, its message already a
4894
- * sentence) is said as written; anything else — the browser's "Failed to fetch", a check that threw, a save's own
4895
- * bookkeeping message — is a developer's text, so it goes to the console and the person gets the shared sentence.
4921
+ * #3097 3b: the sentence for a refused reference request, whose reply `d` was already read. A busy lock, a sign-in
4922
+ * refusal or an unreadable answer gets the shared sentence for it (never the lock's time estimate); otherwise the
4923
+ * server's sentence for the person, else the caller's own words, with the reply kept in the console.
4896
4924
  */
4897
- function personErrorText(e, ctx) {
4898
- if (e && e.forPerson && typeof e.message === 'string' && e.message.trim()) return e.message;
4899
- console.warn('steel-editor: ' + ((ctx && ctx.action) || 'a step') + ' failed', e);
4900
- return failureCopy(e, ctx).text;
4925
+ /** A review route's refusal is a fragment written to follow " — "; said on its own, it starts a sentence and ends one. */
4926
+ function sentenceCase(text){
4927
+ const t=String(text||'').trim();
4928
+ return !t?t:(t.charAt(0).toUpperCase()+t.slice(1)+(/[.!?]$/.test(t)?'':'.'));
4929
+ }
4930
+
4931
+ function refusalText(d, fallback, ctx){
4932
+ const body=d&&typeof d==='object'?d:{code:'response-unreadable'};
4933
+ const kind=failureKind({body});
4934
+ if(kind==='busy'||kind==='access'||kind==='connection'||kind==='outdated')return errorText({body},ctx);
4935
+ const said=personText(body);
4936
+ if(!said)console.warn('steel-editor: '+((ctx&&ctx.action)||'a reference step')+' was refused with nothing to say to the person',body);
4937
+ return said||fallback;
4901
4938
  }
4902
4939
 
4903
4940
  /**
4904
- * #3097: what a failed switch to the 3D view says. The scene route's own sentence keeps its old lead ("Could not
4905
- * open 3D view: …"); anything else — an unreadable reply, a refusal with nothing said, no answer, a renderer that
4906
- * threw while loading — is the shared sentence. Opening the view only reads, so a retry is safe to offer.
4941
+ * #3097: what a failed switch to the 3D view says. The scene route's own sentence for the person keeps its old lead
4942
+ * ("Could not open 3D view: …"), read again from the reply (personText), never from the error's message; anything
4943
+ * else — an unreadable reply, a refusal with nothing said, no answer, a renderer that threw while loading — is the
4944
+ * shared sentence. Opening the view only reads, so a retry is safe to offer.
4907
4945
  */
4908
4946
  function threeDOpenFailureText(e) {
4909
- if (e && e.forPerson && typeof e.message === 'string' && e.message.trim()) return 'Could not open 3D view: ' + e.message;
4910
- console.error('steel-editor: the 3D view did not open', e);
4911
- return failureCopy(e, { action: 'open the 3D view', retrySafe: true }).text;
4947
+ const said = e && personText(e.body);
4948
+ if (said) return 'Could not open 3D view: ' + said;
4949
+ return errorText(e, { action: 'open the 3D view', retrySafe: true });
4912
4950
  }
4913
4951
 
4914
4952
  /* WHY A SECOND COUNTER AND NOT JUST `modelEditGeneration`.
@@ -4927,7 +4965,7 @@ async function boot() {
4927
4965
  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; }
4928
4966
  armEarlyViewToggle(); // BEFORE the first await — that is the whole point; see above
4929
4967
  startContractEvents(); // subscribe first; contract events buffer until the atomic snapshot is installed
4930
- [DisplayUnits, GridDisplay, SteelCore, ViewGen, ModelCmd, DetailRefs, V2Projection, V2Commands, V2Validation, SplitView, FilterCore, PlanXf, CatalogPicker, ModelEditor, ViewportToolbar, ModelLighting, PointerDock, EditorShell, ReviewClient, ProfileColours, ReferenceSheet, ReadConfidence, CkStd, ModelPanelBridge, ChatQuestions, SteelSlim, LastSeen, MarksCore, FramesCore, AiMarks] = await Promise.all([
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([
4931
4969
  import('./display-units.js'), import('./grid-display.js'),
4932
4970
  import('./steel-3d-core.js'), import('./steel-view-generation.js'), import('./steel-model-commands.js'),
4933
4971
  import('./steel-detail-refs.js'), import('./steel-model-v2-projection.js'),
@@ -4937,7 +4975,7 @@ async function boot() {
4937
4975
  import('./model-viewport-toolbar.js'), import('./model-viewport-lighting.js'), import('./model-pointer-dock.js'), import('./model-editor-shell.js'),
4938
4976
  import('./connection-review-client.js'), import('./steel-profile-colours.js'),
4939
4977
  import('./steel-reference-sheet.js'), import('./steel-read-confidence.js'),
4940
- import('./checkpoint-standard.js'), import('./model-panel-bridge.js'), import('./model-chat-questions.js'),
4978
+ import('./checkpoint-standard.js'), import('./steel-environments.js'), import('./model-panel-bridge.js'), import('./model-chat-questions.js'),
4941
4979
  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'),
4942
4980
  ]);
4943
4981
  ({ 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
@@ -5134,7 +5172,7 @@ async function boot() {
5134
5172
  // showed the UK chip while every profile, weight, material and RFI on the page stayed US-backed —
5135
5173
  // so the editor told the user their catalogue held US shapes only, for steel the server resolves
5136
5174
  // perfectly. `C` is loaded by here (the lines below read it), so the contract can answer.
5137
- const _sr = await fetch(C && C.environment === 'UK' ? '/api/uk-shapes' : '/api/aisc-shapes');
5175
+ const _sr = await fetch(SteelEnv.traitsFor(C && C.environment).shapesPath);
5138
5176
  if (!_sr.ok) throw new Error('HTTP ' + _sr.status);
5139
5177
  const _sj = await _sr.json();
5140
5178
  if (!_sj.weights || typeof _sj.weights !== 'object' || !_sj.sections || typeof _sj.sections !== 'object') throw new Error('payload missing weights/sections');
@@ -5143,6 +5181,9 @@ async function boot() {
5143
5181
  window.__STEEL_SECTIONS = _sj.sections;
5144
5182
  window.__STEEL_PROFILE_CATALOG = _sj.catalog;
5145
5183
  window.__STEEL_MATERIAL_CATALOG = _sj.materials;
5184
+ // Spellings that stand on a default the drawing did not state (EU `RHS`/`SHS` -> cold-formed), with the label for each.
5185
+ // Absent from the US and UK payloads, which have none.
5186
+ window.__STEEL_ASSUMED = _sj.assumed && typeof _sj.assumed === 'object' ? _sj.assumed : {};
5146
5187
  } catch (e) {
5147
5188
  window.__STEEL_CATALOG_LOAD_FAILED = true;
5148
5189
  bumpRfiEpoch(); // …and the failure is a change of answer too, not an absence of one
@@ -5683,7 +5724,7 @@ function aiNoteText(item,marks,wrote){
5683
5724
  switch(item.channel){
5684
5725
  case'filter':return'The Drawing Filter (which sheets and areas the read used) was chosen by the AI'+chosen+'. Every member rests on that choice.';
5685
5726
  case'scope':return'The drawing set was too large to read at once, so the AI chose which files to read'+chosen+'. The model covers only those files.';
5686
- case'setup-origin':return'The model origin was chosen by the AI'+chosen+'. Every member’s position rests on it.';
5727
+ case'setup-origin':return'The model origin was chosen by the AI'+chosen+'. '+(item.rule?item.rule+' ':'')+'Every member’s position rests on it.';
5687
5728
  case'audit-gap':return'The AI settled a question the drawings left open'+chosen+'.';
5688
5729
  case'unmodelled-detail':return'The AI left a detail unmodelled'+chosen+'.';
5689
5730
  case'connection':return'The AI assumed a connection FloLess cannot place on a member now'+chosen+'.';
@@ -5885,19 +5926,32 @@ function aiReviewsRefresh(){
5885
5926
  started is applied, so an older answer arriving last never offers again what was just recorded. */
5886
5927
  let mpLoadSeq=0;
5887
5928
  const MP_REFRESH_FAILED='FloLess could not refresh the list just now, so it may still show some that are already reviewed. Close and reopen Make precise to see the latest.';
5929
+ // The latest read also settles the note a stale Read the rest left (state.restNote), and lets go of the panel the press
5930
+ // held for it: whichever read that is, so the press never has to tell which read landed.
5931
+ function mpRestSettle(state,phase){
5932
+ const n=state.restNote;if(!n)return;
5933
+ if(phase)n.phase=phase;
5934
+ if(n.holds){n.holds=false;state.busy=false;}
5935
+ }
5888
5936
  async function mpLoad(keepLive){
5889
5937
  const state=makePrecise;if(!state||!PROJECT)return;
5890
5938
  const seq=++mpLoadSeq;
5891
5939
  try{
5892
- const d=await mpRead();if(makePrecise!==state||seq!==mpLoadSeq)return;
5940
+ const d=await mpRead();if(makePrecise!==state){mpRestSettle(state);return;}if(seq!==mpLoadSeq)return;
5893
5941
  mpAdopt(d);state.review=d;state.status='ready';if(!keepLive)state.live='';
5942
+ mpRestSettle(state,'shown');
5894
5943
  const ids=new Set(d.groups.flatMap(g=>g.items.map(c=>c.decisionId)));for(const id of [...state.changed])if(!ids.has(id))state.changed.delete(id);
5895
5944
  }catch(e){
5896
- if(makePrecise!==state||seq!==mpLoadSeq)return;
5945
+ if(makePrecise!==state){mpRestSettle(state);return;}if(seq!==mpLoadSeq)return;
5897
5946
  console.warn('make precise: could not read the AI decisions',String(e&&e.message||e));
5947
+ // While the note is up it says the list could not be refreshed, once; the live line only takes back its promise.
5948
+ if(state.restNote){
5949
+ mpRestSettle(state,'failed');
5950
+ if(keepLive&&state.live)state.live=state.live.replace(/ ?The list now shows what is still to review\.$/,'');
5951
+ }
5898
5952
  // What the confirm said stays (it may be that FloLess cannot tell what was recorded); only its promise that the
5899
5953
  // list shows the latest is taken back.
5900
- if(state.review){
5954
+ else if(state.review){
5901
5955
  const said=keepLive&&state.live&&!state.live.endsWith(MP_REFRESH_FAILED)?state.live.replace(/ ?The list now shows what is still to review\.$/,''):'';
5902
5956
  state.live=keepLive&&state.live.endsWith(MP_REFRESH_FAILED)?state.live:(said?said+' ':'')+MP_REFRESH_FAILED;
5903
5957
  }
@@ -5917,9 +5971,12 @@ function openMakePrecise(){
5917
5971
  makePrecise={status:'loading',review:null,live:'',busy:false,changed:new Set(),arm:null,armTimer:0,limits:{},focus:{key:'title'},mark:null};
5918
5972
  render();mpLoad();
5919
5973
  }
5974
+ window.openMakePrecise=openMakePrecise; // the header's Part of the set chip (paintCoverageStat) opens it from another scope
5920
5975
  function closeMakePrecise(){
5921
5976
  if(!makePrecise)return;clearTimeout(makePrecise.armTimer);makePrecise=null;render();
5922
- (document.getElementById('aiPreciseB')||moreBtn).focus();
5977
+ // Back where it was opened from: the strip's button, else the Part of the set chip once the review is done.
5978
+ const chip=document.getElementById('coverageStat'),chipOpens=chip&&chip.getAttribute('role')==='button'&&chip.style.display!=='none';
5979
+ (document.getElementById('aiPreciseB')||(chipOpens?chip:null)||moreBtn).focus();
5923
5980
  }
5924
5981
  /* The chat UI session cookie the confirm route asks for. Minted once; asked again once if it expired. */
5925
5982
  function mpSession(){
@@ -6000,7 +6057,9 @@ async function mpConfirm(items){
6000
6057
  ...(items.every(c=>c.outcome==='changed')?{changed:true}:{})});
6001
6058
  if(differently){state.mark=null;state.focus={after:[...rest,...after]};await mpLoad(true);return;}
6002
6059
  if(conflict){
6003
- state.review=d.review;for(const id of d.changed||[])state.changed.add(id);
6060
+ // A conflict's review carries the decisions only: Files left for later is the same model's, so it stays until the next load.
6061
+ state.review=d.review&&!d.review.readRest&&state.review&&state.review.readRest?{...d.review,readRest:state.review.readRest}:d.review;
6062
+ for(const id of d.changed||[])state.changed.add(id);
6004
6063
  state.focus={after:[...(d.changed||[]),...rest,...after]};render();return;
6005
6064
  }
6006
6065
  // Focus: after a full confirm the next one to review; otherwise the first one this confirm did not record.
@@ -6058,11 +6117,150 @@ function mpWhereToChange(c){
6058
6117
  default:return'Change it in the model here in the editor, or read the drawings again from Attach revised drawings in the workspace.';
6059
6118
  }
6060
6119
  }
6120
+ /* #2554 slice 2b: Read the rest. What the model left for later (`review.readRest`, server-owned) and the control that
6121
+ queues a read of it from the project's own stored copies. One read takes up to `max` files; the person picks Precise or
6122
+ Quick as on any read. Every warning names what is wrong and what to do; nothing here refuses. */
6123
+ const MP_REST_ATTACH='Attach them again with Attach revised drawings in the workspace.';
6124
+ const mpRestIds=x=>x.version+':'+x.files.map(f=>f.sha256).join(','); // one offer: the version and its files, in order
6125
+ function mpRestState(state){
6126
+ const r=state.review&&state.review.readRest;if(!r||!Array.isArray(r.files))return null;
6127
+ if(!state.rest||state.rest.src!==r){
6128
+ // A refresh of the same offer keeps what the person did; a new one (another read published since) starts afresh, so
6129
+ // an old "queued" or warning never hides the files that are left now.
6130
+ const old=state.rest&&mpRestIds(state.rest.src)===mpRestIds(r)?state.rest:null,keep=old&&old.chosen?new Set(r.files.map(f=>f.sha256).filter(s=>old.chosen.has(s))):null;
6131
+ state.rest={src:r,chosen:keep&&keep.size?keep:new Set(r.files.slice(0,r.max).map(f=>f.sha256)),mode:state.rest?state.rest.mode:'precise',open:!!(state.rest&&state.rest.open),
6132
+ msg:old?old.msg:'',msgKind:old?old.msgKind:'',missing:old?old.missing:[],queued:old?old.queued:null,cap:false};
6133
+ }
6134
+ return state.rest;
6135
+ }
6136
+ // After a stale answer: why nothing was queued, and where the refresh stands (refreshing, shown, failed).
6137
+ function mpRestNoteText(state){
6138
+ const n=state.restNote,why='The model changed since this panel opened, so nothing was queued.';if(!n)return'';
6139
+ const r=state.review&&state.review.readRest,left=!!(r&&Array.isArray(r.files)&&r.files.length);
6140
+ return why+' '+(n.phase==='refreshing'?'FloLess is refreshing the files left for later.':n.phase==='failed'?MP_REFRESH_FAILED
6141
+ :left?'Files left for later now shows what is left to read.':'Every file is read now, so nothing is left for later.');
6142
+ }
6143
+ const mpRestNames=names=>names.length<=3?names.join(', ').replace(/, ([^,]*)$/,' and $1'):names.slice(0,3).join(', ')+' and '+(names.length-3)+' more';
6144
+ function mpRestHtml(state){
6145
+ const r=state.review.readRest,rs=mpRestState(state);if(!rs)return'';
6146
+ const dis=state.busy||rs.busy?' disabled':'',n=r.files.length,s=k=>k===1?'':'s';
6147
+ let h='';
6148
+ if(r.unknown)h+=`<div class=mp-banner role=note>FloLess cannot tell every drawing file this model left out${n?', so it can name only these '+n:''}. ${esc(MP_REST_ATTACH)}</div>`;
6149
+ if(!n)return h;
6150
+ if(r.version==null){
6151
+ if(r.noVersion==='unreadable'){
6152
+ h+=`<div class=mp-banner role=note>FloLess could not read this project’s saved versions just now, so it can’t read the stored copies yet. Nothing is lost; try again in a moment.</div>`
6153
+ +`<div class=mp-rest-acts><button type=button class=ghost data-mp-rest-retry data-mp-key=rest-retry data-command-id="steel.make-precise-read-rest-retry"${dis}>Try again</button></div>`;
6154
+ return h;
6155
+ }
6156
+ h+=`<div class=mp-banner role=note>${r.noVersion==='changed'?'This model’s list of files left for later differs from its newest saved version':'No saved version of this model holds these files yet'}, so FloLess can read its stored copies once the model is published. ${esc(MP_REST_ATTACH)}</div>`;
6157
+ return h;
6158
+ }
6159
+ if(rs.queued){
6160
+ h+=`<div class=hint role=status>${esc(rs.queued)}</div>`;
6161
+ return h;
6162
+ }
6163
+ const chosen=r.files.filter(f=>rs.chosen.has(f.sha256)),k=chosen.length,isDefault=k===Math.min(n,r.max)&&r.files.slice(0,r.max).every(f=>rs.chosen.has(f.sha256));
6164
+ const label=!k?'Read the rest':isDefault?(n>r.max?`Read the rest (${r.max} of ${n})`:`Read the rest (${n} file${s(n)})`):`Read ${k} chosen file${s(k)}`;
6165
+ const mode=m=>`<label class=mp-rest-mode><input type=radio name=mpRestMode value=${esc(m)} data-mp-rest-mode=${esc(m)} data-mp-key="rm:${esc(m)}" data-command-id="steel.make-precise-read-rest-mode#${esc(m)}" data-command-instance-label="${m==='quick'?'Quick':'Precise'}"${rs.mode===m?' checked':''}${dis}> ${m==='quick'?'Quick: faster. The model is labelled Quick model until you review its AI decisions.':'Precise: takes longer; the read asks you where the drawings leave something open.'}</label>`;
6166
+ h+=`<div class=mp-rest role=group aria-label="Read the files left for later">`;
6167
+ h+=`<div class=mp-rest-modes role=radiogroup aria-label="Read as"><span class=hint>Read as</span>${mode('precise')}${mode('quick')}</div>`;
6168
+ if(rs.msg)h+=`<div class="${rs.msgKind==='alert'?'mp-banner':'hint'}" role=${rs.msgKind==='alert'?'alert':'status'}>${esc(rs.msg)}</div>`;
6169
+ h+=`<div class=mp-rest-acts><button type=button class=mp-yes data-mp-rest-go data-mp-key=rest data-command-id="steel.make-precise-read-rest" data-tip="Queue one drawing read of these files, from the copies saved with the project"${!k?' disabled':dis}>${esc(label)}</button>`;
6170
+ if(n>1)h+=`<button type=button class=ghost data-mp-rest-choose data-mp-key=rest-choose data-command-id="steel.make-precise-read-rest-choose" aria-expanded="${rs.open}" aria-controls=mpRestList${dis}>${rs.open?'Hide files':'Choose files'}</button>`;
6171
+ h+='</div>';
6172
+ if(!k)h+='<div class=hint>Choose at least one file.</div>';
6173
+ if(rs.open&&n>1){
6174
+ h+=`<div class=mp-rest-head><span class=hint>${k} of ${n} chosen${n>r.max?' · one read takes up to '+r.max:''}</span><span class=mp-arm><button type=button class=ghost data-mp-rest-first data-mp-key=rest-first data-command-id="steel.make-precise-read-rest-first"${dis}>First ${Math.min(n,r.max)}</button><button type=button class=ghost data-mp-rest-clear data-mp-key=rest-clear data-command-id="steel.make-precise-read-rest-clear"${dis}>Clear</button></span></div>`;
6175
+ if(rs.cap)h+=`<div class=hint role=note>${r.max} is the most one read takes. The rest stay for another read.</div>`;
6176
+ h+=`<div class=mp-rest-list id=mpRestList role=group aria-label="Files to read">`;
6177
+ for(const f of r.files){
6178
+ const miss=rs.missing.includes(f.sha256);
6179
+ h+=`<label class=mp-rest-file><input type=checkbox data-mp-rest-file="${esc(f.sha256)}" data-mp-key="rf:${esc(f.sha256)}" data-command-id="steel.make-precise-read-rest-file#${esc(f.sha256)}" data-command-instance-label="${esc(f.name)}"${rs.chosen.has(f.sha256)?' checked':''}${dis}> <span>${esc(f.name)}</span>${miss?' <span class="chip assumed">Copy missing</span>':''}</label>`;
6180
+ }
6181
+ h+='</div>';
6182
+ }
6183
+ h+='</div>';
6184
+ return h;
6185
+ }
6186
+ function mpRestWire(p,state){
6187
+ const rs=state.rest,r=state.review&&state.review.readRest;if(!rs||!r)return;
6188
+ p.querySelector('[data-mp-rest-go]')?.addEventListener('click',()=>mpRestQueue(state));
6189
+ p.querySelector('[data-mp-rest-retry]')?.addEventListener('click',()=>{state.live='Reading the saved versions again…';state.focus={key:'title'};panel();mpLoad(true);});
6190
+ p.querySelector('[data-mp-rest-choose]')?.addEventListener('click',()=>{rs.open=!rs.open;state.focus={key:'rest-choose'};panel();});
6191
+ p.querySelector('[data-mp-rest-first]')?.addEventListener('click',()=>{rs.chosen=new Set(r.files.slice(0,r.max).map(f=>f.sha256));rs.cap=false;state.focus={key:'rest-first'};panel();});
6192
+ p.querySelector('[data-mp-rest-clear]')?.addEventListener('click',()=>{rs.chosen=new Set();rs.cap=false;state.focus={key:'rest-clear'};panel();});
6193
+ for(const b of p.querySelectorAll('[data-mp-rest-mode]'))b.addEventListener('change',()=>{if(b.checked){rs.mode=b.dataset.mpRestMode==='quick'?'quick':'precise';state.focus={key:'rm:'+rs.mode};}});
6194
+ for(const c of p.querySelectorAll('[data-mp-rest-file]'))c.addEventListener('change',()=>{
6195
+ const sha=c.dataset.mpRestFile;rs.cap=false;
6196
+ if(c.checked){if(rs.chosen.size>=r.max){rs.cap=true;}else rs.chosen.add(sha);}else rs.chosen.delete(sha);
6197
+ state.focus={key:'rf:'+sha};panel();
6198
+ });
6199
+ }
6200
+ async function mpRestQueue(state){
6201
+ const r0=state.rest,r=state.review&&state.review.readRest;if(!r0||!r||r0.busy||state.busy||r.version==null)return;
6202
+ const files=r.files.filter(f=>r0.chosen.has(f.sha256)).map(f=>f.sha256);if(!files.length)return;
6203
+ const isDefault=files.length===Math.min(r.files.length,r.max)&&r.files.slice(0,r.max).every(f=>r0.chosen.has(f.sha256));
6204
+ // The whole panel waits with it (state.busy), so no confirm or refresh rebuilds the offer under a read being queued.
6205
+ r0.busy=true;state.busy=true;r0.msg='';state.restNote=null;state.live='Queuing a read of '+files.length+' file'+(files.length===1?'':'s')+'…';state.focus={key:'rest'};panel();
6206
+ let res=null,body=null;
6207
+ try{
6208
+ res=await fetch('/api/projects/'+encodeURIComponent(PROJECT)+'/revision-requests',{method:'POST',headers:{'content-type':'application/json'},credentials:'same-origin',
6209
+ body:JSON.stringify({fromCoverage:{version:r.version,...(isDefault?{}:{files})},buildMode:r0.mode})});
6210
+ body=await res.json().catch(()=>null);
6211
+ }catch(e){console.warn('make precise: could not queue Read the rest',String(e&&e.message||e));}
6212
+ r0.busy=false;state.busy=false;if(makePrecise!==state)return;
6213
+ // The answer belongs to the offer that was sent. A refresh that landed meanwhile with another offer keeps its own
6214
+ // controls; the answer is said on the panel's line instead, so it never hides files that are left now.
6215
+ const cur=state.rest,same=!!cur&&mpRestIds(cur.src)===mpRestIds(r);if(cur)cur.busy=false;
6216
+ const rs=same?cur:{...r0,chosen:new Set(r0.chosen)};
6217
+ const left=r.files.length-files.length,moved=' The list of files left for later has changed since; check it before reading more.';
6218
+ if(res&&res.ok&&body&&body.ok){
6219
+ const asked=body.buildModeNotice?' '+body.buildModeNotice:'';
6220
+ rs.queued='A read of '+files.length+' file'+(files.length===1?' is':'s is')+' queued'+(rs.mode==='quick'&&!body.buildModeNotice?' as Quick':'')+'. It waits in Requests until the AI chat reads it, and the review comes back to you there.'+(left?' '+left+' file'+(left===1?' stays':'s stay')+' left for later.':'')+asked;
6221
+ state.live=same?'':rs.queued+moved;state.focus={key:'title'};panel();return; // same offer: the section says it (role=status), once
6222
+ }
6223
+ const code=body&&body.code;
6224
+ // The server's own words, as a sentence: some routes answer in a lower-case fragment with no full stop.
6225
+ const said=body&&typeof body.error==='string'?(t=>(t.charAt(0).toUpperCase()+t.slice(1))+(/[.!?]$/.test(t)?'':'.'))(body.error.trim()):'';
6226
+ if(!said){
6227
+ // No answer FloLess can read: the read may or may not have been queued, so it says exactly that.
6228
+ rs.msg='FloLess could not confirm whether the read was queued. Open Requests in the workspace to check before pressing Read the rest again.';rs.msgKind='alert';
6229
+ }else if(code==='read-rest-file-missing'&&Array.isArray(body.files)){
6230
+ rs.missing=body.files.map(f=>f.sha256);for(const m of rs.missing)rs.chosen.delete(m);rs.open=true;
6231
+ const others=r.files.filter(f=>rs.chosen.has(f.sha256)).length;
6232
+ rs.msg=said+(others?' The other '+others+' are still chosen; press '+(others===1?'Read 1 chosen file':'Read '+others+' chosen files')+' to read them now.':'');rs.msgKind='note';
6233
+ }else if(code==='read-rest-stale'){
6234
+ // Another read published since the panel opened: say why nothing was queued, and refresh. The note is its own state,
6235
+ // and the list read that lands settles it (mpLoad), so nothing here edits words another read may have written. The
6236
+ // panel stays held until that read lets go (mpRestSettle), so a second press cannot start another under it.
6237
+ state.restNote={phase:'refreshing',holds:true};state.live='';state.busy=true;state.focus={key:'rest-note'};panel();
6238
+ mpLoad(true);
6239
+ return;
6240
+ }else if(code==='revision-read-active'){
6241
+ // The server says which: still running, waiting for the person's review, or a failed read to clear first.
6242
+ rs.msg=said+' Open Requests in the workspace to see it; Read the rest is here when it is done.';rs.msgKind='note';
6243
+ }else{
6244
+ rs.msg=said;rs.msgKind='alert';
6245
+ }
6246
+ state.live=same?'':rs.msg+moved;state.focus={key:'rest'};panel(); // same offer: said in the section, as a status or an alert
6247
+ }
6248
+ /* The block on its own, when no Files read decision is left to review: what is still not read, and Read the rest. */
6249
+ function mpRestSection(state){
6250
+ const r=state.review&&state.review.readRest;if(!r)return'';
6251
+ const sentence=mpRestSentence(r);
6252
+ return`<section class="mer-group mp-group" aria-labelledby=mpGRest><div class=mp-ghead><h3 class=mp-gtitle id=mpGRest>Files left for later</h3></div>${sentence?`<p class=mp-cons>${esc(sentence)}</p>`:''}${mpRestHtml(state)}</section>`;
6253
+ }
6254
+ function mpRestSentence(r){
6255
+ const names=(r.files||[]).map(f=>f.name);if(!names.length)return'';
6256
+ return'This model has not read '+mpRestNames(names)+(r.unknown?', and FloLess cannot name every file it left out':'')+'. A later read of these files adds them to the model.';
6257
+ }
6061
6258
  function renderMakePrecisePanel(p){
6062
6259
  const state=makePrecise,review=state.review,prog=review&&review.progress;
6063
6260
  // The rebuild replaces every node: keep focus, the list's scroll and each open "Why?".
6064
6261
  const active=document.activeElement,keepKey=active&&p.contains(active)?active.getAttribute('data-mp-key'):null;
6065
6262
  const oldList=p.querySelector('#mpList'),keepScroll=oldList?oldList.scrollTop:0;
6263
+ const oldRest=p.querySelector('#mpRestList'),keepRestScroll=oldRest?oldRest.scrollTop:0;
6066
6264
  const openWhy=new Set([...p.querySelectorAll('details.mp-why[open]')].map(x=>x.dataset.mpId));
6067
6265
  p.setAttribute('aria-busy',String(!!state.busy));p.setAttribute('aria-labelledby','mpTitle');
6068
6266
  const dis=state.busy?' disabled':'',s=n=>n===1?'':'s';
@@ -6073,11 +6271,13 @@ function renderMakePrecisePanel(p){
6073
6271
  if(state.status==='loading')html+='<div class=mer-empty role=status>Reading the AI decisions…</div>';
6074
6272
  else if(state.status==='error')html+=`<div class=mer-empty>FloLess could not read the AI decisions just now. Your model is unchanged.<div class=mer-toolbar><button id=mpRetry data-mp-key=retry data-command-id="steel.make-precise-retry" class=ghost>Try again</button></div></div>`;
6075
6273
  else if(!prog.remaining){
6076
- html+=`<div class=mp-done id=mpDoneMsg tabindex=-1 data-mp-key=done-msg><b>${prog.total?(prog.total===1?'The AI decision is reviewed.':'All '+prog.total+' AI decisions are reviewed.'):'This model rests on no AI decision.'}</b> This model is no longer labelled Quick model.<div class=hint>Reviewing records your look at each decision. It does not verify the model.</div></div>`;
6274
+ html+=`<div class=mp-done id=mpDoneMsg tabindex=-1 data-mp-key=done-msg><b>${prog.total?(prog.total===1?'The AI decision is reviewed.':'All '+prog.total+' AI decisions are reviewed.'):'This model rests on no AI decision.'}</b> This model is no longer labelled Quick model.<div class=hint>Reviewing records your look at each decision. It does not verify the model.${review.readRest?' It does not read the files left for later either, so the model still says it is part of the set.':''}</div></div>`;
6275
+ if(review.readRest)html+=mpRestSection(state);
6077
6276
  }else{
6078
6277
  if(review.record==='unreadable')html+='<div class=mp-banner role=note>The review record can’t be read, so nothing can be marked reviewed yet. Your model is unchanged.</div>';
6079
6278
  else if(review.record==='absent')html+='<div class=mp-banner role=note>FloLess has no record of how the AI made these decisions, so they can’t be confirmed here, and the model stays a Quick model while it rests on them. Reading the drawings again records them.</div>';
6080
6279
  html+='<div class=mer-list id=mpList>';
6280
+ if(review.readRest&&!review.groups.some(g=>g.id==='scope'))html+=mpRestSection(state); // the choice is reviewed; the files are still not read
6081
6281
  review.groups.forEach((g,gi)=>{
6082
6282
  const items=g.items.slice(0,mpShownIn(g)),hidden=g.items.length-items.length;
6083
6283
  const can=g.items.filter(c=>c.confirmable),gk=esc(g.id),gl=esc(g.title);
@@ -6091,6 +6291,7 @@ function renderMakePrecisePanel(p){
6091
6291
  }
6092
6292
  html+=`<section class="mer-group mp-group" aria-labelledby="mpG${gi}"><div class=mp-ghead><h3 class=mp-gtitle id="mpG${gi}">${gl} <span class=mp-gcount>· ${g.items.length} to review</span></h3>${act}</div>`;
6093
6293
  if(g.consequence)html+=`<p class=mp-cons>${esc(g.consequence)}</p>`;
6294
+ if(g.id==='scope'&&review.readRest)html+=mpRestHtml(state);
6094
6295
  for(const c of items){
6095
6296
  const which=twin.get(c.decisionId)||'';
6096
6297
  const id=esc(c.decisionId),changed=state.changed.has(c.decisionId),q0=c.question||c.chosen||'An AI decision';
@@ -6132,6 +6333,7 @@ function renderMakePrecisePanel(p){
6132
6333
  });
6133
6334
  html+='</div>';
6134
6335
  }
6336
+ if(state.restNote)html+=`<div class=mer-live id=mpRestNote role=status tabindex=-1 data-mp-key=rest-note>${esc(mpRestNoteText(state))}</div>`;
6135
6337
  html+=`<div class=mer-live id=mpLive role=status aria-live=polite>${esc(state.live||'')}</div>`;
6136
6338
  p.innerHTML=html;
6137
6339
  const card=id=>mpCards().find(c=>c.decisionId===id),group=id=>review&&review.groups.find(g=>g.id===id);
@@ -6182,6 +6384,7 @@ function renderMakePrecisePanel(p){
6182
6384
  };
6183
6385
  for(const b of p.querySelectorAll('[data-mp-all-yes]'))b.onclick=()=>{const g=group(b.dataset.mpAllYes);if(g)mpConfirm(g.items.filter(c=>c.confirmable));};
6184
6386
  for(const b of p.querySelectorAll('[data-mp-all-no]'))b.onclick=()=>{clearTimeout(state.armTimer);state.arm=null;state.focus={key:'all:'+b.dataset.mpAllNo};panel();};
6387
+ if(review&&review.readRest)mpRestWire(p,state);
6185
6388
  const list=p.querySelector('#mpList');if(list)list.scrollTop=keepScroll;
6186
6389
  const f=state.focus;state.focus=null;
6187
6390
  const byKey=k=>p.querySelector('[data-mp-key="'+CSS.escape(k)+'"]');
@@ -6190,12 +6393,15 @@ function renderMakePrecisePanel(p){
6190
6393
  else if(f&&f.key)el=byKey(f.key)||(f.orCard?p.querySelector('[data-mp-id="'+CSS.escape(f.orCard)+'"] summary'):null);
6191
6394
  else if(keepKey)el=byKey(keepKey);
6192
6395
  if(el)el.focus({preventScroll:!(f&&(f.after||f.orCard))});
6396
+ const restList=p.querySelector('#mpRestList');if(restList)restList.scrollTop=keepRestScroll;
6193
6397
  }
6194
6398
  const newModelId=()=>`m-v2-${Date.now().toString(36)}-${(v2IdSeq++).toString(36)}`;
6195
6399
  V2_SESSION=V2Commands.createV2CommandSession(C,{
6196
6400
  validate:doc=>V2Validation.validateClientSteelModelV2(doc,V2_SCHEMA),
6197
6401
  mintId:newModelId,
6198
6402
  resolveSection:m=>{const d=profileDimsIn(m&&m.profile);return d?{...d,units:'in'}:null;},
6403
+ // The merge compares sources by effective grade: the environment's default, hollow by catalogue row (EU-0b, #3199).
6404
+ defaultMaterial:p=>profileDefaultMaterial(p),
6199
6405
  // This re-points P after EVERY commit. During ?selftest=1 it must not: the guard swapped P for a CLONE
6200
6406
  // so its fixtures cannot touch the live projection, and re-pointing would hand the live one back on the
6201
6407
  // first commit — after which every `P.members=[…]` fixture writes straight into it and the restore,
@@ -6430,7 +6636,7 @@ async function scanMemberEnds(liveMessage,pinnedScope){ // pinnedScope: re-che
6430
6636
  if(!d.report.findings.length){memberEndReview=null;memberEndGhostSync();memberEndScan={busy:false,error:false,live:'No member ends are short of support centerlines.'};document.body.classList.remove('member-end-review');updateMemberEndStatus();panel();const settled=memberEndScan;if(b){b.classList.add('ok');b.textContent='No short member ends ✓';}setTimeout(()=>{if(memberEndScan===settled){memberEndScan=null;panel();}if(b)b.classList.remove('ok');updateMemberEndStatus();},1500);return;}
6431
6637
  const chosen=memberEndChoicesForReport(d.report,prior&&prior.chosen),selected=new Set();for(const f of d.report.findings){const key=memberEndKey(f);if(prior){if(prior.selected.has(key)&&f.classification==='needs-review'&&chosen.get(key)&&memberEndTargetEqual(chosen.get(key),prior.chosen.get(key)))selected.add(key);}else if(f.classification==='needs-review'&&f.targets&&f.targets.length===1&&!f.geometryOnly)selected.add(key);}
6432
6638
  memberEndScan=null;memberEndReview={report:d.report,scope,chosen,selected,focus:0,query:prior?prior.query||'':'',anchor:null,busy:false,undoToken:d.undo&&d.undo.token||null,undoDirection:d.undo&&d.undo.direction||null,live:typeof liveMessage==='string'?liveMessage:'Check each endpoint against its drawing or model evidence.'};document.body.classList.add('member-end-review');modelSelection.clearMembers();focusMemberEnd(0);memberEndGhostSync();updateMemberEndStatus();
6433
- }catch(e){memberEndReview=null;memberEndGhostSync();memberEndStatus={known:false,count:null,etag:null,revision:null,scopeSig:null};document.body.classList.remove('member-end-review');modelSelection.clearMembers();memberEndScan={busy:false,error:true,live:personErrorText(e,{action:'check member ends',retrySafe:true})};updateMemberEndStatus();panel();toast(memberEndScan.live);}
6639
+ }catch(e){memberEndReview=null;memberEndGhostSync();memberEndStatus={known:false,count:null,etag:null,revision:null,scopeSig:null};document.body.classList.remove('member-end-review');modelSelection.clearMembers();memberEndScan={busy:false,error:true,live:errorText(e,{action:'check member ends',retrySafe:true})};updateMemberEndStatus();panel();toast(memberEndScan.live);}
6434
6640
  }
6435
6641
  function closeMemberEndReview(){if(memberEndReview&&memberEndReview.busy){memberEndReview.live='Finish the current member-end action before closing.';panel();return;}memberEndReview=null;document.body.classList.remove('member-end-review');modelSelection.clearMembers();memberEndGhostSync();render();moreBtn.focus();}
6436
6642
  // Ends Apply would extend right now: ticked, still needing review, with a chosen support. The one thing closing the
@@ -6484,10 +6690,10 @@ function focusMemberEnd(index,opts){
6484
6690
  }
6485
6691
  function chooseMemberEndTarget(key,index){if(!memberEndReview||memberEndReview.busy)return;const f=memberEndReview.report.findings.find(x=>memberEndKey(x)===key);const t=f&&f.targets&&f.targets[index];if(!f||!t)return;memberEndReview.chosen.set(key,t);memberEndReview.selected.add(key);memberEndReview.live='Selected '+memberEndTargetName(t)+' for '+f.memberId+' end '+(f.end+1)+'.';panel();memberEndRepaint();}
6486
6692
  async function applyMemberEndSelection(){if(!memberEndReview||memberEndReview.busy)return;const selections=[];for(const f of memberEndReview.report.findings){const key=memberEndKey(f),target=memberEndReview.chosen.get(key);if(f.classification==='needs-review'&&memberEndReview.selected.has(key)&&target)selections.push({findingId:f.findingId,contextHash:f.contextHash,memberId:f.memberId,end:f.end,target});}if(!selections.length)return;
6487
- const review=memberEndReview;review.busy=true;review.live='Extending selected member ends…';panel();try{const d=await memberEndRequest('apply',{scope:review.scope,selections});installMemberEndContract(d.contract,d.etag,d.storeRevision);if(memberEndReview!==review)return scanMemberEnds(undefined,review.scope);const previousChosen=review.chosen;review.report=d.report;review.undoToken=d.undoToken;review.undoDirection='undo';review.selected.clear();review.chosen=memberEndChoicesForReport(d.report,previousChosen);review.busy=false;review.live='Extended '+selections.length+' member end'+(selections.length===1?'':'s')+' to support centerlines.';memberEndStatus={known:true,count:memberEndUnresolved(d.report),etag:d.etag,revision:d.storeRevision,scopeSig:memberEndScopeSig(review.scope)};updateMemberEndStatus();panel();undoToast(review.live,()=>undoMemberEndResolution());}catch(e){const said=personErrorText(e,{action:'extend those member ends',unsure:'Check member ends again to see what the model holds now.'});if(memberEndReview===review){review.busy=false;review.live=said;panel();}toast(said);}}
6488
- async function keepMemberEnd(f){if(!memberEndReview||memberEndReview.busy)return;const review=memberEndReview;review.busy=true;panel();try{const d=await memberEndRequest('keep-short',{scope:review.scope,findingId:f.findingId,contextHash:f.contextHash,memberId:f.memberId,end:f.end,reason:'other-reviewed'});installMemberEndContract(d.contract,d.etag,d.storeRevision);if(memberEndReview!==review)return scanMemberEnds(undefined,review.scope);review.report=d.report;review.undoToken=d.undoToken;review.undoDirection='undo';review.selected.delete(memberEndKey(f));review.busy=false;review.live='Kept '+f.memberId+' end '+(f.end+1)+' short.';memberEndStatus={known:true,count:memberEndUnresolved(d.report),etag:d.etag,revision:d.storeRevision,scopeSig:memberEndScopeSig(review.scope)};updateMemberEndStatus();panel();}catch(e){if(memberEndReview===review){review.busy=false;review.live=personErrorText(e,{action:'keep this member end short',unsure:'Check member ends again to see what the model holds now.'});panel();}}}
6489
- async function restoreMemberEnd(f){if(!memberEndReview||memberEndReview.busy)return;const review=memberEndReview;review.busy=true;panel();try{const d=await memberEndRequest('restore',{scope:review.scope,findingId:f.findingId,contextHash:f.contextHash,memberId:f.memberId,end:f.end});installMemberEndContract(d.contract,d.etag,d.storeRevision);if(memberEndReview!==review)return scanMemberEnds(undefined,review.scope);review.report=d.report;review.undoToken=d.undoToken;review.undoDirection='undo';review.busy=false;review.live='Restored the traced endpoint for '+f.memberId+'.';memberEndStatus={known:true,count:memberEndUnresolved(d.report),etag:d.etag,revision:d.storeRevision,scopeSig:memberEndScopeSig(review.scope)};updateMemberEndStatus();panel();}catch(e){if(memberEndReview===review){review.busy=false;review.live=personErrorText(e,{action:'restore the traced endpoint',unsure:'Check member ends again to see what the model holds now.'});panel();}}}
6490
- async function undoMemberEndResolution(){if(!memberEndReview||memberEndReview.busy||!memberEndReview.undoToken)return;const review=memberEndReview,token=review.undoToken;review.busy=true;review.live='Updating member-end history…';panel();try{const d=await memberEndRequest('undo',{token});installMemberEndContract(d.contract,d.etag,d.storeRevision);const next=memberEndHistoryAction(d.direction),completed=d.direction==='redo'?'Undid member-end changes':'Redid member-end changes';review.busy=false;await scanMemberEnds(completed+' · '+next.label+' is available',review.scope);}catch(e){if(memberEndReview===review){review.busy=false;if(e.code==='member-end-undo-unavailable'){review.undoToken=null;review.undoDirection=null;review.live='This history action is no longer available. Check member ends again.';}else review.live='Could not confirm the history action. Check member ends again before retrying.';panel();}toast(personErrorText(e,{action:'update member-end history',unsure:'Check member ends again before retrying.'}));}}
6693
+ const review=memberEndReview;review.busy=true;review.live='Extending selected member ends…';panel();try{const d=await memberEndRequest('apply',{scope:review.scope,selections});installMemberEndContract(d.contract,d.etag,d.storeRevision);if(memberEndReview!==review)return scanMemberEnds(undefined,review.scope);const previousChosen=review.chosen;review.report=d.report;review.undoToken=d.undoToken;review.undoDirection='undo';review.selected.clear();review.chosen=memberEndChoicesForReport(d.report,previousChosen);review.busy=false;review.live='Extended '+selections.length+' member end'+(selections.length===1?'':'s')+' to support centerlines.';memberEndStatus={known:true,count:memberEndUnresolved(d.report),etag:d.etag,revision:d.storeRevision,scopeSig:memberEndScopeSig(review.scope)};updateMemberEndStatus();panel();undoToast(review.live,()=>undoMemberEndResolution());}catch(e){const said=errorText(e,{action:'extend those member ends',unsure:'Check member ends again to see what the model holds now.'});if(memberEndReview===review){review.busy=false;review.live=said;panel();}toast(said);}}
6694
+ async function keepMemberEnd(f){if(!memberEndReview||memberEndReview.busy)return;const review=memberEndReview;review.busy=true;panel();try{const d=await memberEndRequest('keep-short',{scope:review.scope,findingId:f.findingId,contextHash:f.contextHash,memberId:f.memberId,end:f.end,reason:'other-reviewed'});installMemberEndContract(d.contract,d.etag,d.storeRevision);if(memberEndReview!==review)return scanMemberEnds(undefined,review.scope);review.report=d.report;review.undoToken=d.undoToken;review.undoDirection='undo';review.selected.delete(memberEndKey(f));review.busy=false;review.live='Kept '+f.memberId+' end '+(f.end+1)+' short.';memberEndStatus={known:true,count:memberEndUnresolved(d.report),etag:d.etag,revision:d.storeRevision,scopeSig:memberEndScopeSig(review.scope)};updateMemberEndStatus();panel();}catch(e){if(memberEndReview===review){review.busy=false;review.live=errorText(e,{action:'keep this member end short',unsure:'Check member ends again to see what the model holds now.'});panel();}}}
6695
+ async function restoreMemberEnd(f){if(!memberEndReview||memberEndReview.busy)return;const review=memberEndReview;review.busy=true;panel();try{const d=await memberEndRequest('restore',{scope:review.scope,findingId:f.findingId,contextHash:f.contextHash,memberId:f.memberId,end:f.end});installMemberEndContract(d.contract,d.etag,d.storeRevision);if(memberEndReview!==review)return scanMemberEnds(undefined,review.scope);review.report=d.report;review.undoToken=d.undoToken;review.undoDirection='undo';review.busy=false;review.live='Restored the traced endpoint for '+f.memberId+'.';memberEndStatus={known:true,count:memberEndUnresolved(d.report),etag:d.etag,revision:d.storeRevision,scopeSig:memberEndScopeSig(review.scope)};updateMemberEndStatus();panel();}catch(e){if(memberEndReview===review){review.busy=false;review.live=errorText(e,{action:'restore the traced endpoint',unsure:'Check member ends again to see what the model holds now.'});panel();}}}
6696
+ async function undoMemberEndResolution(){if(!memberEndReview||memberEndReview.busy||!memberEndReview.undoToken)return;const review=memberEndReview,token=review.undoToken;review.busy=true;review.live='Updating member-end history…';panel();try{const d=await memberEndRequest('undo',{token});installMemberEndContract(d.contract,d.etag,d.storeRevision);const next=memberEndHistoryAction(d.direction),completed=d.direction==='redo'?'Undid member-end changes':'Redid member-end changes';review.busy=false;await scanMemberEnds(completed+' · '+next.label+' is available',review.scope);}catch(e){if(memberEndReview===review){review.busy=false;if(e.code==='member-end-undo-unavailable'){review.undoToken=null;review.undoDirection=null;review.live='This history action is no longer available. Check member ends again.';}else review.live='Could not confirm the history action. Check member ends again before retrying.';panel();}toast(errorText(e,{action:'update member-end history',unsure:'Check member ends again before retrying.'}));}}
6491
6697
  // Selection is MODEL-WIDE, not per-sheet: the 3D shows every plan, so a pick / box-select / Ctrl-click can
6492
6698
  // span sheets. byId + selArr therefore search ALL plans (not just the active P) so the inspector + edits see
6493
6699
  // the whole selection — else selecting a roof (S-203) member while S-202 is active shows nothing, and a
@@ -7288,7 +7494,7 @@ function commitMemberEndpointsProvider(id,spec,source){
7288
7494
  // A column is stored base→top, and the model refuses one the other way round. Say so here, in words and
7289
7495
  // before the frame policy: dragging a plumb column's top below its base is ALSO a turn end for end, and
7290
7496
  // the column rule is the reason the user can act on.
7291
- if(input.canonical.role==='column'&&from[2]>to[2])return positionRefuse(COLUMN_ORDER_REFUSAL,source);
7497
+ if(input.canonical.role==='column'&&from[2]-to[2]>V2Validation.COLUMN_LEVEL_TOLERANCE_MM)return positionRefuse(COLUMN_ORDER_REFUSAL,source); // the model's own tolerance (#3208)
7292
7498
  // A gesture that moves the line RIGIDLY (the axial slide, and since the redesign the two lateral
7293
7499
  // translates) must merely KEEP partFrame's branch, in both directions; a swing re-aims the member and
7294
7500
  // has to land on the ordinary branch; the end-node drag may not ENTER the plumb cone, nor turn end for
@@ -7601,13 +7807,19 @@ function parseVec(s){s=String(s==null?'':s).trim();if(!s)return null;
7601
7807
  let defaultTosMm=0, addProfile='', addMaterial='', addType='beam'; // addProfile/addMaterial/addType are independent defaults for newly drawn members
7602
7808
  function nativeElevationModel(){return C&&C.type===MODEL_V2_TYPE;}
7603
7809
  function syncElevationContext(){const value=Number(P&&P.default_tos_mm);defaultTosMm=Number.isFinite(value)?value:0;return defaultTosMm;}
7810
+ // The registry's traits for THIS model's standard. An unstated or unregistered one resolves as the
7811
+ // compatibility fallback, exactly as `catalogProviderFor` does on the server. Nothing on this page
7812
+ // compares an environment id: it asks a trait (`web/steel-environments.js`). Declared HERE, ahead of
7813
+ // its first reader, because it is a `const` inside `main()` and `_catalogEnvironment` below runs at once.
7814
+ const _envTraits=()=>SteelEnv.traitsFor(typeof C!=='undefined'&&C?C.environment:undefined);
7815
+
7604
7816
  // THE MODEL'S OWN CATALOGUE NAMES THE EMPTY DESCRIPTOR, not a literal 'US'.
7605
7817
  //
7606
7818
  // When the fetch fails there are no rows either way — but the descriptor's `environment` is what names
7607
7819
  // the standard and picks the MATERIAL catalogue, so a UK project whose fetch failed presented American
7608
7820
  // grades (A992/A36) as if they were its own. An empty picker that says UK is an honest failure; a
7609
7821
  // populated one offering the wrong country's steel is a wrong answer wearing the right chrome.
7610
- const _catalogEnvironment=(typeof C!=='undefined'&&C&&C.environment==='UK')?'UK':'US';
7822
+ const _catalogEnvironment=_envTraits().id;
7611
7823
  const profileCatalog=window.__STEEL_PROFILE_CATALOG||{environment:_catalogEnvironment,standard:'Profile catalog',families:[],rows:[]};
7612
7824
  const profileCatalogRows=CatalogPicker.buildProfileRows(profileCatalog,window.__STEEL_SECTIONS||{},window.__STEEL_WEIGHTS||{});
7613
7825
  const materialCatalog=CatalogPicker.materialCatalogDescriptorFor(profileCatalog.environment||_catalogEnvironment,window.__STEEL_MATERIAL_CATALOG);
@@ -7630,8 +7842,11 @@ function profileCatalogValues(){return profileCatalogRows.flatMap(r=>[r.designat
7630
7842
  // S355J2H is the hot-finished hollow grade, S355 the modern default for open sections (S275 is the
7631
7843
  // legacy grade and is deliberately NOT the default).
7632
7844
  function profileDefaultMaterial(profile){const p=_canonDes(profile);
7633
- if(_modelEnvironment()==='UK')return /^(CHS|SHS|RHS|EHS)/.test(p)?'S355J2H':'S355';
7634
- return /^W\d/.test(p)?'A992':p.startsWith('HSS')?'A500-GR.B':'A36';}
7845
+ return SteelEnv.defaultGradeFor(_envTraits().id,p,_profileCatalogRow(profile));}
7846
+ // How the section was chosen when the drawing did not say (EU `RHS200*100*5` -> cold-formed KK, labelled by the
7847
+ // catalogue payload), or the reader's own account of a route the drawing DID state (`profileBasis`). '' for an
7848
+ // exact catalogue name and for every US/UK designation.
7849
+ function profileBasisText(m){return (m&&m.profileBasis)||(window.__STEEL_ASSUMED||{})[_canonDes(m&&m.profile)]||'';}
7635
7850
  function applyProfileChoice(ids,value){
7636
7851
  const v=_canonDes(value);if(!v)return;
7637
7852
  edit(()=>{for(const id of ids){const m=byId(id);if(m)ModelCmd.patchMember(m,{profile:v,rfi:_wtPlf(v)==null});}if(!profs.includes(v)){profs.push(v);profs.sort(CatalogPicker.naturalProfileCompare);}});
@@ -8801,13 +9016,12 @@ function _profileDimIn(token){
8801
9016
  // `typeof C` rather than a bare `C`: these functions are sliced out of this page by the geometry
8802
9017
  // harnesses, where the contract is not in scope, and a bare reference is a ReferenceError there rather
8803
9018
  // than a falsy read. Absent means the compatibility fallback, exactly as it does on the server.
8804
- const _modelEnvironment=()=>(typeof C!=='undefined'&&C&&C.environment==='UK')?'UK':'US';
8805
- const _doubleAngleScale=()=>_modelEnvironment()==='UK'?1/IN_TO_MM:1;
9019
+ const _doubleAngleScale=()=>_envTraits().designationTokenUnit==='mm'?1/IN_TO_MM:1;
8806
9020
  // The name to CALL the section table when telling a user their designation is not in it. AISC is the
8807
9021
  // American Institute of Steel Construction, so saying "not in the AISC table" to someone modelling in
8808
9022
  // the UK names the wrong standards body about their own steel — and does it in the RFI list, the
8809
9023
  // confidence panel and the footprint tooltip, i.e. everywhere the tool explains a refusal.
8810
- const _catalogLabel=()=>_modelEnvironment()==='UK'?'UK section':'AISC';
9024
+ const _catalogLabel=()=>_envTraits().catalogueNoun;
8811
9025
  function _parseDoubleAngleIn(profile){
8812
9026
  const p=_canonDes(profile);if(!p.startsWith('2L'))return null;
8813
9027
  const orientation=p.endsWith('SLBB')?'slbb':p.endsWith('LLBB')?'llbb':null;
@@ -8853,7 +9067,7 @@ function profileDimsIn(profile){
8853
9067
  // Gated to a metric model deliberately: the US arms below already consult this same table where they
8854
9068
  // should, and reordering them is a behaviour change to shipped US drawing that this slice has twice
8855
9069
  // been caught making by accident.
8856
- if(_modelEnvironment()==='UK'){
9070
+ if(!_envTraits().aiscInchTable){
8857
9071
  // A SHAPE THE CATALOGUE REFUSES IS REFUSED HERE TOO. An elliptical hollow section (EHS) is marked
8858
9072
  // geometrySupported:false and the server answers 'unsupported-custom' with no drawable geometry —
8859
9073
  // but its row still carries a depth and a width, so falling through to the raw table below drew all
@@ -9888,6 +10102,26 @@ function updGridToggle(){const b=document.getElementById('gridToggleB');if(!b)re
9888
10102
  // other grid operation.
9889
10103
  function gridSetVisible(on){if(!C||!gridOf()||on===gridOn())return;
9890
10104
  editGrid(()=>{ModelCmd.patchGrid(gridOf(),{on:!!on});});updGridToggle();refresh3DGrid();if(view3dShown)build3DLegend();} // a list drawn for 3D must reflect the grid change; the 2D list's key tracks the grid, so render() rebuilds that one
10105
+ // #3214 — the grid's levels in the 3D Objects list: one row per level, writing the same `hidden_z` the Grid lines…
10106
+ // panel ticks, named as the 3D tag names them. A level is SHOWN when the grid is on and the level is not hidden, so
10107
+ // a box never claims a level the model is not drawing. Fewer than two levels lists none: "Grid lines" says it all.
10108
+ function gridLegendLevels(){const gc=GC(),g=gridOf();if(!gc||!g||!GridDisplay)return[];
10109
+ const parsed=GridDisplay.readStoredLevels(g);if(parsed.err||parsed.levels.length<2)return[];
10110
+ const units=displayUnits(),hidden=new Set(gc.normalizeHiddenLevels(g.hidden_z,parsed.levels).map(gc.gridLevelKey));
10111
+ return parsed.levels.map(lv=>{const key=gc.gridLevelKey(lv.mm),name=GridDisplay.levelDisplayName(lv,units);
10112
+ return {mm:lv.mm,key,name,instance:name+' at '+GridDisplay.elevationText(lv.mm,units),hidden:hidden.has(key),shown:gridOn()&&!hidden.has(key)};});}
10113
+ function gridLegendState(levels){const n=levels.filter(l=>l.shown).length;return n===0?'off':(n===levels.length?'on':'mixed');}
10114
+ // One undoable edit, then the same repaint gridSetVisible does.
10115
+ function gridLegendPatch(patch){if(!C||!gridOf())return;editGrid(()=>{ModelCmd.patchGrid(gridOf(),patch);});updGridToggle();refresh3DGrid();if(view3dShown)build3DLegend();}
10116
+ // The whole grid on or off, and the level boxes choose WHICH levels: switching off writes only `on`, so switching on
10117
+ // again brings the same levels back. With no level chosen there is nothing to bring back, so on shows every level.
10118
+ function gridLegendToggleAll(levels){
10119
+ if(!levels.some(l=>!l.hidden)){gridLegendPatch({on:true,hidden_z:undefined});return;}
10120
+ gridLegendPatch({on:!gridOn()});}
10121
+ // One level. With the grid off, its box turns the grid on with just this level, so the click does what the box says.
10122
+ function gridLegendToggleLevel(lv,levels){
10123
+ if(!gridOn()){const others=levels.filter(l=>l.key!==lv.key).map(l=>l.mm);gridLegendPatch({on:true,hidden_z:others.length?others:undefined});return;}
10124
+ const hidden=levels.filter(l=>l.key===lv.key?!l.hidden:l.hidden).map(l=>l.mm);gridLegendPatch({hidden_z:hidden.length?hidden:undefined});}
9891
10125
  document.addEventListener('gridcore-ready',()=>{try{if(C)render();}catch(_){}}); // module shim finished after boot → paint the grid layer
9892
10126
  function reflectTakeoverButtons(){for(const [id,on] of [['gridEditB',gridMode],['dimStyleB',dimStyleMode],['csSetB',csaxisMode]]){const b=document.getElementById(id);if(b){b.classList.toggle('on',!!on);b.setAttribute('aria-pressed',String(!!on));}}}
9893
10127
  function setGridMode(on){if(!C)return;if(on&&!gridMode&&!memberEndYieldPanel('Grid lines',()=>{setGridMode(true);render();},'gridEditB'))return; // the member-end review gives way first, or asks (#1412)
@@ -12263,6 +12497,10 @@ function refusedSheetPropsHtml(rows){
12263
12497
  out+=kv('ID',esc(idText(m)));
12264
12498
  out+=kv('Mark',markHtml(m.id));
12265
12499
  out+=kv('Profile',esc(m.profile||'—'));
12500
+ // How the section was chosen, when the drawing did not say (EU `RHS200*100*5` -> cold-formed KK, labelled), or the
12501
+ // reader's own account of a route the drawing DID state. Nothing for an exact catalogue name.
12502
+ {const basis=profileBasisText(m);
12503
+ if(basis)out+=kv('Section basis',esc(basis));}
12266
12504
  out+=kv('Material',m.material?esc(m.material):esc(profileDefaultMaterial(m.profile))+' <span style="color:var(--mut);font-size:11px">· profile default</span>');
12267
12505
  const withheld=[];
12268
12506
  for(const def of PROP_DEFS){
@@ -13217,6 +13455,7 @@ function panel(){
13217
13455
  ${typeFilterHTML(arr)}
13218
13456
  ${memberTypeField('mTypeS',[m])}
13219
13457
  <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>
13458
+ ${profileBasisText(m)?`<div class="row hint" id=profileBasis role=note>Section basis: ${esc(profileBasisText(m))}</div>`:''}
13220
13459
  <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>
13221
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>
13222
13461
  <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>
@@ -15688,10 +15927,9 @@ function syncEnvChip(){
15688
15927
  const b=document.createElement('b');
15689
15928
  b.textContent=label;
15690
15929
  chip.append(b);
15691
- chip.setAttribute('data-tip',stated==='UK'
15692
- ?'This model resolves every section against the UK catalogue (BS EN sections, S355 default grade). Chosen when the project was created and fixed for its life.'
15693
- :stated==='US'
15694
- ?'This model resolves every section against the US catalogue (AISC sections, A992/A36 default grade). Chosen when the project was created and fixed for its life.'
15930
+ const _statedTraits=SteelEnv.traitsOf(stated);
15931
+ chip.setAttribute('data-tip',_statedTraits
15932
+ ?_statedTraits.chipTip
15695
15933
  // Two different sentences for the two unstated cases, because only one of them is a gap. Telling
15696
15934
  // someone on a projectless surface that "projects created since this setting existed state one
15697
15935
  // explicitly" is advice about something they cannot do from here.
@@ -16565,10 +16803,11 @@ function applyConnectionBakeTruth(j,announce=true){
16565
16803
  }
16566
16804
  async function fetchScenePayload(contract=C){
16567
16805
  const r=await fetch('/api/contract/'+encodeURIComponent(APP_ID)+'/scene'+PROJECT_QS,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({contract})});
16568
- // #3097: what this throws can reach a toast ("Could not open 3D view: …"). The server's own sentence is marked as
16569
- // one; an unreadable body or a refusal with nothing said keeps its facts (status, body) for the shared sentence.
16806
+ // #3097: what this throws can reach a toast ("Could not open 3D view: …"). It carries the reply (status, body), and
16807
+ // the sentence is read from that reply (threeDOpenFailureText), so the message here is for the console only. 3b: not
16808
+ // marked `forPerson`, because a server's `error` is not a sentence this page wrote (it may be `diagnostic`).
16570
16809
  let j;try{j=await r.json();}catch(e){throw Object.assign(new Error('the scene reply was not readable JSON'),{status:r.status,body:{code:'response-unreadable'},cause:e});}
16571
- if(!j||!j.ok){const said=j&&typeof j.error==='string'&&j.error.trim();throw Object.assign(new Error(said||'scene render failed'),{status:r.status,body:j,forPerson:!!said});}
16810
+ if(!j||!j.ok)throw Object.assign(new Error('the scene render was refused'),{status:r.status,body:j&&typeof j==='object'?j:{}});
16572
16811
  return j;
16573
16812
  }
16574
16813
  function connectionTruthRequest(){
@@ -17647,7 +17886,7 @@ async function placeConnection(jointId,memberIds,skipped,token){
17647
17886
  // 428 is the client failing to send a precondition, which is a FloLess bug, not something the user
17648
17887
  // can act on — never show its header vocabulary. "Place it again" IS now a real action (the
17649
17888
  // inspector's Place again…), so the sentence names the recovery instead of stopping at the fault.
17650
- const why=(res.status===428||!d.error)?'what it joins could not be recorded':String(d.error);
17889
+ const why=(res.status!==428&&personText(d))||'what it joins could not be recorded';
17651
17890
  toast('“'+name+'” is placed — '+why+', so it is not being watched. Use Place again… to start watching it.');
17652
17891
  return false;
17653
17892
  }
@@ -17746,9 +17985,10 @@ function reviewVerbFailed(e,fallback){
17746
17985
  if(e&&e.status===409){toast('Someone else already reviewed this connection — its status just updated');markReviewDirty({storeRevision:reviewAt.storeRevision,reviewRevision:reviewAt.reviewRevision+1});return;}
17747
17986
  /* The server's own 4xx prose is written FOR the user and names what to do; anything else — a transport
17748
17987
  failure, a 5xx behind an HTML error page — is not, so the caller's sentence wins, because it is the
17749
- only one that names the connection. */
17750
- const speakable=e&&!e.transport&&e.status>=400&&e.status<500&&e.authored!==false&&e.message;
17751
- if(speakable){toast(String(e.message));return;}
17988
+ only one that names the connection. #3097 3b: the prose is read again from the reply (personText), never from
17989
+ the error's message, so a refusal the server marked `diagnostic` is not spoken. */
17990
+ const speakable=e&&!e.transport&&e.status>=400&&e.status<500&&personText(e.body);
17991
+ if(speakable){toast(speakable);return;}
17752
17992
  /* #3097: the why and the next step come from the shared sentence, after the caller's own words (which name the
17753
17993
  connection). A review change whose answer was lost or unexplained may have landed, so it is never told to "try
17754
17994
  again" blindly: the review status refreshes on its own and shows what the server holds. */
@@ -17919,7 +18159,7 @@ async function replaceConnectionAt(jointId,pick){
17919
18159
  captured above is detached, and mutating it would move nothing while the toast claimed it had.
17920
18160
  Cheap, and the alternative is a lie about geometry. (Codex code review.) */
17921
18161
  const live=(Array.isArray(C.joints)?C.joints:[]).find(j=>j&&j.id===jointId);
17922
- if(!live||live.kind!=='custom')throw new Error('the connection is no longer in this model');
18162
+ if(!live||live.kind!=='custom')throw Object.assign(new Error('The connection is no longer in this model; it may have been removed in another window.'),{forPerson:true});
17923
18163
  mutated=true; // only now may C move
17924
18164
  /* `edit()` SOFT-FAILS: a V2CommandError is caught, toasted, and reported by a `false` RETURN rather
17925
18165
  than a throw. Discarding that return was the one hole in the no-rollback argument — the
@@ -17944,7 +18184,9 @@ async function replaceConnectionAt(jointId,pick){
17944
18184
  console.warn('steel-editor: re-placement failed',e);
17945
18185
  toast(mutated
17946
18186
  ? '“'+name+'” was moved but is no longer being watched — use Place again… to start watching it'
17947
- : '“'+name+'” was not moved — '+((e&&e.message)?String(e.message):'the model could not be saved first'));
18187
+ /* #3097 3b: nothing moved yet, so the save before it, the untrack or the check above is what failed. Its
18188
+ sentence is the server's, the page's own (`forPerson`) or the shared one, never the thrown text. */
18189
+ : '“'+name+'” was not moved. '+sentenceCase(errorText(e,{action:'move it',retrySafe:true})));
17948
18190
  }finally{
17949
18191
  /* THE SINGLE MOST IMPORTANT ASSERTION IN THIS FEATURE. A leaked gate disables saving for the rest of
17950
18192
  the session, which is worse than the bug the gate fixes - so it is released on every path,
@@ -18021,7 +18263,7 @@ function legendMembers(){return legendView()==='3d'?allMembers():(P.members||[])
18021
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()];}
18022
18264
  // What the 2D list is drawn from, so render() rebuilds it only when that changed (a sheet switch, an edit, a toggle).
18023
18265
  let legendShownKey='';
18024
- function legendKey(){return legendView()==='3d'?'3d':['2d',viewIdOf(P),planGroups().map(g=>g.key+':'+g.color+':'+categoryOfProfile(g.key)).join(','),(P.dims||[]).length,dimsVisible,!!gridOf(),gridOf()?gridOn():''].join('|');}
18266
+ 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('|');}
18025
18267
  function syncLegendToPane(){if(legendTab!=='objects'||!C||!P)return;if(legendKey()!==legendShownKey)build3DLegend();else refreshLegendSel();}
18026
18268
  // Explorer-style multi-isolate on dbl-click of a legend group row: plain = isolate just this group; Ctrl = toggle
18027
18269
  // it in/out of the isolated set; Shift = the contiguous range from the anchor row to this one (in displayed order).
@@ -18110,12 +18352,16 @@ function memberTypeSettled(m,k){
18110
18352
  ?!!b&&b.type===p.brace.type&&b.floor===p.brace.floor&&b.offset===p.brace.offset&&b.lowerEnd===p.brace.lowerEnd
18111
18353
  :b===undefined);
18112
18354
  }
18113
- function applyMemberType(ms,k){
18355
+ // `write` is how the patch reaches the model. The default, ModelCmd.patchMember, sends a drawn row to the command session
18356
+ // through its link and patches an object with no link (a member not yet added) in place, so a stored member must not go
18357
+ // through it. A custom write returns false when the model refused the patch; that member keeps its type and connections.
18358
+ // Returns the connections notice it showed (or ''), so a caller that toasts after it can say it too.
18359
+ function applyMemberType(ms,k,write=ModelCmd.patchMember){
18114
18360
  let dropped=0,unsupported=0;
18115
18361
  for(const m of ms){if(!m)continue;
18116
18362
  const wasBrace=isBrace(m);
18117
18363
  const patch=memberTypePatch(m,k),type=patch.memberType;
18118
- ModelCmd.patchMember(m,patch);
18364
+ if(write(m,patch)===false)continue;
18119
18365
  // Becoming a brace ORPHANS any connection hanging off this member: the bake (steel-joints.expandJoints)
18120
18366
  // refuses a brace `main`, so the joint would linger in C.joints, never render, and vanish from 3D with no
18121
18367
  // explanation. Purge it here and say so, rather than leave a recipe that can never bake. (silent-failure review)
@@ -18129,8 +18375,10 @@ function applyMemberType(ms,k){
18129
18375
  j.secondaries=j.secondaries.filter(s=>s!==m.id);unsupported++;}
18130
18376
  }
18131
18377
  }
18132
- if(dropped||unsupported)toast([dropped?dropped+' connection'+(dropped>1?'s':'')+' removed':'',
18133
- unsupported?unsupported+' connection'+(unsupported>1?'s':'')+' lost its support':''].filter(Boolean).join(' · ')+' — a brace can’t carry or support one');
18378
+ const notice=dropped||unsupported?[dropped?dropped+' connection'+(dropped>1?'s':'')+' removed':'',
18379
+ unsupported?unsupported+' connection'+(unsupported>1?'s':'')+' lost its support':''].filter(Boolean).join(' · ')+' — a brace can’t carry or support one':'';
18380
+ if(notice)toast(notice);
18381
+ return notice;
18134
18382
  }
18135
18383
  function memberTypeValueFor(ms){const vals=ms.map(memberTypeOf),one=vals.every(v=>v===vals[0]);return one?memberTypeLabel(vals[0]):'';}
18136
18384
  function memberTypeField(id,ms){
@@ -18182,8 +18430,24 @@ function wireTypeFilter(p){
18182
18430
  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).
18183
18431
  });
18184
18432
  }
18185
- function profileKeyOf(m){return canonProfile(m&&m.profile);} // matches the scene group key (contract-to-scene canonProfile)
18186
- function categoryOfProfile(profKey){for(const m of (P.members||[]))if(profileKeyOf(m)===profKey)return memberTypeOf(m);return 'beam';} // a profile-group's category = the type of its member(s)
18433
+ function profileKeyOf(m){return canonProfile(m&&m.profile);} // the spelling the member carries (UC305X97): the plan's own group key (planGroups)
18434
+ // 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
+ // catalogue's name for the section (UC305*305*97, #2877) while the member carries the drawing's spelling (UC305X97),
18436
+ // so a 3D row is matched to its members through the scene itself. A member the scene did not draw keeps its own spelling,
18437
+ // as every member did before #2877: it sits in a row only where that spelling is also the scene's key. In 2D the rows
18438
+ // are the plan's own (planGroups). One key on both sides is what lets a row select its members, Follow selection
18439
+ // find a member's row, and By type put a profile under its members' type.
18440
+ function legendKeyOf(m){if(legendView()==='3d'){const el=m&&partsById[m.id];if(el&&el.group)return el.group;}return profileKeyOf(m);}
18441
+ // A profile-group's category is the type its members share, or MIXED_TYPES when they differ (#3208): filing a row by its
18442
+ // first member's type claimed a retype that had only partly happened. The key has a colon, which normMemberTypeKey never
18443
+ // produces, so no custom type can share it. ponytail: a full pass over the members per call, made per row on every build
18444
+ // and every 2D render() (legendKey), and per selected member (Follow selection); index member types by row key once per
18445
+ // model change if rows × members ever shows in a profile.
18446
+ const MIXED_TYPES=':mixed';
18447
+ function categoryOfProfile(profKey){let t=null;for(const m of legendMembers())if(legendKeyOf(m)===profKey){const k=memberTypeOf(m);if(t===null)t=k;else if(k!==t)return MIXED_TYPES;}return t||'beam';}
18448
+ // "Column 6 · Beam 2": how a mixed row's members split, most first.
18449
+ function memberTypeSplit(profKey){const n=new Map();for(const m of legendMembers())if(legendKeyOf(m)===profKey){const k=memberTypeOf(m);n.set(k,(n.get(k)||0)+1);}
18450
+ return [...n].sort((a,b)=>b[1]-a[1]).map(([k,c])=>memberTypeLabel(k)+' '+c).join(' · ');}
18187
18451
  let legendMode=(localStorage.getItem('floless.legendMode')==='type')?'type':'profile';
18188
18452
  // Built on OPEN, not once: profiles come and go as the model is edited. It lives at page scope rather
18189
18453
  // than inside wire3DBar() because building the swatch list needs the MODEL, not the 3D view, so the
@@ -18249,9 +18513,9 @@ let legendMode=(localStorage.getItem('floless.legendMode')==='type')?'type':'pro
18249
18513
  let collapsedCats=new Set((()=>{try{return JSON.parse(localStorage.getItem('floless.legendCollapsed')||'[]');}catch{return [];}})());
18250
18514
  let legendQuery=''; // transient objects-list search filter (members + connections only) — NOT persisted
18251
18515
  let legendIdHits=[]; // #2998: the member ids the current search matched by id (applyLegendFilter); one → Enter selects it
18252
- // While a search is active, object categories (member types + connections) render EXPANDED so a match inside a
18516
+ // While a search is active, object categories (member types, Mixed types, connections, placed details) render EXPANDED so a match inside a
18253
18517
  // manually-collapsed category still surfaces — WITHOUT mutating the persisted collapsedCats.
18254
- function catForceOpen(cat){return !!legendQuery&&(cat==='placed-details'||memberTypeRecords().some(t=>t.k===cat)||/^conn-/.test(cat));}
18518
+ function catForceOpen(cat){return !!legendQuery&&(cat==='placed-details'||cat===MIXED_TYPES||memberTypeRecords().some(t=>t.k===cat)||/^conn-/.test(cat));}
18255
18519
  function saveLegendPrefs(){try{localStorage.setItem('floless.legendMode',legendMode);localStorage.setItem('floless.legendCollapsed',JSON.stringify([...collapsedCats]));}catch{}}
18256
18520
  // Drag a typed member row onto another type category to retype it. Pointer Events (NOT the HTML5 drag API,
18257
18521
  // which paints a white browser ghost on Windows). A 6px threshold tells a drag from the row's click(hide) /
@@ -18264,7 +18528,8 @@ function wireRowDrag(row,g){const handle=row.querySelector('.drag-handle');if(!h
18264
18528
  if(!started){if(Math.hypot(ev.clientX-sx,ev.clientY-sy)<6)return;started=true;row._dragging=true;clearTimeout(leg3dClickT); // crossed the threshold → it's a drag, not a click
18265
18529
  ghost=document.createElement('div');ghost.className='leg-drag-ghost';const sw=document.createElement('span');sw.className='lsw';sw.style.background=g.color;ghost.append(sw,document.createTextNode(g.label));doc.body.appendChild(ghost);}
18266
18530
  ghost.style.transform=`translate(${ev.clientX+12}px,${ev.clientY-14}px)`;
18267
- const elp=doc.elementFromPoint(ev.clientX,ev.clientY);const hdr=elp&&elp.closest?elp.closest('#m3dLegend .cat-hdr'):null;
18531
+ const elp=doc.elementFromPoint(ev.clientX,ev.clientY);let hdr=elp&&elp.closest?elp.closest('#m3dLegend .cat-hdr'):null;
18532
+ if(hdr&&hdr.dataset.cat===MIXED_TYPES)hdr=null; // Mixed types is not a type to drop onto
18268
18533
  if(hdr!==target){if(target)target.classList.remove('drop-target');target=hdr;if(target)target.classList.add('drop-target');}};
18269
18534
  const up=()=>{doc.removeEventListener('pointermove',move);doc.removeEventListener('pointerup',up);
18270
18535
  if(ghost)ghost.remove();if(target)target.classList.remove('drop-target');
@@ -18272,11 +18537,46 @@ function wireRowDrag(row,g){const handle=row.querySelector('.drag-handle');if(!h
18272
18537
  if(drop)retypeProfile(g.key,drop);};
18273
18538
  doc.addEventListener('pointermove',move);doc.addEventListener('pointerup',up);});}
18274
18539
  // Retype every member of a profile-group to `cat` (undoable); the legend re-categorises on rebuild + flashes the moved row.
18540
+ // The row's members are found the list's way (in 3D the model's own members, by the scene's group) and every one is written
18541
+ // through the command session by its id, so the model validates each change. That includes members no plan draws (read
18542
+ // only from an elevation, #3208): writing through the drawn rows, as the Properties type field does, left those on their
18543
+ // old type while the row filed under the new one. Owner ruling 2026-11-06: member by member — what the model accepts
18544
+ // changes, what it refuses keeps its type and is named, and one undo reverts the drop. Only members not already settled
18545
+ // as that type are written: a settled member's write changes nothing, so it must not turn a drop the model refused into
18546
+ // an undo step and a success flash. When it refuses every write, nothing changed, so edit() puts the model back and
18547
+ // leaves no undo step.
18275
18548
  function retypeProfile(profKey,cat){if(!memberTypeKnown(cat))return;
18276
- const targets=(P.members||[]).filter(m=>profileKeyOf(m)===profKey);
18277
- if(!targets.length||targets.every(m=>memberTypeOf(m)===cat))return; // already that type → no-op (no empty undo step)
18278
- edit(()=>applyMemberType(targets,cat));
18279
- setTimeout(()=>{const r=[...legendBody('root').querySelectorAll('#m3dLegend .lrow[data-key]')].find(r=>r.dataset.key===profKey);if(r){r.classList.add('flash');setTimeout(()=>r.classList.remove('flash'),400);}},250);}
18549
+ const targets=legendMembers().filter(m=>legendKeyOf(m)===profKey),toWrite=targets.filter(m=>!memberTypeSettled(m,cat));
18550
+ if(!toWrite.length)return; // already that type → no-op (no empty undo step)
18551
+ const refused=[];
18552
+ const write=(m,patch)=>{try{V2_SESSION.patchMember(m.id,patch);return true;}catch(err){if(!err||err.name!=='V2CommandError')throw err;refused.push({id:String(m.id),err});return false;}};
18553
+ let notice='';
18554
+ const ok=edit(()=>{notice=applyMemberType(toWrite,cat,write);if(refused.length===toWrite.length)throw refused[0].err;});
18555
+ // After edit(), so it replaces edit()'s own refusal line and applyMemberType's connections notice (which it repeats); held,
18556
+ // so the build status the next bake shows does not replace it. The reasons go to the console for the terminal AI.
18557
+ if(refused.length){for(const r of refused)console.warn('steel: retype refused',r.id,r.err.code,r.err.message,r.err.details);
18558
+ // The members that kept their type are selected, so all of them can be seen in 3D and in Properties however many there are.
18559
+ legendSelecting=true;try{clearWholeReferenceSelection();modelSelection.replaceMembers(refused.map(r=>r.id));modelSelection.clearGrids();selDimIds.clear();sel3dDimIds.clear();legendSelAnchor=null;render();}finally{legendSelecting=false;}
18560
+ answerToast(retypeRefusalText(refused,targets.length,cat)+(notice?' '+notice+'.':''));}
18561
+ if(!ok)return; // nothing moved: no flash on a row that stayed where it was
18562
+ // The row may land under a collapsed header (the type it was dropped on, or Mixed types after a partial drop): open it,
18563
+ // as Follow selection does, so the row is there to see rather than gone.
18564
+ if(collapsedCats.delete(categoryOfProfile(profKey))){saveLegendPrefs();build3DLegend();}
18565
+ setTimeout(()=>{const r=[...legendBody('root').querySelectorAll('#m3dLegend .lrow[data-key]')].find(r=>r.dataset.key===profKey);if(r){r.scrollIntoView({block:'nearest'});r.classList.add('flash');setTimeout(()=>r.classList.remove('flash'),400);}},250);}
18566
+ // What a drop left, which members kept their type and why (up to five named per reason; all of them selected). Each refusal is worded by its reason:
18567
+ // the column rule (a member stored running downward from its start cannot be a column) in words a detailer can act on,
18568
+ // any other as a check only the terminal AI can look into.
18569
+ function retypeRefusalText(refused,total,cat){
18570
+ const reasonOf=err=>err.code==='model-invalid'&&V2Validation.onlyColumnEndpointOrder(err.details)?'order':'other';
18571
+ const why={
18572
+ order:one=>'a column is stored bottom end first, and '+(one?'it runs':'they run')+' downward from '+(one?'its':'their')+' start. Ask your terminal AI to reverse '+(one?'it':'them')+', then drag the row again.',
18573
+ other:one=>'the model’s checks refused that type for '+(one?'it':'them')+'. Ask your terminal AI to look at '+(one?'it':'them')+'.'};
18574
+ const groups=new Map();for(const r of refused){const k=reasonOf(r.err);if(!groups.has(k))groups.set(k,[]);groups.get(k).push(r.id);}
18575
+ const list=ids=>ids.length===1?ids[0]:ids.length>6?ids.slice(0,5).join(', ')+' and '+(ids.length-5)+' more':ids.slice(0,-1).join(', ')+' and '+ids[ids.length-1]; // bounded: they are selected too
18576
+ const done=total-refused.length;
18577
+ return [done?done+' of '+total+' members are '+memberTypeLabel(cat)+'.':'',
18578
+ ...[...groups].map(([k,ids])=>list(ids)+' kept '+(ids.length===1?'its':'their')+' type: '+why[k](ids.length===1)),
18579
+ refused.length===1?'It is selected.':'They are selected.'].filter(Boolean).join(' ');}
18280
18580
  // ════════════════════════════════════════════════════════════════════════════════════════════════════════════
18281
18581
  // Panel tabs (Objects | Views | Favourites | References) + the Views Organizer.
18282
18582
  // #m3dLegend holds the four tab bodies the main window shows as panel tabs of its left Model section; only the
@@ -21084,7 +21384,7 @@ async function refRemove(r){
21084
21384
  const mid=newMutationId();claimMutation(mid);
21085
21385
  const res=await fetch(refApi('/'+encodeURIComponent(r.id)),{method:'DELETE',headers:{'x-floless-mutation-id':mid}});
21086
21386
  const d=await res.json().catch(()=>({}));
21087
- if(!res.ok||!d.ok){toast(d.error||'Could not remove that reference');return;}
21387
+ if(!res.ok||!d.ok){toast(refusalText(d,'Could not remove that reference.',{action:'remove that reference'}));return;}
21088
21388
  adoptReferenceWrite(d.etag);
21089
21389
  const i=refList().findIndex(x=>x&&x.id===r.id);if(i>=0)C.reference_models.splice(i,1);
21090
21390
  refGeom.delete(r.id);refRenderedGeom.delete(r.id);refUnresolved.delete(r.id);refFailed.delete(r.id);refEmpty.delete(r.id);
@@ -21437,7 +21737,7 @@ const RI_MAX_BYTES=150*1024*1024;
21437
21737
  // early. File A's storeys would then ride file B's sha, and the reader would select nothing.
21438
21738
  riProbeRows=null;riStoreyPick=null;riTypePick=null;riPopulation=null;
21439
21739
  riClearSoft();
21440
- if(!res.ok||!d.ok){riStage('drop');riErr(d.error||'Could not read that file.');return;}
21740
+ if(!res.ok||!d.ok){riStage('drop');riErr(refusalText(d,'Could not read that file.',{action:'read that file'}));return;}
21441
21741
  riSha=d.sha;riVerdict=d.verdict||null;
21442
21742
  {const bb=d.probe&&d.probe.bbox;riProbeCentre=bb?[0,1,2].map(i=>(bb.min[i]+bb.max[i])/2):null;}
21443
21743
  const said=d.probe&&d.probe.units&&d.probe.units.declared;
@@ -21547,7 +21847,9 @@ const RI_MAX_BYTES=150*1024*1024;
21547
21847
  }
21548
21848
  riClearSoft();
21549
21849
  if(!res.ok||!d.ok){
21550
- if(riBackgrounded)toast('Reference import failed — '+(d.error||'the model could not be added.'));
21850
+ // #3097 3b: the server's sentence only when it wrote one for the person, never a `diagnostic` error.
21851
+ const said=refusalText(d,'',{action:'add that reference'});
21852
+ if(riBackgrounded)toast('Reference import failed — '+(said||'the model could not be added.'));
21551
21853
  // STAY ON CONFIRM for the refusals the picker itself can fix. `riStage('drop')` swaps the whole
21552
21854
  // body back to the dropzone, so telling somebody to "choose fewer storeys or types" would
21553
21855
  // remove every control that lets them. The other failures still go back — there is nothing to
@@ -21558,8 +21860,8 @@ const RI_MAX_BYTES=150*1024*1024;
21558
21860
  ||d.code==='reference-empty-filter'||d.code==='reference-filter-unconfirmed';
21559
21861
  if(actionable&&riStageNow!=='drop'){
21560
21862
  riStage('confirm');
21561
- const e=ri$('riConfirmErr');e.textContent=d.error||'Could not add that reference.';e.style.display='block';
21562
- }else{riStage('drop');riErr(d.error||'Could not add that reference.');}
21863
+ const e=ri$('riConfirmErr');e.textContent=said||'Could not add that reference.';e.style.display='block';
21864
+ }else{riStage('drop');riErr(said||'Could not add that reference.');}
21563
21865
  return;
21564
21866
  }
21565
21867
  adoptReferenceWrite(d.etag);
@@ -21947,11 +22249,11 @@ const RI_MAX_BYTES=150*1024*1024;
21947
22249
  // A REFUSAL PAINTED INTO A HIDDEN PANEL IS A REFUSAL NOBODY READ. Backgrounded, this modal is
21948
22250
  // `display:none`, so the note below would render perfectly and silently.
21949
22251
  if(rvBackgrounded){
21950
- toast('Could not go back to version '+row.n+' of “'+r.name+'” — '+((d&&d.error)||'FloLess could not re-read it.'));
22252
+ toast('Could not go back to version '+row.n+' of “'+r.name+'” — '+refusalText(d,'FloLess could not re-read it.',{action:'go back to that version'}));
21951
22253
  rv$('refVersionModal').style.display='flex';rvBackgrounded=false;
21952
22254
  }
21953
22255
  rvhPaint();rvStage('history');
21954
- rvhNote((d&&d.error)||'FloLess could not go back to that version.');
22256
+ rvhNote(refusalText(d,'FloLess could not go back to that version.',{action:'go back to that version'}));
21955
22257
  return;
21956
22258
  }
21957
22259
  }catch(e){
@@ -22198,7 +22500,7 @@ const RI_MAX_BYTES=150*1024*1024;
22198
22500
  const d=await res.json().catch(()=>({}));
22199
22501
  if(mine!==rvRun)return;
22200
22502
  rvClearSoft();
22201
- if(!res.ok||!d.ok){rvStage('drop');rvErr(d.error||'Could not read that file.');return;}
22503
+ if(!res.ok||!d.ok){rvStage('drop');rvErr(refusalText(d,'Could not read that file.',{action:'read that file'}));return;}
22202
22504
  rvSha=d.sha;
22203
22505
  rvSubmit(mine);
22204
22506
  }catch(e){
@@ -22262,7 +22564,7 @@ const RI_MAX_BYTES=150*1024*1024;
22262
22564
  // display:none — so the state below would render perfectly and silently. Say it out loud and
22263
22565
  // bring the panel back, which is where its remedies live (choose another file, load unfiltered).
22264
22566
  if(rvBackgrounded){
22265
- toast('Could not load a new version of “'+r.name+'” — '+((d&&d.error)||'the comparison could not be made.'));
22567
+ toast('Could not load a new version of “'+r.name+'” — '+refusalText(d,'the comparison could not be made.',{action:'load the new version'}));
22266
22568
  rv$('refVersionModal').style.display='flex';rvBackgrounded=false;
22267
22569
  }
22268
22570
  rvRefusal(d,res.status);return;
@@ -22393,7 +22695,7 @@ const RI_MAX_BYTES=150*1024*1024;
22393
22695
  // dropped, so a read-only comparison gets only the one that applies. THERE IS NO FOURTH.
22394
22696
  actions=readOnly?[{id:'cancel',label:'Close',weight:'primary'}]:core.REFUSAL_ACTIONS;
22395
22697
  }else{
22396
- lead.textContent=(d&&d.error)||'Could not load a new version of this reference.';
22698
+ lead.textContent=refusalText(d,'Could not load a new version of this reference.',{action:'load a new version of this reference'});
22397
22699
  host.appendChild(lead);
22398
22700
  if(code==='reference-filter-unmatched'){
22399
22701
  actions=[{id:'cancel',label:'Cancel',weight:'ghost'},
@@ -22510,7 +22812,7 @@ const RI_MAX_BYTES=150*1024*1024;
22510
22812
  d=await res.json().catch(()=>({}));
22511
22813
  if(mine!==rvRun){releaseMutation(mid);return;}
22512
22814
  rvClearSoft();
22513
- if(!res.ok||!d.ok){releaseMutation(mid);rvStage('drop');rvErr(d.error||'Could not add that reference.');return;}
22815
+ if(!res.ok||!d.ok){releaseMutation(mid);rvStage('drop');rvErr(refusalText(d,'Could not add that reference.',{action:'add that reference'}));return;}
22514
22816
  }catch(e){
22515
22817
  if(mine!==rvRun||(e&&e.name==='AbortError')){if(mid)releaseMutation(mid);return;}
22516
22818
  if(mid)releaseMutation(mid);
@@ -22954,7 +23256,7 @@ const RI_MAX_BYTES=150*1024*1024;
22954
23256
  if(mine!==rcGhostRun)return;
22955
23257
  if(!res.ok||!d.ok){
22956
23258
  rcGhostGaveUp(ids,RC_GHOST_FATAL.has(d&&d.code),
22957
- (d&&d.error)||'The removed objects could not be drawn where they used to be — the list below still stands.');
23259
+ refusalText(d,'The removed objects could not be drawn where they used to be — the list below still stands.',{action:'draw the removed objects',retrySafe:true}));
22958
23260
  return;
22959
23261
  }
22960
23262
  const v=window.Steel3DView;
@@ -23215,15 +23517,17 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23215
23517
  // which row had focus and restore it at the end - ONLY if focus was already in this list, because
23216
23518
  // build3DLegend also runs on tab switches and model loads, where grabbing focus would yank the caret
23217
23519
  // out of whatever the user is actually using.
23218
- const legendRowId=r=>r?(r.dataset.key||r.dataset.connkey||r.dataset.dim||r.getAttribute('aria-label')||''):'';
23520
+ const legendRowId=r=>r?(r.dataset.key||r.dataset.connkey||r.dataset.dim||(r.dataset.gridz&&'gridz:'+r.dataset.gridz)||r.getAttribute('aria-label')||''):'';
23219
23521
  const refocus=(()=>{const a=host.ownerDocument.activeElement;return a&&host.contains(a)&&a.closest?legendRowId(a.closest('.lrow')):'';})();
23522
+ // …and a group header or its box (#3208: Instructor focuses them, and Enter / Space on one rebuilds the list).
23523
+ const refocusHdr=(()=>{const a=host.ownerDocument.activeElement,h=a&&host.contains(a)&&a.closest?a.closest('.cat-hdr'):null;return h?{cat:h.dataset.cat,box:!!(a.classList&&a.classList.contains('cat-tog'))}:null;})();
23220
23524
  const groups=in3d?window.Steel3DView.getGroups():planGroups(),placedDetails=in3d?(C.detail_placements||[]).filter(d=>d&&d.id):[];host.replaceChildren(); // 2D: only what is drawn on this sheet
23221
23525
  const empty=!groups.length&&!placedDetails.length;
23222
23526
  if(empty){host.appendChild(Object.assign(document.createElement('div'),{className:'lsempty',textContent:in3d?'No objects in the model yet.':'No members on this sheet yet.'}));
23223
23527
  if(in3d||!((P.dims||[]).length||gridOf()))return;} // the other tabs are independent of scene parts; a sheet with no members still lists its dimensions and grid
23224
23528
  const hint=document.createElement('div');hint.className='lhint';hint.textContent='click to select · box = show/hide (selection) · dbl-click = isolate (selection) · Ctrl/Shift to multi-select';if(!empty)host.appendChild(hint);
23225
23529
  const addRow=(g,indent,draggable)=>{const row=document.createElement('div');row.className='lrow'+(indent?' typed':'');row.dataset.key=g.key;
23226
- if(draggable){const dh=document.createElement('span');dh.className='drag-handle';dh.textContent='⠿';dh.dataset.tip='Drag onto another type';['click','dblclick'].forEach(ev=>dh.addEventListener(ev,e=>e.stopPropagation()));row.appendChild(dh);} // handle = the only drag initiator; swallow its own clicks so it never toggles the row
23530
+ if(draggable){const dh=document.createElement('span');dh.className='drag-handle';dh.textContent='⠿';dh.dataset.tip='Drag onto another type';dh.dataset.commandId='steel.objects-retype#'+g.label;dh.dataset.commandInstanceLabel=g.label;dh.tabIndex=-1;dh.setAttribute('role','button');dh.setAttribute('aria-label','Drag '+g.label+' onto another type');['click','dblclick'].forEach(ev=>dh.addEventListener(ev,e=>e.stopPropagation()));row.appendChild(dh);} // handle = the only drag initiator; swallow its own clicks so it never toggles the row
23227
23531
  const sw=document.createElement('span');sw.className='lsw';sw.style.setProperty('--sw',g.color);sw.setAttribute('role','checkbox');sw.dataset.tip='Show / hide';
23228
23532
  row.append(sw,document.createTextNode(g.label));
23229
23533
  // Show/hide lives on the BOX; dbl-click a row isolates. When the row is part of a multi-selection, the box toggles
@@ -23240,9 +23544,18 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23240
23544
  host.appendChild(row);return row;};
23241
23545
  // A collapsible legend category: chevron (collapse) + tri-state master on/off (■/□/◪) + label + count.
23242
23546
  // getState()→'on'|'off'|'mixed' drives the master glyph; onToggle() runs the master action (refresh follows).
23243
- const buildCatHeader=(cat,label,count,opts)=>{opts=opts||{};const hdr=document.createElement('div');hdr.className='cat-hdr'+(opts.empty?' empty':'')+(opts.sub?' sub':'');hdr.dataset.cat=cat;hdr._getState=opts.getState;
23244
- const catOpen=!collapsedCats.has(cat)||catForceOpen(cat);const chev=Object.assign(document.createElement('span'),{className:'cat-chevron',textContent:catOpen?'▼':'▶'});
23547
+ const buildCatHeader=(cat,label,count,opts)=>{opts=opts||{};const hdr=document.createElement('div');hdr.className='cat-hdr'+(opts.empty?' empty':'')+(opts.sub?' sub':'');hdr.dataset.cat=cat;hdr.dataset.commandId='steel.objects-category#'+(opts.instance||label);hdr.dataset.commandInstanceLabel=opts.instance||label;hdr._getState=opts.getState;
23548
+ const catOpen=!collapsedCats.has(cat)||catForceOpen(cat);
23549
+ // Instructor's carrier (#3208): a button it can focus and describe, but not a tab stop — the list keeps one. Its sheet
23550
+ // names it (and the box) by data-command-instance-label, not by its text (▼■…(n)) or the box's aria-label.
23551
+ hdr.setAttribute('role','button');hdr.tabIndex=-1;hdr.setAttribute('aria-expanded',String(catOpen));
23552
+ hdr.addEventListener('keydown',e=>{if(e.target!==hdr||(e.key!=='Enter'&&e.key!==' '))return;e.preventDefault();e.stopPropagation();hdr.click();});
23553
+ const chev=Object.assign(document.createElement('span'),{className:'cat-chevron',textContent:catOpen?'▼':'▶'});
23245
23554
  const tog=Object.assign(document.createElement('span'),{className:'cat-tog'});tog.dataset.tip=opts.toggleTitle||('Show / hide all '+label.toLowerCase());if(opts.empty||!opts.onToggle)tog.style.display='none';
23555
+ // The box is a control of its own, so Instructor names it rather than the header around it (#3208): a toggle button,
23556
+ // because Instructor's focus lookup (web/instructor.js focusFor) resolves [role="button"]; updateCatTog keeps aria-pressed.
23557
+ tog.dataset.commandId='steel.objects-category-visibility#'+(opts.instance||label);tog.dataset.commandInstanceLabel=opts.instance||label;tog.setAttribute('role','button');tog.tabIndex=-1;tog.setAttribute('aria-label','Show '+(opts.instance||label));
23558
+ tog.addEventListener('keydown',e=>{if(e.key!=='Enter'&&e.key!==' ')return;e.preventDefault();e.stopPropagation();tog.click();});
23246
23559
  const lab=Object.assign(document.createElement('span'),{className:'cat-label',textContent:label});
23247
23560
  const cnt=Object.assign(document.createElement('span'),{className:'cat-count',textContent:'('+count+')'});
23248
23561
  hdr.append(chev,tog,lab,cnt);
@@ -23250,7 +23563,7 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23250
23563
  if(opts.onToggle)tog.addEventListener('click',e=>{e.stopPropagation();opts.onToggle();refresh3DLegend();});
23251
23564
  updateCatTog(hdr);return hdr;};
23252
23565
  // master state/action over a set of part-group keys (members + connection categories share this)
23253
- const grpState=keys=>{const h=new Set(vis.groupState().hidden),sh=new Set(vis.selectionHiddenIds());let shown=0,hiddenCount=0;for(const k of keys){const ids=legendMembers().filter(m=>profileKeyOf(m)===k).map(m=>m.id),n=ids.filter(id=>sh.has(id)).length;if(h.has(k)||(ids.length&&n===ids.length))hiddenCount++;else if(n){}else shown++;}return hiddenCount===keys.length?'off':(shown===keys.length?'on':'mixed');};
23566
+ const grpState=keys=>{const h=new Set(vis.groupState().hidden),sh=new Set(vis.selectionHiddenIds());let shown=0,hiddenCount=0;for(const k of keys){const ids=legendMembers().filter(m=>legendKeyOf(m)===k).map(m=>m.id),n=ids.filter(id=>sh.has(id)).length;if(h.has(k)||(ids.length&&n===ids.length))hiddenCount++;else if(n){}else shown++;}return hiddenCount===keys.length?'off':(shown===keys.length?'on':'mixed');};
23254
23567
  const grpToggle=keys=>{vis.setGroupsHidden(keys,grpState(keys)==='on');}; // all-on → hide all; mixed/off → show all (also clears Hide-selected ids in those groups)
23255
23568
  const members=groups.filter(g=>g.key!=='detail'&&!CONN_ORDER.includes(g.key));
23256
23569
  const conns=groups.filter(g=>CONN_ORDER.includes(g.key)).sort((a,b)=>CONN_ORDER.indexOf(a.key)-CONN_ORDER.indexOf(b.key));
@@ -23269,7 +23582,7 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23269
23582
  const cir=document.createElementNS(NS,'circle');cir.setAttribute('cx','7');cir.setAttribute('cy','7');cir.setAttribute('r','4.5');
23270
23583
  const lin=document.createElementNS(NS,'line');lin.setAttribute('x1','10.6');lin.setAttribute('y1','10.6');lin.setAttribute('x2','14');lin.setAttribute('y2','14');
23271
23584
  svg.append(cir,lin);ico.append(svg);
23272
- const inp=document.createElement('input');inp.id='legSearch';inp.type='text';inp.placeholder='Search objects…';inp.autocomplete='off';inp.value=legendQuery;inp.setAttribute('role','searchbox');inp.setAttribute('aria-label','Search objects in the list');
23585
+ const inp=document.createElement('input');inp.id='legSearch';inp.type='text';inp.placeholder='Search mark, member ID or profile…';inp.dataset.commandId='steel.objects-search';inp.autocomplete='off';inp.value=legendQuery;inp.setAttribute('role','searchbox');inp.setAttribute('aria-label','Search objects in the list');
23273
23586
  const clr=Object.assign(document.createElement('span'),{className:'lsx',textContent:'×'});clr.dataset.tip='Clear';
23274
23587
  inp.addEventListener('input',()=>onLegendSearchInput(inp.value));
23275
23588
  inp.addEventListener('keydown',e=>{if(e.key==='Escape'){e.stopPropagation();if(inp.value){inp.value='';onLegendSearchInput('');}else{inp.blur();}}
@@ -23280,11 +23593,18 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23280
23593
  }
23281
23594
  if(legendMode==='type'&&members.length){ // group the profile-rows under their member-type categories
23282
23595
  const mtypes=memberTypeRecords();
23283
- const byCat=new Map(mtypes.map(t=>[t.k,[]]));
23596
+ const byCat=new Map([...mtypes.map(t=>[t.k,[]]),[MIXED_TYPES,[]]]);
23284
23597
  for(const g of members){(byCat.get(categoryOfProfile(g.key))||byCat.get('beam')).push(g);}
23285
23598
  for(const {k,label} of mtypes){const gs=byCat.get(k)||[],keys=gs.map(g=>g.key);
23286
23599
  host.appendChild(buildCatHeader(k,label,gs.length,{empty:!gs.length,getState:()=>grpState(keys),onToggle:()=>grpToggle(keys),toggleTitle:'Show / hide all '+label.toLowerCase()+'s'}));
23287
23600
  if(!collapsedCats.has(k)||catForceOpen(k))for(const g of gs)addRow(g,true,true);}
23601
+ // #3208: a row whose members are of different types files under none of them. Only shown when there is one: it is not a
23602
+ // type, so it is no place to drop a row. The split rides on the row as CSS content, so a search never matches on it.
23603
+ const mixed=byCat.get(MIXED_TYPES),mixedKeys=mixed.map(g=>g.key);
23604
+ if(mixed.length){const hdr=buildCatHeader(MIXED_TYPES,'Mixed types',mixed.length,{getState:()=>grpState(mixedKeys),onToggle:()=>grpToggle(mixedKeys),toggleTitle:'Show / hide all mixed-type profiles'});
23605
+ hdr.dataset.tip='These profiles hold members of different types. Drag a row onto a type to give all its members that type.';host.appendChild(hdr);
23606
+ if(!collapsedCats.has(MIXED_TYPES)||catForceOpen(MIXED_TYPES))for(const g of mixed){const r=addRow(g,true,true);r.dataset.mix=memberTypeSplit(g.key);
23607
+ r.setAttribute('aria-label',g.label+', mixed types: '+r.dataset.mix);}} // the row's own label overrides its CSS content, so the split is said here too
23288
23608
  } else for(const g of members)addRow(g);
23289
23609
  if(conns.length){ // group connection PARTS under their joint (Phase 2): each part-kind a row, hidden per-id
23290
23610
  if(members.length){host.appendChild(Object.assign(document.createElement('div'),{className:'ldiv'}));}
@@ -23350,7 +23670,7 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23350
23670
  host.appendChild(buildCatHeader('dims','Dimensions',DIM_CATS.length,{getState:dimState,onToggle:dimToggle,toggleTitle:'Show / hide all dimension overlays'}));
23351
23671
  if(!collapsedCats.has('dims')){host.appendChild(Object.assign(document.createElement('div'),{className:'lhint',textContent:'click the box to show / hide'}));
23352
23672
  for(const dc of DIM_CONN){const ck='dims-'+dc.ct; // middle category: overlays grouped by connection
23353
- host.appendChild(buildCatHeader(ck,dc.label,dc.cats.length,{sub:true,getState:()=>dcState(dc.cats),onToggle:()=>dcToggle(dc.cats),toggleTitle:'Show / hide all '+dc.label.toLowerCase()+' dimensions'}));
23673
+ host.appendChild(buildCatHeader(ck,dc.label,dc.cats.length,{sub:true,instance:dc.label+' dimensions',getState:()=>dcState(dc.cats),onToggle:()=>dcToggle(dc.cats),toggleTitle:'Show / hide all '+dc.label.toLowerCase()+' dimensions'}));
23354
23674
  if(!collapsedCats.has(ck))for(const k of dc.cats)addDimRow(k,DIM_LABEL[k],true);}
23355
23675
  }
23356
23676
  }else if((P.dims||[]).length){ // 2D: the dimensions drawn on this sheet, under the same switch as the ⋯ menu's Dimensions
@@ -23363,19 +23683,25 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23363
23683
  legendRowCheckbox(row,sw,label,flip); // no onEnter: a dimension row has no selection to reach
23364
23684
  host.appendChild(row);
23365
23685
  }
23366
- // GRID — the structural grid's visibility (per-plan contract data; same undoable switch as the panel
23367
- // checkbox and the ⋯ menu item). Only shown when this plan has a grid — slate outline swatch to match
23686
+ // GRID — the structural grid's visibility (contract data; the same undoable `on` switch as the panel checkbox
23687
+ // and the ⋯ menu item). Only shown when this plan has a grid — slate outline swatch to match
23368
23688
  // the grid's colour, not the cyan dim overlays.
23689
+ // In 3D a grid with several levels also lists one row per level, highest first (#3214). "Grid lines" stays the
23690
+ // whole-grid on/off switch, and its box shows how many levels are drawn: all, some (mixed) or none.
23369
23691
  if(gridOf()){
23370
23692
  host.appendChild(Object.assign(document.createElement('div'),{className:'ldiv'}));
23371
- const grow=document.createElement('div');grow.className='lrow dim';grow.dataset.tip='Show / hide the structural grid (2D + 3D)';
23372
- const gsw=document.createElement('span');gsw.className='lsw';gsw.style.setProperty('--sw','#64748b');gsw.setAttribute('role','checkbox');gsw.dataset.tip='Show / hide';
23373
- grow.append(gsw,document.createTextNode('Grid lines'));
23374
- grow.classList.toggle('dimoff',!gridOn());
23375
- const gflip=()=>gridSetVisible(!gridOn());
23376
- gsw.addEventListener('click',e=>{e.stopPropagation();gflip();});gsw.addEventListener('dblclick',e=>e.stopPropagation());
23377
- legendRowCheckbox(grow,gsw,'Grid lines',gflip); // no onEnter: the grid row has no selection to reach
23378
- host.appendChild(grow);
23693
+ const levels=in3d?gridLegendLevels():[],st=levels.length?gridLegendState(levels):(gridOn()?'on':'off');
23694
+ const gridRow=(label,tip,indent,state,flip,name)=>{const row=document.createElement('div');row.className='lrow dim'+(indent?' typed':'')+(state==='mixed'?' mixed':'');row.dataset.tip=tip;
23695
+ const sw=document.createElement('span');sw.className='lsw';sw.style.setProperty('--sw','#64748b');sw.setAttribute('role','checkbox');sw.dataset.tip='Show / hide';
23696
+ row.append(sw,document.createTextNode(label));row.classList.toggle('dimoff',state==='off');
23697
+ sw.addEventListener('click',e=>{e.stopPropagation();flip();});sw.addEventListener('dblclick',e=>e.stopPropagation());
23698
+ legendRowCheckbox(row,sw,name||label,flip); // no onEnter: a grid row has no selection to reach. A level's name adds its elevation, so two levels labelled alike are told apart.
23699
+ host.appendChild(row);return row;};
23700
+ const grow=gridRow('Grid lines',levels.length?'Show / hide the grid lines (2D + 3D); the level boxes choose which levels':'Show / hide the structural grid (2D + 3D)',false,st,()=>levels.length?gridLegendToggleAll(levels):gridSetVisible(!gridOn()));
23701
+ grow.dataset.gridz='all';grow.dataset.commandId='steel.objects-grid-lines';
23702
+ for(const lv of levels.slice().reverse()){ // highest first: the list reads as the grid stands in the model
23703
+ const row=gridRow(lv.name,'Show / hide the grid at this level (3D only)',true,lv.shown?'on':'off',()=>gridLegendToggleLevel(lv,levels),lv.instance);
23704
+ row.dataset.gridz=String(lv.key);row.dataset.commandId='steel.objects-grid-level#'+lv.instance;row.dataset.commandInstanceLabel=lv.instance;}
23379
23705
  }
23380
23706
  // CLIP — one provider-neutral list and interaction session is mounted by the shared 3D layer.
23381
23707
  // Steel and Revit therefore share selection, range selection, rename, enable, delete and empty-state behavior.
@@ -23393,7 +23719,9 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23393
23719
  const keyRows=[...host.querySelectorAll('.lrow:not(.qhide)')].filter(r=>r.getAttribute('role')==='checkbox');
23394
23720
  if(keyRows.length)refTreeRoving(keyRows,'lsel');
23395
23721
  if(refocus){const back=keyRows.find(r=>legendRowId(r)===refocus); // the rebuilt twin of the row they were on
23396
- if(back){keyRows.forEach(r=>{r.tabIndex=r===back?0:-1;});back.focus();}}} // the Objects body's visibility is owned by the active-tab class, not set here
23722
+ if(back){keyRows.forEach(r=>{r.tabIndex=r===back?0:-1;});back.focus();}}
23723
+ if(refocusHdr){const h=[...host.querySelectorAll('.cat-hdr')].find(x=>x.dataset.cat===refocusHdr.cat),t=h&&(refocusHdr.box?h.querySelector('.cat-tog'):h);
23724
+ if(t&&t.style.display!=='none')t.focus();}} // the Objects body's visibility is owned by the active-tab class, not set here
23397
23725
  // Permanent visibility menu: selection exposes Isolate/Hide; Ghost stays available and active treatment keeps
23398
23726
  // Show all reachable after Hide selected clears that now-invisible selection. Updated on every relevant change.
23399
23727
  function updateIsolateBtn(){return modelEditor?.getState?.()??null;} // compatibility call sites only; shared toolbar chrome owns Visibility DOM
@@ -23425,7 +23753,7 @@ function updateWorkBtn(){const b=document.getElementById('m3dWork'),ck=document.
23425
23753
  // A type category's master toggle reads its profiles' hide state: all visible = ■ on, all hidden = □ off,
23426
23754
  // some = ◪ mixed. Colour comes from data-state (CSS); the glyph from the textContent.
23427
23755
  function updateCatTog(hdr){const tog=hdr&&hdr.querySelector('.cat-tog');if(!tog||!hdr._getState||tog.style.display==='none')return;
23428
- const state=hdr._getState();tog.dataset.state=state;tog.textContent=state==='on'?'■':(state==='off'?'□':'◪');}
23756
+ const state=hdr._getState();tog.dataset.state=state;tog.textContent=state==='on'?'■':(state==='off'?'□':'◪');tog.setAttribute('aria-pressed',state==='on'?'true':state==='off'?'false':'mixed');}
23429
23757
  function refresh3DLegend(){const vis=legendVis();if(!vis)return;const st=vis.groupState(),hidden=new Set(st.hidden),solo=new Set(st.solo),sh=new Set(vis.selectionHiddenIds());
23430
23758
  legendBody('root').querySelectorAll('#m3dLegend .lrow[data-key]').forEach(r=>{const k=r.dataset.key,ids=legRowIds(r),n=ids.filter(id=>sh.has(id)).length;const off=hidden.has(k)||(solo.size>0&&!solo.has(k))||(ids.length>0&&n===ids.length),mixed=!off&&n>0;r.classList.toggle('off',off);r.classList.toggle('mixed',mixed);r.classList.toggle('solo',solo.size>0&&solo.has(k));legendRowChecked(r);}); // PROFILE rows: filled=shown, hollow=hidden, dash=mixed
23431
23759
  const ch=new Set(vis.connHiddenIds()); // per-part connection hide
@@ -23471,7 +23799,7 @@ function followLegendSelection(rows){
23471
23799
  if(!legendFollow||legendTab!=='objects'||!selIds.size){legendFollowKey='';return;}
23472
23800
  const key=[...selIds].sort().join(',');if(key===legendFollowKey)return;
23473
23801
  if(legendSelecting){legendFollowKey=key;return;} // chosen in the list itself: nothing to bring into view
23474
- if(legendMode==='type'){const shut=new Set();for(const m of legendMembers())if(selIds.has(m.id)){const cat=categoryOfProfile(profileKeyOf(m));if(collapsedCats.has(cat))shut.add(cat);}
23802
+ if(legendMode==='type'){const shut=new Set();for(const m of legendMembers())if(selIds.has(m.id)){const cat=categoryOfProfile(legendKeyOf(m));if(collapsedCats.has(cat))shut.add(cat);}
23475
23803
  if(shut.size){shut.forEach(c=>collapsedCats.delete(c));saveLegendPrefs();build3DLegend();return;}} // the rebuild marks the rows and comes back here
23476
23804
  legendFollowKey=key;
23477
23805
  const first=rows.find(r=>r.classList.contains('lfollow'));if(first&&first.scrollIntoView)first.scrollIntoView({block:'nearest'});}
@@ -23516,28 +23844,33 @@ function applyLegendFilter(){
23516
23844
  host.querySelectorAll('.lidhit').forEach(t=>t.remove());legendIdHits=[]; // a row's own text, never last pass's tag, is what it is matched on
23517
23845
  if(!q){rows.forEach(r=>r.classList.remove('qhide'));host.querySelectorAll('.cat-hdr.qhide').forEach(h=>h.classList.remove('qhide'));return;}
23518
23846
  // #2998: a row also matches by the ids of what it holds (a member id such as c-021, the id AI decisions, Make precise,
23519
- // Inspect and the chat all use). A row grouped by profile holds many, so the matched id is shown after its label.
23520
- const byKey=new Map();for(const m of legendMembers())if(m&&m.id!=null){const k=profileKeyOf(m);if(!byKey.has(k))byKey.set(k,[]);byKey.get(k).push(String(m.id));}
23847
+ // Inspect and the chat all use), and by a member's part marks: the marks the drawings gave it (the Mark row in
23848
+ // Properties), which is what an RFI or a fabricator quotes. A row grouped by profile holds many, so what matched is shown
23849
+ // after its label: the id, or the mark with its member's id.
23850
+ const byKey=new Map();for(const m of legendMembers())if(m&&m.id!=null){const k=legendKeyOf(m);if(!byKey.has(k))byKey.set(k,[]);byKey.get(k).push(String(m.id));}
23851
+ const finds=id=>id.toLowerCase().includes(q)||memberMarks(id).some(k=>k.toLowerCase().includes(q));
23852
+ const whole=id=>id.toLowerCase()===q||memberMarks(id).some(k=>k.toLowerCase()===q);
23853
+ const said=id=>id.toLowerCase().includes(q)?id:memberMarks(id).find(k=>k.toLowerCase().includes(q))+' ('+id+')';
23521
23854
  let any=false;const tagged=[];
23522
23855
  rows.forEach(r=>{const textHit=(r.textContent||'').toLowerCase().includes(q);
23523
23856
  const ids=r.dataset.key?(byKey.get(r.dataset.key)||[]):(r._ids||[]).map(String);
23524
- const exactFirst=(a,b)=>(b.toLowerCase()===q)-(a.toLowerCase()===q)||a.localeCompare(b); // a typed whole id leads its row's tag
23525
- // Every member whose id matches is a candidate for Enter, also in a row its label already matched (a member IPE300 in
23526
- // the IPE300 row); only a row found by id alone needs the tag that says why it is shown.
23527
- const idMatches=ids.filter(id=>id.toLowerCase().includes(q)).sort(exactFirst),idHits=textHit?[]:idMatches;
23857
+ const exactFirst=(a,b)=>whole(b)-whole(a)||a.localeCompare(b); // a typed whole id or mark leads its row's tag
23858
+ // Every member whose id or mark matches is a candidate for Enter, also in a row its label already matched (a member
23859
+ // IPE300 in the IPE300 row); only a row found by id or mark alone needs the tag that says why it is shown.
23860
+ const idMatches=ids.filter(finds).sort(exactFirst),idHits=textHit?[]:idMatches;
23528
23861
  if(r.dataset.key)legendIdHits.push(...idMatches);
23529
23862
  const hit=textHit||idHits.length>0;r.classList.toggle('qhide',!hit);if(hit)any=true;
23530
23863
  if(idHits.length)tagged.push([r,idHits]);});
23531
- // A whole id typed is that member, even when it also begins longer ids (m-12 of m-120, m-121).
23532
- const exact=legendIdHits.filter(id=>id.toLowerCase()===q);if(exact.length===1)legendIdHits=exact;
23864
+ // A whole id or mark typed is that member, even when it also begins longer ones (m-12 of m-120, m-121).
23865
+ const exact=legendIdHits.filter(whole);if(exact.length===1)legendIdHits=exact;
23533
23866
  const one=legendIdHits.length===1;
23534
23867
  for(const [r,idHits] of tagged){const t=document.createElement('span');t.className='lidhit';
23535
- t.textContent='· '+idHits[0]+(idHits.length>1?' +'+(idHits.length-1)+' more':'');
23536
- t.dataset.tip=one&&r.dataset.key&&idHits[0]===legendIdHits[0]?'Member '+idHits[0]+' is in this group. Press Enter in the search box to select only it.'
23537
- :'Matched by id: '+idHits.slice(0,8).join(', ')+(idHits.length>8?', …':'')+'. Clicking the row selects the whole group.';
23868
+ t.textContent='· '+said(idHits[0])+(idHits.length>1?' +'+(idHits.length-1)+' more':'');
23869
+ t.dataset.tip=one&&r.dataset.key&&idHits[0]===legendIdHits[0]?'Member '+said(idHits[0])+' is in this group. Press Enter in the search box to select only it.'
23870
+ :'Matched by mark or member ID: '+idHits.slice(0,8).map(said).join(', ')+(idHits.length>8?', …':'')+'. Clicking the row selects the whole group.';
23538
23871
  r.appendChild(t);}
23539
23872
  host.querySelectorAll('.cat-hdr').forEach(h=>{const cat=h.dataset.cat||'';
23540
- if(!(memberTypeRecords().some(t=>t.k===cat)||/^conn-/.test(cat)||cat==='placed-details'))return; // leave the Dimensions/Clip headers untouched
23873
+ if(!(memberTypeRecords().some(t=>t.k===cat)||/^conn-/.test(cat)||cat==='placed-details'||cat===MIXED_TYPES))return; // leave the Dimensions/Clip headers untouched
23541
23874
  let vis=false;
23542
23875
  for(let n=h.nextElementSibling;n&&!n.classList.contains('cat-hdr')&&!n.classList.contains('lsec')&&!n.classList.contains('ldiv');n=n.nextElementSibling){
23543
23876
  if((n.matches('.lrow[data-key]')||n.matches('.lrow[data-connkey]')||n.matches('.lrow[data-detailkey]'))&&!n.classList.contains('qhide')){vis=true;break;}}
@@ -23547,7 +23880,7 @@ function applyLegendFilter(){
23547
23880
  }
23548
23881
  // Resolve a row to the member/connection ids it represents. A member row's data-key is a profile key; a connection
23549
23882
  // row carries its part ids on row._ids. Used by legend click-to-select + the box/isolate SELECTION actions below.
23550
- function legRowIds(row){if(!row)return [];if(row.dataset.connkey||row.dataset.detailkey)return (row._ids||[]).slice();const k=row.dataset.key;if(!k)return [];return legendMembers().filter(m=>profileKeyOf(m)===k).map(m=>m.id);} // 3D: v2's list shows root members, so its lookup uses the format-aware model list; 2D: this sheet's members only
23883
+ function legRowIds(row){if(!row)return [];if(row.dataset.connkey||row.dataset.detailkey)return (row._ids||[]).slice();const k=row.dataset.key;if(!k)return [];return legendMembers().filter(m=>legendKeyOf(m)===k).map(m=>m.id);} // 3D: v2's list shows root members, so its lookup uses the format-aware model list; 2D: this sheet's members only
23551
23884
  let bar3dWired=false;
23552
23885
  function seg3dActive(sel,attr,val){document.querySelectorAll(sel+' button').forEach(b=>{const on=b.getAttribute(attr)===val;b.classList.toggle('on',on);
23553
23886
  // The tick is a CSS ::after on `.on`, which announces nothing. These are EXCLUSIVE choices, so the
@@ -25361,7 +25694,7 @@ function rfiSymptomMembersIn(scope){
25361
25694
  // still fail are mostly these. Prefixes match sectionKindOf's, which already knows them by sight.
25362
25695
  // …and it only means anything while the model resolves against a US catalogue. A UK model resolves
25363
25696
  // these perfectly, so firing there would tell a user their own catalogue cannot hold their own steel.
25364
- const _isEuroSection=p=>_modelEnvironment()!=='UK'&&/^(IPE|HE[ABM]?|UB|UC|UKB|UKC|UKA|PFC|UPN|UPE)\s*\d/i.test(String(p||'').trim());
25697
+ const _isEuroSection=p=>SteelEnv.looksLikeForeignSection(_envTraits().id,p);
25365
25698
  /** The one sentence for a dead section table, shared so `rfiSymptomReason` can recognise it EXACTLY
25366
25699
  * rather than re-testing the flag — see that function for why the difference is load-bearing. */
25367
25700
  const RFI_CATALOG_REASON='The section table could not be loaded — sizes and weights are unavailable. Reload the page.';
@@ -25375,7 +25708,7 @@ function rfiReason(m){if(!m.profile)return 'No profile assigned';
25375
25708
  // after"). Sending its author to check a designation that is perfectly correct is the same
25376
25709
  // misdirection the European case above exists to stop.
25377
25710
  if(_aiscKgM(m.profile)!=null)return 'This model records no weight for that size — the designation itself is a standard '+_catalogLabel()+' shape';
25378
- if(_isEuroSection(m.profile))return 'European/British section — this catalogue holds AISC (US) shapes only, so it can’t resolve here';
25711
+ if(_isEuroSection(m.profile))return _envTraits().foreignSectionNoun.replace(/^./,c=>c.toUpperCase())+' — this catalogue holds '+_envTraits().shapesHeldNote+', so it can’t resolve here';
25379
25712
  return 'Size not in the '+_catalogLabel()+' table — check the designation';}
25380
25713
  // #628. The tooltip on a verified row's ✓ Verified pill. It was shared with a second marker — a green
25381
25714
  // number chip — so the two could never drift apart; that chip's CSS was never emitted after the RFI list
@@ -29496,7 +29829,7 @@ function openRaiseRfi(jointId,checkId,invoker){
29496
29829
  if(rfiFormFor&&rfiOpen())return 'An RFI form is open in the RFI list. Finish or cancel it, then press Raise an RFI again.';
29497
29830
  if(rfiOpen())closeRFI();
29498
29831
  rfiRaiseReturn=invoker&&invoker.isConnected?invoker:(document.activeElement instanceof Element?document.activeElement:null);
29499
- rfiRaise={jointId,checkId:checkId||null,status:'loading',data:null,error:'',useSaved:false,expanded:null,forms:new Map(),outcomes:new Map(),busy:null,generation:-1,seq:++rfiRaiseSeq};
29832
+ rfiRaise={jointId,checkId:checkId||null,status:'loading',data:null,note:'',useSaved:false,expanded:null,forms:new Map(),outcomes:new Map(),busy:null,generation:-1,seq:++rfiRaiseSeq};
29500
29833
  // Bring back every attempt on this connection that is still waiting to be settled, as it was left.
29501
29834
  for(const[key,attempt]of rfiRaiseUnsettled){
29502
29835
  if(attempt.jointId!==jointId)continue;
@@ -29537,10 +29870,10 @@ async function raiseRfiSaved(){
29537
29870
  }
29538
29871
  async function raiseRfiLoad(keepMessage){
29539
29872
  const r=rfiRaise;if(!r)return;const seq=r.seq;
29540
- r.status='loading';if(!keepMessage)r.error='';renderRaiseRfi();
29873
+ r.status='loading';if(!keepMessage)r.note='';renderRaiseRfi();
29541
29874
  const unsaved=await raiseRfiSaved();
29542
29875
  if(rfiRaise!==r||r.seq!==seq)return;
29543
- if(unsaved&&!r.useSaved){r.status='unsaved';r.error=unsaved;renderRaiseRfi();return;}
29876
+ if(unsaved&&!r.useSaved){r.status='unsaved';r.note=unsaved;renderRaiseRfi();return;}
29544
29877
  r.generation=modelEditGeneration;
29545
29878
  const ctl=new AbortController(),timer=setTimeout(()=>ctl.abort(),RFI_RAISE_DEADLINE_MS);
29546
29879
  let res=null,body=null;
@@ -29550,7 +29883,7 @@ async function raiseRfiLoad(keepMessage){
29550
29883
  if(rfiRaise!==r||r.seq!==seq)return;
29551
29884
  if(!res||!res.ok||!body||body.ok!==true){
29552
29885
  r.status='failed';
29553
- r.error=body&&typeof body.error==='string'&&body.error?rfiRaiseCap(body.error):'FloLess could not read the questions for connection '+r.jointId+' just now. Try again in a moment.';
29886
+ r.note=personText(body)?rfiRaiseCap(personText(body)):'FloLess could not read the questions for connection '+r.jointId+' just now. Try again in a moment.';
29554
29887
  renderRaiseRfi();return;
29555
29888
  }
29556
29889
  r.data=body;r.status='ready';
@@ -29592,13 +29925,13 @@ function renderRaiseRfi(){
29592
29925
  if(!r)return;
29593
29926
  if(r.status==='loading'){list.append(rfiRaiseEl('div',{class:'rfiempty'},'Reading this connection’s questions…'));return;}
29594
29927
  if(r.status==='unsaved'){
29595
- banner.hidden=false;banner.append(document.createTextNode(r.error+' '),
29928
+ banner.hidden=false;banner.append(document.createTextNode(r.note+' '),
29596
29929
  rfiRaiseEl('button',{type:'button','data-command-id':'steel.rfi-raise-use-saved#connection '+r.jointId,'data-command-instance-label':'connection '+r.jointId,'data-raise-ctl':'use-saved',onclick:()=>{r.useSaved=true;raiseRfiLoad();}},'Show the saved model’s questions'));
29597
29930
  list.append(rfiRaiseEl('div',{class:'rfiempty'},'Save your edits, or go on with the saved model.'));return;
29598
29931
  }
29599
29932
  if(r.status==='failed'){
29600
29933
  const box=rfiRaiseEl('div',{class:'rfiempty'});
29601
- box.append(rfiRaiseEl('b',null,'The questions for connection '+r.jointId+' could not be read.'),document.createTextNode(r.error),rfiRaiseEl('br'),
29934
+ box.append(rfiRaiseEl('b',null,'The questions for connection '+r.jointId+' could not be read.'),document.createTextNode(r.note),rfiRaiseEl('br'),
29602
29935
  rfiRaiseEl('button',{type:'button','data-command-id':'steel.rfi-raise-retry#connection '+r.jointId,'data-command-instance-label':'connection '+r.jointId,'data-raise-ctl':'retry',onclick:()=>raiseRfiLoad()},'Try again'));
29603
29936
  list.append(box);return;
29604
29937
  }
@@ -29607,7 +29940,7 @@ function renderRaiseRfi(){
29607
29940
  if(r.data&&r.data.rfisUnavailable)notes.push(r.data.rfisUnavailable);
29608
29941
  if(notes.length){banner.hidden=false;banner.textContent=notes.join(' ');}
29609
29942
  const storeBlind=!!(r.data&&r.data.rfisUnavailable);
29610
- if(r.error){const e=rfiRaiseEl('div',{class:'rfifail',role:'alert'},r.error);list.append(e);}
29943
+ if(r.note){const e=rfiRaiseEl('div',{class:'rfifail',role:'alert'},r.note);list.append(e);}
29611
29944
  const qs=raiseRfiOrdered();
29612
29945
  if(!qs.length){
29613
29946
  const box=rfiRaiseEl('div',{class:'rfiempty'});
@@ -29736,7 +30069,7 @@ async function raiseRfiFile(checkId){
29736
30069
  }
29737
30070
  // A definite answer settles the attempt, wherever the person now is.
29738
30071
  rfiRaiseUnsettled.delete(rfiRaiseKey(r.jointId,checkId));
29739
- if(!here){toast(res.ok?'Filed as '+body.rfi.id+'.':rfiRaiseCap(body.error||'This RFI was not filed.'),false,9000);if(res.ok&&typeof refreshRfiRecords==='function')refreshRfiRecords();return;}
30072
+ if(!here){toast(res.ok?'Filed as '+body.rfi.id+'.':rfiRaiseCap(personText(body)||'This RFI was not filed.'),false,9000);if(res.ok&&typeof refreshRfiRecords==='function')refreshRfiRecords();return;}
29740
30073
  if(res.ok&&body&&body.ok===true&&body.rfi&&body.rfi.id){
29741
30074
  const id=body.rfi.id,said='Filed as '+id+(form.action==='send'?' and marked sent.':' with the answer recorded.');
29742
30075
  r.forms.delete(checkId);r.outcomes.set(checkId,{kind:'filed',text:said,rfiId:id});
@@ -29749,7 +30082,7 @@ async function raiseRfiFile(checkId){
29749
30082
  console.error('[steel] an RFI about a connection was refused',{status:res.status,code,error:body&&body.error});
29750
30083
  // A definite answer: this attempt is over, so a fresh key goes with the next one.
29751
30084
  form.opKey=null;form.request=null;
29752
- const said=body&&typeof body.error==='string'&&body.error?rfiRaiseCap(body.error):'FloLess could not file this RFI just now, and did not say why. Try again in a moment.';
30085
+ const said=personText(body)?rfiRaiseCap(personText(body)):'FloLess could not file this RFI just now, and did not say why. Try again in a moment.';
29753
30086
  if(code==='rfi-connection-question-changed'||code==='rfi-connection-question-gone'||code==='rfi-promote-stale'){
29754
30087
  r.outcomes.set(checkId,{kind:'refused',text:said+(code==='rfi-connection-question-changed'?' The question was read again: check it, then file it.':'')});
29755
30088
  await raiseRfiLoad(true);