@floless/app 0.168.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 (80) hide show
  1. package/cli-actions.mjs +8 -1
  2. package/dist/floless-server.cjs +125533 -99597
  3. package/dist/schemas/drawing-check.profile.v1.schema.json +12 -2
  4. package/dist/schemas/steel.model.v2.schema.json +2 -1
  5. package/dist/skills/floless-app-knowledge/SKILL.md +43 -13
  6. package/dist/skills/floless-app-new-workflow/SKILL.md +8 -1
  7. package/dist/skills/floless-app-rfi/SKILL.md +4 -2
  8. package/dist/skills/floless-app-routines/SKILL.md +2 -2
  9. package/dist/skills/floless-app-routines/references/routines-api.md +20 -8
  10. package/dist/skills/floless-app-steel-model/SKILL.md +8 -5
  11. package/dist/skills/floless-app-steel-takeoff/SKILL.md +31 -1
  12. package/dist/skills/floless-app-workflows/SKILL.md +22 -3
  13. package/dist/skills/floless-app-workflows/references/agent-steps.md +40 -6
  14. package/dist/skills/floless-app-workflows/references/exec-contract.md +27 -0
  15. package/dist/skills/floless-app-workflows/references/script-runner.md +105 -0
  16. package/dist/templates/college-phase-exporter.flo +7 -2
  17. package/dist/templates/trimble-list-projects.flo +10 -2
  18. package/dist/web/agent-steps.js +90 -19
  19. package/dist/web/agents.js +77 -31
  20. package/dist/web/app.css +267 -4
  21. package/dist/web/app.js +71 -7
  22. package/dist/web/aware-update-client.js +4 -4
  23. package/dist/web/aware.js +1277 -219
  24. package/dist/web/chat.css +10 -0
  25. package/dist/web/chat.js +407 -117
  26. package/dist/web/checkpoint-standard.js +5 -3
  27. package/dist/web/commands-drawing-check.js +4 -0
  28. package/dist/web/commands-shell.js +551 -15
  29. package/dist/web/commands-steel.js +68 -2
  30. package/dist/web/commands-vector.js +69 -0
  31. package/dist/web/drawing-check-editor.html +10 -0
  32. package/dist/web/drawing-check-editor.js +821 -237
  33. package/dist/web/failure-copy.js +50 -2
  34. package/dist/web/filter-ai-proposal.js +11 -8
  35. package/dist/web/flo-3d.js +310 -0
  36. package/dist/web/flo-card.js +72 -0
  37. package/dist/web/guide.js +33 -24
  38. package/dist/web/index.html +95 -5
  39. package/dist/web/instructor.js +102 -15
  40. package/dist/web/left-pane.js +4 -1
  41. package/dist/web/local-discovery.js +8 -7
  42. package/dist/web/missed-routines.js +239 -0
  43. package/dist/web/model-editor-steel-adapter.js +41 -1
  44. package/dist/web/model-measure.js +6 -0
  45. package/dist/web/model-spatial-panel.js +19 -4
  46. package/dist/web/model-spatial-tools.js +3 -3
  47. package/dist/web/model-viewport-revit-adapter.js +3 -3
  48. package/dist/web/model-viewport-toolbar.js +11 -0
  49. package/dist/web/origin-rule.js +155 -0
  50. package/dist/web/pages.js +17 -14
  51. package/dist/web/panels.js +1 -1
  52. package/dist/web/project-access.js +1 -1
  53. package/dist/web/project-history.js +2 -2
  54. package/dist/web/project-modules.js +5 -5
  55. package/dist/web/project-reconciliation.js +1 -1
  56. package/dist/web/project-rfis.js +8 -3
  57. package/dist/web/project-workflows.js +8 -6
  58. package/dist/web/renderers.js +6 -0
  59. package/dist/web/report-csp.js +68 -0
  60. package/dist/web/revit-editor.js +22 -8
  61. package/dist/web/run-history.js +14 -4
  62. package/dist/web/steel-3d-core.js +39 -9
  63. package/dist/web/steel-3d-flo.js +331 -0
  64. package/dist/web/steel-3d-view.js +164 -0
  65. package/dist/web/steel-ai-marks.js +3 -1
  66. package/dist/web/steel-editor.html +583 -129
  67. package/dist/web/steel-environments.js +297 -0
  68. package/dist/web/steel-filter.html +3 -2
  69. package/dist/web/steel-model-v2-client-validation.js +8 -1
  70. package/dist/web/steel-model-v2-commands.js +23 -9
  71. package/dist/web/steel-model-v2-projection.js +1 -1
  72. package/dist/web/step-rename.js +3 -2
  73. package/dist/web/terminal-requests.js +79 -1
  74. package/dist/web/tool-updates.js +9 -7
  75. package/dist/web/vector-3d.html +1 -1
  76. package/dist/web/vector-editor.html +50 -8
  77. package/dist/web/workspace-root-management.js +1 -1
  78. package/dist/web/workspaces.js +2334 -253
  79. package/launch.mjs +5 -0
  80. package/package.json +11 -8
@@ -164,7 +164,7 @@
164
164
  [data-theme="light"] #selFly,[data-theme="light"] #m3dBar,[data-theme="light"] #m3dToolBar,
165
165
  [data-theme="light"] #calloutPop,[data-theme="light"] #viewFly,[data-theme="light"] #comboPop.on-stage,
166
166
  [data-theme="light"] #propPop,[data-theme="light"] #snapMenu,[data-theme="light"] #dimEditPop,[data-theme="light"] #cmHud,
167
- [data-theme="light"] #m3dCube,[data-theme="light"] #m3dAxes,[data-theme="light"] #plHint,
167
+ [data-theme="light"] #m3dCube,[data-theme="light"] #m3dFloMin,[data-theme="light"] #m3dFloCard,[data-theme="light"] #m3dAxes,[data-theme="light"] #plHint,
168
168
  [data-theme="light"] #gridReadout,[data-theme="light"] #gridLabelEdit,[data-theme="light"] #m3dReadout,[data-theme="light"] #m3dRubber,
169
169
  [data-theme="light"] #m3dDimLabels,[data-theme="light"] #m3dMemberLabels,[data-theme="light"] #m3dHoverChip,
170
170
  [data-theme="light"] #m3dPropLabelHost,[data-theme="light"] #m3dSelLenLabels,
@@ -1191,6 +1191,10 @@ rect.lblhot:focus-visible{outline:2px solid var(--brand);outline-offset:2px;stro
1191
1191
  line needs ~227px. Laid out flat, the readout was pushed past the panel's own right edge and (in 3D
1192
1192
  at a 1600px window) off the screen with it: the DOM value was right, so it read correct to a probe,
1193
1193
  while the user saw "2" of "26 px". */
1194
+ #m3dViewMenu .mrow{display:flex;flex-wrap:wrap;align-items:center;gap:7px 8px;padding:2px 12px 8px 47px;min-width:150px;box-sizing:border-box} /* Flo size: under the Flo words, like the pl-note; the words and the read-out on one line, the slider full width under them */
1195
+ #m3dViewMenu .mrow .mlbl{color:var(--mut);font-size:11px;flex:1 1 auto}
1196
+ #m3dViewMenu .mrow .mval{color:var(--mut);font-size:11px;flex:none;text-align:right;font-variant-numeric:tabular-nums;order:2}
1197
+ #m3dViewMenu .mrow input[type=range]{flex:0 0 100%;min-width:0;order:3}
1194
1198
  #moreMenu .mrow{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;padding:2px 12px 8px 26px;max-width:100%;box-sizing:border-box}
1195
1199
  #moreMenu .mrow .mlbl{color:var(--mut);font-size:11px;flex:0 0 100%}
1196
1200
  #moreMenu .mrow input[type=range]{flex:1 1 60px;min-width:0}
@@ -1985,9 +1989,26 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1985
1989
  #panel .mp-more{width:100%;margin-top:6px;font-size:11px;padding:4px 7px}
1986
1990
  #panel .mp-sheet{font-weight:400;color:var(--mut)}
1987
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}
1988
2003
  #panel .mp-done:focus:not(:focus-visible){outline:none}
1989
2004
  #panel .mp-done .hint{margin-top:4px}
1990
2005
  #quickStat.is-unknown{text-decoration:underline dashed;text-underline-offset:3px}
2006
+ /* #2554 slice 2: which drawing files the model did not read. Muted, not amber (that is the Quick label's), and short: the
2007
+ full list is in its tip. */
2008
+ #coverageStat{white-space:nowrap;color:var(--mut);max-width:16ch;overflow:hidden;text-overflow:ellipsis}
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)}
1991
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}
1992
2013
  .conf-quick b{color:var(--warn)}
1993
2014
  #srcStat b{display:inline-block;max-width:130px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
@@ -2871,6 +2892,8 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2871
2892
  #m3dLegend .lrow.sub{padding-left:34px} /* a row inside a nested category — indented one level deeper */
2872
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}
2873
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) */
2874
2897
  #m3dLegend .lrow.flash{background:rgba(59,130,246,.12)}
2875
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)}
2876
2899
  /* The Ctrl+Shift drag-out badge. Same recipe as .leg-drag-ghost but sized to its text (a fixed width
@@ -2894,6 +2917,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2894
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) */
2895
2918
  #m3dLegend .lsempty{color:var(--mut);font-size:11px;padding:10px 4px;text-align:center}
2896
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 */
2897
2921
  /* Show-all reset bar — panel-local entry to showAllGroups(); shown only when something is hidden/isolated. Clones the
2898
2922
  .lsearch full-width box recipe; brand border on hover only (a one-shot action, not a mode → no solid fill). */
2899
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}
@@ -2950,6 +2974,36 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2950
2974
  cube was dropped 44px for a collision that cannot happen and sat 56 from the top against 12 from
2951
2975
  the right. Equal insets put it in the corner. */
2952
2976
  #m3dCube{position:absolute;right:12px;top:12px;width:84px;height:84px;display:none;z-index:6;cursor:pointer;filter:drop-shadow(0 6px 14px rgba(0,0,0,.5))}
