@floless/app 0.167.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 (257) hide show
  1. package/autostart.mjs +169 -63
  2. package/desktop-shell.mjs +335 -0
  3. package/dist/floless-server.cjs +14518 -11361
  4. package/dist/schemas/steel.model.v2.schema.json +2 -1
  5. package/dist/skills/floless-app-onboarding/SKILL.md +13 -4
  6. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +3 -0
  7. package/dist/skills/floless-app-steel-takeoff/SKILL.md +21 -2
  8. package/dist/skills/floless-app-ui/SKILL.md +2 -2
  9. package/dist/skills/floless-app-workflows/SKILL.md +2 -2
  10. package/dist/web/agents.js +1 -1
  11. package/dist/web/app.css +165 -8
  12. package/dist/web/app.js +53 -13
  13. package/dist/web/aware-update-client.js +13 -5
  14. package/dist/web/aware.js +183 -39
  15. package/dist/web/chat.css +2 -1
  16. package/dist/web/chat.js +410 -80
  17. package/dist/web/commands-filter.js +5 -5
  18. package/dist/web/commands-shell.js +172 -10
  19. package/dist/web/commands-steel.js +1 -1
  20. package/dist/web/desktop-window.js +435 -0
  21. package/dist/web/drawing-check-editor.js +18 -10
  22. package/dist/web/failure-copy.js +14 -1
  23. package/dist/web/guide.js +75 -9
  24. package/dist/web/index.html +64 -6
  25. package/dist/web/instructor.js +1 -1
  26. package/dist/web/leave-guard.js +347 -14
  27. package/dist/web/pages.js +5 -1
  28. package/dist/web/panels.js +5 -2
  29. package/dist/web/pdf-view.js +421 -0
  30. package/dist/web/project-history.js +2 -1
  31. package/dist/web/project-modules.js +3 -1
  32. package/dist/web/project-rfis.js +3 -1
  33. package/dist/web/project-workflows.js +4 -2
  34. package/dist/web/reference-geometry-worker.js +11 -2
  35. package/dist/web/revit-editor.html +1 -0
  36. package/dist/web/revit-editor.js +37 -8
  37. package/dist/web/shared-prefs.js +364 -0
  38. package/dist/web/steel-editor.html +204 -43
  39. package/dist/web/steel-filter-flo.js +74 -18
  40. package/dist/web/steel-filter.html +22 -6
  41. package/dist/web/tab-signal.js +36 -1
  42. package/dist/web/tekla-editor.html +1 -0
  43. package/dist/web/tool-updates.js +159 -38
  44. package/dist/web/vector-3d.html +14 -3
  45. package/dist/web/vector-editor.html +10 -2
  46. package/dist/web/vendor/README.md +23 -0
  47. package/dist/web/vendor/pdfjs/LICENSE +177 -0
  48. package/dist/web/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
  49. package/dist/web/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
  50. package/dist/web/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
  51. package/dist/web/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
  52. package/dist/web/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
  53. package/dist/web/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
  54. package/dist/web/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
  55. package/dist/web/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
  56. package/dist/web/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
  57. package/dist/web/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
  58. package/dist/web/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
  59. package/dist/web/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
  60. package/dist/web/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
  61. package/dist/web/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
  62. package/dist/web/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
  63. package/dist/web/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
  64. package/dist/web/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
  65. package/dist/web/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
  66. package/dist/web/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
  67. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
  68. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
  69. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
  70. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
  71. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
  72. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
  73. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
  74. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  75. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
  76. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
  77. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
  78. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
  79. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
  80. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
  81. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  82. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
  83. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
  84. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
  85. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
  86. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
  87. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
  88. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
  89. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  90. package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
  91. package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
  92. package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
  93. package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  94. package/dist/web/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
  95. package/dist/web/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
  96. package/dist/web/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
  97. package/dist/web/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
  98. package/dist/web/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
  99. package/dist/web/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
  100. package/dist/web/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
  101. package/dist/web/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
  102. package/dist/web/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
  103. package/dist/web/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
  104. package/dist/web/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
  105. package/dist/web/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
  106. package/dist/web/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
  107. package/dist/web/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
  108. package/dist/web/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
  109. package/dist/web/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
  110. package/dist/web/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
  111. package/dist/web/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
  112. package/dist/web/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
  113. package/dist/web/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
  114. package/dist/web/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
  115. package/dist/web/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
  116. package/dist/web/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
  117. package/dist/web/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
  118. package/dist/web/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
  119. package/dist/web/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
  120. package/dist/web/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
  121. package/dist/web/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
  122. package/dist/web/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
  123. package/dist/web/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
  124. package/dist/web/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
  125. package/dist/web/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
  126. package/dist/web/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
  127. package/dist/web/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
  128. package/dist/web/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
  129. package/dist/web/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
  130. package/dist/web/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
  131. package/dist/web/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
  132. package/dist/web/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
  133. package/dist/web/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
  134. package/dist/web/vendor/pdfjs/cmaps/H.bcmap +0 -0
  135. package/dist/web/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
  136. package/dist/web/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
  137. package/dist/web/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
  138. package/dist/web/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
  139. package/dist/web/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
  140. package/dist/web/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
  141. package/dist/web/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
  142. package/dist/web/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
  143. package/dist/web/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
  144. package/dist/web/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
  145. package/dist/web/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
  146. package/dist/web/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
  147. package/dist/web/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
  148. package/dist/web/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
  149. package/dist/web/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
  150. package/dist/web/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
  151. package/dist/web/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
  152. package/dist/web/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
  153. package/dist/web/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
  154. package/dist/web/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
  155. package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
  156. package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  157. package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  158. package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
  159. package/dist/web/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
  160. package/dist/web/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
  161. package/dist/web/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
  162. package/dist/web/vendor/pdfjs/cmaps/LICENSE +36 -0
  163. package/dist/web/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
  164. package/dist/web/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
  165. package/dist/web/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
  166. package/dist/web/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
  167. package/dist/web/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
  168. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  169. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  170. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  171. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  172. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  173. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  174. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  175. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  176. package/dist/web/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
  177. package/dist/web/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
  178. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
  179. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
  180. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
  181. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
  182. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
  183. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
  184. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  185. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  186. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  187. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  188. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  189. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  190. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  191. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  192. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  193. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  194. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  195. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  196. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  197. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  198. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  199. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  200. package/dist/web/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  201. package/dist/web/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  202. package/dist/web/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  203. package/dist/web/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  204. package/dist/web/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  205. package/dist/web/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  206. package/dist/web/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  207. package/dist/web/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
  208. package/dist/web/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
  209. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
  210. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
  211. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
  212. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
  213. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
  214. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
  215. package/dist/web/vendor/pdfjs/cmaps/V.bcmap +0 -0
  216. package/dist/web/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
  217. package/dist/web/vendor/pdfjs/iccs/CGATS001Compat-v2-micro.icc +0 -0
  218. package/dist/web/vendor/pdfjs/iccs/LICENSE +116 -0
  219. package/dist/web/vendor/pdfjs/pdf.min.mjs +28 -0
  220. package/dist/web/vendor/pdfjs/pdf.worker.mjs +64908 -0
  221. package/dist/web/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  222. package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  223. package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  224. package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  225. package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  226. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  227. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  228. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  229. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  230. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  231. package/dist/web/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  232. package/dist/web/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
  233. package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  234. package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  235. package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  236. package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  237. package/dist/web/vendor/pdfjs/wasm/LICENSE_JBIG2 +196 -0
  238. package/dist/web/vendor/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
  239. package/dist/web/vendor/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  240. package/dist/web/vendor/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
  241. package/dist/web/vendor/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
  242. package/dist/web/vendor/pdfjs/wasm/LICENSE_QCMS +21 -0
  243. package/dist/web/vendor/pdfjs/wasm/jbig2.wasm +0 -0
  244. package/dist/web/vendor/pdfjs/wasm/jbig2_nowasm_fallback.js +15 -0
  245. package/dist/web/vendor/pdfjs/wasm/openjpeg.wasm +0 -0
  246. package/dist/web/vendor/pdfjs/wasm/openjpeg_nowasm_fallback.js +17 -0
  247. package/dist/web/vendor/pdfjs/wasm/qcms_bg.wasm +0 -0
  248. package/dist/web/workspaces.js +167 -26
  249. package/home-env.mjs +28 -0
  250. package/install-path.mjs +59 -3
  251. package/launch-starting-page.mjs +35 -15
  252. package/launch.mjs +358 -51
  253. package/package.json +2 -1
  254. package/pin-home.mjs +6 -0
  255. package/post-update-marker.mjs +14 -0
  256. package/preferences-file.mjs +289 -0
  257. package/supervisor-lock.mjs +195 -0
