@floless/app 0.166.0 → 0.168.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 (261) hide show
  1. package/autostart.mjs +169 -63
  2. package/desktop-shell.mjs +335 -0
  3. package/dist/floless-server.cjs +20570 -14555
  4. package/dist/schemas/drawing-check.profile.v1.schema.json +1 -1
  5. package/dist/schemas/steel.model.v2.schema.json +4 -2
  6. package/dist/skills/floless-app-onboarding/SKILL.md +13 -4
  7. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +3 -0
  8. package/dist/skills/floless-app-steel-takeoff/SKILL.md +34 -3
  9. package/dist/skills/floless-app-ui/SKILL.md +2 -2
  10. package/dist/skills/floless-app-workflows/SKILL.md +2 -2
  11. package/dist/templates/college-phase-exporter.flo +11 -45
  12. package/dist/web/agents.js +1 -1
  13. package/dist/web/app.css +223 -8
  14. package/dist/web/app.js +53 -13
  15. package/dist/web/aware-update-client.js +13 -5
  16. package/dist/web/aware.js +559 -118
  17. package/dist/web/chat.css +23 -0
  18. package/dist/web/chat.js +1003 -83
  19. package/dist/web/commands-filter.js +28 -5
  20. package/dist/web/commands-shell.js +304 -18
  21. package/dist/web/commands-steel.js +1 -1
  22. package/dist/web/desktop-window.js +435 -0
  23. package/dist/web/drawing-check-editor.js +18 -10
  24. package/dist/web/failure-copy.js +14 -1
  25. package/dist/web/guide.js +75 -9
  26. package/dist/web/index.html +72 -12
  27. package/dist/web/instructor.js +1 -1
  28. package/dist/web/leave-guard.js +347 -14
  29. package/dist/web/pages.js +5 -1
  30. package/dist/web/panels.js +5 -2
  31. package/dist/web/pdf-view.js +421 -0
  32. package/dist/web/project-history.js +133 -11
  33. package/dist/web/project-modules.js +3 -1
  34. package/dist/web/project-rfis.js +3 -1
  35. package/dist/web/project-workflows.js +4 -2
  36. package/dist/web/reference-geometry-worker.js +11 -2
  37. package/dist/web/revit-editor.html +1 -0
  38. package/dist/web/revit-editor.js +37 -8
  39. package/dist/web/shared-prefs.js +364 -0
  40. package/dist/web/steel-ai-marks.js +45 -1
  41. package/dist/web/steel-editor.html +265 -58
  42. package/dist/web/steel-filter-flo.js +243 -23
  43. package/dist/web/steel-filter.html +58 -16
  44. package/dist/web/tab-signal.js +36 -1
  45. package/dist/web/tekla-editor.html +1 -0
  46. package/dist/web/terminal-requests.js +5 -0
  47. package/dist/web/tool-updates.js +220 -54
  48. package/dist/web/vector-3d.html +14 -3
  49. package/dist/web/vector-editor.html +10 -2
  50. package/dist/web/vendor/README.md +23 -0
  51. package/dist/web/vendor/pdfjs/LICENSE +177 -0
  52. package/dist/web/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
  53. package/dist/web/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
  54. package/dist/web/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
  55. package/dist/web/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
  56. package/dist/web/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
  57. package/dist/web/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
  58. package/dist/web/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
  59. package/dist/web/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
  60. package/dist/web/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
  61. package/dist/web/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
  62. package/dist/web/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
  63. package/dist/web/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
  64. package/dist/web/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
  65. package/dist/web/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
  66. package/dist/web/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
  67. package/dist/web/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
  68. package/dist/web/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
  69. package/dist/web/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
  70. package/dist/web/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
  71. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
  72. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
  73. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
  74. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
  75. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
  76. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
  77. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
  78. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  79. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
  80. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
  81. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
  82. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
  83. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
  84. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
  85. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  86. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
  87. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
  88. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
  89. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
  90. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
  91. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
  92. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
  93. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  94. package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
  95. package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
  96. package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
  97. package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  98. package/dist/web/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
  99. package/dist/web/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
  100. package/dist/web/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
  101. package/dist/web/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
  102. package/dist/web/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
  103. package/dist/web/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
  104. package/dist/web/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
  105. package/dist/web/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
  106. package/dist/web/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
  107. package/dist/web/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
  108. package/dist/web/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
  109. package/dist/web/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
  110. package/dist/web/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
  111. package/dist/web/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
  112. package/dist/web/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
  113. package/dist/web/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
  114. package/dist/web/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
  115. package/dist/web/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
  116. package/dist/web/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
  117. package/dist/web/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
  118. package/dist/web/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
  119. package/dist/web/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
  120. package/dist/web/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
  121. package/dist/web/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
  122. package/dist/web/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
  123. package/dist/web/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
  124. package/dist/web/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
  125. package/dist/web/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
  126. package/dist/web/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
  127. package/dist/web/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
  128. package/dist/web/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
  129. package/dist/web/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
  130. package/dist/web/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
  131. package/dist/web/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
  132. package/dist/web/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
  133. package/dist/web/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
  134. package/dist/web/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
  135. package/dist/web/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
  136. package/dist/web/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
  137. package/dist/web/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
  138. package/dist/web/vendor/pdfjs/cmaps/H.bcmap +0 -0
  139. package/dist/web/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
  140. package/dist/web/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
  141. package/dist/web/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
  142. package/dist/web/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
  143. package/dist/web/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
  144. package/dist/web/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
  145. package/dist/web/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
  146. package/dist/web/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
  147. package/dist/web/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
  148. package/dist/web/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
  149. package/dist/web/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
  150. package/dist/web/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
  151. package/dist/web/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
  152. package/dist/web/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
  153. package/dist/web/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
  154. package/dist/web/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
  155. package/dist/web/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
  156. package/dist/web/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
  157. package/dist/web/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
  158. package/dist/web/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
  159. package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
  160. package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  161. package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  162. package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
  163. package/dist/web/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
  164. package/dist/web/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
  165. package/dist/web/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
  166. package/dist/web/vendor/pdfjs/cmaps/LICENSE +36 -0
  167. package/dist/web/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
  168. package/dist/web/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
  169. package/dist/web/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
  170. package/dist/web/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
  171. package/dist/web/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
  172. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  173. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  174. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  175. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  176. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  177. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  178. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  179. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  180. package/dist/web/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
  181. package/dist/web/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
  182. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
  183. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
  184. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
  185. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
  186. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
  187. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
  188. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  189. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  190. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  191. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  192. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  193. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  194. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  195. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  196. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  197. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  198. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  199. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  200. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  201. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  202. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  203. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  204. package/dist/web/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  205. package/dist/web/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  206. package/dist/web/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  207. package/dist/web/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  208. package/dist/web/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  209. package/dist/web/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  210. package/dist/web/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  211. package/dist/web/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
  212. package/dist/web/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
  213. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
  214. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
  215. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
  216. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
  217. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
  218. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
  219. package/dist/web/vendor/pdfjs/cmaps/V.bcmap +0 -0
  220. package/dist/web/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
  221. package/dist/web/vendor/pdfjs/iccs/CGATS001Compat-v2-micro.icc +0 -0
  222. package/dist/web/vendor/pdfjs/iccs/LICENSE +116 -0
  223. package/dist/web/vendor/pdfjs/pdf.min.mjs +28 -0
  224. package/dist/web/vendor/pdfjs/pdf.worker.mjs +64908 -0
  225. package/dist/web/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  226. package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  227. package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  228. package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  229. package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  230. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  231. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  232. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  233. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  234. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  235. package/dist/web/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  236. package/dist/web/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
  237. package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  238. package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  239. package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  240. package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  241. package/dist/web/vendor/pdfjs/wasm/LICENSE_JBIG2 +196 -0
  242. package/dist/web/vendor/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
  243. package/dist/web/vendor/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  244. package/dist/web/vendor/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
  245. package/dist/web/vendor/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
  246. package/dist/web/vendor/pdfjs/wasm/LICENSE_QCMS +21 -0
  247. package/dist/web/vendor/pdfjs/wasm/jbig2.wasm +0 -0
  248. package/dist/web/vendor/pdfjs/wasm/jbig2_nowasm_fallback.js +15 -0
  249. package/dist/web/vendor/pdfjs/wasm/openjpeg.wasm +0 -0
  250. package/dist/web/vendor/pdfjs/wasm/openjpeg_nowasm_fallback.js +17 -0
  251. package/dist/web/vendor/pdfjs/wasm/qcms_bg.wasm +0 -0
  252. package/dist/web/workspaces.js +527 -64
  253. package/home-env.mjs +28 -0
  254. package/install-path.mjs +59 -3
  255. package/launch-starting-page.mjs +35 -15
  256. package/launch.mjs +358 -51
  257. package/package.json +2 -1
  258. package/pin-home.mjs +6 -0
  259. package/post-update-marker.mjs +14 -0
  260. package/preferences-file.mjs +289 -0
  261. package/supervisor-lock.mjs +195 -0
@@ -1959,6 +1959,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1959
1959
  #panel .mp-chose{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px;font-size:11.5px;line-height:1.4;color:var(--mut)}
1960
1960
  #panel .mp-chose>span{min-width:0;overflow-wrap:anywhere}
1961
1961
  #panel .mp-chose b{color:var(--text);font-weight:600}
