@things-factory/figure-ui 10.1.127 → 10.1.129

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/figure-ui",
3
- "version": "10.1.127",
3
+ "version": "10.1.129",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "@things-factory:registry": "https://registry.npmjs.org"
@@ -40,9 +40,9 @@
40
40
  "@operato/shell": "^10.0.0",
41
41
  "@operato/styles": "^10.0.0",
42
42
  "@operato/utils": "^10.0.0",
43
- "@things-factory/ai-assistant": "^10.1.127",
44
- "@things-factory/figure-service": "^10.1.123",
43
+ "@things-factory/ai-assistant": "^10.1.129",
44
+ "@things-factory/figure-service": "^10.1.129",
45
45
  "three": "^0.185.1"
46
46
  },
47
- "gitHead": "1a224d9f1cbf56697a739e505b97333dd090d473"
47
+ "gitHead": "4d1ef242d9b7e6669a34c27b6d31aed778c07a90"
48
48
  }
@@ -1,8 +1,7 @@
1
1
  /*
2
- * Going from the preview back to editing does not build the edit canvas again: a 3D scene costs about a third of a
3
- * second to make, and the canvas keeps its selection, gizmo and camera while the preview is in front. The preview is the
4
- * other way round -- it is taken down when it is left, because a preview left standing behind the canvas made every edit
5
- * dearer (a box added went from 240 ms to over a second, 2026-10-08).
2
+ * Going between editing and the preview does not build a 3D scene each time (about 300 ms): the edit canvas and, once it
3
+ * has been asked for, the preview stay standing and one of them is out of sight. A preview shown again after the figure
4
+ * changed makes its content again inside its scene (below); one that did not change is shown as it was.
6
5
  */
7
6
  import { test } from 'node:test'
8
7
  import assert from 'node:assert/strict'
@@ -17,9 +16,12 @@ test('the edit canvas stays standing, out of sight, while the preview is in fron
17
16
  assert.ok(/div\[middle\]\[hidden\]\s*\{\s*display: none;/.test(editor), 'and hidden by the stylesheet, which `display: flex` would otherwise override')
18
17
  })
19
18
 
20
- test('the preview is only there while it is in front', () => {
19
+ test('the preview is made when first asked for and kept, out of sight, after that', () => {
21
20
  const editor = read('../client/modeller/editor.ts')
22
- assert.ok(editor.includes("${this.middle === 'preview'\n ? html`<figure-preview"), 'it is made when asked for and taken down when left')
21
+ assert.ok(editor.includes("if (this.middle === 'preview') this.previewMounted = true"), 'made when asked for')
22
+ assert.ok(editor.includes("${this.previewMounted\n ? html`<figure-preview\n ?hidden=${this.middle !== 'preview'}\n .active=${this.middle === 'preview'}"), 'then kept, hidden and not in front')
23
+ const preview = read('../client/modeller/figure-preview.ts')
24
+ assert.ok(preview.includes('if (!this.active) {\n this.stale = true') && preview.includes('this.stale || changed.has(\'active\')'), 'out of sight it does not follow the figure; shown again it catches up')
23
25
  })
24
26
 
25
27
  test('a canvas out of sight is not resized to nothing and takes no picture', () => {