@@ -3001,6 +3001,9 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
3001
3001
  Metadata only — no state, no DOM. The armed flags these describe live inside main()
3002
3002
  and are read by the reporter that sits beside them; see the note in commands-steel.js
3003
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>
3004
3007
  <script src="commands.js"></script>
3005
3008
  <script src="commands-steel.js"></script>
3006
3009
  <!-- An Esc this editor leaves unused closes the shell's editor overlay (#1571); mounted after the keydown ladder. -->
@@ -4815,10 +4818,44 @@ function contractFailureState(status, code, serverError, projectScoped) {
4815
4818
  detail: 'Error ' + status + ' · ' + code,
4816
4819
  };
4817
4820
  }
4818
- return {
4819
- headline: 'Couldn’t load this model',
4820
- body: serverError || ('The server returned error ' + status + '. Reopen the editor and try again.'),
4821
- };
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;
4822
4859
  }
4823
4860
 
4824
4861
  /* WHY A SECOND COUNTER AND NOT JUST `modelEditGeneration`.
@@ -6316,11 +6353,17 @@ function reconcileDecisions(){
6316
6353
  if(JSON.stringify(decidedMembers(C.members))===JSON.stringify(serverDecided))return;
6317
6354
  V2_SESSION.adoptWorkPointDecisions(serverDecided);render();sync3D();
6318
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'};
6319
6359
  async function memberEndRequest(path,body){
6320
- 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.
6321
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);}
6322
- 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;}
6323
- 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 */
6324
6367
  return d;