1962
+ #panel .mp-chose b.ai-restated{text-decoration:underline dotted var(--mut);text-underline-offset:2px;cursor:help} /* #2998: shown in project units; the tip says what the AI wrote */
1962
1963
  #panel .mp-confirm{flex:none;font-size:11px;padding:4px 10px}
1963
1964
  #panel .mp-chose{flex-wrap:wrap}
1964
1965
  #panel .mp-acts{display:flex;flex:none;flex-wrap:wrap;gap:6px;margin-left:auto}
@@ -2892,6 +2893,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2892
2893
  #m3dLegend .lsearch .lsx:hover{color:#fecaca;background:#7f1d1d}
2893
2894
  #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) */
2894
2895
  #m3dLegend .lsempty{color:var(--mut);font-size:11px;padding:10px 4px;text-align:center}
2896
+ #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 */
2895
2897
  /* Show-all reset bar — panel-local entry to showAllGroups(); shown only when something is hidden/isolated. Clones the
2896
2898
  .lsearch full-width box recipe; brand border on hover only (a one-shot action, not a mode → no solid fill). */
2897
2899
  #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}
@@ -2999,6 +3001,9 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2999
3001
  Metadata only — no state, no DOM. The armed flags these describe live inside main()
3000
3002
  and are read by the reporter that sits beside them; see the note in commands-steel.js
3001
3003
  for why the same declarations also load in the shell. -->
3004
+ <!-- #3097: the shared failure sentence (failureCopy / failureParts), so no message on this page builds an HTTP
3005
+ status, an error code or an exception's text into what a person reads. Pure: no DOM, no fetch. -->
3006
+ <script src="failure-copy.js"></script>
3002
3007
  <script src="commands.js"></script>
3003
3008
  <script src="commands-steel.js"></script>
3004
3009
  <!-- An Esc this editor leaves unused closes the shell's editor overlay (#1571); mounted after the keydown ladder. -->
@@ -4813,10 +4818,44 @@ function contractFailureState(status, code, serverError, projectScoped) {
4813
4818
  detail: 'Error ' + status + ' · ' + code,
4814
4819
  };
4815
4820
  }
4816
- return {
4817
- headline: 'Couldn’t load this model',
4818
- body: serverError || ('The server returned error ' + status + '. Reopen the editor and try again.'),
4819
- };
4821
+ // The server's own sentence still leads when it wrote one. Without one, the shared sentence says why in FloLess
4822
+ // words and what to do — never the status number (#3097). A read, so a plain retry is safe to offer.
4823
+ if (serverError) return { headline: 'Couldn’t load this model', body: serverError };
4824
+ const parts = failureParts({ status, body: code ? { code } : null }, { action: 'load this model', retrySafe: true });
4825
+ return { headline: parts.headline.replace(/\.$/, ''), body: parts.detail };
4826
+ }
4827
+
4828
+ /**
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".
4832
+ * `ctx` is failureCopy's: `action` completes "Couldn’t …", `retrySafe` only for a request that just reads.
4833
+ */
4834
+ 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;
4837
+ }
4838
+
4839
+ /**
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.
4843
+ */
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;
4848
+ }
4849
+
4850
+ /**
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.
4854
+ */
4855
+ 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;
4820
4859
  }
4821
4860
 
4822
4861
  /* WHY A SECOND COUNTER AND NOT JUST `modelEditGeneration`.
@@ -5561,9 +5600,19 @@ function aiMarksInner(){
5561
5600
  }
5562
5601
  function aiPlanLabel(viewId){const plan=(C.plans||[]).find(p=>V2Projection.planViewId(p)===viewId);return plan?String(plan.title||plan.sheet||viewId):String(viewId);}
5563
5602
  /* The record's words for one decision, when FloLess has read them: what was chosen, why, and how sure the AI was. */
