Commit graph grid-apps-cmms/src/main/mesh.js
Author SHA1 Message Date
cda1d784ff Fix CMMS-embedded loads freezing on the boot curtain forever
restore_space() (the normal boot path, restoring a previous IndexedDB
session) is intentionally skipped for a CMMS-scoped launch - but its
finalization tail (hide the loading curtain via boot_done(), enable
handles, publish app_ready) only ever ran inside restore_space() itself.
Skipping it meant the curtain never went away even after cmms_load_from_url
fetched and loaded the file successfully underneath it. app_ready
subscribers never fired either - mesh/history.js's undo-tracking enable,
mesh/build.js's doc-name label - a second, less visible bug from the same
cause.

Wrapped in try/finally so this always runs, even on a failed fetch -
a file that can't load shouldn't leave the user stuck behind the
curtain either. Also calls api.document.restoreOrCreate() first, since
restore_space() always does that before any file-load in normal use.
2026-08-27 20:15:28 +10:00
0acf40cac2 Fix CMMS config timing: read from URL params, not window.MESH_TOOL_CONFIG
A parent iframe cannot inject window.MESH_TOOL_CONFIG into this app's
window before init() runs - by the time the iframe's load event fires
(the only cross-frame signal available for a same-origin page this app's
own server generates, not the CMMS), init() has already executed and
already decided to call restore_space() instead. Query params are read
synchronously during init() itself, before the existing 'hide url params'
cleanup strips them - self.MESH_TOOL_CONFIG is still set from them so
util.download() (src/mesh/build.js) has one stable place to read from.
2026-08-23 17:21:11 +10:00
ee5b863f02 CMMS embedding: load-from-URL on boot, POST-save instead of download
Additive only, gated entirely on window.MESH_TOOL_CONFIG being present (set
by the CMMS's public/mesh-edit.php host page, absent everywhere else -
standalone use is unaffected).

- src/main/mesh.js: cmms_load_from_url() fetches bytes from the
  host-provided loadUrl and feeds them through the existing load_files()
  path (same one drag-and-drop and the Import button use) - skips
  restore_space() when embedded, since job-scoped launch means "load this
  exact file", not whatever was last open in this browser's IndexedDB.
- src/mesh/build.js: util.download() calls cmms_save_to_host() instead of
  triggering a browser download when embedded - POSTs to the same
  job/manufacturing_project-scoped save endpoint pattern as the CAD editor
  fork's post_bytes_to_host().