6325
6368
  }
6326
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
@@ -6333,7 +6376,7 @@ async function scanMemberEnds(liveMessage,pinnedScope){ // pinnedScope: re-che
6333
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;}
6334
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);}
6335
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();
6336
- }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);}
6337
6380
  }
6338
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();}
6339
6382
  // Ends Apply would extend right now: ticked, still needing review, with a chosen support. The one thing closing the
@@ -6387,10 +6430,10 @@ function focusMemberEnd(index,opts){
6387
6430
  }
6388
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();}
6389
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;
6390
- 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.');}}
6391
- 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();}}}
6392
- 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();}}}
6393
- 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.'}));}}
6394
6437
  // Selection is MODEL-WIDE, not per-sheet: the 3D shows every plan, so a pick / box-select / Ctrl-click can
6395
6438
  // span sheets. byId + selArr therefore search ALL plans (not just the active P) so the inspector + edits see
6396
6439
  // the whole selection — else selecting a roof (S-203) member while S-202 is active shows nothing, and a
@@ -8128,7 +8171,8 @@ async function flushContractWith(token, signal) {
8128
8171
  console.error('flush refused 428 — a first-party writer sent no precondition; this is a FloLess bug');
8129
8172
  if (seq === saveSeq) setSaved('err');
8130
8173
  showSaveRefusedBanner();
8131
- 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' });
8132
8176
  }
8133
8177
  if (res.status === 412) {
8134
8178
  // Approve must abort (the throw below), and the user needs to know WHY — a bare "save failed" toast
@@ -8137,7 +8181,7 @@ async function flushContractWith(token, signal) {
8137
8181
  conflicted = true;
8138
8182
  if (seq === saveSeq) setSaved('conflict');
8139
8183
  showConflictBanner();
8140
- 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' });
8141
8185
  }
8142
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);
8143
8187
  // The flush committed. Same rule as persistServer: apply the report only when the body was readable and
@@ -8147,7 +8191,14 @@ async function flushContractWith(token, signal) {
8147
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; } }
8148
8192
  else releaseMutation(mid);
8149
8193
  if (seq === saveSeq) setSaved(res.ok ? 'ok' : 'err'); // only the latest save owns the pill
8150
- 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
+ }
8151
8202
  return { etag: adoptedTag, generation: publishedGeneration };
8152
8203
  }, token).finally(()=>{saveWritesInFlight--;publishContractSaveState();});
8153
8204
  }