5564
- function aiChosenText(id,marks){
5603
+ // #2998: a length the AI wrote in the other unit system is shown in the project's (decisionChoiceInUnits); what it
5604
+ // actually wrote goes into `wrote`, for the row's tooltip.
5605
+ function aiChosenWords(chosen,value,wrote){
5606
+ const said=AiMarks&&chosen?AiMarks.decisionChoiceInUnits(chosen,value,displayUnits()):{text:chosen||''};
5607
+ if(said.wrote&&wrote)wrote.push(said.wrote);
5608
+ return said.text;
5609
+ }
5610
+ const aiWroteTip=wrote=>wrote.length?'Shown in this project’s units. The AI wrote '+[...new Set(wrote)].join(', ')+'.':'';
5611
+ // The tip on hover, and the same words for a screen reader, which never sees a data-tip.
5612
+ function aiWroteMark(el,wrote){if(!wrote.length)return;const tip=aiWroteTip(wrote);el.dataset.tip=tip;el.appendChild(Object.assign(document.createElement('span'),{className:'sr-only',textContent:' '+tip}));}
5613
+ function aiChosenText(id,marks,wrote){
5565
5614
  const entry=marks.entries.get(id),rec=aiRecord.rows.get(id);
5566
- const chosen=(entry&&typeof entry.chosen==='string'&&entry.chosen)||(rec&&rec.chosen)||'';
5615
+ const chosen=aiChosenWords((entry&&typeof entry.chosen==='string'&&entry.chosen)||(rec&&rec.chosen)||'',(entry&&entry.value)||(rec&&rec.value),wrote);
5567
5616
  let t=chosen?'the AI chose '+chosen:'the AI decided it';
5568
5617
  if(rec&&rec.why)t+=' (why: '+String(rec.why).replace(/\.\s*$/,'')+(rec.confidence?'; '+rec.confidence+' confidence':'')+')';
5569
5618
  else if(!AI_DECISION_ID.test(id))t+=' (FloLess cannot read this decision’s id, so it cannot say why)';
@@ -5574,11 +5623,12 @@ function aiChosenText(id,marks){
5574
5623
  if(at)t+=(note===undefined?', reviewed by you':', changed by you')+(mpDate(at)?' on '+mpDate(at):'')+(note?' ('+note.replace(/\.\s*$/,'')+')':'');
5575
5624
  return t;
5576
5625
  }
5577
- function aiNoteText(item,marks){
5578
- const entry=item.decisionId?marks.entries.get(item.decisionId):null,chosen=entry&&entry.chosen?': '+entry.chosen:'';
5626
+ function aiNoteText(item,marks,wrote){
5627
+ const entry=item.decisionId?marks.entries.get(item.decisionId):null,chosen=entry&&entry.chosen?': '+aiChosenWords(entry.chosen,entry.value,wrote):'';
5579
5628
  if(item.reason==='unreadable')return'An AI decision FloLess could not read.';
5580
5629
  switch(item.channel){
5581
5630
  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
+ 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.';
5582
5632
  case'setup-origin':return'The model origin was chosen by the AI'+chosen+'. Every member’s position rests on it.';
5583
5633
  case'audit-gap':return'The AI settled a question the drawings left open'+chosen+'.';
5584
5634
  case'unmodelled-detail':return'The AI left a detail unmodelled'+chosen+'.';
@@ -5615,8 +5665,8 @@ function renderAiStrip(){
5615
5665
  const chip=span('chip assumed','AI chose this view’s '+rows.map(r=>r==='scale'?'scale':'level').join(' and '));
5616
5666
  chip.tabIndex=0;chip.setAttribute('role','note');
5617
5667
  chip.setAttribute('data-command-id','steel.ai-decision-view-note#'+vid);chip.setAttribute('data-command-instance-label',aiPlanLabel(vid));
5618
- const said=viewRows.map(v=>'its '+(v.row==='scale'?'drawing scale':'level')+(marks.entries.get(v.decisionId)&&marks.entries.get(v.decisionId).chosen?' ('+marks.entries.get(v.decisionId).chosen+')':'')).join(' and ');
5619
- const tip='The AI decided '+said+' for '+aiPlanLabel(vid)+'. Every member drawn on this view rests on that choice, and Inspect says so for each. Not reviewed.';
5668
+ const wrote=[],said=viewRows.map(v=>{const e=marks.entries.get(v.decisionId);return 'its '+(v.row==='scale'?'drawing scale':'level')+(e&&e.chosen?' ('+aiChosenWords(e.chosen,e.value,wrote)+')':'');}).join(' and ');
5669
+ const tip='The AI decided '+said+' for '+aiPlanLabel(vid)+'. Every member drawn on this view rests on that choice, and Inspect says so for each. Not reviewed.'+(wrote.length?' '+aiWroteTip(wrote):'');
5620
5670
  chip.setAttribute('data-tip',tip);chip.setAttribute('aria-label',tip);
5621
5671
  line.appendChild(chip);
5622
5672
  }
@@ -5639,7 +5689,7 @@ function renderAiStrip(){
5639
5689
  line.appendChild(more);
5640
5690
  if(aiStripOpen){
5641
5691
  const d=document.createElement('div');d.className='ai-details';d.id='aiStripDetails';
5642
- if(marks.model.length){const ul=document.createElement('ul');for(const item of marks.model){const li=document.createElement('li');li.textContent=aiNoteText(item,marks);ul.appendChild(li);}d.appendChild(ul);}
5692
+ if(marks.model.length){const ul=document.createElement('ul');for(const item of marks.model){const li=document.createElement('li'),wrote=[];li.textContent=aiNoteText(item,marks,wrote);aiWroteMark(li,wrote);ul.appendChild(li);}d.appendChild(ul);}
5643
5693
  const n=marks.decisionCount;
5644
5694
  d.appendChild(span('',(n?'Your current edits rest on '+n+' AI decision'+(n===1?'':'s')+' FloLess can trace. ':'Your current edits rest on no AI decision FloLess can trace. ')
5645
5695
  +'The marks follow your current edits; the Quick model label describes the model as last saved. '
@@ -5670,18 +5720,19 @@ function fillAiNote(box,m,canonical,list,marks){
5670
5720
  const chip=document.createElement('span');chip.className='chip assumed';chip.textContent='AI decision';
5671
5721
  const b=document.createElement('b');b.textContent='Rests on AI decisions';head.append(chip,b);box.appendChild(head);
5672
5722
  for(const mark of list){
5673
- const row=document.createElement('div');row.className='ai-row';
5723
+ const row=document.createElement('div'),wrote=[];row.className='ai-row';
5674
5724
  if(mark.kind==='height'){
5675
5725
  const z=(mark.end===0?canonical.from:canonical.to)?.z,now=z&&Number.isFinite(z.known)?fmtDispElev(z.known):''; // the full analysis: a reviewed decision is listed, and says so (aiChosenText)
5676
5726
  const word=aiEndWord(m.role,mark.end),n=mark.decisionIds.length;
5677
5727
  row.textContent=word.charAt(0).toUpperCase()+word.slice(1)+' height'+(now?' '+now:'')+' rests on '+(n===1?'an AI decision':n+' AI decisions')
5678
- +(mark.derived?', derived from '+(n===1?'it':'them')+' by a copy, split or merge':'')+': '+mark.decisionIds.map(id=>aiChosenText(id,marks)).join('; ')+'.';
5728
+ +(mark.derived?', derived from '+(n===1?'it':'them')+' by a copy, split or merge':'')+': '+mark.decisionIds.map(id=>aiChosenText(id,marks,wrote)).join('; ')+'.';
5679
5729
  }else if(mark.kind==='connection'){
5680
5730
  const joint=(C.joints||[]).find(j=>j&&j.id===mark.jointId);
5681
- row.textContent='Its connection '+String(joint&&joint.name||mark.jointId)+' rests on an AI assumption: '+aiChosenText(mark.decisionId,marks)+'.';
5731
+ row.textContent='Its connection '+String(joint&&joint.name||mark.jointId)+' rests on an AI assumption: '+aiChosenText(mark.decisionId,marks,wrote)+'.';
5682
5732
  }else{
5683
- row.textContent='Drawn on '+aiPlanLabel(mark.viewId)+', whose '+(mark.row==='scale'?'drawing scale':'level')+' the AI decided: '+aiChosenText(mark.decisionId,marks)+'.';
5733
+ row.textContent='Drawn on '+aiPlanLabel(mark.viewId)+', whose '+(mark.row==='scale'?'drawing scale':'level')+' the AI decided: '+aiChosenText(mark.decisionId,marks,wrote)+'.';
5684
5734
  }
5735
+ aiWroteMark(row,wrote);
5685
5736
  box.appendChild(row);
5686
5737
  }
5687
5738
  const foot=document.createElement('div');foot.className='ai-foot';
@@ -5999,7 +6050,8 @@ function renderMakePrecisePanel(p){
5999
6050
  :`<div class=mp-q-text>${qHtml}</div>`;
6000
6051
  const marking=!!(state.mark&&state.mark.id===c.decisionId);
6001
6052
  const changeB=c.canMarkChanged?`<button type=button class="ghost mp-changeb" data-mp-mark="${id}" data-mp-key="m:${id}" data-command-id="steel.make-precise-mark-changed#${esc(c.decisionId)}" data-command-instance-label="${short}" aria-expanded="${marking}" aria-controls="mpM${id}" aria-label="Changed it myself: ${esc(q)}" data-tip="Change it in the model yourself, then record here that you did"${dis}>Changed it myself</button>`:'';
6002
- html+=`<div class=mp-chose><span>The AI chose: <b>${esc(c.chosen||'(not recorded)')}</b></span>${c.confirmable?`<span class=mp-acts><button class=mp-confirm data-mp-confirm="${id}" data-mp-key="c:${id}" data-command-id="steel.make-precise-confirm#${esc(c.decisionId)}" data-command-instance-label="${short}" aria-label="Confirm: ${esc(q)}"${dis}>Confirm</button>${changeB}</span>`:''}</div>`;
6053
+ const chWrote=[],chText=aiChosenWords(c.chosen,c.value,chWrote);
6054
+ html+=`<div class=mp-chose><span>The AI chose: <b${chWrote.length?` class=ai-restated data-tip="${esc(aiWroteTip(chWrote))}"`:''}>${esc(chText||'(not recorded)')}</b>${chWrote.length?`<span class=sr-only> ${esc(aiWroteTip(chWrote))}</span>`:''}</span>${c.confirmable?`<span class=mp-acts><button class=mp-confirm data-mp-confirm="${id}" data-mp-key="c:${id}" data-command-id="steel.make-precise-confirm#${esc(c.decisionId)}" data-command-instance-label="${short}" aria-label="Confirm: ${esc(q)}"${dis}>Confirm</button>${changeB}</span>`:''}</div>`;
6003
6055
  if(!c.confirmable&&c.notConfirmable)html+=`<div class="hint mp-why-not">${esc(c.notConfirmable)}</div>`;
6004
6056
  if(c.confirmable&&!c.canMarkChanged&&!c.canEditHeight&&c.channel==='setup')html+=`<div class="hint mp-why-not">${esc(MP_FIXED_SETUP)}</div>`;
6005
6057
  if(marking)html+=`<div class=mp-mark id="mpM${id}" role=group aria-label="Record your change: ${esc(q)}"><div class=hint id="mpMl${id}">${esc(mpWhereToChange(c))}</div>`
@@ -6301,11 +6353,17 @@ function reconcileDecisions(){
6301
6353
  if(JSON.stringify(decidedMembers(C.members))===JSON.stringify(serverDecided))return;
6302
6354
  V2_SESSION.adoptWorkPointDecisions(serverDecided);render();sync3D();
6303
6355
  }
6356
+ // #3097: what "Couldn’t …" says for each member-end request. Only the scan just reads, so only it may be retried
6357
+ // blindly; for a change the outcome of an unexplained failure is unknown, and the next check shows what the model holds.
6358
+ const MEMBER_END_ACTIONS={scan:'check member ends',apply:'extend those member ends','keep-short':'keep this member end short',restore:'restore the traced endpoint',undo:'update member-end history'};
6304
6359
  async function memberEndRequest(path,body){
6305
- if(!PROJECT)throw new Error('Member-end review is available inside a project.');
6360
+ if(!PROJECT)throw Object.assign(new Error('Member-end review is available inside a project.'),{forPerson:true});
6361
+ const ctx={action:MEMBER_END_ACTIONS[path]||'finish that member-end step',retrySafe:path==='scan',unsure:'Check member ends again to see what the model holds now.'};
6362
+ // Every message this throws is a sentence for a person: the callers show it in the review's live line and a toast.
6363
+ // A fetch that got no answer is the browser's "Failed to fetch", so it is said in FloLess words; the cause stays on it.
6306
6364
  const mutating=path!=='scan',mid=mutating?newMutationId():null,headers={'content-type':'application/json'};if(mutating){headers['x-floless-mutation-id']=mid;if(serverEtag)headers['if-match']=serverEtag;claimMutation(mid);}
6307
- let res;try{res=await fetch('/api/projects/'+encodeURIComponent(PROJECT)+'/member-ends/'+path,{method:'POST',headers,body:JSON.stringify(body)});}catch(e){if(mid)releaseMutation(mid);throw e;}
6308
- const d=await res.json().catch(()=>({}));if(!res.ok){if(mid)releaseMutation(mid);const error=new Error(d.error||('Member-end request failed ('+res.status+')'));error.code=d.code;error.status=res.status;throw error;}if(d&&d.contract)paintQuickStat(d.quick??null); /* #2521 row 5: a reply carrying the model repaints its label; none means precise */
6365
+ let res;try{res=await fetch('/api/projects/'+encodeURIComponent(PROJECT)+'/member-ends/'+path,{method:'POST',headers,body:JSON.stringify(body)});}catch(e){if(mid)releaseMutation(mid);console.warn('member-ends: '+path+' got no answer',e);throw Object.assign(new Error(failureCopy(e,ctx).text),{cause:e,forPerson:true});}
6366
+ const d=await res.json().catch(()=>({}));if(!res.ok){if(mid)releaseMutation(mid);console.warn('member-ends: '+path+' refused',{status:res.status,code:d.code});const error=new Error(replyFailureText(res.status,d,ctx));error.code=d.code;error.status=res.status;error.forPerson=true;throw error;}if(d&&d.contract)paintQuickStat(d.quick??null); /* #2521 row 5: a reply carrying the model repaints its label; none means precise */
6309
6367
  return d;
6310
6368
  }
6311
6369
  async function scanMemberEnds(liveMessage,pinnedScope){ // pinnedScope: re-check the scope an open review was scanned with (Undo/Redo, a stale apply) instead of the view you are on; only the explicit "Check this sheet/3D model" rescan omits it
@@ -6318,7 +6376,7 @@ async function scanMemberEnds(liveMessage,pinnedScope){ // pinnedScope: re-che
6318
6376
  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;}
6319
6377
  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);}
6320
6378
  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();
6321
- }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:e&&e.message?e.message:'Could not check member ends.'};updateMemberEndStatus();panel();toast(memberEndScan.live);}
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);}
6322
6380
  }
6323
6381
  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();}
6324
6382
  // Ends Apply would extend right now: ticked, still needing review, with a chosen support. The one thing closing the
@@ -6372,10 +6430,10 @@ function focusMemberEnd(index,opts){
6372
6430
  }
6373
6431
  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();}
6374
6432
  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;
6375
- 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){if(memberEndReview===review){review.busy=false;review.live=e.message||'The model changed — check member ends again.';panel();}toast(e.message||'Could not extend member ends.');}}
6376
- 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=e.message||'Could not keep this member end short.';panel();}}}
6377
- 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=e.message||'Could not restore the traced endpoint.';panel();}}}
6378
- 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(e.message||'Could not update member-end history.');}}
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.'}));}}
6379
6437
  // Selection is MODEL-WIDE, not per-sheet: the 3D shows every plan, so a pick / box-select / Ctrl-click can
