@bitmagic/cli 0.1.54-dev.2 → 0.1.54-dev.4

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.
@@ -372,6 +372,8 @@ ${ASSET_DETAIL_HTML}
372
372
  var voxelStartTimer = null;
373
373
  // Set when a reload took an open session with it, so start() can say so once the boot is done.
374
374
  var voxelSessionWasLost = false;
375
+ // A CHECK_TERRAIN_CHANGES probe is in flight from onChangeSignal. See the comment there.
376
+ var terrainProbePending = false;
375
377
  // How long EDIT_VOXEL_ASSET may go unanswered before the engine is presumed too old to know it.
376
378
  // Generous: a real start fetches the .vxl from the CDN before it answers.
377
379
  var VOXEL_START_TIMEOUT_MS = 10000;
@@ -908,6 +910,10 @@ ${ASSET_DETAIL_HTML}
908
910
  voxelSessionPending = false;
909
911
  if (voxelStartTimer) { clearTimeout(voxelStartTimer); voxelStartTimer = null; }
910
912
  setVoxelSessionUi(false);
913
+ // The reply this was waiting for belongs to the engine that is being replaced, and its waiter
914
+ // times out into the old closure. Left true, it would refuse every probe for the rest of the
915
+ // page's life and the terrain check would silently stop happening.
916
+ terrainProbePending = false;
911
917
  banner.classList.remove('show');
912
918
  terrainBanner.classList.remove('show');
913
919
  setStatus('', 'Loading…');
@@ -1145,9 +1151,24 @@ ${ASSET_DETAIL_HTML}
1145
1151
  // Terrain sessions announce nothing (VOXEL_OBJECT_EDIT_* is object-only), so ask. A null
1146
1152
  // answer — timeout, or an engine from before the terrain editor — reloads as it always did.
1147
1153
  if (activeTab === 'editor' && loaded) {
1154
+ // One probe at a time. The 500 ms poll keeps re-signalling the same unchanged mtime for the
1155
+ // whole 2 s wait, and every waiter matching a type resolves off ONE reply — so without this
1156
+ // a single agent write armed four probes that all resolved together and called start() four
1157
+ // times, reloading the iframe mid-navigation on each.
1158
+ if (terrainProbePending) return;
1159
+ terrainProbePending = true;
1148
1160
  void request('CHECK_TERRAIN_CHANGES', 'TERRAIN_HAS_CHANGES', 2000).then(function (terrain) {
1149
- if (terrain && terrain.hasChanges === true) banner.classList.add('show');
1150
- else start();
1161
+ terrainProbePending = false;
1162
+ if (terrain && terrain.hasChanges === true) { banner.classList.add('show'); return; }
1163
+ // Re-ask everything the synchronous path asked. Up to two seconds have passed inside a
1164
+ // stale closure: the creator may have opened a voxel session or switched auto-reload off
1165
+ // since, and reloading on the answer to a question that old is how a just-opened session
1166
+ // got destroyed by a change signal that predated it.
1167
+ if (!autoReload || voxelSessionActive || voxelSessionPending) {
1168
+ banner.classList.add('show');
1169
+ return;
1170
+ }
1171
+ start();
1151
1172
  });
1152
1173
  return;
1153
1174
  }
@@ -2137,11 +2158,30 @@ ${ASSET_DETAIL_HTML}
2137
2158
  });
2138
2159
  }
2139
2160
 
2161
+ /**
2162
+ * Reload, unless that would throw away a sculpt the creator cannot see the cost of.
2163
+ *
2164
+ * Every automatic reload defers to an open session, and then the banner that deferral raises
2165
+ * offers a button that does not — reading "this scene is out of date" while the creator is
2166
+ * mid-sculpt, which is an invitation to lose the work. Asking is right here rather than
2167
+ * refusing: unlike the automatic paths this is a deliberate act, and a session the engine has
2168
+ * wedged needs a way out. The engine asks the same question on Escape, so the wording matches
2169
+ * what a creator has already seen from the toolbar.
2170
+ */
2171
+ function reloadUnlessSculpting() {
2172
+ if (voxelSessionActive
2173
+ && !window.confirm('You have unsaved voxel edits. Reloading discards them. Reload anyway?')) {
2174
+ return;
2175
+ }
2176
+ start();
2177
+ }
2178
+
2140
2179
  shotButton.addEventListener('click', takeScreenshot);
2141
- document.getElementById('reload').addEventListener('click', function () { start(); });
2180
+ document.getElementById('reload').addEventListener('click', reloadUnlessSculpting);
2142
2181
  // Same thing the bar's Reload does, put where a creator is already looking when a boot fails.
2182
+ // Unguarded on purpose: a failed boot has no session left to protect, and this is the way out.
2143
2183
  document.getElementById('boot-retry').addEventListener('click', function () { start(); });
2144
- document.getElementById('banner-reload').addEventListener('click', function () { start(); });
2184
+ document.getElementById('banner-reload').addEventListener('click', reloadUnlessSculpting);
2145
2185
  tabButtons.forEach(function (button) {
2146
2186
  button.addEventListener('click', function () {
2147
2187
  void selectTab(button.getAttribute('data-tab'));
@@ -1 +1 @@
1
- {"version":3,"file":"shell-page.js","sourceRoot":"","sources":["../../src/editor/shell-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,EACL,qBAAqB,EAAE,kBAAkB,GAC1C,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE7F,oGAAoG;AACpG,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;;;;;;;;;GAYG;AACH,SAAS,sBAAsB;IAC7B,OAAO;QACL,6BAA6B,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG;QACjE,iCAAiC,qBAAqB,CAAC,QAAQ,EAAE,GAAG;QACpE,8BAA8B,kBAAkB,CAAC,QAAQ,EAAE,GAAG;KAC/D,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC,kGAAkG;AAClG,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK;SACT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;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@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitmagic/cli",
3
- "version": "0.1.54-dev.2",
3
+ "version": "0.1.54-dev.4",
4
4
  "description": "Build Bitmagic games from your own agent tool",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Bitmagic Oy",
@@ -23,9 +23,9 @@
23
23
  "fflate": "^0.8.2",
24
24
  "playwright-core": "^1.59.1",
25
25
  "tar": "^7.4.3",
26
- "@bitmagic/world-forger": "0.1.14-dev.2",
27
- "@bitmagic/asset-core": "0.2.9-dev.2",
28
- "@bitmagic/animation-forger": "0.1.9-dev.2"
26
+ "@bitmagic/animation-forger": "0.1.9-dev.4",
27
+ "@bitmagic/world-forger": "0.1.14-dev.4",
28
+ "@bitmagic/asset-core": "0.2.9-dev.4"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@eslint/js": "^9.38.0",