@@ -9747,7 +9798,7 @@ function gridReadFromDrawing(keep){
9747
9798
  // metric job in inches. Swallowing that one turns the loudness into a LIE: the sheet's grid read
9748
9799
  // fine, and the user is told to start blank. So a `grid-core:` error is reported as itself.
9749
9800
  let r=null;try{r=gc.gridFromDrawing(els,(P.mm_per_px>0)?P.mm_per_px:FT_TO_MM,displayUnits());}
9750
- 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
9751
9802
  if(!r){toast('No grid found in this sheet’s linework — draw one with Start blank instead');return;}
9752
9803
  const g=r.grid;
9753
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)
@@ -16411,7 +16462,11 @@ function applyConnectionBakeTruth(j,announce=true){
16411
16462
  }
16412
16463
  async function fetchScenePayload(contract=C){
16413
16464
  const r=await fetch('/api/contract/'+encodeURIComponent(APP_ID)+'/scene'+PROJECT_QS,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({contract})});
16414
- 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;
16415
16470
  }
16416
16471
  function connectionTruthRequest(){
16417
16472
  const contract=JSON.parse(JSON.stringify(C)),previewByEnd=new WeakMap();
@@ -16591,7 +16646,7 @@ async function sendSelectionToHost(host,ids,hostPid){
16591
16646
  if(!pre.ok||!review.ok){
16592
16647
  if(review&&review.code==='host-bake-empty'){await showSelectionHostBakeReview(review,NAME,true,false);return;}
16593
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;}
16594
- 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});
16595
16650
  }
16596
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'));
16597
16652
  let confirmed=review.kind==='clean'&&!changedClean;
@@ -16606,7 +16661,7 @@ async function sendSelectionToHost(host,ids,hostPid){
16606
16661
  hostDispatchMayHaveStarted=false;
16607
16662
  if(sent.ok&&j.ok){await acknowledgeSelectionHostBake(review.consent);break;}
16608
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;}
16609
- 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});
16610
16665
  }
16611
16666
  if(!j||!j.ok)return;
16612
16667
  // Report what TEKLA received, never what we asked for: the server legitimately drops members it
@@ -16976,9 +17031,12 @@ const view3dApi={
16976
17031
  if(!current||current.objects!==objects)return; // a newer read already superseded this failed upload
16977
17032
  const previous=refRenderedGeom.get(id);
16978
17033
  if(previous)refGeom.set(id,previous);else refGeom.delete(id);
16979
- 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');
16980
17038
  pushReferences();if(legendTab==='refs')renderRefsTab();if(refSelectedObjIdx!==null)panel();
16981
- 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');
16982
17040
  },
16983
17041
  onConnMemberPickChange:()=>{}, // the chosen set shows as the 3D selection + the chip's live count; nothing else to reflect