6380
6438
  // span sheets. byId + selArr therefore search ALL plans (not just the active P) so the inspector + edits see
6381
6439
  // the whole selection — else selecting a roof (S-203) member while S-202 is active shows nothing, and a
@@ -8113,7 +8171,8 @@ async function flushContractWith(token, signal) {
8113
8171
  console.error('flush refused 428 — a first-party writer sent no precondition; this is a FloLess bug');
8114
8172
  if (seq === saveSeq) setSaved('err');
8115
8173
  showSaveRefusedBanner();
8116
- throw new Error('save refused: no precondition sent');
8174
+ // #3097: the banner explains it; a step that waited on this save says so instead of "couldn’t tell why".
8175
+ throw Object.assign(new Error('Your latest edits weren’t saved because of a problem inside FloLess. Use Report an issue at the bottom of the window.'), { forPerson: true, code: 'save-refused' });
8117
8176
  }
8118
8177
  if (res.status === 412) {
8119
8178
  // Approve must abort (the throw below), and the user needs to know WHY — a bare "save failed" toast
@@ -8122,7 +8181,7 @@ async function flushContractWith(token, signal) {
8122
8181
  conflicted = true;
8123
8182
  if (seq === saveSeq) setSaved('conflict');
8124
8183
  showConflictBanner();
8125
- throw new Error('save conflict');
8184
+ throw Object.assign(new Error('Your latest edits weren’t saved because this model was changed somewhere else. Choose Reload or Overwrite in the message about that change.'), { forPerson: true, code: 'save-conflict' });
8126
8185
  }
8127
8186
  if (res.ok) { let d = {}, bodyReadable = true; try { d = await res.json(); } catch (_) { bodyReadable = false; } paintQuickStat(bodyReadable ? (d.quick ?? null) : undefined); if(signal&&signal.aborted)quarantineMutation(mid, seq); const t = d.etag || res.headers.get('ETag'); adoptedTag = t || null; if (d.contract && t && Number.isSafeInteger(d.storeRevision)) { const generationBefore = modelEditGeneration; adoptSaveReply(d.contract, t, d.storeRevision, seq); /* #1936 - installing the reply re-bumps the generation although nothing the person looked at changed; report the post-install generation, but ONLY when nothing visible moved between the PUT and the install (a genuine concurrent edit still shows as a mismatch) */ if (generationBefore === publishedGeneration && modelEditGeneration === generationBefore + 1) publishedGeneration = modelEditGeneration; } else { if (t) { const pv = serverEtag; serverEtag = t; restampDraftBase(pv, t); } if (Number.isSafeInteger(d.storeRevision)) serverRevision = Math.max(serverRevision, d.storeRevision); serverDecided = sentDecided; if (seq !== saveSeq) reconcileDecisions(); } conflicted = false; lastSeenCommitOwnSave(t, d, bodyReadable, sentCopy);
8128
8187
  // The flush committed. Same rule as persistServer: apply the report only when the body was readable and
@@ -8132,7 +8191,14 @@ async function flushContractWith(token, signal) {
8132
8191
  if (bodyReadable && usable && seq === saveSeq) applyRevalidation(d.revalidation); if (!bodyReadable) { const generationBefore = modelEditGeneration; /* the sign-off reads the generation this returns, so the recovery lands before it, and a whole-document install is followed exactly like the reply install above */ const recovered = await recoverStoredDecisions(seq); if (recovered === 'failed') publishedGeneration = -1; /* the stored document was never confirmed, so no sign-off may match it: the person is asked to check again */ else if (recovered === true && generationBefore === publishedGeneration && modelEditGeneration === generationBefore + 1) publishedGeneration = modelEditGeneration; } }
8133
8192
  else releaseMutation(mid);
8134
8193
  if (seq === saveSeq) setSaved(res.ok ? 'ok' : 'err'); // only the latest save owns the pill
8135
- if (!res.ok) throw new Error('save failed (' + res.status + ')');
8194
+ // #3097: callers show this message (the member-end check's live line, a toast), so it is a sentence for a person,
8195
+ // never "save failed (500)". The status rides on the error for any caller that branches on it.
8196
+ if (!res.ok) {
8197
+ const body = await res.json().catch(() => null);
8198
+ console.error('steel-editor: flush save refused', { status: res.status, code: body && body.code });
8199
+ throw Object.assign(new Error(replyFailureText(res.status, body, { action: 'save your latest edits', unsure: 'The save status in the editor’s header shows whether they were kept.' })),
8200
+ { status: res.status, body, forPerson: true });
8201
+ }
8136
8202
  return { etag: adoptedTag, generation: publishedGeneration };
8137
8203
  }, token).finally(()=>{saveWritesInFlight--;publishContractSaveState();});
8138
8204
  }
@@ -9732,7 +9798,7 @@ function gridReadFromDrawing(keep){
9732
9798
  // metric job in inches. Swallowing that one turns the loudness into a LIE: the sheet's grid read
9733
9799
  // fine, and the user is told to start blank. So a `grid-core:` error is reported as itself.
9734
9800
  let r=null;try{r=gc.gridFromDrawing(els,(P.mm_per_px>0)?P.mm_per_px:FT_TO_MM,displayUnits());}
9735
- catch(err){if(String((err&&err.message)||'').startsWith('grid-core:')){console.error('[steel] grid read refused',err);toast('Could not read the grid: '+err.message);return;}r=null;}
9801
+ catch(err){if(String((err&&err.message)||'').startsWith('grid-core:')){console.error('[steel] grid read refused',err);toast('Couldn’t read the grid, because of a problem inside FloLess rather than in your drawing. Use Start blank to draw it, and use Report an issue at the bottom of the window.');return;}r=null;} // #3097: grid-core's own words are for a developer; they stay in the console
9736
9802
  if(!r){toast('No grid found in this sheet’s linework — draw one with Start blank instead');return;}
9737
9803
  const g=r.grid;
9738
9804
  if(keep){g.z=keep.z; // the user's levels always survive a re-read; their hand-set labels beat detected ones (the tooltip promises it)
@@ -16396,7 +16462,11 @@ function applyConnectionBakeTruth(j,announce=true){
16396
16462
  }
16397
16463
  async function fetchScenePayload(contract=C){
16398
16464
  const r=await fetch('/api/contract/'+encodeURIComponent(APP_ID)+'/scene'+PROJECT_QS,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({contract})});
16399
- const j=await r.json();if(!j.ok)throw new Error(j.error||'scene render failed');return j;
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.
16467
+ 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});}
16469
+ return j;
16400
16470
  }