2977
+ /* Flo's button sits centred under the cube, in the canvas bar's icon-button idiom. */
2978
+ /* Minimize, beside Flo while the pointer is on it (steel-3d-view.js places it). Hidden with visibility too, so
2979
+ a faded chip is never a tab stop. */
2980
+ #m3dFloMin{position:fixed;z-index:7;width:24px;height:24px;min-width:0;min-height:0;margin:0;padding:0;display:flex;align-items:center;justify-content:center;background:var(--panel);border:1px solid var(--line);border-radius:5px;box-shadow:0 4px 10px rgba(0,0,0,.35);color:var(--mut);cursor:pointer;opacity:0;visibility:hidden;transition:opacity .16s ease,visibility 0s linear .16s}
2981
+ #m3dFloMin.show{opacity:1;visibility:visible;transition:opacity .16s ease}
2982
+ #m3dFloMin:hover{background:var(--btn-hover);color:var(--text)}
2983
+ #m3dFloMin:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
2984
+ #m3dFloMin svg{width:14px;height:14px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
2985
+ @media (prefers-reduced-motion:reduce){#m3dFloMin,#m3dFloMin.show{transition:none}}
2986
+ /* Flo's card: what the member Flo stands on is, beside Flo's head (steel-3d-view.js places it every frame). It is
2987
+ on the 3D stage, which is always dark, so it stays dark in the light theme too. Never in the way: it takes no
2988
+ pointer, so orbit and pick go straight through it. */
2989
+ #m3dFloCard{--fc-s:1;position:fixed;z-index:6;min-width:calc(150px * var(--fc-s));max-width:calc(220px * var(--fc-s));padding:calc(8px * var(--fc-s)) calc(11px * var(--fc-s)) calc(9px * var(--fc-s));background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 22px rgba(0,0,0,.45);color:var(--text);pointer-events:none;display:none}
2990
+ #m3dFloCard.show{display:block;animation:fcIn .15s ease}
2991
+ @keyframes fcIn{from{opacity:0}to{opacity:1}}
2992
+ #m3dFloCard::before{content:"";position:absolute;top:var(--fc-tail,14px);width:9px;height:9px;background:var(--panel);border:1px solid var(--line);transform:rotate(45deg)}
2993
+ #m3dFloCard[data-side="right"]::before{left:-5.5px;border-top:0;border-right:0}
2994
+ #m3dFloCard[data-side="left"]::before{right:-5.5px;border-bottom:0;border-left:0}
2995
+ #m3dFloCard .fc-cap{font:500 calc(10px * var(--fc-s))/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.06em;text-transform:uppercase;color:var(--mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
2996
+ #m3dFloCard .fc-head{font-size:calc(17px * var(--fc-s));font-weight:700;line-height:1.25;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
2997
+ #m3dFloCard .fc-head:first-child{margin-top:0}
2998
+ #m3dFloCard .fc-rows{display:grid;grid-template-columns:auto 1fr;column-gap:calc(12px * var(--fc-s));row-gap:2px;margin-top:calc(6px * var(--fc-s));font-size:calc(11.5px * var(--fc-s));line-height:1.35}
2999
+ #m3dFloCard .fc-rows:first-child{margin-top:0}
3000
+ #m3dFloCard .fc-k{color:var(--mut);font-size:calc(10px * var(--fc-s));letter-spacing:.04em;text-transform:uppercase;align-self:center;white-space:nowrap}
3001
+ #m3dFloCard .fc-v{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
3002
+ #m3dFloCard .fc-varies{font-style:italic;font-weight:500;color:var(--mut)} /* several selected and they differ: read as "not one value", like Properties' Varies */
3003
+ #floCardScope .fc-reset{display:block;width:auto;text-align:left;margin:2px 0 4px 47px;padding:3px 4px;background:none;border:0;color:var(--brand);font-size:11px;cursor:pointer}
3004
+ #floCardScope .fc-reset:hover{text-decoration:underline}
3005
+ #floCardScope .fc-reset:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
3006
+ @media (prefers-reduced-motion:reduce){#m3dFloCard.show{animation:none}}
2953
3007
  /* Tekla-style world-axis triad, bottom-right (where the cube used to sit). Passive readout
2954
3008
  (pointer-events:none) — orientation is the ViewCube's job; this only SHOWS where world X/Y/Z point. */
2955
3009
  #m3dAxesDock{position:absolute;right:15px;bottom:12px;display:none;flex-direction:column;align-items:center;gap:4px;z-index:5;pointer-events:none}
@@ -3008,6 +3062,8 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
3008
3062
  <script src="commands-steel.js"></script>
3009
3063
  <!-- An Esc this editor leaves unused closes the shell's editor overlay (#1571); mounted after the keydown ladder. -->
3010
3064
  <script src="overlay-escape.js"></script>
3065
+ <script src="flo.js"></script>
3066
+ <script src="flo-card.js"></script>
3011
3067
  <script type="importmap">{"imports":{"three":"./vendor/three.module.js","three/addons/":"./vendor/","three-bvh-csg":"./vendor/three-bvh-csg.module.js"}}</script>
3012
3068
  <script type="module" src="./steel-3d-view.js"></script>
3013
3069
  <!-- grid-core is an ES module; the editor's classic script reaches it via window.GridCore (set before
@@ -3119,6 +3175,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
3119
3175
  <span class=stat id=saveStat data-tip="Edits auto-save in this browser (localStorage)">Saved</span>
3120
3176
  <span class=stat id=srcStat style="display:none"></span>
3121
3177
  <span class=stat id=quickStat data-command-id="steel.quick-model-chip" tabindex=0 style="display:none"></span>
3178
+ <span class=stat id=coverageStat data-command-id="steel.read-coverage-chip" tabindex=0 style="display:none"></span>
3122
3179
  <span class=tb-sep></span>
3123
3180
  <button data-command-id="steel.undo" id=undoB data-tip="Undo (Ctrl+Z)">↶</button>
3124
3181
  <button data-command-id="steel.redo" id=redoB data-tip="Redo (Ctrl+Y / Ctrl+Shift+Z)">↷</button>
@@ -4165,6 +4222,7 @@ function legendBody(key){
4165
4222
  return legendBodies[key];
4166
4223
  }
4167
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.
4168
4226
  let CkStd = null; // checkpoint-standard.js — the ONE place a steel standard is named for a reader. A
4169
4227
  // dynamic import for the same reason DisplayUnits is one: a `<script type=module>` is DEFERRED and
4170
4228
  // binds AFTER this classic script has already drawn. The Drawing Filter checkpoint imports the same
@@ -4394,7 +4452,7 @@ function handleContractChanged(m){
4394
4452
  const parked=parkDraftForExternalChange();
4395
4453
  const lead=(typeof m.reason==='string'&&CHANGE_LEAD[m.reason])||'This model was changed';
4396
4454
  showAiUpdateBanner(parked?lead+'. Reload to see the newest version. Your unsaved edits are kept on this computer.':lead+', but your unsaved edits could not be kept on this computer, so reloading now would lose them. Write down or take a screenshot of what you changed first.',parked?{onSeeChanges:seeChangesFromOpenTab}:{noReload:true,onSeeChanges:seeChangesFromOpenTab});
4397
- }else location.reload();
4455
+ }else{if(window.flolessModelFloRemember)window.flolessModelFloRemember();location.reload();} /* Flo visits what changed once the model is back */
4398
4456
  }
4399
4457
  function bufferContractEvent(m){
4400
4458
  if(!Number.isSafeInteger(m.storeRevision)||m.storeRevision<0||typeof m.etag!=='string'){console.warn('steel-editor: ignored an unorderable contract event');return;}
@@ -4542,6 +4600,27 @@ function handleReviewChanged(m){
4542
4600
  el.style.display='';
4543
4601
  if(typeof renderConfQuick==='function')renderConfQuick();
4544
4602
  }
4603
+ /* #2554 slice 2: which drawing files the loaded model did not read, beside the Quick chip and never inside it. Server-owned:
4604
+ no edit here changes it, so it is painted from each load. Absent (null) = the whole set was read; undefined = an
4605
+ unreadable reply, which leaves the chip as it was. */
4606
+ function paintCoverageStat(c){
4607
+ if(c===undefined)return;
4608
+ const el=document.getElementById('coverageStat');if(!el)return;
4609
+ const shown=c&&(c.state==='part'||c.state==='unknown')&&typeof c.short==='string'&&c.short?c:null;
4610
+ if(!shown){el.style.display='none';el.textContent='';el.removeAttribute('data-tip');el.removeAttribute('role');el.onclick=el.onkeydown=null;return;}
4611
+ el.textContent=shown.short;
4612
+ el.classList.toggle('is-unknown',shown.state==='unknown');
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
+ }
4622
+ el.style.display='';
4623
+ }
4545
4624
  /* The confidence report's line: scoped to the last saved model, and it says so when the report shows unsaved edits. */
4546
4625
  function renderConfQuick(){
4547
4626
  const el=document.getElementById('confQuick');if(!el)return;
@@ -4826,36 +4905,48 @@ function contractFailureState(status, code, serverError, projectScoped) {
4826
4905
  }
4827
4906
 
4828
4907
  /**
4829
- * #3097: the sentence a person reads for a failed request on this page. The server's own `error` is shown as
4830
- * written wherever this page has always shown it (which server text to trust is a separate question, Slice 2);
4831
- * a failure the server said nothing about gets the shared failure-copy.js sentence, never "(500)" or "HTTP 403".
4908
+ * #3097: the sentence a person reads for a failed request on this page. The server's own sentence is shown as
4909
+ * written when it wrote one for the person (`personText`: never raw exception text it marked `diagnostic`);
4910
+ * anything else gets the shared failure-copy.js sentence, never "(500)" or "HTTP 403".
4832
4911
  * `ctx` is failureCopy's: `action` completes "Couldn’t …", `retrySafe` only for a request that just reads.
4833
4912
  */
4834
4913
  function replyFailureText(status, body, ctx) {
4835
- const said = body && typeof body.error === 'string' ? body.error.trim() : '';
4836
- return said || failureCopy({ status, body: body && typeof body === 'object' ? body : null }, ctx).text;
4914
+ return personText(body) || failureCopy({ status, body: body && typeof body === 'object' ? body : null }, ctx).text;
4837
4915
  }
4838
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
+
4839
4920
  /**
4840
- * #3097: the sentence for a caught error. An error this page threw FOR a person (`forPerson`, its message already a
4841
- * sentence) is said as written; anything else — the browser's "Failed to fetch", a check that threw, a save's own
4842
- * 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.
4843
4924
  */
4844
- function personErrorText(e, ctx) {
4845
- if (e && e.forPerson && typeof e.message === 'string' && e.message.trim()) return e.message;
4846
- console.warn('steel-editor: ' + ((ctx && ctx.action) || 'a step') + ' failed', e);
4847
- 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;
4848
4938
  }
4849
4939
 
4850
4940
  /**
4851
- * #3097: what a failed switch to the 3D view says. The scene route's own sentence keeps its old lead ("Could not
4852
- * open 3D view: …"); anything else — an unreadable reply, a refusal with nothing said, no answer, a renderer that
4853
- * 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.
4854
4945
  */
4855
4946
  function threeDOpenFailureText(e) {
4856
- if (e && e.forPerson && typeof e.message === 'string' && e.message.trim()) return 'Could not open 3D view: ' + e.message;
4857
- console.error('steel-editor: the 3D view did not open', e);
4858
- 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 });
4859
4950
  }
4860
4951
 