2026-08-23 17:17:33 +10:00
Stewart Allen
913977ec64 updating mesh visuals
add document history
2026-02-17 23:49:25 -05:00
Stewart Allen
a66d7fe202 clean up electron build, merge electron mod into core 2025-11-12 23:29:36 -05:00
Stewart Allen
b52ab788e5 disable step debug. add mesh script persistance, control, error dialog 2025-10-26 18:15:13 -04:00
Stewart Allen
1ba9fbee19 fix step face generation with inner holes 2025-10-26 11:03:51 -04:00
Stewart Allen
6d202aafaa add mesh script tool 2025-10-24 23:56:06 -04:00
Stewart Allen
a4e687f709 allow app versions to be served with prefixes instead of cookies 2025-07-13 18:47:09 -04:00
Stewart Allen
11552df76f renew module work 2025-07-07 13:36:03 -04:00
Stewart Allen
f139f01b83 fix history rewrite 2025-07-07 01:08:04 -04:00
Stewart Allen
ce4f5d6e78 move src2 -> src, web2 -> web, remove old module system, fix deps 2025-07-06 23:44:33 -04:00
Stewart Allen
e1070c9e04 fix svg extrusion in mesh:tool 2025-05-19 15:57:24 -04:00
Stewart Allen
6f9e066d13 add event-driven once keypress actions, split S and V ephemeral overrides, all mesh split at specified value 2025-01-21 12:14:05 -08:00
Stewart Allen
e52402a479 bump rev 4.0.28, 1.5.6 2024-09-10 21:53:07 -04:00
Stewart Allen
fd9d2b7f58 fix delete face selection 2024-09-04 23:11:34 -04:00
Stewart Allen
4dc9e38a08 bump rev 4.0.26, 1.5.5 2024-09-03 18:51:16 -04:00
Stewart Allen
80b4765cd0 bump rev 4.0.23, 1.5.4 2024-08-28 18:21:15 -04:00
Stewart Allen
996e1afb39 bump rev 4.0.22, 1.5.3 2024-08-20 21:18:08 -04:00
Stewart Allen
ad53e78e7e bump rev 4.0.20, 1.5.2 2024-08-16 23:10:12 -04:00
Stewart Allen
66d9ed71b1 fix mode selection on sketch add 2024-08-15 14:38:52 -04:00
Stewart Allen
2ca2dc1c70 add (flawed) faces to sketch 2024-08-15 13:46:12 -04:00
Stewart Allen
5ac59f416b bump rev 4.0.19, 1.5.1 2024-08-12 20:14:58 -04:00
Stewart Allen
c960501a87 add mode key sohrtcuts, face selection re-triangulation 2024-08-12 15:54:49 -04:00
Stewart Allen
0057f56505 bump rev 4.0.18, 1.5.0 2024-08-11 11:22:26 -04:00
Stewart Allen
7ff172f5f3 checkpoint 2024-08-09 21:53:33 -04:00
Stewart Allen
cad64d52f8 remove unused indexed option for mesh loading 2024-08-02 15:35:11 -04:00
Stewart Allen
b5ed7b1a4a preserve object visibility 2024-08-02 10:17:40 -04:00
Stewart Allen
8d50945828 bump rev 4.0.17, 1.4.9 2024-08-02 09:34:15 -04:00
Stewart Allen
18b6b8567a deep clone + args, rework/cleanup ui binding, preserve groups on poly re-nest 2024-07-30 15:12:02 -04:00
Stewart Allen
f451308bb8 bump rev 4.0.16, 1.4.8 2024-07-28 22:40:21 -04:00
Stewart Allen
a2a5fc1cd4 add sketch z scaling, item ordering, sensible grouping on union 2024-07-28 13:30:20 -04:00
Stewart Allen
611d3cac1c add_rect now calls add_poly, refactor add_ to add. 2024-07-28 11:10:44 -04:00
Stewart Allen
f04fb3a813 add open poly rendering and preferences 2024-07-27 22:08:26 -04:00
Stewart Allen
a6c4f8aff1 add sketch item(s) duplication 2024-07-27 20:01:13 -04:00
Stewart Allen
508507e684 fix gerber open poly offsetting 2024-07-27 17:55:34 -04:00
Stewart Allen
f8cce06183 better file error load handling 2024-07-27 17:25:05 -04:00
Stewart Allen
921f1dabe0 add open poly handling in gbr sketch import 2024-07-27 16:54:05 -04:00
Stewart Allen
83624f0617 add gerber sketch import to mesh:tool 2024-07-27 16:37:42 -04:00
Stewart Allen
2966ad22b8 bump rev 4.0.15, 1.4.7 2024-07-27 14:09:00 -04:00
Stewart Allen
d8655a60a9 mesh: add svg import to sketch, kiri: fix svg import multi obj 2024-07-27 13:49:28 -04:00
Stewart Allen
2efb9cfab8 add proper negative extrusion handling (normals and chamfer reversal) 2024-07-27 12:28:09 -04:00
Stewart Allen
96b111e463 experimental attach sketch to face 2024-07-27 00:51:31 -04:00
Stewart Allen
f36808c160 fix sketch normal, extrude to match sketch normal 2024-07-27 00:39:23 -04:00
Stewart Allen
ed5186fdbb bump rev 4.0.14, 1.4.6 2024-07-26 20:08:24 -04:00
Stewart Allen
a6be28907c start drag snapping with models 2024-07-26 16:28:52 -04:00
Stewart Allen
caeba6a48d stub in snap but requires more work and validating removal of some mouse dragging code 2024-07-26 14:58:08 -04:00
Stewart Allen
c7fed8da3b add sketch and sketch item centering 2024-07-26 00:35:36 -04:00
Stewart Allen
71f94e30d5 bump rev 4.0.13, 1.4.5 2024-07-25 23:34:40 -04:00
Stewart Allen
47e47df0a5 add sketch item dialogs and editing, sketch extrusion dialog and options 2024-07-25 23:30:58 -04:00