16401
16471
  function connectionTruthRequest(){
16402
16472
  const contract=JSON.parse(JSON.stringify(C)),previewByEnd=new WeakMap();
@@ -16576,7 +16646,7 @@ async function sendSelectionToHost(host,ids,hostPid){
16576
16646
  if(!pre.ok||!review.ok){
16577
16647
  if(review&&review.code==='host-bake-empty'){await showSelectionHostBakeReview(review,NAME,true,false);return;}
16578
16648
  if(review&&review.code==='stale-selection'){await showSelectionHostBakeReview(review,NAME,true,false,true);toast('The selection changed. Reload the model, review your selection, and try again.');return;}
16579
- throw Object.assign(new Error(review.error||('send review failed ('+pre.status+')')),{body:review});
16649
+ throw Object.assign(new Error(replyFailureText(pre.status,review,{action:'review what would be sent to '+NAME,retrySafe:true})),{body:review});
16580
16650
  }
16581
16651
  activeSelectionHostBakeConsents.set(review.consent,PROJECT?('/api/projects/'+encodeURIComponent(PROJECT)+'/host-bake-consent?appId='+encodeURIComponent(APP_ID)):('/api/apps/'+encodeURIComponent(APP_ID)+'/host-bake-consent'));
16582
16652
  let confirmed=review.kind==='clean'&&!changedClean;
@@ -16591,7 +16661,7 @@ async function sendSelectionToHost(host,ids,hostPid){
16591
16661
  hostDispatchMayHaveStarted=false;
16592
16662
  if(sent.ok&&j.ok){await acknowledgeSelectionHostBake(review.consent);break;}
16593
16663
  if(attempt===0&&j&&['host-bake-confirmation-stale','host-bake-preflight-required','stale-selection'].includes(j.code)){await cancelSelectionHostBake(review.consent);changedClean=true;toast('The selection changed. Checking the latest version…');continue;}
16594
- activeSelectionHostBakeConsents.delete(review.consent);throw Object.assign(new Error(j.error||('send failed ('+sent.status+')')),{body:j});
16664
+ activeSelectionHostBakeConsents.delete(review.consent);throw Object.assign(new Error(replyFailureText(sent.status,j,{action:'send to '+NAME,unsure:'Check the open model in '+NAME+' before sending again.'})),{body:j});
16595
16665
  }
16596
16666
  if(!j||!j.ok)return;
16597
16667
  // Report what TEKLA received, never what we asked for: the server legitimately drops members it
@@ -16961,9 +17031,12 @@ const view3dApi={
16961
17031
  if(!current||current.objects!==objects)return; // a newer read already superseded this failed upload
16962
17032
  const previous=refRenderedGeom.get(id);
16963
17033
  if(previous)refGeom.set(id,previous);else refGeom.delete(id);
16964
- refFailed.set(id,reason||'the graphics device could not upload this reference');
17034
+ // #3097: the renderer's reason is an exception message (an allocation RangeError, a WebGL error); it goes to the
17035
+ // console, and the row tooltip and measure toast say what happened in words.
17036
+ if(reason)console.warn('steel-editor: reference geometry upload failed',id,reason);
17037
+ refFailed.set(id,'this computer’s graphics couldn’t draw it');
16965
17038
  pushReferences();if(legendTab==='refs')renderRefsTab();if(refSelectedObjIdx!==null)panel();
16966
- toast('Could not draw the new geometry for “'+((refById(id)||{}).name||id)+'” — keeping the previous view');
17039
+ toast('Couldn’t draw the new geometry for “'+((refById(id)||{}).name||id)+'”, so the previous view is kept');
16967
17040
  },
16968
17041
  onConnMemberPickChange:()=>{}, // the chosen set shows as the 3D selection + the chip's live count; nothing else to reflect
16969
17042
  onConnMemberPickAbandon:(jointId,reason)=>{ // left the pick without answering it (focus moved, left 3D, pane went inactive)
@@ -17517,8 +17590,10 @@ async function reviewVerb(verb,jointId,opts){
17517
17590
  catch(e){const err=new Error('the server could not be reached');err.transport=true;throw err;}
17518
17591
  const d=await res.json().catch(()=>{console.warn('steel-editor: a review reply was not readable JSON',{verb,status:res.status});return {};});
17519
17592
  if(!res.ok){
17520
- const err=new Error(d.error||('the review action failed ('+res.status+')'));
17521
- err.code=d.code;err.status=res.status;throw err;
17593
+ /* #3097: no status number in the message. `authored` records whether the server wrote a sentence at all, so
17594
+ the caller only ever speaks the server's prose, never a fallback that stands in for it. */
17595
+ const err=new Error(typeof d.error==='string'&&d.error.trim()?d.error.trim():'the review action was refused');
17596
+ err.code=d.code;err.status=res.status;err.body=d;err.authored=typeof d.error==='string'&&!!d.error.trim();throw err;
17522
17597
  }
17523
17598
  return d;
17524
17599
  }
@@ -17557,9 +17632,14 @@ function reviewVerbFailed(e,fallback){
17557
17632
  /* The server's own 4xx prose is written FOR the user and names what to do; anything else — a transport
17558
17633
  failure, a 5xx behind an HTML error page — is not, so the caller's sentence wins, because it is the
17559
17634
  only one that names the connection. */
17560
- const speakable=e&&!e.transport&&e.status>=400&&e.status<500&&e.message;
17561
- toast(speakable?String(e.message)
17562
- :(fallback+' — '+((e&&e.transport)?'the server could not be reached':'try again in a moment')));
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;}
17637
+ /* #3097: the why and the next step come from the shared sentence, after the caller's own words (which name the
17638
+ connection). A review change whose answer was lost or unexplained may have landed, so it is never told to "try
17639
+ again" blindly: the review status refreshes on its own and shows what the server holds. */
17640
+ const parts=failureParts(e&&e.transport?{name:'TypeError',message:'Failed to fetch'}:{status:e&&e.status,body:e&&e.body},
17641
+ {action:'change this connection’s review',unsure:'The connection’s review status updates on its own; check it before trying again.'});
17642
+ toast(String(fallback).replace(/[.!?]?$/,'.')+(parts.detail?' '+parts.detail:''));
17563
17643
  }
17564
17644
  /* Is the document on screen still the one that flush published? THREE tripwires, each answering a
17565
17645
  different question, because no one of them is total on its own - see `modelEditGeneration`. */
@@ -18053,6 +18133,7 @@ let legendMode=(localStorage.getItem('floless.legendMode')==='type')?'type':'pro
18053
18133
  legMenu.addEventListener('keydown',e=>menuKeys(e,legMenu,legBtn,legClose));
18054
18134
  let collapsedCats=new Set((()=>{try{return JSON.parse(localStorage.getItem('floless.legendCollapsed')||'[]');}catch{return [];}})());
18055
18135
  let legendQuery=''; // transient objects-list search filter (members + connections only) — NOT persisted
18136
+ let legendIdHits=[]; // #2998: the member ids the current search matched by id (applyLegendFilter); one → Enter selects it
18056
18137
  // While a search is active, object categories (member types + connections) render EXPANDED so a match inside a
18057
18138
  // manually-collapsed category still surfaces — WITHOUT mutating the persisted collapsedCats.
18058
18139
  function catForceOpen(cat){return !!legendQuery&&(cat==='placed-details'||memberTypeRecords().some(t=>t.k===cat)||/^conn-/.test(cat));}
@@ -18765,7 +18846,7 @@ function referenceWorker(){
18765
18846
  const reason=(event&&event.message)||'the geometry worker stopped';
18766
18847
  const failed=refGeometryWorker;refGeometryWorker=null;
18767
18848
  try{failed&&failed.terminate();}catch(_){}
18768
- for(const pending of refGeometryPending.values())pending.reject(new Error(reason));
18849
+ for(const pending of refGeometryPending.values())pending.reject(Object.assign(new Error(reason),{referenceFailure:'worker-stopped'}));
18769
18850
  refGeometryPending.clear();
18770
18851
  };
18771
18852
  return refGeometryWorker;
@@ -18776,7 +18857,7 @@ function fetchReferenceGeometry(url){
18776
18857
  // A crashed/OOM-stalled worker may raise no `error` event. Bound the request so one bad reference
18777
18858
  // cannot leave its row spinning forever and block every later reference in the sequential opener.
18778
18859
  const timer=setTimeout(()=>{
18779
- const reason=new Error('reference geometry timed out');
18860
+ const reason=Object.assign(new Error('reference geometry timed out'),{referenceFailure:'timeout'});
18780
18861
  const stalled=refGeometryWorker;refGeometryWorker=null;
18781
18862
  try{stalled&&stalled.terminate();}catch(_){}
18782
18863
  // Decode is CPU-bound after the body arrives, so an AbortController cannot rescue this worker.
@@ -18789,6 +18870,42 @@ function fetchReferenceGeometry(url){
18789
18870
  });
18790
18871
  }
18791
18872
  const refFailed=new Map(); // id -> why its geometry could not be fetched (see loadReferenceGeometry)
18873
+ /**
18874
+ * #3097: WHY a reference's geometry could not be read, as the clause the row's tooltip and the measure toast put
18875
+ * after "Couldn’t read this reference’s geometry:". Built from facts — the status, the server's JSON, the worker's `failure`
18876
+ * kind (the worker cannot load failure-copy.js, so it never writes a sentence), or a rejection's `referenceFailure`
18877
+ * — and never a status number or an exception's text; those go to the console. The server's own `error` is said
18878
+ * as written where it wrote one, as it always has been.
18879
+ */
18880
+ // Reloading cannot help this one (FloLess already rebuilt it once), so the measure toast offers Report an issue instead.
18881
+ const REF_CORRUPT_REASON='the stored geometry came back damaged, even after FloLess rebuilt it';
18882
+ function referenceFailureReason(status,d,rejected){
18883
+ if(rejected){
18884
+ console.warn('steel-editor: reference geometry read stopped',rejected);
18885
+ if(rejected.referenceFailure==='timeout')return 'reading it took too long';
18886
+ if(rejected.referenceFailure==='worker-stopped')return 'the part of FloLess that reads it stopped';
18887
+ return 'FloLess ran into a problem it couldn’t identify';
18888
+ }
18889
+ const body=d&&typeof d==='object'?d:{};
18890
+ if(typeof body.error==='string'&&body.error.trim())return body.error.trim();
18891
+ if(body.diagnostic)console.warn('steel-editor: reference geometry unreadable',{status,diagnostic:body.diagnostic});
18892
+ else console.warn('steel-editor: reference geometry refused',{status,code:body.code});
18893
+ if(body.failure==='corrupt'||body.code==='reference-binary-corrupt')return REF_CORRUPT_REASON;
18894
+ if(body.failure==='connection')return 'FloLess stopped answering before it finished';
18895
+ if(body.failure==='unreadable')return 'FloLess sent an answer this window couldn’t read';
18896
+ const kind=failureKind({status,body});
18897
+ if(kind==='connection')return 'FloLess stopped answering before it finished';
18898
+ if(kind==='access')return status===403?'FloLess doesn’t allow this from here':'your FloLess sign-in needs attention';
18899
+ if(kind==='missing')return 'FloLess no longer has it; it may have been removed in another window';
18900
+ if(kind==='busy')return 'FloLess is busy with other work on this project';
18901
+ return 'FloLess ran into a problem it couldn’t identify';
18902
+ }
18903
+ // The measure toast for a reference whose geometry failed: the reason as one clause (a server sentence's own full stop
18904
+ // dropped, so it never reads ".."), then the step that can help.
18905
+ function referenceFailureToast(reason){
18906
+ return 'Couldn’t read this reference’s geometry: '+String(reason||'').replace(/[.!?\s]+$/,'')+'. '
18907
+ +(reason===REF_CORRUPT_REASON?'Use Report an issue at the bottom of the window.':'Use ⋯ ▸ Reload its geometry to try again.');
18908
+ }
18792
18909
  const refEmpty=new Set(); // ids the reader answered for, with nothing drawable in the answer
18793
18910
  let refSelectedId=null; // the reference the panel has expanded (and the 3D layer has selected)
18794
18911
  /**
@@ -19095,7 +19212,7 @@ async function loadReferenceGeometry(id,opts){
19095
19212
  else if(d.code==='reference-empty'){only(refEmpty);refEmpty.add(id);}
19096
19213
  // An `else` is mandatory here: a 500 whose body is not JSON parses to `{}`, so without one a failed
19097
19214
  // fetch produced no toast, no state and no log — the row simply looked fine.
19098
- else {only(refFailed);refFailed.set(id,d.error||('the server answered '+res.status));}
19215
+ else {only(refFailed);refFailed.set(id,referenceFailureReason(res.status,d));}
19099
19216
  }catch(e){
19100
19217
  // FAILURE IS ROW STATE, not a swallow. The first cut had an empty catch whose comment claimed the row
19101
19218
  // would stay "loading…" — and the `finally` below falsified it on the very next line: it clears
@@ -19105,7 +19222,7 @@ async function loadReferenceGeometry(id,opts){
19105
19222
  // whole feature must avoid.
19106
19223
  if(refById(id)){
19107
19224
  for(const st of [refUnresolved,refEmpty])st.delete(id);
19108
- refFailed.set(id,(e&&e.message)||'could not reach the server');
19225
+ refFailed.set(id,referenceFailureReason(0,null,e||{}));
19109
19226
  }
19110
19227
  console.error('[reference] geometry fetch failed',id,e);
19111
19228
  }
@@ -19271,7 +19388,7 @@ function refMeasureArm(id){
19271
19388
  // whose file failed to load exactly what a user whose file is legitimately empty is told.
19272
19389
  if(!refGeom.has(id)){
19273
19390
  toast(refLoading.has(id)?'Still reading its geometry — try again in a moment'
19274
- :refFailed.has(id)?('Its geometry could not be read — '+refFailed.get(id))
19391
+ :refFailed.has(id)?referenceFailureToast(refFailed.get(id))
19275
19392
  :refEmpty.has(id)?'This file has nothing drawable in it to measure'
19276
19393
  :'There is no geometry to measure yet');
19277
19394
  return;}
@@ -23040,7 +23157,8 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23040
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');
23041
23158
  const clr=Object.assign(document.createElement('span'),{className:'lsx',textContent:'×'});clr.dataset.tip='Clear';
23042
23159
  inp.addEventListener('input',()=>onLegendSearchInput(inp.value));
23043
- inp.addEventListener('keydown',e=>{if(e.key==='Escape'){e.stopPropagation();if(inp.value){inp.value='';onLegendSearchInput('');}else{inp.blur();}}});
23160
+ inp.addEventListener('keydown',e=>{if(e.key==='Escape'){e.stopPropagation();if(inp.value){inp.value='';onLegendSearchInput('');}else{inp.blur();}}
23161
+ else if(e.key==='Enter'&&legendIdHits.length===1){e.preventDefault();legendSelectMemberId(legendIdHits[0]);}}); // #2998: the one member the search found by id
23044
23162
  clr.addEventListener('click',()=>{if(!inp.value&&!legendQuery)return;inp.value='';onLegendSearchInput('');inp.focus();});
23045
23163
  sb.append(ico,inp,clr);
23046
23164
  host.insertBefore(sb,hint);
@@ -23205,6 +23323,15 @@ function refresh3DLegend(){const vis=legendVis();if(!vis)return;const st=vis.gro
23205
23323
  function legendRowClick(e,row){if(row&&row._dragging)return;const mods={ctrl:e.ctrlKey||e.metaKey,shift:e.shiftKey};clearTimeout(leg3dClickT);if(mods.ctrl||mods.shift)legendSelect(row,mods);else leg3dClickT=setTimeout(()=>legendSelect(row,mods),220);}
23206
23324
  // A selection made IN the list is already where the person is looking, so Follow selection must not scroll the list
23207
23325
  // away from it. The flag covers every way the list selects (click, Ctrl, Shift range, Enter), whatever branch it takes.
23326
+ // #2998: select ONE member the search found by its id (Enter in the search box), as a plain row click selects a group,
23327
+ // and frame it in the pane being searched: `model.fit-selection` only reaches the 3D camera, so a plan zooms itself.
23328
+ // The search box keeps focus, so a person can refine the query and press Enter again.
23329
+ function legendSelectMemberId(id){
23330
+ if(!legendMembers().some(m=>m&&String(m.id)===id))return;
23331
+ legendSelecting=true;try{clearWholeReferenceSelection();modelSelection.replaceMembers([id]);modelSelection.clearGrids();selDimIds.clear();sel3dDimIds.clear();legendSelAnchor=null;render();}finally{legendSelecting=false;}
23332
+ if(legendView()==='2d'){if(sel2d().length)zoomToSelection();}
23333
+ else if(modelEditor.isReady())modelEditor.dispatch('model.fit-selection');
23334
+ }
23208
23335
  function legendSelect(row,mods){legendSelecting=true;try{legendSelectRows(row,mods);}finally{legendSelecting=false;}}
23209
23336
  function legendSelectRows(row,mods){
23210
23337
  if(!row)return;const ids=legRowIds(row);if(!ids.length)return;
@@ -23271,9 +23398,29 @@ function applyLegendFilter(){
23271
23398
  const q=(legendQuery||'').trim().toLowerCase();
23272
23399
  const old=host.querySelector('.lsnomatch');if(old)old.remove(); // only its own note: an empty sheet's stays
23273
23400
  const rows=[...host.querySelectorAll('.lrow[data-key],.lrow[data-connkey],.lrow[data-detailkey]')];
23401
+ host.querySelectorAll('.lidhit').forEach(t=>t.remove());legendIdHits=[]; // a row's own text, never last pass's tag, is what it is matched on
23274
23402
  if(!q){rows.forEach(r=>r.classList.remove('qhide'));host.querySelectorAll('.cat-hdr.qhide').forEach(h=>h.classList.remove('qhide'));return;}
23275
- let any=false;
23276
- rows.forEach(r=>{const hit=(r.textContent||'').toLowerCase().includes(q);r.classList.toggle('qhide',!hit);if(hit)any=true;});
23403
+ // #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));}
23406
+ let any=false;const tagged=[];
23407
+ rows.forEach(r=>{const textHit=(r.textContent||'').toLowerCase().includes(q);
23408
+ 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;
23413
+ if(r.dataset.key)legendIdHits.push(...idMatches);
23414
+ const hit=textHit||idHits.length>0;r.classList.toggle('qhide',!hit);if(hit)any=true;
23415
+ 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;
23418
+ const one=legendIdHits.length===1;
23419
+ 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.';
23423
+ r.appendChild(t);}
23277
23424
  host.querySelectorAll('.cat-hdr').forEach(h=>{const cat=h.dataset.cat||'';
23278
23425
  if(!(memberTypeRecords().some(t=>t.k===cat)||/^conn-/.test(cat)||cat==='placed-details'))return; // leave the Dimensions/Clip headers untouched
23279
23426
  let vis=false;
@@ -23862,7 +24009,7 @@ async function setView(on,{remember=true}={}){
23862
24009
  // the success path above — a staleness check on only one of the two exits is not a check.
23863
24010
  if(seq!==viewSeq)return;
23864
24011
  applyViewState('2d');if(window.Steel3DView)window.Steel3DView.hide();
23865
- toast('Could not open 3D view: '+((e&&e.message)||e));
24012
+ toast(threeDOpenFailureText(e));
23866
24013
  // FALL THROUGH, do not return. The failure path must not persist the mode that failed — that is what
23867
24014
  // `failed` below is for — but it still needs the shared tail. An earlier revision returned here and
23868
24015
  // skipped panel(), refreshPropLabels3d() and updCS(): the success path calls updCS()/csSyncF3d()
@@ -25602,7 +25749,7 @@ async function refreshRfiRecords(opts){
25602
25749
  // KEYED ON THE HTTP STATUS, not on `code`: the three refusals `resolveProject` answers with — an
25603
25750
  // unknown project, a malformed id, a project with no incarnation yet — carry no code at all, so an
25604
25751
  // arm that switched on one would fall through for a state a real project can reach.
25605
- rfiState={status:'fail',records:live,sizeTruth:'known',liveTruth:j.liveTruth==='unavailable'?'unavailable':'known',detail:'',
25752
+ rfiState={status:'fail',records:live,sizeTruth:'known',liveTruth:j.liveTruth==='unavailable'?'unavailable':'known',detail:'',drawnHeightCheck:rfiDrawnHeightCheckOf(j),
25606
25753
  liveDetail:String(j.liveTruthDetail||''),http:r.status||0,error:String((j&&j.error)||''),
25607
25754
  // #2521 row 3b-2: a Quick version's unfiled questions live in the version, so they show even now.
25608
25755
  quickFiling:Array.isArray(j&&j.quickFiling)?j.quickFiling:[],
@@ -25624,6 +25771,7 @@ async function refreshRfiRecords(opts){
25624
25771
  sizeTruth:j.sizeTruth==='known'?'known':'unavailable',
25625
25772
  liveTruth:j.liveTruth==='known'?'known':'unavailable',
25626
25773
  detail:String(j.sizeTruthDetail||''),liveDetail:String(j.liveTruthDetail||''),http:200,error:'',
25774
+ drawnHeightCheck:rfiDrawnHeightCheckOf(j),
25627
25775
  quickFiling:Array.isArray(j.quickFiling)?j.quickFiling:[],
25628
25776
  readQuestions:j.readQuestions&&typeof j.readQuestions==='object'?j.readQuestions:null,
25629
25777
  readQuestionsUnavailable:!!j.readQuestionsUnavailable};
@@ -26686,7 +26834,8 @@ async function rfiDispatch(snap,retried,deadline){
26686
26834
  }
26687
26835
  }
26688
26836
  if(rfiFormFor&&rfiFormFor.opKey===snap.opKey)rfiFormFor={...rfiFormFor,busy:false};
26689
- const said=String(j.error||'')||('FloLess could not record that (HTTP '+res.status+'), and did not say why.');
26837
+ // #3097: the server's own sentence as always; without one, the shared sentence, never "(HTTP 500)".
26838
+ const said=replyFailureText(res.status,j,{action:'record that',unsure:'Check the RFI list before trying again.'});
26690
26839
  // `rfi-not-found` removes its own subject, so it never has a row to live in.
26691
26840
  if(code==='rfi-not-found')rfiSetOutcome(null,code,said,'attempt');
26692
26841
  else report(code||'rfi-refused',said);
@@ -27529,6 +27678,38 @@ function rfiEndUnresolved(memberId,end){
27529
27678
  }
27530
27679
  const rfiEndWords=(end,m)=>m&&m.role==='column'?(end===0?'bottom':'top'):(end===0?'start':'end');
27531
27680
  /** The server's own sentences for a height row, as notes. Never re-derived here. */
27681
+ /* #2628 slice A: a filed question the model now raises as a DRAWING CONFLICT (the drawings state a different height
27682
+ than the model holds) keeps its historical words and gains one line with the current question, "Now: …". ONE helper
27683
+ for the record, each grouped occurrence (collapsed and expanded) and the copied text, so the three cannot drift.
27684
+ Any `drawnHeights` the server sent counts, readable or not: the safe side is to show the current question. */
27685
+ const rfiDrawnConflict=g=>!!(g&&g.kind==='unknown-elevation'&&g.drawnHeights!==undefined&&typeof g.question==='string'&&g.question);
27686
+ const rfiNowText=g=>rfiDrawnConflict(g)?'Now: '+g.question:'';
27687
+ const rfiNowHtml=g=>rfiDrawnConflict(g)?'<div class="rfinote rfinow" data-rfi-now><b>Now:</b> '+esc(g.question)+'</div>':'';
27688
+ /** The grouped occurrences the model now raises as drawing conflicts, in occurrence order. */
27689
+ const rfiNowOccurrences=r=>(r&&r.grouped&&Array.isArray(r.occurrences)?r.occurrences:[])
27690
+ .filter(occ=>occ&&rfiDrawnConflict(occ.liveGap)).sort((a,b)=>a.occurrenceIndex-b.occurrenceIndex);
27691
+ const RFI_NOW_COLLAPSED=3;
27692
+ /** The whole RFI as copied: the server's text, then each current conflict line. */
27693
+ function rfiCopyText(r){
27694
+ if(!r||!r.text)return '';
27695
+ const count=r.grouped&&Array.isArray(r.occurrences)?r.occurrences.length:0;
27696
+ const lines=r.grouped
27697
+ ?rfiNowOccurrences(r).map(occ=>'Now, occurrence '+(occ.occurrenceIndex+1)+' of '+count+': '+occ.liveGap.question)
27698
+ :r.liveOnly?[]:[rfiNowText(r.liveGap)].filter(Boolean);
27699
+ return lines.length?r.text+'\n\n'+lines.join('\n'):r.text;
27700
+ }
27701
+ /* #2628 (R8-2): the drawn-height check could not read every end. Its OWN state beside liveTruth, never folded into
27702
+ it: it changes no action's eligibility and only adds this sentence to the banner. */
27703
+ function rfiDrawnHeightCheckOf(j){
27704
+ const c=j&&j.drawnHeightCheck;
27705
+ // Incomplete is always said; a count the server did not send readably is left out, never read as "0" or as clear.
27706
+ if(!c||c.state!=='incomplete')return null;
27707
+ return {state:'incomplete',ends:Number.isSafeInteger(c.ends)&&c.ends>0?c.ends:0};
27708
+ }
27709
+ // The server's drawnHeightIncompleteText in server/drawn-height-conflict.ts says the same words; keep the two in step.
27710
+ const rfiDrawnHeightCheckText=c=>c.ends>0
27711
+ ?'FloLess could not check every end’s drawn height against the model ('+c.ends+' '+(c.ends===1?'end':'ends')+' unchecked).'
27712
+ :'FloLess could not check the ends’ drawn heights against the model.';
27532
27713
  function rfiElevationNotes(g){
27533
27714
  if(!g||g.kind!=='unknown-elevation')return [];
27534
27715
  const notes=[];
@@ -27675,6 +27856,12 @@ function paintRfiBanner(){
27675
27856
  +'unavailable on every row below until it does. Reload the page to try again.';
27676
27857
  html=html?html+'<br>'+clause:clause;
27677
27858
  }
27859
+ // #2628: independent too, and appended for the same reason. Shown above an empty list as well, so "No current model
27860
+ // questions were found" is never the only thing said while some ends were not checked.
27861
+ if(rfiState.drawnHeightCheck){
27862
+ const line='<span data-rfi-drawn-check>'+esc(rfiDrawnHeightCheckText(rfiState.drawnHeightCheck))+'</span>';
27863
+ html=html?html+'<br>'+line:line;
27864
+ }
27678
27865
  banner.innerHTML=html;
27679
27866
  banner.hidden=!html;
27680
27867
  const retry=document.getElementById('rfiRetry');
@@ -28305,6 +28492,7 @@ function rfiGroupedRecordRowHtml(r){
28305
28492
  const error=rfiTargetErrors.get(key);
28306
28493
  return '<li class=rfioccurrence data-rfi-occurrence="'+index+'"><article aria-labelledby="rfi-occ-'+r.seq+'-'+index+'"><div class=rfioccurrence-head><span class="rfioccurrence-title rfimeta"><h4 id="rfi-occ-'+r.seq+'-'+index+'" tabindex="-1">Occurrence '+(index+1)+' of '+count+' — '+esc(rfiGroupedOccurrenceSubject(occ))+'</h4>'+rfiAiMark(occ.latestBy)+'</span><span class="rfikind '+rfiStatusTone(occ)+'">'+esc(rfiStatusWords(occ))+'</span></div>'
28307
28494
  +'<div class=rfinote>'+esc(occ.question)+(sheets?' · '+esc(sheets):'')+'</div>'
28495
+ +rfiNowHtml(occ.liveGap)
28308
28496
  +(occ.reopened?'<div class=rfinote>Reopened '+rfiDated(occ.reopened.at)+(occ.reopened.why?': '+esc(occ.reopened.why):'.')+'</div>':'')
28309
28497
  +rfiRoundsHtml(r,occ.earlierRounds,index)
28310
28498
  +(error?'<div class=rfifail role=alert>'+esc(error.message)+'</div>':'')
@@ -28315,7 +28503,7 @@ function rfiGroupedRecordRowHtml(r){
28315
28503
  :'<ol id="'+panelId+'" class=rfioccurrences aria-label="Occurrences in '+esc(r.id)+'" hidden></ol>';
28316
28504
  const sheetSummary=rfiScope==='sheet'?matching.length+' of '+count+' occurrences on this sheet · ':'';
28317
28505
  return '<div class="rfirow'+(formOpen?' editing':'')+'" data-rfi-row="'+esc(rowKey)+'"'+(rowBusy?' aria-busy="true"':'')+'><span class="rfikind '+rfiStatusTone(r)+'">'+esc(kind)+'</span><div class=rfitx>'
28318
- +esc(r.question||'This grouped RFI records no question.')+'<div class=rfimeta><span>'+esc(r.id)+'</span>'+rfiFiledByYou(r)+'<span>'+esc(rfiStatusWords(r))+'</span><span>'+sheetSummary+count+' occurrences · '+r.counts.sheets+' sheets · '+r.counts.entities+' members/connections</span></div>'
28506
+ +esc(r.question||'This grouped RFI records no question.')+(expanded?'':rfiGroupedNowHtml(r,count))+'<div class=rfimeta><span>'+esc(r.id)+'</span>'+rfiFiledByYou(r)+'<span>'+esc(rfiStatusWords(r))+'</span><span>'+sheetSummary+count+' occurrences · '+r.counts.sheets+' sheets · '+r.counts.entities+' members/connections</span></div>'
28319
28507
  +deliveryNote+rfiSettleHtml(r,rowKey)+(groupForm?rfiFormHtml(r,'all '+count+' occurrences',rowKey):(formOpen?'':recovering?rfiRecoveryHtml(rowKey)+(copy?'<div class=rfiacts>'+copy+'</div>':''):'<div class=rfiacts>'+gmail+send+allAnswer+allClose+allReopen+copy+deliveryActs+'</div>'))
28320
28508
  +'<button class="ghost rfigroup-toggle" data-command-id="steel.rfi-group-toggle#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'" data-rfi-expand="'+esc(r.id)+'" data-rfi-ctl=expand aria-expanded="'+expanded+'" aria-controls="'+panelId+'"><span>'+(expanded?'Hide':'Show')+' '+count+' occurrences</span><span aria-hidden=true>'+(expanded?'▴':'▾')+'</span></button>'
28321
28509
  +(formOpen?'':rfiOutcomeHtml(rowKey))+occurrences+'</div></div>';
@@ -28514,6 +28702,14 @@ async function rfiReadRaise(gapKeys,asOne,busyKey){
28514
28702
  }
28515
28703
  }
28516
28704
 
28705
+ /** Collapsed, a grouped RFI names its occurrences the drawings now contradict, so folding it never hides them. */
28706
+ function rfiGroupedNowHtml(r,count){
28707
+ const now=rfiNowOccurrences(r);
28708
+ if(!now.length)return '';
28709
+ const more=now.length-RFI_NOW_COLLAPSED;
28710
+ return now.slice(0,RFI_NOW_COLLAPSED).map(occ=>'<div class="rfinote rfinow" data-rfi-now><b>Now, occurrence '+(occ.occurrenceIndex+1)+' of '+count+':</b> '+esc(occ.liveGap.question)+'</div>').join('')
28711
+ +(more>0?'<div class="rfinote rfinow" data-rfi-now-more>…and '+more+' more '+(more===1?'occurrence':'occurrences')+' the drawings now contradict. Show the occurrences to read them.</div>':'');
28712
+ }
28517
28713
  function rfiRecordRowHtml(r){
28518
28714
  if(r&&r.grouped)return rfiGroupedRecordRowHtml(r);
28519
28715
  const rowKey=rfiRowKey('record',r.id);
@@ -28641,6 +28837,7 @@ function rfiRecordRowHtml(r){
28641
28837
  const acts=gmailBtn+(resolve||'')+verbBtns+deliveryActs+copy+locate+targetControls;
28642
28838
  return '<div class="rfirow'+(formOpen?' editing':'')+'" data-rfi-row="'+esc(rowKey)+'"'+(saving||deliveryBusy?' aria-busy="true"':'')+'><span class="rfikind '+rfiStatusTone(r)+'">'+esc(kind)+'</span><div class=rfitx>'
28643
28839
  +esc(r.question||'This RFI records no question.')
28840
+ +rfiNowHtml(r.liveGap)
28644
28841
  +'<div class=rfimeta>'+meta+'</div>'
28645
28842
  +(notes.length?'<div class=rfinote>'+notes.join(' ')+'</div>':'')
28646
28843
  +rfiRoundsHtml(r,r.earlierRounds,null)
@@ -28649,7 +28846,7 @@ function rfiRecordRowHtml(r){
28649
28846
  +(receiptMismatch&&!profileMismatch?'<div class=rfinote role="note" data-rfi-receipt-truth>'+esc(rfiSentence(receiptMismatch.fact))+' Refresh the model view before closing this RFI as resolved.</div>':'')
28650
28847
  +(settling?'<div class=rfinote role="note" data-rfi-profile-settle>'+esc(settling.message)+'</div>':'')
28651
28848
  +deliveryHtml+rfiSettleHtml(r,rowKey)
28652
- +(rfiCopyFallbackId===r.id&&r.text?'<div class=rfinote style="white-space:pre-wrap;user-select:text">'+esc(r.text)+'</div>':'')
28849
+ +(rfiCopyFallbackId===r.id&&r.text?'<div class=rfinote style="white-space:pre-wrap;user-select:text">'+esc(rfiCopyText(r))+'</div>':'')
28653
28850
  +(elevGap&&!formOpen&&!recovering?rfiElevationControls(rowKey,r.id,elevGap):'')
28654
28851
  // The outcome renders INSIDE the form when one is open (directly above Submit, where focus lands);
28655
28852
  // at row level only when there is no form to put it in.
@@ -29036,11 +29233,12 @@ function wireRfiList(){
29036
29233
  // The list may have been re-read since this markup was painted (the repaint is suppressed while
29037
29234
  // focus is inside the list), so the record can be gone. Say so rather than clicking into silence.
29038
29235
  if(!r||!r.text){toast('The filed RFIs were re-read and this one is no longer listed — reopen the list.');return;}
29236
+ const text=rfiCopyText(r);
29039
29237
  // Promise.resolve().then(...) so the CATCH BELOW IS REACHABLE. In an insecure context
29040
29238
  // `navigator.clipboard` is undefined, and `navigator.clipboard.writeText(...)` then throws
29041
29239
  // SYNCHRONOUSLY — before any promise exists — so a bare `.catch` never fires and the button does
29042
29240
  // nothing at all. `web/aware.js` and `web/workspaces.js` both guard the same hazard.
29043
- Promise.resolve().then(()=>navigator.clipboard.writeText(r.text)).then(()=>{
29241
+ Promise.resolve().then(()=>navigator.clipboard.writeText(text)).then(()=>{
29044
29242
  const was=b.textContent;b.textContent='Copied';setTimeout(()=>{b.textContent=was;},1600);
29045
29243
  }).catch(err=>{
29046
29244
  // Bind and log it: an insecure context and a denied permission are different problems and a bug
@@ -32408,7 +32606,9 @@ async function askAiCreateRequest(draft){
32408
32606
  try {
32409
32607
  flushed=await window.flushContract();
32410
32608
  } catch (err) {
32411
- askAiSetStatus('Could not save the contract — check the server and try again.', 'var(--err)');
32609
+ // #3097: nothing has been sent yet, so sending again is safe; the save's own message goes to the console.
32610
+ console.error('[steel] Ask AI: the model could not be saved before sending', err);
32611
+ askAiSetStatus('Nothing was sent to your AI, because your latest edits couldn’t be saved first. Make sure FloLess is still running and the model shows as saved, then send again.', 'var(--err)');
32412
32612
  return null;
32413
32613
  }
32414
32614
  askAiSetStatus('Sending…', 'var(--mut)');
@@ -32428,13 +32628,17 @@ async function askAiCreateRequest(draft){
32428
32628
  if (res.ok) {
32429
32629
  const body=await res.json();return body.request||null;
32430
32630
  } else {
32431
- let errText = 'Request failed (' + res.status + ')';
32432
- try { const body = await res.json(); if (body && body.error) errText = body.error; } catch (_) {}
32433
- askAiSetStatus(errText, 'var(--err)');
32631
+ // #3097: the server's own sentence when it wrote one, else the shared sentence — never "Request failed (500)".
32632
+ let body = null;
32633
+ try { body = await res.json(); } catch (_) {}
32634
+ console.error('[steel] Ask AI request refused', { status: res.status, code: body && body.code });
32635
+ askAiSetStatus(replyFailureText(res.status, body, { action: 'send this to your AI' }), 'var(--err)');
32434
32636
  return null;
32435
32637
  }
32436
32638
  } catch (err) {
32437
- askAiSetStatus('Network error — check the server and try again.', 'var(--err)');
32639
+ // No answer, or an answer this page couldn't read: the request may have been queued, so it is not sent again blindly.
32640
+ console.error('[steel] Ask AI request got no usable answer', err);
32641
+ askAiSetStatus(failureCopy(err, { action: 'send this to your AI', unsure: 'Check your queued requests before sending again.' }).text, 'var(--err)');
32438
32642
  return null;
32439
32643
  }
32440
32644
  }
@@ -32580,7 +32784,10 @@ rfiPostShell({type:'floless:editor-ready'});
32580
32784
  refresh();
32581
32785
  })();
32582
32786
 
32583
- boot().catch(err => { EditorFocus.fail('The model did not open, so the connection was not shown. The Model step says why.'); document.body.replaceChildren(Object.assign(document.createElement('p'), { textContent: 'Failed to load: ' + err.message, style: 'padding:24px;color:var(--err)' })); });
32787
+ // #3097: a boot that threw replaces the page with this. The exception's own text ("Cannot read properties of …") is a
32788
+ // developer's, so it goes to the console; the person reads what happened and what to do.
32789
+ const BOOT_FAILED_TEXT = 'Couldn’t open this model. Something in the editor stopped while it was loading. Close the editor and open the model again; if it keeps happening, use Report an issue at the bottom of the window.';
32790
+ boot().catch(err => { EditorFocus.fail('The model did not open, so the connection was not shown. The Model step says why.'); console.error('steel-editor: boot failed', err); document.body.replaceChildren(Object.assign(document.createElement('p'), { textContent: BOOT_FAILED_TEXT, style: 'padding:24px;color:var(--err)' })); });
32584
32791
 
32585
32792
  // Themed tooltips (replaces native title=) for the 3D toolbar — one shared element, shown on
32586
32793
  // data-tip hover after a short delay, positioned below the control and clamped to the viewport. A function of