4861
4952
  /* WHY A SECOND COUNTER AND NOT JUST `modelEditGeneration`.
@@ -4874,7 +4965,7 @@ async function boot() {
4874
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; }
4875
4966
  armEarlyViewToggle(); // BEFORE the first await — that is the whole point; see above
4876
4967
  startContractEvents(); // subscribe first; contract events buffer until the atomic snapshot is installed
4877
- [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([
4878
4969
  import('./display-units.js'), import('./grid-display.js'),
4879
4970
  import('./steel-3d-core.js'), import('./steel-view-generation.js'), import('./steel-model-commands.js'),
4880
4971
  import('./steel-detail-refs.js'), import('./steel-model-v2-projection.js'),
@@ -4884,7 +4975,7 @@ async function boot() {
4884
4975
  import('./model-viewport-toolbar.js'), import('./model-viewport-lighting.js'), import('./model-pointer-dock.js'), import('./model-editor-shell.js'),
4885
4976
  import('./connection-review-client.js'), import('./steel-profile-colours.js'),
4886
4977
  import('./steel-reference-sheet.js'), import('./steel-read-confidence.js'),
4887
- 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'),
4888
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'),
4889
4980
  ]);
4890
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
@@ -4966,6 +5057,7 @@ async function boot() {
4966
5057
  // live, and observable to anything that runs in between. Validate, then publish.
4967
5058
  const snapshotPayload = await res.json();
4968
5059
  paintQuickStat(snapshotPayload && typeof snapshotPayload === 'object' ? (snapshotPayload.quick ?? null) : undefined);
5060
+ paintCoverageStat(snapshotPayload && typeof snapshotPayload === 'object' ? (snapshotPayload.coverage ?? null) : undefined);
4969
5061
  lastAiReviews = snapshotPayload && typeof snapshotPayload === 'object' && snapshotPayload.aiReviews && typeof snapshotPayload.aiReviews === 'object' ? snapshotPayload.aiReviews : null; // #2521 row 8a
4970
5062
  const loaded = snapshotPayload && snapshotPayload.contract;
4971
5063
  // Shape first, then type. A body that is null, an array or a scalar has no `type` to test, so a
@@ -5080,7 +5172,7 @@ async function boot() {
5080
5172
  // showed the UK chip while every profile, weight, material and RFI on the page stayed US-backed —
5081
5173
  // so the editor told the user their catalogue held US shapes only, for steel the server resolves
5082
5174
  // perfectly. `C` is loaded by here (the lines below read it), so the contract can answer.
5083
- 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);
5084
5176
  if (!_sr.ok) throw new Error('HTTP ' + _sr.status);
5085
5177
  const _sj = await _sr.json();
5086
5178
  if (!_sj.weights || typeof _sj.weights !== 'object' || !_sj.sections || typeof _sj.sections !== 'object') throw new Error('payload missing weights/sections');
@@ -5089,6 +5181,9 @@ async function boot() {
5089
5181
  window.__STEEL_SECTIONS = _sj.sections;
5090
5182
  window.__STEEL_PROFILE_CATALOG = _sj.catalog;
5091
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 : {};
5092
5187
  } catch (e) {
5093
5188
  window.__STEEL_CATALOG_LOAD_FAILED = true;
5094
5189
  bumpRfiEpoch(); // …and the failure is a change of answer too, not an absence of one
@@ -5629,7 +5724,7 @@ function aiNoteText(item,marks,wrote){
5629
5724
  switch(item.channel){
5630
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.';
5631
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.';
5632
- 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.';
5633
5728
  case'audit-gap':return'The AI settled a question the drawings left open'+chosen+'.';
5634
5729
  case'unmodelled-detail':return'The AI left a detail unmodelled'+chosen+'.';
5635
5730
  case'connection':return'The AI assumed a connection FloLess cannot place on a member now'+chosen+'.';
@@ -5831,19 +5926,32 @@ function aiReviewsRefresh(){
5831
5926
  started is applied, so an older answer arriving last never offers again what was just recorded. */
5832
5927
  let mpLoadSeq=0;
5833
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
+ }
5834
5936
  async function mpLoad(keepLive){
5835
5937
  const state=makePrecise;if(!state||!PROJECT)return;
5836
5938
  const seq=++mpLoadSeq;
5837
5939
  try{
5838
- 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;
5839
5941
  mpAdopt(d);state.review=d;state.status='ready';if(!keepLive)state.live='';
5942
+ mpRestSettle(state,'shown');
5840
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);
5841
5944
  }catch(e){
5842
- if(makePrecise!==state||seq!==mpLoadSeq)return;
5945
+ if(makePrecise!==state){mpRestSettle(state);return;}if(seq!==mpLoadSeq)return;
5843
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
+ }
5844
5952
  // What the confirm said stays (it may be that FloLess cannot tell what was recorded); only its promise that the
5845
5953
  // list shows the latest is taken back.