16984
17042
  onConnMemberPickAbandon:(jointId,reason)=>{ // left the pick without answering it (focus moved, left 3D, pane went inactive)
@@ -17532,8 +17590,10 @@ async function reviewVerb(verb,jointId,opts){
17532
17590
  catch(e){const err=new Error('the server could not be reached');err.transport=true;throw err;}
17533
17591
  const d=await res.json().catch(()=>{console.warn('steel-editor: a review reply was not readable JSON',{verb,status:res.status});return {};});
17534
17592
  if(!res.ok){
17535
- const err=new Error(d.error||('the review action failed ('+res.status+')'));
17536
- 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;
17537
17597
  }
17538
17598
  return d;
17539
17599
  }
@@ -17572,9 +17632,14 @@ function reviewVerbFailed(e,fallback){
17572
17632
  /* The server's own 4xx prose is written FOR the user and names what to do; anything else — a transport
17573
17633
  failure, a 5xx behind an HTML error page — is not, so the caller's sentence wins, because it is the
17574
17634
  only one that names the connection. */
17575
- const speakable=e&&!e.transport&&e.status>=400&&e.status<500&&e.message;
17576
- toast(speakable?String(e.message)
17577
- :(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:''));
17578
17643
  }
17579
17644
  /* Is the document on screen still the one that flush published? THREE tripwires, each answering a
17580
17645
  different question, because no one of them is total on its own - see `modelEditGeneration`. */
@@ -18781,7 +18846,7 @@ function referenceWorker(){
18781
18846
  const reason=(event&&event.message)||'the geometry worker stopped';
18782
18847
  const failed=refGeometryWorker;refGeometryWorker=null;
18783
18848
  try{failed&&failed.terminate();}catch(_){}
18784
- 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'}));
18785
18850
  refGeometryPending.clear();
18786
18851
  };
18787
18852
  return refGeometryWorker;
@@ -18792,7 +18857,7 @@ function fetchReferenceGeometry(url){
18792
18857
  // A crashed/OOM-stalled worker may raise no `error` event. Bound the request so one bad reference
18793
18858
  // cannot leave its row spinning forever and block every later reference in the sequential opener.
18794
18859
  const timer=setTimeout(()=>{
18795
- const reason=new Error('reference geometry timed out');
18860
+ const reason=Object.assign(new Error('reference geometry timed out'),{referenceFailure:'timeout'});
18796
18861
  const stalled=refGeometryWorker;refGeometryWorker=null;
18797
18862
  try{stalled&&stalled.terminate();}catch(_){}
18798
18863
  // Decode is CPU-bound after the body arrives, so an AbortController cannot rescue this worker.
@@ -18805,6 +18870,42 @@ function fetchReferenceGeometry(url){
18805
18870
  });
18806
18871
  }
18807
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
+ }
18808
18909
  const refEmpty=new Set(); // ids the reader answered for, with nothing drawable in the answer
18809
18910
  let refSelectedId=null; // the reference the panel has expanded (and the 3D layer has selected)
18810
18911
  /**
@@ -19111,7 +19212,7 @@ async function loadReferenceGeometry(id,opts){
19111
19212
  else if(d.code==='reference-empty'){only(refEmpty);refEmpty.add(id);}
19112
19213
  // An `else` is mandatory here: a 500 whose body is not JSON parses to `{}`, so without one a failed
19113
19214
  // fetch produced no toast, no state and no log — the row simply looked fine.
19114
- else {only(refFailed);refFailed.set(id,d.error||('the server answered '+res.status));}
19215
+ else {only(refFailed);refFailed.set(id,referenceFailureReason(res.status,d));}
19115
19216
  }catch(e){
19116
19217
  // FAILURE IS ROW STATE, not a swallow. The first cut had an empty catch whose comment claimed the row
19117
19218
  // would stay "loading…" — and the `finally` below falsified it on the very next line: it clears
@@ -19121,7 +19222,7 @@ async function loadReferenceGeometry(id,opts){
19121
19222
  // whole feature must avoid.
19122
19223
  if(refById(id)){
19123
19224
  for(const st of [refUnresolved,refEmpty])st.delete(id);
19124
- refFailed.set(id,(e&&e.message)||'could not reach the server');
19225
+ refFailed.set(id,referenceFailureReason(0,null,e||{}));
19125
19226
  }
19126
19227
  console.error('[reference] geometry fetch failed',id,e);
19127
19228
  }
@@ -19287,7 +19388,7 @@ function refMeasureArm(id){
19287
19388
  // whose file failed to load exactly what a user whose file is legitimately empty is told.
19288
19389
  if(!refGeom.has(id)){
19289
19390
  toast(refLoading.has(id)?'Still reading its geometry — try again in a moment'
19290
- :refFailed.has(id)?('Its geometry could not be read — '+refFailed.get(id))
19391
+ :refFailed.has(id)?referenceFailureToast(refFailed.get(id))
19291
19392
  :refEmpty.has(id)?'This file has nothing drawable in it to measure'
19292
19393
  :'There is no geometry to measure yet');
19293
19394
  return;}
@@ -23908,7 +24009,7 @@ async function setView(on,{remember=true}={}){
23908
24009
  // the success path above — a staleness check on only one of the two exits is not a check.
23909
24010
  if(seq!==viewSeq)return;
23910
24011
  applyViewState('2d');if(window.Steel3DView)window.Steel3DView.hide();
23911
- toast('Could not open 3D view: '+((e&&e.message)||e));
24012
+ toast(threeDOpenFailureText(e));
23912
24013
  // FALL THROUGH, do not return. The failure path must not persist the mode that failed — that is what
23913
24014
  // `failed` below is for — but it still needs the shared tail. An earlier revision returned here and
23914
24015
  // skipped panel(), refreshPropLabels3d() and updCS(): the success path calls updCS()/csSyncF3d()
@@ -25648,7 +25749,7 @@ async function refreshRfiRecords(opts){
25648
25749
  // KEYED ON THE HTTP STATUS, not on `code`: the three refusals `resolveProject` answers with — an
25649
25750
  // unknown project, a malformed id, a project with no incarnation yet — carry no code at all, so an
25650
25751
  // arm that switched on one would fall through for a state a real project can reach.
25651
- 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),
25652
25753
  liveDetail:String(j.liveTruthDetail||''),http:r.status||0,error:String((j&&j.error)||''),
25653
25754
  // #2521 row 3b-2: a Quick version's unfiled questions live in the version, so they show even now.
25654
25755
  quickFiling:Array.isArray(j&&j.quickFiling)?j.quickFiling:[],
@@ -25670,6 +25771,7 @@ async function refreshRfiRecords(opts){
25670
25771
  sizeTruth:j.sizeTruth==='known'?'known':'unavailable',
25671
25772
  liveTruth:j.liveTruth==='known'?'known':'unavailable',
25672
25773
  detail:String(j.sizeTruthDetail||''),liveDetail:String(j.liveTruthDetail||''),http:200,error:'',
25774
+ drawnHeightCheck:rfiDrawnHeightCheckOf(j),
25673
25775
  quickFiling:Array.isArray(j.quickFiling)?j.quickFiling:[],
25674
25776
  readQuestions:j.readQuestions&&typeof j.readQuestions==='object'?j.readQuestions:null,
25675
25777
  readQuestionsUnavailable:!!j.readQuestionsUnavailable};
@@ -26732,7 +26834,8 @@ async function rfiDispatch(snap,retried,deadline){
26732
26834
  }
26733
26835
  }
26734
26836
  if(rfiFormFor&&rfiFormFor.opKey===snap.opKey)rfiFormFor={...rfiFormFor,busy:false};
26735
- 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.'});
26736
26839
  // `rfi-not-found` removes its own subject, so it never has a row to live in.
26737
26840
  if(code==='rfi-not-found')rfiSetOutcome(null,code,said,'attempt');
26738
26841
  else report(code||'rfi-refused',said);
@@ -27575,6 +27678,38 @@ function rfiEndUnresolved(memberId,end){
27575
27678
  }
27576
27679
  const rfiEndWords=(end,m)=>m&&m.role==='column'?(end===0?'bottom':'top'):(end===0?'start':'end');
27577
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.';
27578
27713
  function rfiElevationNotes(g){
27579
27714
  if(!g||g.kind!=='unknown-elevation')return [];
27580
27715
  const notes=[];
@@ -27721,6 +27856,12 @@ function paintRfiBanner(){
27721
27856
  +'unavailable on every row below until it does. Reload the page to try again.';
27722
27857
  html=html?html+'<br>'+clause:clause;
27723
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
+ }
27724
27865
  banner.innerHTML=html;
27725
27866
  banner.hidden=!html;
27726
27867
  const retry=document.getElementById('rfiRetry');
@@ -28351,6 +28492,7 @@ function rfiGroupedRecordRowHtml(r){
28351
28492
  const error=rfiTargetErrors.get(key);
28352
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>'
28353
28494
  +'<div class=rfinote>'+esc(occ.question)+(sheets?' · '+esc(sheets):'')+'</div>'
28495
+ +rfiNowHtml(occ.liveGap)
28354
28496
  +(occ.reopened?'<div class=rfinote>Reopened '+rfiDated(occ.reopened.at)+(occ.reopened.why?': '+esc(occ.reopened.why):'.')+'</div>':'')
28355
28497
  +rfiRoundsHtml(r,occ.earlierRounds,index)
28356
28498
  +(error?'<div class=rfifail role=alert>'+esc(error.message)+'</div>':'')
@@ -28361,7 +28503,7 @@ function rfiGroupedRecordRowHtml(r){
28361
28503
  :'<ol id="'+panelId+'" class=rfioccurrences aria-label="Occurrences in '+esc(r.id)+'" hidden></ol>';
28362
28504
  const sheetSummary=rfiScope==='sheet'?matching.length+' of '+count+' occurrences on this sheet · ':'';
28363
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>'
28364
- +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>'
28365
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>'))
28366
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>'
28367
28509
  +(formOpen?'':rfiOutcomeHtml(rowKey))+occurrences+'</div></div>';
@@ -28560,6 +28702,14 @@ async function rfiReadRaise(gapKeys,asOne,busyKey){
28560
28702
  }
28561
28703
  }
28562
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
+ }
28563
28713
  function rfiRecordRowHtml(r){
28564
28714
  if(r&&r.grouped)return rfiGroupedRecordRowHtml(r);
28565
28715
  const rowKey=rfiRowKey('record',r.id);
@@ -28687,6 +28837,7 @@ function rfiRecordRowHtml(r){
28687
28837
  const acts=gmailBtn+(resolve||'')+verbBtns+deliveryActs+copy+locate+targetControls;
28688
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>'
28689
28839
  +esc(r.question||'This RFI records no question.')
28840
+ +rfiNowHtml(r.liveGap)
28690
28841
  +'<div class=rfimeta>'+meta+'</div>'
28691
28842
  +(notes.length?'<div class=rfinote>'+notes.join(' ')+'</div>':'')
28692
28843
  +rfiRoundsHtml(r,r.earlierRounds,null)
@@ -28695,7 +28846,7 @@ function rfiRecordRowHtml(r){
28695
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>':'')
28696
28847
  +(settling?'<div class=rfinote role="note" data-rfi-profile-settle>'+esc(settling.message)+'</div>':'')
28697
28848
  +deliveryHtml+rfiSettleHtml(r,rowKey)
28698
- +(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>':'')
28699
28850
  +(elevGap&&!formOpen&&!recovering?rfiElevationControls(rowKey,r.id,elevGap):'')
28700
28851
  // The outcome renders INSIDE the form when one is open (directly above Submit, where focus lands);
28701
28852
  // at row level only when there is no form to put it in.
@@ -29082,11 +29233,12 @@ function wireRfiList(){
29082
29233
  // The list may have been re-read since this markup was painted (the repaint is suppressed while
29083
29234
  // focus is inside the list), so the record can be gone. Say so rather than clicking into silence.
29084
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);
29085
29237
  // Promise.resolve().then(...) so the CATCH BELOW IS REACHABLE. In an insecure context
29086
29238
  // `navigator.clipboard` is undefined, and `navigator.clipboard.writeText(...)` then throws
29087
29239
  // SYNCHRONOUSLY — before any promise exists — so a bare `.catch` never fires and the button does
29088
29240
  // nothing at all. `web/aware.js` and `web/workspaces.js` both guard the same hazard.
29089
- Promise.resolve().then(()=>navigator.clipboard.writeText(r.text)).then(()=>{
29241
+ Promise.resolve().then(()=>navigator.clipboard.writeText(text)).then(()=>{
29090
29242
  const was=b.textContent;b.textContent='Copied';setTimeout(()=>{b.textContent=was;},1600);
29091
29243
  }).catch(err=>{
29092
29244
  // Bind and log it: an insecure context and a denied permission are different problems and a bug
@@ -32454,7 +32606,9 @@ async function askAiCreateRequest(draft){
32454
32606
  try {
32455
32607
  flushed=await window.flushContract();
32456
32608
  } catch (err) {
32457
- 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)');
32458
32612
  return null;
32459
32613
  }
32460
32614
  askAiSetStatus('Sending…', 'var(--mut)');
@@ -32474,13 +32628,17 @@ async function askAiCreateRequest(draft){
32474
32628
  if (res.ok) {
32475
32629
  const body=await res.json();return body.request||null;
32476
32630
  } else {
32477
- let errText = 'Request failed (' + res.status + ')';
32478
- try { const body = await res.json(); if (body && body.error) errText = body.error; } catch (_) {}
32479
- 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)');
32480
32636
  return null;
32481
32637
  }
32482
32638
  } catch (err) {
32483
- 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)');
32484
32642
  return null;
32485
32643
  }
32486
32644
  }
@@ -32626,7 +32784,10 @@ rfiPostShell({type:'floless:editor-ready'});
32626
32784
  refresh();
32627
32785
  })();
32628
32786
 
32629
- 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)' })); });
32630
32791
 
32631
32792
  // Themed tooltips (replaces native title=) for the 3D toolbar — one shared element, shown on
32632
32793
  // data-tip hover after a short delay, positioned below the control and clamped to the viewport. A function of