5846
- if(state.review){
5954
+ else if(state.review){
5847
5955
  const said=keepLive&&state.live&&!state.live.endsWith(MP_REFRESH_FAILED)?state.live.replace(/ ?The list now shows what is still to review\.$/,''):'';
5848
5956
  state.live=keepLive&&state.live.endsWith(MP_REFRESH_FAILED)?state.live:(said?said+' ':'')+MP_REFRESH_FAILED;
5849
5957
  }
@@ -5863,9 +5971,12 @@ function openMakePrecise(){
5863
5971
  makePrecise={status:'loading',review:null,live:'',busy:false,changed:new Set(),arm:null,armTimer:0,limits:{},focus:{key:'title'},mark:null};
5864
5972
  render();mpLoad();
5865
5973
  }
5974
+ window.openMakePrecise=openMakePrecise; // the header's Part of the set chip (paintCoverageStat) opens it from another scope
5866
5975
  function closeMakePrecise(){
5867
5976
  if(!makePrecise)return;clearTimeout(makePrecise.armTimer);makePrecise=null;render();
5868
- (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();
5869
5980
  }
5870
5981
  /* The chat UI session cookie the confirm route asks for. Minted once; asked again once if it expired. */
5871
5982
  function mpSession(){
@@ -5946,7 +6057,9 @@ async function mpConfirm(items){
5946
6057
  ...(items.every(c=>c.outcome==='changed')?{changed:true}:{})});
5947
6058
  if(differently){state.mark=null;state.focus={after:[...rest,...after]};await mpLoad(true);return;}
5948
6059
  if(conflict){
5949
- 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);
5950
6063
  state.focus={after:[...(d.changed||[]),...rest,...after]};render();return;
5951
6064
  }
5952
6065
  // Focus: after a full confirm the next one to review; otherwise the first one this confirm did not record.
@@ -6004,11 +6117,150 @@ function mpWhereToChange(c){
6004
6117
  default:return'Change it in the model here in the editor, or read the drawings again from Attach revised drawings in the workspace.';
6005
6118
  }
6006
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
+ }
6007
6258
  function renderMakePrecisePanel(p){
6008
6259
  const state=makePrecise,review=state.review,prog=review&&review.progress;
6009
6260
  // The rebuild replaces every node: keep focus, the list's scroll and each open "Why?".
6010
6261
  const active=document.activeElement,keepKey=active&&p.contains(active)?active.getAttribute('data-mp-key'):null;
6011
6262
  const oldList=p.querySelector('#mpList'),keepScroll=oldList?oldList.scrollTop:0;
6263
+ const oldRest=p.querySelector('#mpRestList'),keepRestScroll=oldRest?oldRest.scrollTop:0;
6012
6264
  const openWhy=new Set([...p.querySelectorAll('details.mp-why[open]')].map(x=>x.dataset.mpId));
6013
6265
  p.setAttribute('aria-busy',String(!!state.busy));p.setAttribute('aria-labelledby','mpTitle');
6014
6266
  const dis=state.busy?' disabled':'',s=n=>n===1?'':'s';
@@ -6019,11 +6271,13 @@ function renderMakePrecisePanel(p){
6019
6271
  if(state.status==='loading')html+='<div class=mer-empty role=status>Reading the AI decisions…</div>';
6020
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>`;
6021
6273
  else if(!prog.remaining){
6022
- 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);
6023
6276
  }else{
6024
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>';
6025
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>';
6026
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
6027
6281
  review.groups.forEach((g,gi)=>{
6028
6282
  const items=g.items.slice(0,mpShownIn(g)),hidden=g.items.length-items.length;
6029
6283
  const can=g.items.filter(c=>c.confirmable),gk=esc(g.id),gl=esc(g.title);
@@ -6037,6 +6291,7 @@ function renderMakePrecisePanel(p){
6037
6291
  }
6038
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>`;
6039
6293
  if(g.consequence)html+=`<p class=mp-cons>${esc(g.consequence)}</p>`;
6294
+ if(g.id==='scope'&&review.readRest)html+=mpRestHtml(state);
6040
6295
  for(const c of items){
6041
6296
  const which=twin.get(c.decisionId)||'';
6042
6297
  const id=esc(c.decisionId),changed=state.changed.has(c.decisionId),q0=c.question||c.chosen||'An AI decision';
@@ -6078,6 +6333,7 @@ function renderMakePrecisePanel(p){
6078
6333
  });
6079
6334
  html+='</div>';
6080
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>`;
6081
6337
  html+=`<div class=mer-live id=mpLive role=status aria-live=polite>${esc(state.live||'')}</div>`;
6082
6338
  p.innerHTML=html;
6083
6339
  const card=id=>mpCards().find(c=>c.decisionId===id),group=id=>review&&review.groups.find(g=>g.id===id);
@@ -6128,6 +6384,7 @@ function renderMakePrecisePanel(p){
6128
6384
  };
6129
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));};
6130
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);
6131
6388
  const list=p.querySelector('#mpList');if(list)list.scrollTop=keepScroll;
6132
6389
  const f=state.focus;state.focus=null;
6133
6390
  const byKey=k=>p.querySelector('[data-mp-key="'+CSS.escape(k)+'"]');
@@ -6136,12 +6393,15 @@ function renderMakePrecisePanel(p){
6136
6393
  else if(f&&f.key)el=byKey(f.key)||(f.orCard?p.querySelector('[data-mp-id="'+CSS.escape(f.orCard)+'"] summary'):null);
6137
6394
  else if(keepKey)el=byKey(keepKey);
6138
6395
  if(el)el.focus({preventScroll:!(f&&(f.after||f.orCard))});
6396
+ const restList=p.querySelector('#mpRestList');if(restList)restList.scrollTop=keepRestScroll;
6139
6397
  }
6140
6398
  const newModelId=()=>`m-v2-${Date.now().toString(36)}-${(v2IdSeq++).toString(36)}`;
6141
6399
  V2_SESSION=V2Commands.createV2CommandSession(C,{
6142
6400
  validate:doc=>V2Validation.validateClientSteelModelV2(doc,V2_SCHEMA),
6143
6401
  mintId:newModelId,
6144
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),
6145
6405
  // This re-points P after EVERY commit. During ?selftest=1 it must not: the guard swapped P for a CLONE
6146
6406
  // so its fixtures cannot touch the live projection, and re-pointing would hand the live one back on the
6147
6407
  // first commit — after which every `P.members=[…]` fixture writes straight into it and the restore,
@@ -6376,7 +6636,7 @@ async function scanMemberEnds(liveMessage,pinnedScope){ // pinnedScope: re-che
6376
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;}
6377
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);}
6378
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();
6379
- }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);}
6380
6640
  }
6381
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();}
6382
6642
  // Ends Apply would extend right now: ticked, still needing review, with a chosen support. The one thing closing the
@@ -6430,10 +6690,10 @@ function focusMemberEnd(index,opts){
6430
6690
  }
6431
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();}
6432
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;
6433
- 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);}}
6434
- 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();}}}
6435
- 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();}}}
6436
- 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.'}));}}
6437
6697
  // Selection is MODEL-WIDE, not per-sheet: the 3D shows every plan, so a pick / box-select / Ctrl-click can
6438
6698
  // span sheets. byId + selArr therefore search ALL plans (not just the active P) so the inspector + edits see
6439
6699
  // the whole selection — else selecting a roof (S-203) member while S-202 is active shows nothing, and a
@@ -7234,7 +7494,7 @@ function commitMemberEndpointsProvider(id,spec,source){
7234
7494
  // A column is stored base→top, and the model refuses one the other way round. Say so here, in words and
7235
7495
  // before the frame policy: dragging a plumb column's top below its base is ALSO a turn end for end, and
7236
7496
  // the column rule is the reason the user can act on.
7237
- 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)
7238
7498
  // A gesture that moves the line RIGIDLY (the axial slide, and since the redesign the two lateral
7239
7499
  // translates) must merely KEEP partFrame's branch, in both directions; a swing re-aims the member and
7240
7500
  // has to land on the ordinary branch; the end-node drag may not ENTER the plumb cone, nor turn end for
@@ -7547,13 +7807,19 @@ function parseVec(s){s=String(s==null?'':s).trim();if(!s)return null;
7547
7807
  let defaultTosMm=0, addProfile='', addMaterial='', addType='beam'; // addProfile/addMaterial/addType are independent defaults for newly drawn members
7548
7808
  function nativeElevationModel(){return C&&C.type===MODEL_V2_TYPE;}
7549
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
+
7550
7816
  // THE MODEL'S OWN CATALOGUE NAMES THE EMPTY DESCRIPTOR, not a literal 'US'.
7551
7817
  //
7552
7818
  // When the fetch fails there are no rows either way — but the descriptor's `environment` is what names
7553
7819
  // the standard and picks the MATERIAL catalogue, so a UK project whose fetch failed presented American
7554
7820
  // grades (A992/A36) as if they were its own. An empty picker that says UK is an honest failure; a
7555
7821
  // populated one offering the wrong country's steel is a wrong answer wearing the right chrome.
7556
- const _catalogEnvironment=(typeof C!=='undefined'&&C&&C.environment==='UK')?'UK':'US';
7822
+ const _catalogEnvironment=_envTraits().id;
7557
7823
  const profileCatalog=window.__STEEL_PROFILE_CATALOG||{environment:_catalogEnvironment,standard:'Profile catalog',families:[],rows:[]};
7558
7824
  const profileCatalogRows=CatalogPicker.buildProfileRows(profileCatalog,window.__STEEL_SECTIONS||{},window.__STEEL_WEIGHTS||{});
7559
7825
  const materialCatalog=CatalogPicker.materialCatalogDescriptorFor(profileCatalog.environment||_catalogEnvironment,window.__STEEL_MATERIAL_CATALOG);
@@ -7576,8 +7842,11 @@ function profileCatalogValues(){return profileCatalogRows.flatMap(r=>[r.designat
7576
7842
  // S355J2H is the hot-finished hollow grade, S355 the modern default for open sections (S275 is the
7577
7843
  // legacy grade and is deliberately NOT the default).
7578
7844
  function profileDefaultMaterial(profile){const p=_canonDes(profile);
7579
- if(_modelEnvironment()==='UK')return /^(CHS|SHS|RHS|EHS)/.test(p)?'S355J2H':'S355';
7580
- 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)]||'';}
7581
7850
  function applyProfileChoice(ids,value){
7582
7851
  const v=_canonDes(value);if(!v)return;
7583
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);}});
@@ -8747,13 +9016,12 @@ function _profileDimIn(token){
8747
9016
  // `typeof C` rather than a bare `C`: these functions are sliced out of this page by the geometry
8748
9017
  // harnesses, where the contract is not in scope, and a bare reference is a ReferenceError there rather
8749
9018
  // than a falsy read. Absent means the compatibility fallback, exactly as it does on the server.
8750
- const _modelEnvironment=()=>(typeof C!=='undefined'&&C&&C.environment==='UK')?'UK':'US';
8751
- const _doubleAngleScale=()=>_modelEnvironment()==='UK'?1/IN_TO_MM:1;
9019
+ const _doubleAngleScale=()=>_envTraits().designationTokenUnit==='mm'?1/IN_TO_MM:1;
8752
9020
  // The name to CALL the section table when telling a user their designation is not in it. AISC is the
8753
9021
  // American Institute of Steel Construction, so saying "not in the AISC table" to someone modelling in
8754
9022
  // the UK names the wrong standards body about their own steel — and does it in the RFI list, the
8755
9023
  // confidence panel and the footprint tooltip, i.e. everywhere the tool explains a refusal.
8756
- const _catalogLabel=()=>_modelEnvironment()==='UK'?'UK section':'AISC';
9024
+ const _catalogLabel=()=>_envTraits().catalogueNoun;
8757
9025
  function _parseDoubleAngleIn(profile){
8758
9026
  const p=_canonDes(profile);if(!p.startsWith('2L'))return null;
8759
9027
  const orientation=p.endsWith('SLBB')?'slbb':p.endsWith('LLBB')?'llbb':null;
@@ -8799,7 +9067,7 @@ function profileDimsIn(profile){
8799
9067
  // Gated to a metric model deliberately: the US arms below already consult this same table where they
8800
9068
  // should, and reordering them is a behaviour change to shipped US drawing that this slice has twice
8801
9069
  // been caught making by accident.
8802
- if(_modelEnvironment()==='UK'){
9070
+ if(!_envTraits().aiscInchTable){
8803
9071
  // A SHAPE THE CATALOGUE REFUSES IS REFUSED HERE TOO. An elliptical hollow section (EHS) is marked
8804
9072
  // geometrySupported:false and the server answers 'unsupported-custom' with no drawable geometry —
8805
9073
  // but its row still carries a depth and a width, so falling through to the raw table below drew all
@@ -9834,6 +10102,26 @@ function updGridToggle(){const b=document.getElementById('gridToggleB');if(!b)re
9834
10102
  // other grid operation.
9835
10103
  function gridSetVisible(on){if(!C||!gridOf()||on===gridOn())return;
9836
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});}
9837
10125
  document.addEventListener('gridcore-ready',()=>{try{if(C)render();}catch(_){}}); // module shim finished after boot → paint the grid layer
9838
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));}}}
9839
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)
@@ -12209,6 +12497,10 @@ function refusedSheetPropsHtml(rows){
12209
12497
  out+=kv('ID',esc(idText(m)));
12210
12498
  out+=kv('Mark',markHtml(m.id));
12211
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));}
12212
12504
  out+=kv('Material',m.material?esc(m.material):esc(profileDefaultMaterial(m.profile))+' <span style="color:var(--mut);font-size:11px">· profile default</span>');
12213
12505
  const withheld=[];
12214
12506
  for(const def of PROP_DEFS){
@@ -13163,6 +13455,7 @@ function panel(){
13163
13455
  ${typeFilterHTML(arr)}
13164
13456
  ${memberTypeField('mTypeS',[m])}
13165
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>`:''}
13166
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>
13167
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>
13168
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>
@@ -15634,10 +15927,9 @@ function syncEnvChip(){
15634
15927
  const b=document.createElement('b');
15635
15928
  b.textContent=label;
15636
15929
  chip.append(b);
15637
- chip.setAttribute('data-tip',stated==='UK'
15638
- ?'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.'
15639
- :stated==='US'
15640
- ?'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
15641
15933
  // Two different sentences for the two unstated cases, because only one of them is a gap. Telling
15642
15934
  // someone on a projectless surface that "projects created since this setting existed state one
15643
15935
  // explicitly" is advice about something they cannot do from here.
@@ -15680,6 +15972,54 @@ function updDimToggle(){const b=document.getElementById('dimToggleB');if(!b)retu
15680
15972
  document.getElementById('dimToggleB').onclick=e=>{e.stopPropagation();dimsVisible=!dimsVisible;updDimToggle();render();};
15681
15973
 
15682
15974
  function updPosGizmoToggle(){const b=document.getElementById('posGizmoToggleB');if(!b)return;b.disabled=false;b.classList.toggle('on',showPosGizmo);b.setAttribute('aria-checked',String(showPosGizmo));}
15975
+ /* Show Flo is OFF until the person turns it on in the 3D Labels menu: Flo is an extra (owner, 2026-11-04). The key is
15976
+ read by steel-3d-view.js when 3D starts; the "–" beside Flo turns it off the same way. */
15977
+ /* Flo's settings live here, in memory, seeded once from storage and written back to it best-effort: storage can be
15978
+ blocked (a locked-down browser), and then every switch still works for this page, it is just not kept. A var read
15979
+ lazily, because syncDisplayRows can run before this line does. */
15980
+ var floSettings;
15981
+ function floSt(){if(!floSettings){let on=false,size=100;
15982
+ try{on=localStorage.getItem('steel:flo3d:v2')==='on';const v=Number(localStorage.getItem('steel:floSize:v2'));if(v>=60&&v<=200)size=Math.round(v);}catch(_){}
15983
+ floSettings={on,size,fields:FloCard.readFloCardFields(floCardStore())};}
15984
+ return floSettings;}
15985
+ function floShown(){return floSt().on;}
15986
+ let floShellMood='idle';
15987
+ function updFloToggle(){const on=floShown();
15988
+ const b=document.getElementById('floToggleB');if(b){b.classList.toggle('on',on);b.setAttribute('aria-checked',String(on));}
15989
+ updateLabelsBandMarks();}
15990
+ function rememberFloShown(on){floSt().on=!!on;try{localStorage.setItem('steel:flo3d:v2',on?'on':'off');}catch(_){}}
15991
+ /* The key is written here, so the switch holds before the 3D view exists. */
15992
+ function setFloShownFromPage(on){rememberFloShown(on);modelEditor.steel.setFlo(on);updFloToggle();}
15993
+ /* The chip beside Flo hides it from inside the 3D view: the key follows, so it stays off until switched back on in Labels. */
15994
+ window.addEventListener('floless:flo3d-shown',e=>{const via=e.detail&&e.detail.via;if(via==='chip')rememberFloShown(false);updFloToggle();});
15995
+ /* Flo's card: which details it shows (web/flo-card.js keeps the list and its order; stored per browser, like Show Flo). */
15996
+ function floCardStore(){try{return localStorage;}catch(_){return null;}}
15997
+ function floCardFields(){return floSt().fields;}
15998
+ function updFloCardRows(){const want=floCardFields();
15999
+ for(const r of document.querySelectorAll('#floCardScope [data-key]')){const on=want.includes(r.dataset.key);r.classList.toggle('on',on);r.setAttribute('aria-checked',String(on));}}
16000
+ function setFloCardFields(fields){floSt().fields=FloCard.sanitizeFloCardFields(fields);FloCard.writeFloCardFields(floCardStore(),fields);updFloCardRows();if(view3dReady)modelEditor.steel.refreshFloCard();}
16001
+ /* The section is drawn into the 3D Labels menu from the adapter's spec (model-editor-steel-adapter.js), and drawn
16002
+ again whenever the 3D toolbar is, so it is wired after every render (render3DToolbarShell). */
16003
+ function wireFloSection(){const section=document.getElementById('floSection'),d=document.getElementById('floCardDisc'),body=document.getElementById('floCardScope');
16004
+ if(!section||!d||!body)throw new Error('Flo controls are missing from the 3D Labels menu');
16005
+ section.onclick=e=>e.stopPropagation();
16006
+ section.onkeydown=e=>{if((e.key==='Enter'||e.key===' ')&&e.target.tagName==='BUTTON'){e.preventDefault();e.stopPropagation();if(!e.repeat)e.target.click();}};
16007
+ d.onclick=()=>{const open=d.getAttribute('aria-expanded')!=='true';d.setAttribute('aria-expanded',String(open));body.hidden=!open;d.querySelector('.pl-chevron').textContent=open?'▾':'▸';if(!open)d.focus();};
16008
+ document.getElementById('floToggleB').onclick=()=>setFloShownFromPage(!floShown());
16009
+ document.getElementById('floCardNote').textContent='Shown on Flo’s card. Several selected: a shared value, or Varies.';
16010
+ for(const r of body.querySelectorAll('[data-key]'))r.onclick=()=>{const k=r.dataset.key,want=floCardFields();setFloCardFields(want.includes(k)?want.filter(x=>x!==k):want.concat(k));};
16011
+ document.getElementById('floCardReset').onclick=()=>setFloCardFields(FloCard.FLO_CARD_DEFAULT);
16012
+ const size=document.getElementById('floSize'),sizeV=document.getElementById('floSizeV'),pct=floSizePct();
16013
+ size.value=pct;sizeV.textContent=pct+'%';
16014
+ size.addEventListener('input',()=>{const p=Math.round(Number(size.value));sizeV.textContent=p+'%';floSt().size=p;try{localStorage.setItem('steel:floSize:v2',String(p));}catch(_){}if(view3dReady)modelEditor.steel.setFloSize(p/100);});
16015
+ updFloCardRows();updFloToggle();}
16016
+ /* Flo size, in percent (Labels → Flo size): one setting for Flo and its card, stored per browser like Show Flo. The 3D view
16017
+ reads the same key when it starts (steel-3d-view.js floStoredSize), and the same range: anything else is 100%. */
16018
+ function floSizePct(){return floSt().size;}
16019
+ /* The shell pushes AI Chat's mood for this project (workspaces.js syncModelFlo): thinking, working, yourcall or idle. */
16020
+ window.flolessModelFlo=(state)=>{floShellMood=(state&&state.mood)||'idle';updFloToggle();try{modelEditor.steel.setFloMood(state&&state.mood);}catch(_){}};
16021
+ /* handleContractChanged lives outside this block and cannot see modelEditor: it reaches Flo through this. */
16022
+ window.flolessModelFloRemember=()=>{try{modelEditor.steel.floRemember();}catch(_){}};
15683
16023
  document.getElementById('aiMarksToggleB').onclick=e=>{e.stopPropagation();showAiMarks=!showAiMarks;try{localStorage.setItem('steel:aiMarks:v2',showAiMarks?'1':'0');}catch(_){}updAiMarksToggle();render();}; // #2521 row 6: hides the 2D and 3D marks only; the strip and Inspect stay (owner ruling 2026-10-29)
15684
16024
  document.getElementById('posGizmoToggleB').onclick=e=>{e.stopPropagation();showPosGizmo=!showPosGizmo;try{localStorage.setItem('steel:posGizmo:v2',showPosGizmo?'1':'0');}catch(_){}updPosGizmoToggle();if(view3dReady&&window.Steel3DView&&window.Steel3DView.setPositionGizmoVisible)window.Steel3DView.setPositionGizmoVisible(showPosGizmo);}; // the gizmo is a 3D overlay — push straight to the view (.stopPropagation keeps the menu open, like every .dtog)
15685
16025
  // ⋯ Display → Grid label size. One setting, both views: 2D re-places its bubbles from the anchors baked
@@ -15755,7 +16095,7 @@ function updPlToggle(){const pl=C.prop_labels;if(!pl)return;reconcileActiveView(
15755
16095
  // switches the menus show, so it cannot disagree with them: the 3D button follows Ref line + the 3D property-label
15756
16096
  // switch, the 2D button follows the 2D plan's property-label switch only, whichever pane is active.
15757
16097
  function updateLabelsBandMarks(){
15758
- for(const [btnId,switchIds] of [['m3dView',['m3dRef','m3dPropLabels']],['pl2dBtn',['pl2dPropLabels']]]){
16098
+ for(const [btnId,switchIds] of [['m3dView',['m3dRef','m3dPropLabels','floToggleB']],['pl2dBtn',['pl2dPropLabels']]]){
15759
16099
  // The 2D button is wired after the 3D shell at boot, so it is skipped until it is registered. Once registered it is
15760
16100
  // required: a missing button then means the menu was wired against markup that was never drawn.
15761
16101
  if(btnId==='pl2dBtn'&&!propLabelMenus.has('pl2d'))continue;
@@ -15789,6 +16129,7 @@ function render3DToolbarShell(){
15789
16129
  bar.innerHTML=ViewportToolbar.renderToolbarMarkup(ModelEditor.steelRenderPlan());
15790
16130
  wirePropLabelSection('m3dPl','m3dPropLabels','m3dPlDisclosure','m3dPlScope','3d');
15791
16131
  updPlToggle();
16132
+ wireFloSection();
15792
16133
  return bar;
15793
16134
  }
15794
16135
  render3DToolbarShell();
@@ -16462,10 +16803,11 @@ function applyConnectionBakeTruth(j,announce=true){
16462
16803
  }
16463
16804
  async function fetchScenePayload(contract=C){
16464
16805
  const r=await fetch('/api/contract/'+encodeURIComponent(APP_ID)+'/scene'+PROJECT_QS,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({contract})});
16465
- // #3097: what this throws can reach a toast ("Could not open 3D view: …"). The server's own sentence is marked as
16466
- // 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`).
16467
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});}
16468
- 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:{}});
16469
16811
  return j;
16470
16812
  }
16471
16813
  function connectionTruthRequest(){
@@ -17185,6 +17527,18 @@ const view3dApi={
17185
17527
  detailRequest('create',place,undefined,armedItems);},
17186
17528
  onIsolateChange:()=>{updateIsolateBtn();refresh3DLegend();}, // every object-visibility change (isolate, group/part/selection hide, Show all) → refresh recovery control + legend rows
17187
17529
  onWorkAreaChange:()=>updateWorkBtn(), // work area set / toggled → refresh the button + its checkbox
17530
+ // Flo's card (web/flo-card.js): the property registry's own values, so the card says exactly what Properties and the
17531
+ // property labels say. With several members selected and Flo on one of them, the card speaks for all of them by the
17532
+ // Properties pane's rule (shared value, Varies, or left out). Null when the member is gone or nothing chosen has a value.
17533
+ // Show Flo and Flo size as this page holds them (Labels menu), read when the 3D view is built.
17534
+ floSettings:()=>{const t=floSt();return {on:t.on,size:t.size};},
17535
+ floCardFor:id=>{if(!allMembers().some(x=>x.id===id))return null;
17536
+ const sel=propLabelSelection(),group=sel.length>1&&sel.some(x=>x.id===id)?sel:allMembers().filter(x=>x.id===id),look=projectedMemberLookup(),v={};
17537
+ const ms=group.map(b=>look(b.id)||b);
17538
+ for(const def of PROP_DEFS){if(!FloCard.FLO_CARD_FIELDS.includes(def.key))continue;
17539
+ const texts=ms.map(m=>{const raw=def.needsPlan&&!m.wp?(def.canonicalGet?def.canonicalGet(m):undefined):(def.labelGet||def.get)(m);return raw===undefined?undefined:def.fmt(raw);});
17540
+ const t=FloCard.aggregateFloCardValue(texts);if(t!==undefined)v[def.key]={label:def.label,text:t,varies:t===FloCard.VARIES&&ms.length>1};}
17541
+ return FloCard.floCardModel(v,floCardFields(),{count:ms.length});},
17188
17542
  };
17189
17543
  /*
17190
17544
  * THE COMMON TOOLBAR'S FACADE over the 3D view (shared 3D editor, Task 1). Mounted HERE because this
@@ -17532,7 +17886,7 @@ async function placeConnection(jointId,memberIds,skipped,token){
17532
17886
  // 428 is the client failing to send a precondition, which is a FloLess bug, not something the user
17533
17887
  // can act on — never show its header vocabulary. "Place it again" IS now a real action (the
17534
17888
  // inspector's Place again…), so the sentence names the recovery instead of stopping at the fault.
17535
- 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';
17536
17890
  toast('“'+name+'” is placed — '+why+', so it is not being watched. Use Place again… to start watching it.');
17537
17891
  return false;
17538
17892
  }
@@ -17631,9 +17985,10 @@ function reviewVerbFailed(e,fallback){
17631
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;}
17632
17986
  /* The server's own 4xx prose is written FOR the user and names what to do; anything else — a transport
17633
17987
  failure, a 5xx behind an HTML error page — is not, so the caller's sentence wins, because it is the
17634
- only one that names the connection. */
17635
- const speakable=e&&!e.transport&&e.status>=400&&e.status<500&&e.authored!==false&&e.message;
17636
- 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;}
17637
17992
  /* #3097: the why and the next step come from the shared sentence, after the caller's own words (which name the
17638
17993
  connection). A review change whose answer was lost or unexplained may have landed, so it is never told to "try
17639
17994
  again" blindly: the review status refreshes on its own and shows what the server holds. */
@@ -17804,7 +18159,7 @@ async function replaceConnectionAt(jointId,pick){
17804
18159
  captured above is detached, and mutating it would move nothing while the toast claimed it had.
17805
18160
  Cheap, and the alternative is a lie about geometry. (Codex code review.) */
17806
18161
  const live=(Array.isArray(C.joints)?C.joints:[]).find(j=>j&&j.id===jointId);
17807
- 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});
17808
18163
  mutated=true; // only now may C move
17809
18164
  /* `edit()` SOFT-FAILS: a V2CommandError is caught, toasted, and reported by a `false` RETURN rather
17810
18165
  than a throw. Discarding that return was the one hole in the no-rollback argument — the
@@ -17829,7 +18184,9 @@ async function replaceConnectionAt(jointId,pick){
17829
18184
  console.warn('steel-editor: re-placement failed',e);
17830
18185
  toast(mutated
17831
18186
  ? '“'+name+'” was moved but is no longer being watched — use Place again… to start watching it'
17832
- : '“'+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})));
17833
18190
  }finally{
17834
18191
  /* THE SINGLE MOST IMPORTANT ASSERTION IN THIS FEATURE. A leaked gate disables saving for the rest of
17835
18192
  the session, which is worse than the bug the gate fixes - so it is released on every path,
@@ -17906,7 +18263,7 @@ function legendMembers(){return legendView()==='3d'?allMembers():(P.members||[])
17906
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()];}
17907
18264
  // What the 2D list is drawn from, so render() rebuilds it only when that changed (a sheet switch, an edit, a toggle).
17908
18265
  let legendShownKey='';
17909
- 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('|');}
17910
18267
  function syncLegendToPane(){if(legendTab!=='objects'||!C||!P)return;if(legendKey()!==legendShownKey)build3DLegend();else refreshLegendSel();}
17911
18268
  // Explorer-style multi-isolate on dbl-click of a legend group row: plain = isolate just this group; Ctrl = toggle
17912
18269
  // it in/out of the isolated set; Shift = the contiguous range from the anchor row to this one (in displayed order).
@@ -17995,12 +18352,16 @@ function memberTypeSettled(m,k){
17995
18352
  ?!!b&&b.type===p.brace.type&&b.floor===p.brace.floor&&b.offset===p.brace.offset&&b.lowerEnd===p.brace.lowerEnd
17996
18353
  :b===undefined);
17997
18354
  }
17998
- 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){
17999
18360
  let dropped=0,unsupported=0;
18000
18361
  for(const m of ms){if(!m)continue;
18001
18362
  const wasBrace=isBrace(m);
18002
18363
  const patch=memberTypePatch(m,k),type=patch.memberType;
18003
- ModelCmd.patchMember(m,patch);
18364
+ if(write(m,patch)===false)continue;
18004
18365
  // Becoming a brace ORPHANS any connection hanging off this member: the bake (steel-joints.expandJoints)
18005
18366
  // refuses a brace `main`, so the joint would linger in C.joints, never render, and vanish from 3D with no
18006
18367
  // explanation. Purge it here and say so, rather than leave a recipe that can never bake. (silent-failure review)
@@ -18014,8 +18375,10 @@ function applyMemberType(ms,k){
18014
18375
  j.secondaries=j.secondaries.filter(s=>s!==m.id);unsupported++;}
18015
18376
  }
18016
18377
  }
18017
- if(dropped||unsupported)toast([dropped?dropped+' connection'+(dropped>1?'s':'')+' removed':'',
18018
- 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;
18019
18382
  }
18020
18383
  function memberTypeValueFor(ms){const vals=ms.map(memberTypeOf),one=vals.every(v=>v===vals[0]);return one?memberTypeLabel(vals[0]):'';}
18021
18384
  function memberTypeField(id,ms){
@@ -18067,8 +18430,24 @@ function wireTypeFilter(p){
18067
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).
18068
18431
  });
18069
18432
  }
18070
- function profileKeyOf(m){return canonProfile(m&&m.profile);} // matches the scene group key (contract-to-scene canonProfile)
18071
- 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(' · ');}
18072
18451
  let legendMode=(localStorage.getItem('floless.legendMode')==='type')?'type':'profile';
18073
18452
  // Built on OPEN, not once: profiles come and go as the model is edited. It lives at page scope rather
18074
18453
  // than inside wire3DBar() because building the swatch list needs the MODEL, not the 3D view, so the
@@ -18134,9 +18513,9 @@ let legendMode=(localStorage.getItem('floless.legendMode')==='type')?'type':'pro
18134
18513
  let collapsedCats=new Set((()=>{try{return JSON.parse(localStorage.getItem('floless.legendCollapsed')||'[]');}catch{return [];}})());
18135
18514
  let legendQuery=''; // transient objects-list search filter (members + connections only) — NOT persisted
18136
18515
  let legendIdHits=[]; // #2998: the member ids the current search matched by id (applyLegendFilter); one → Enter selects it
18137
- // 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
18138
18517
  // manually-collapsed category still surfaces — WITHOUT mutating the persisted collapsedCats.
18139
- 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));}
18140
18519
  function saveLegendPrefs(){try{localStorage.setItem('floless.legendMode',legendMode);localStorage.setItem('floless.legendCollapsed',JSON.stringify([...collapsedCats]));}catch{}}
18141
18520
  // Drag a typed member row onto another type category to retype it. Pointer Events (NOT the HTML5 drag API,
18142
18521
  // which paints a white browser ghost on Windows). A 6px threshold tells a drag from the row's click(hide) /
@@ -18149,7 +18528,8 @@ function wireRowDrag(row,g){const handle=row.querySelector('.drag-handle');if(!h
18149
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
18150
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);}
18151
18530
  ghost.style.transform=`translate(${ev.clientX+12}px,${ev.clientY-14}px)`;
18152
- 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
18153
18533
  if(hdr!==target){if(target)target.classList.remove('drop-target');target=hdr;if(target)target.classList.add('drop-target');}};
18154
18534
  const up=()=>{doc.removeEventListener('pointermove',move);doc.removeEventListener('pointerup',up);
18155
18535
  if(ghost)ghost.remove();if(target)target.classList.remove('drop-target');
@@ -18157,11 +18537,46 @@ function wireRowDrag(row,g){const handle=row.querySelector('.drag-handle');if(!h
18157
18537
  if(drop)retypeProfile(g.key,drop);};
18158
18538
  doc.addEventListener('pointermove',move);doc.addEventListener('pointerup',up);});}
18159
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.
18160
18548
  function retypeProfile(profKey,cat){if(!memberTypeKnown(cat))return;
18161
- const targets=(P.members||[]).filter(m=>profileKeyOf(m)===profKey);
18162
- if(!targets.length||targets.every(m=>memberTypeOf(m)===cat))return; // already that type → no-op (no empty undo step)
18163
- edit(()=>applyMemberType(targets,cat));
18164
- 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(' ');}
18165
18580
  // ════════════════════════════════════════════════════════════════════════════════════════════════════════════
18166
18581
  // Panel tabs (Objects | Views | Favourites | References) + the Views Organizer.
18167
18582
  // #m3dLegend holds the four tab bodies the main window shows as panel tabs of its left Model section; only the
@@ -20969,7 +21384,7 @@ async function refRemove(r){
20969
21384
  const mid=newMutationId();claimMutation(mid);
20970
21385
  const res=await fetch(refApi('/'+encodeURIComponent(r.id)),{method:'DELETE',headers:{'x-floless-mutation-id':mid}});
20971
21386
  const d=await res.json().catch(()=>({}));
20972
- 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;}
20973
21388
  adoptReferenceWrite(d.etag);
20974
21389
  const i=refList().findIndex(x=>x&&x.id===r.id);if(i>=0)C.reference_models.splice(i,1);
20975
21390
  refGeom.delete(r.id);refRenderedGeom.delete(r.id);refUnresolved.delete(r.id);refFailed.delete(r.id);refEmpty.delete(r.id);
@@ -21322,7 +21737,7 @@ const RI_MAX_BYTES=150*1024*1024;
21322
21737
  // early. File A's storeys would then ride file B's sha, and the reader would select nothing.
21323
21738
  riProbeRows=null;riStoreyPick=null;riTypePick=null;riPopulation=null;
21324
21739
  riClearSoft();
21325
- 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;}
21326
21741
  riSha=d.sha;riVerdict=d.verdict||null;
21327
21742
  {const bb=d.probe&&d.probe.bbox;riProbeCentre=bb?[0,1,2].map(i=>(bb.min[i]+bb.max[i])/2):null;}
21328
21743
  const said=d.probe&&d.probe.units&&d.probe.units.declared;
@@ -21432,7 +21847,9 @@ const RI_MAX_BYTES=150*1024*1024;
21432
21847
  }
21433
21848
  riClearSoft();
21434
21849
  if(!res.ok||!d.ok){
21435
- 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.'));
21436
21853
  // STAY ON CONFIRM for the refusals the picker itself can fix. `riStage('drop')` swaps the whole
21437
21854
  // body back to the dropzone, so telling somebody to "choose fewer storeys or types" would
21438
21855
  // remove every control that lets them. The other failures still go back — there is nothing to
@@ -21443,8 +21860,8 @@ const RI_MAX_BYTES=150*1024*1024;
21443
21860
  ||d.code==='reference-empty-filter'||d.code==='reference-filter-unconfirmed';
21444
21861
  if(actionable&&riStageNow!=='drop'){
21445
21862
  riStage('confirm');
21446
- const e=ri$('riConfirmErr');e.textContent=d.error||'Could not add that reference.';e.style.display='block';
21447
- }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.');}
21448
21865
  return;
21449
21866
  }
21450
21867
  adoptReferenceWrite(d.etag);
@@ -21832,11 +22249,11 @@ const RI_MAX_BYTES=150*1024*1024;
21832
22249
  // A REFUSAL PAINTED INTO A HIDDEN PANEL IS A REFUSAL NOBODY READ. Backgrounded, this modal is
21833
22250
  // `display:none`, so the note below would render perfectly and silently.
21834
22251
  if(rvBackgrounded){
21835
- 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'}));
21836
22253
  rv$('refVersionModal').style.display='flex';rvBackgrounded=false;
21837
22254
  }
21838
22255
  rvhPaint();rvStage('history');
21839
- 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'}));
21840
22257
  return;
21841
22258
  }
21842
22259
  }catch(e){
@@ -22083,7 +22500,7 @@ const RI_MAX_BYTES=150*1024*1024;
22083
22500
  const d=await res.json().catch(()=>({}));
22084
22501
  if(mine!==rvRun)return;
22085
22502
  rvClearSoft();
22086
- 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;}
22087
22504
  rvSha=d.sha;
22088
22505
  rvSubmit(mine);
22089
22506
  }catch(e){
@@ -22147,7 +22564,7 @@ const RI_MAX_BYTES=150*1024*1024;
22147
22564
  // display:none — so the state below would render perfectly and silently. Say it out loud and
22148
22565
  // bring the panel back, which is where its remedies live (choose another file, load unfiltered).
22149
22566
  if(rvBackgrounded){
22150
- 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'}));
22151
22568
  rv$('refVersionModal').style.display='flex';rvBackgrounded=false;
22152
22569
  }
22153
22570
  rvRefusal(d,res.status);return;
@@ -22278,7 +22695,7 @@ const RI_MAX_BYTES=150*1024*1024;
22278
22695
  // dropped, so a read-only comparison gets only the one that applies. THERE IS NO FOURTH.
22279
22696
  actions=readOnly?[{id:'cancel',label:'Close',weight:'primary'}]:core.REFUSAL_ACTIONS;
22280
22697
  }else{
22281
- 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'});
22282
22699
  host.appendChild(lead);
22283
22700
  if(code==='reference-filter-unmatched'){
22284
22701
  actions=[{id:'cancel',label:'Cancel',weight:'ghost'},
@@ -22395,7 +22812,7 @@ const RI_MAX_BYTES=150*1024*1024;
22395
22812
  d=await res.json().catch(()=>({}));
22396
22813
  if(mine!==rvRun){releaseMutation(mid);return;}
22397
22814
  rvClearSoft();
22398
- 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;}
22399
22816
  }catch(e){
22400
22817
  if(mine!==rvRun||(e&&e.name==='AbortError')){if(mid)releaseMutation(mid);return;}
22401
22818
  if(mid)releaseMutation(mid);
@@ -22839,7 +23256,7 @@ const RI_MAX_BYTES=150*1024*1024;
22839
23256
  if(mine!==rcGhostRun)return;
22840
23257
  if(!res.ok||!d.ok){
22841
23258
  rcGhostGaveUp(ids,RC_GHOST_FATAL.has(d&&d.code),
22842
- (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}));
22843
23260
  return;
22844
23261
  }
22845
23262
  const v=window.Steel3DView;
@@ -23100,15 +23517,17 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23100
23517
  // which row had focus and restore it at the end - ONLY if focus was already in this list, because
23101
23518
  // build3DLegend also runs on tab switches and model loads, where grabbing focus would yank the caret
23102
23519
  // out of whatever the user is actually using.
23103
- 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')||''):'';
23104
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;})();
23105
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
23106
23525
  const empty=!groups.length&&!placedDetails.length;
23107
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.'}));
23108
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
23109
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);
23110
23529
  const addRow=(g,indent,draggable)=>{const row=document.createElement('div');row.className='lrow'+(indent?' typed':'');row.dataset.key=g.key;
23111
- 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
23112
23531
  const sw=document.createElement('span');sw.className='lsw';sw.style.setProperty('--sw',g.color);sw.setAttribute('role','checkbox');sw.dataset.tip='Show / hide';
23113
23532
  row.append(sw,document.createTextNode(g.label));
23114
23533
  // Show/hide lives on the BOX; dbl-click a row isolates. When the row is part of a multi-selection, the box toggles
@@ -23125,9 +23544,18 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23125
23544
  host.appendChild(row);return row;};
23126
23545
  // A collapsible legend category: chevron (collapse) + tri-state master on/off (■/□/◪) + label + count.
23127
23546
  // getState()→'on'|'off'|'mixed' drives the master glyph; onToggle() runs the master action (refresh follows).
23128
- 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;
23129
- 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?'▼':'▶'});
23130
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();});
23131
23559
  const lab=Object.assign(document.createElement('span'),{className:'cat-label',textContent:label});
23132
23560
  const cnt=Object.assign(document.createElement('span'),{className:'cat-count',textContent:'('+count+')'});
23133
23561
  hdr.append(chev,tog,lab,cnt);
@@ -23135,7 +23563,7 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23135
23563
  if(opts.onToggle)tog.addEventListener('click',e=>{e.stopPropagation();opts.onToggle();refresh3DLegend();});
23136
23564
  updateCatTog(hdr);return hdr;};
23137
23565
  // master state/action over a set of part-group keys (members + connection categories share this)
23138
- 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');};
23139
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)
23140
23568
  const members=groups.filter(g=>g.key!=='detail'&&!CONN_ORDER.includes(g.key));
23141
23569
  const conns=groups.filter(g=>CONN_ORDER.includes(g.key)).sort((a,b)=>CONN_ORDER.indexOf(a.key)-CONN_ORDER.indexOf(b.key));
@@ -23154,7 +23582,7 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23154
23582
  const cir=document.createElementNS(NS,'circle');cir.setAttribute('cx','7');cir.setAttribute('cy','7');cir.setAttribute('r','4.5');
23155
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');
23156
23584
  svg.append(cir,lin);ico.append(svg);
23157
- 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');
23158
23586
  const clr=Object.assign(document.createElement('span'),{className:'lsx',textContent:'×'});clr.dataset.tip='Clear';
23159
23587
  inp.addEventListener('input',()=>onLegendSearchInput(inp.value));
23160
23588
  inp.addEventListener('keydown',e=>{if(e.key==='Escape'){e.stopPropagation();if(inp.value){inp.value='';onLegendSearchInput('');}else{inp.blur();}}
@@ -23165,11 +23593,18 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23165
23593
  }
23166
23594
  if(legendMode==='type'&&members.length){ // group the profile-rows under their member-type categories
23167
23595
  const mtypes=memberTypeRecords();
23168
- const byCat=new Map(mtypes.map(t=>[t.k,[]]));
23596
+ const byCat=new Map([...mtypes.map(t=>[t.k,[]]),[MIXED_TYPES,[]]]);
23169
23597
  for(const g of members){(byCat.get(categoryOfProfile(g.key))||byCat.get('beam')).push(g);}
23170
23598
  for(const {k,label} of mtypes){const gs=byCat.get(k)||[],keys=gs.map(g=>g.key);
23171
23599
  host.appendChild(buildCatHeader(k,label,gs.length,{empty:!gs.length,getState:()=>grpState(keys),onToggle:()=>grpToggle(keys),toggleTitle:'Show / hide all '+label.toLowerCase()+'s'}));
23172
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
23173
23608
  } else for(const g of members)addRow(g);
23174
23609
  if(conns.length){ // group connection PARTS under their joint (Phase 2): each part-kind a row, hidden per-id
23175
23610
  if(members.length){host.appendChild(Object.assign(document.createElement('div'),{className:'ldiv'}));}
@@ -23235,7 +23670,7 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23235
23670
  host.appendChild(buildCatHeader('dims','Dimensions',DIM_CATS.length,{getState:dimState,onToggle:dimToggle,toggleTitle:'Show / hide all dimension overlays'}));
23236
23671
  if(!collapsedCats.has('dims')){host.appendChild(Object.assign(document.createElement('div'),{className:'lhint',textContent:'click the box to show / hide'}));
23237
23672
  for(const dc of DIM_CONN){const ck='dims-'+dc.ct; // middle category: overlays grouped by connection
23238
- 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'}));
23239
23674
  if(!collapsedCats.has(ck))for(const k of dc.cats)addDimRow(k,DIM_LABEL[k],true);}
23240
23675
  }
23241
23676
  }else if((P.dims||[]).length){ // 2D: the dimensions drawn on this sheet, under the same switch as the ⋯ menu's Dimensions
@@ -23248,19 +23683,25 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23248
23683
  legendRowCheckbox(row,sw,label,flip); // no onEnter: a dimension row has no selection to reach
23249
23684
  host.appendChild(row);
23250
23685
  }
23251
- // GRID — the structural grid's visibility (per-plan contract data; same undoable switch as the panel
23252
- // 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
23253
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.
23254
23691
  if(gridOf()){
23255
23692
  host.appendChild(Object.assign(document.createElement('div'),{className:'ldiv'}));
23256
- const grow=document.createElement('div');grow.className='lrow dim';grow.dataset.tip='Show / hide the structural grid (2D + 3D)';
23257
- const gsw=document.createElement('span');gsw.className='lsw';gsw.style.setProperty('--sw','#64748b');gsw.setAttribute('role','checkbox');gsw.dataset.tip='Show / hide';
23258
- grow.append(gsw,document.createTextNode('Grid lines'));
23259
- grow.classList.toggle('dimoff',!gridOn());
23260
- const gflip=()=>gridSetVisible(!gridOn());
23261
- gsw.addEventListener('click',e=>{e.stopPropagation();gflip();});gsw.addEventListener('dblclick',e=>e.stopPropagation());
23262
- legendRowCheckbox(grow,gsw,'Grid lines',gflip); // no onEnter: the grid row has no selection to reach
23263
- 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;}
23264
23705
  }
23265
23706
  // CLIP — one provider-neutral list and interaction session is mounted by the shared 3D layer.
23266
23707
  // Steel and Revit therefore share selection, range selection, rename, enable, delete and empty-state behavior.
@@ -23278,7 +23719,9 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23278
23719
  const keyRows=[...host.querySelectorAll('.lrow:not(.qhide)')].filter(r=>r.getAttribute('role')==='checkbox');
23279
23720
  if(keyRows.length)refTreeRoving(keyRows,'lsel');
23280
23721
  if(refocus){const back=keyRows.find(r=>legendRowId(r)===refocus); // the rebuilt twin of the row they were on
23281
- 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
23282
23725
  // Permanent visibility menu: selection exposes Isolate/Hide; Ghost stays available and active treatment keeps
23283
23726
  // Show all reachable after Hide selected clears that now-invisible selection. Updated on every relevant change.
23284
23727
  function updateIsolateBtn(){return modelEditor?.getState?.()??null;} // compatibility call sites only; shared toolbar chrome owns Visibility DOM
@@ -23310,7 +23753,7 @@ function updateWorkBtn(){const b=document.getElementById('m3dWork'),ck=document.
23310
23753
  // A type category's master toggle reads its profiles' hide state: all visible = ■ on, all hidden = □ off,
23311
23754
  // some = ◪ mixed. Colour comes from data-state (CSS); the glyph from the textContent.
23312
23755
  function updateCatTog(hdr){const tog=hdr&&hdr.querySelector('.cat-tog');if(!tog||!hdr._getState||tog.style.display==='none')return;
23313
- 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');}
23314
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());
23315
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
23316
23759
  const ch=new Set(vis.connHiddenIds()); // per-part connection hide
@@ -23356,7 +23799,7 @@ function followLegendSelection(rows){
23356
23799
  if(!legendFollow||legendTab!=='objects'||!selIds.size){legendFollowKey='';return;}
23357
23800
  const key=[...selIds].sort().join(',');if(key===legendFollowKey)return;
23358
23801
  if(legendSelecting){legendFollowKey=key;return;} // chosen in the list itself: nothing to bring into view
23359
- 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);}
23360
23803
  if(shut.size){shut.forEach(c=>collapsedCats.delete(c));saveLegendPrefs();build3DLegend();return;}} // the rebuild marks the rows and comes back here
23361
23804
  legendFollowKey=key;
23362
23805
  const first=rows.find(r=>r.classList.contains('lfollow'));if(first&&first.scrollIntoView)first.scrollIntoView({block:'nearest'});}
@@ -23401,28 +23844,33 @@ function applyLegendFilter(){
23401
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
23402
23845
  if(!q){rows.forEach(r=>r.classList.remove('qhide'));host.querySelectorAll('.cat-hdr.qhide').forEach(h=>h.classList.remove('qhide'));return;}
23403
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,
23404
- // Inspect and the chat all use). A row grouped by profile holds many, so the matched id is shown after its label.
23405
- 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+')';
23406
23854
  let any=false;const tagged=[];
23407
23855
  rows.forEach(r=>{const textHit=(r.textContent||'').toLowerCase().includes(q);
23408
23856
  const ids=r.dataset.key?(byKey.get(r.dataset.key)||[]):(r._ids||[]).map(String);
23409
- const exactFirst=(a,b)=>(b.toLowerCase()===q)-(a.toLowerCase()===q)||a.localeCompare(b); // a typed whole id leads its row's tag
23410
- // Every member whose id matches is a candidate for Enter, also in a row its label already matched (a member IPE300 in
23411
- // the IPE300 row); only a row found by id alone needs the tag that says why it is shown.
23412
- 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;
23413
23861
  if(r.dataset.key)legendIdHits.push(...idMatches);
23414
23862
  const hit=textHit||idHits.length>0;r.classList.toggle('qhide',!hit);if(hit)any=true;
23415
23863
  if(idHits.length)tagged.push([r,idHits]);});
23416
- // A whole id typed is that member, even when it also begins longer ids (m-12 of m-120, m-121).
23417
- 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;
23418
23866
  const one=legendIdHits.length===1;
23419
23867
  for(const [r,idHits] of tagged){const t=document.createElement('span');t.className='lidhit';
23420
- t.textContent='· '+idHits[0]+(idHits.length>1?' +'+(idHits.length-1)+' more':'');
23421
- 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.'
23422
- :'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.';
23423
23871
  r.appendChild(t);}
23424
23872
  host.querySelectorAll('.cat-hdr').forEach(h=>{const cat=h.dataset.cat||'';
23425
- 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
23426
23874
  let vis=false;
23427
23875
  for(let n=h.nextElementSibling;n&&!n.classList.contains('cat-hdr')&&!n.classList.contains('lsec')&&!n.classList.contains('ldiv');n=n.nextElementSibling){
23428
23876
  if((n.matches('.lrow[data-key]')||n.matches('.lrow[data-connkey]')||n.matches('.lrow[data-detailkey]'))&&!n.classList.contains('qhide')){vis=true;break;}}
@@ -23432,7 +23880,7 @@ function applyLegendFilter(){
23432
23880
  }
23433
23881
  // Resolve a row to the member/connection ids it represents. A member row's data-key is a profile key; a connection
23434
23882
  // row carries its part ids on row._ids. Used by legend click-to-select + the box/isolate SELECTION actions below.
23435
- 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
23436
23884
  let bar3dWired=false;
23437
23885
  function seg3dActive(sel,attr,val){document.querySelectorAll(sel+' button').forEach(b=>{const on=b.getAttribute(attr)===val;b.classList.toggle('on',on);
23438
23886
  // The tick is a CSS ::after on `.on`, which announces nothing. These are EXCLUSIVE choices, so the
@@ -25246,7 +25694,7 @@ function rfiSymptomMembersIn(scope){
25246
25694
  // still fail are mostly these. Prefixes match sectionKindOf's, which already knows them by sight.
25247
25695
  // …and it only means anything while the model resolves against a US catalogue. A UK model resolves
25248
25696
  // these perfectly, so firing there would tell a user their own catalogue cannot hold their own steel.
25249
- 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);
25250
25698
  /** The one sentence for a dead section table, shared so `rfiSymptomReason` can recognise it EXACTLY
25251
25699
  * rather than re-testing the flag — see that function for why the difference is load-bearing. */
25252
25700
  const RFI_CATALOG_REASON='The section table could not be loaded — sizes and weights are unavailable. Reload the page.';
@@ -25260,7 +25708,7 @@ function rfiReason(m){if(!m.profile)return 'No profile assigned';
25260
25708
  // after"). Sending its author to check a designation that is perfectly correct is the same
25261
25709
  // misdirection the European case above exists to stop.
25262
25710
  if(_aiscKgM(m.profile)!=null)return 'This model records no weight for that size — the designation itself is a standard '+_catalogLabel()+' shape';
25263
- 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';
25264
25712
  return 'Size not in the '+_catalogLabel()+' table — check the designation';}
25265
25713
  // #628. The tooltip on a verified row's ✓ Verified pill. It was shared with a second marker — a green
25266
25714
  // number chip — so the two could never drift apart; that chip's CSS was never emitted after the RFI list
@@ -28568,7 +29016,13 @@ async function rfiQuickRefile(versionN){
28568
29016
  const filed=(body.outcomes||[]).filter(o=>['created','reused','reopened','successor'].includes(o.result)).length;
28569
29017
  const notFiled=(body.outcomes||[]).filter(o=>o.result==='over-capacity'||o.result==='unplaceable').length;
28570
29018
  toast(filed?filed+' question'+(filed===1?'':'s')+' filed as the AI\'s'+(notFiled?'; '+notFiled+' still could not be filed':'')+'.':notFiled?'Nothing more could be filed: '+notFiled+' still do not fit.':'Nothing was left to file.');
28571
- }else toast('These questions could not be filed: '+((body&&body.error)||'the RFI file could not be written')+'. Nothing was changed.');
29019
+ }else{
29020
+ // #3097: the server's sentence when it wrote one for the person; an unexplained 5xx may have written some of them.
29021
+ const said=personText(body);
29022
+ toast(said?'These questions could not be filed: '+said+'. Nothing was changed.'
29023
+ :res.status>=500?'These questions could not be filed, and FloLess couldn’t tell whether any were written. Check the RFIs before filing them again.'
29024
+ :'These questions could not be filed: the RFI file could not be written. Nothing was changed.');
29025
+ }
28572
29026
  }catch(e){console.error('[steel] could not retry filing the AI questions',e);toast('These questions could not be filed, because FloLess could not be reached. Nothing was changed.');}
28573
29027
  // The button the pointer is over is replaced by the repaint, so no pointer-out ever hides its tip.
28574
29028
  finally{rfiQuickRefileBusy=null;await refreshRfiRecords();if(rfiOpen())renderRfiList();if(window.__tip)window.__tip.hide();}
@@ -29375,7 +29829,7 @@ function openRaiseRfi(jointId,checkId,invoker){
29375
29829
  if(rfiFormFor&&rfiOpen())return 'An RFI form is open in the RFI list. Finish or cancel it, then press Raise an RFI again.';
29376
29830
  if(rfiOpen())closeRFI();
29377
29831
  rfiRaiseReturn=invoker&&invoker.isConnected?invoker:(document.activeElement instanceof Element?document.activeElement:null);
29378
- 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};
29379
29833
  // Bring back every attempt on this connection that is still waiting to be settled, as it was left.
29380
29834
  for(const[key,attempt]of rfiRaiseUnsettled){
29381
29835
  if(attempt.jointId!==jointId)continue;
@@ -29416,10 +29870,10 @@ async function raiseRfiSaved(){
29416
29870
  }
29417
29871
  async function raiseRfiLoad(keepMessage){
29418
29872
  const r=rfiRaise;if(!r)return;const seq=r.seq;
29419
- r.status='loading';if(!keepMessage)r.error='';renderRaiseRfi();
29873
+ r.status='loading';if(!keepMessage)r.note='';renderRaiseRfi();
29420
29874
  const unsaved=await raiseRfiSaved();
29421
29875
  if(rfiRaise!==r||r.seq!==seq)return;
29422
- 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;}
29423
29877
  r.generation=modelEditGeneration;
29424
29878
  const ctl=new AbortController(),timer=setTimeout(()=>ctl.abort(),RFI_RAISE_DEADLINE_MS);
29425
29879
  let res=null,body=null;
@@ -29429,7 +29883,7 @@ async function raiseRfiLoad(keepMessage){
29429
29883
  if(rfiRaise!==r||r.seq!==seq)return;
29430
29884
  if(!res||!res.ok||!body||body.ok!==true){
29431
29885
  r.status='failed';
29432
- 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.';
29433
29887
  renderRaiseRfi();return;
29434
29888
  }
29435
29889
  r.data=body;r.status='ready';
@@ -29471,13 +29925,13 @@ function renderRaiseRfi(){
29471
29925
  if(!r)return;
29472
29926
  if(r.status==='loading'){list.append(rfiRaiseEl('div',{class:'rfiempty'},'Reading this connection’s questions…'));return;}
29473
29927
  if(r.status==='unsaved'){
29474
- banner.hidden=false;banner.append(document.createTextNode(r.error+' '),
29928
+ banner.hidden=false;banner.append(document.createTextNode(r.note+' '),
29475
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'));
29476
29930
  list.append(rfiRaiseEl('div',{class:'rfiempty'},'Save your edits, or go on with the saved model.'));return;
29477
29931
  }
29478
29932
  if(r.status==='failed'){
29479
29933
  const box=rfiRaiseEl('div',{class:'rfiempty'});
29480
- 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'),
29481
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'));
29482
29936
  list.append(box);return;
29483
29937
  }
@@ -29486,7 +29940,7 @@ function renderRaiseRfi(){
29486
29940
  if(r.data&&r.data.rfisUnavailable)notes.push(r.data.rfisUnavailable);
29487
29941
  if(notes.length){banner.hidden=false;banner.textContent=notes.join(' ');}
29488
29942
  const storeBlind=!!(r.data&&r.data.rfisUnavailable);
29489
- 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);}
29490
29944
  const qs=raiseRfiOrdered();
29491
29945
  if(!qs.length){
29492
29946
  const box=rfiRaiseEl('div',{class:'rfiempty'});
@@ -29615,7 +30069,7 @@ async function raiseRfiFile(checkId){
29615
30069
  }
29616
30070
  // A definite answer settles the attempt, wherever the person now is.
29617
30071
  rfiRaiseUnsettled.delete(rfiRaiseKey(r.jointId,checkId));
29618
- 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;}
29619
30073
  if(res.ok&&body&&body.ok===true&&body.rfi&&body.rfi.id){
29620
30074
  const id=body.rfi.id,said='Filed as '+id+(form.action==='send'?' and marked sent.':' with the answer recorded.');
29621
30075
  r.forms.delete(checkId);r.outcomes.set(checkId,{kind:'filed',text:said,rfiId:id});
@@ -29628,7 +30082,7 @@ async function raiseRfiFile(checkId){
29628
30082
  console.error('[steel] an RFI about a connection was refused',{status:res.status,code,error:body&&body.error});
29629
30083
  // A definite answer: this attempt is over, so a fresh key goes with the next one.
29630
30084
  form.opKey=null;form.request=null;
29631
- 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.';
29632
30086
  if(code==='rfi-connection-question-changed'||code==='rfi-connection-question-gone'||code==='rfi-promote-stale'){
29633
30087
  r.outcomes.set(checkId,{kind:'refused',text:said+(code==='rfi-connection-question-changed'?' The question was read again: check it, then file it.':'')});
29634
30088
  await raiseRfiLoad(true);