@selvajs/ui 7.0.1-beta.0 → 7.0.2-beta.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.
@@ -53,6 +53,7 @@
53
53
  );
54
54
 
55
55
  let startedAt = 0;
56
+ let wasSolving = false;
56
57
  let elapsed = $state(0);
57
58
  let finished = $state<{ ms: number; aborted: boolean } | null>(null);
58
59
  let ping = $state(0);
@@ -67,6 +68,10 @@
67
68
  $effect(() => {
68
69
  const solving = isSolving;
69
70
  untrack(() => {
71
+ // Transitions only: the cloud session re-notifies `isSolving` unchanged on every live
72
+ // event and on the result, and restarting the clock there made a long solve end on 0.0 s.
73
+ if (solving === wasSolving) return;
74
+ wasSolving = solving;
70
75
  if (solving) {
71
76
  startedAt = performance.now();
72
77
  shownThisSolve = show;
@@ -74,7 +79,6 @@
74
79
  finished = null;
75
80
  return;
76
81
  }
77
- if (!startedAt) return;
78
82
  const ms = performance.now() - startedAt;
79
83
  startedAt = 0;
80
84
  if (shownThisSolve) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selvajs/ui",
3
- "version": "7.0.1-beta.0",
3
+ "version": "7.0.2-beta.0",
4
4
  "description": "Shared UI components and utilities for Selva applications",
5
5
  "license": "MIT",
6
6
  "author": "VektorNode",
@@ -63,9 +63,9 @@
63
63
  "tailwind-variants": "^3.3.1",
64
64
  "three": "^0.187.0",
65
65
  "@selvajs/compute": "^5.0.0",
66
+ "@selvajs/schemas": "^5.3.0",
66
67
  "@selvajs/solve": "^2.0.0",
67
- "@selvajs/visualization": "^1.6.1-beta.0",
68
- "@selvajs/schemas": "^5.3.0"
68
+ "@selvajs/visualization": "^1.7.0-beta.0"
69
69
  },
70
70
  "peerDependenciesMeta": {
71
71
  "three": {
@@ -95,10 +95,10 @@
95
95
  "tailwind-variants": "^3.3.1",
96
96
  "vitest": "^5.0.5",
97
97
  "@selvajs/compute": "5.0.0",
98
+ "@selvajs/visualization": "1.7.0-beta.0",
98
99
  "@selvajs/schemas": "5.3.0",
99
- "@selvajs/solve": "2.0.0",
100
100
  "@selvajs/config": "0.0.4",
101
- "@selvajs/visualization": "1.6.1-beta.0"
101
+ "@selvajs/solve": "2.0.0"
102
102
  },
103
103
  "imports": {
104
104
  "#lib": "./src/lib/index.js",
@@ -53,6 +53,7 @@
53
53
  );
54
54
 
55
55
  let startedAt = 0;
56
+ let wasSolving = false;
56
57
  let elapsed = $state(0);
57
58
  let finished = $state<{ ms: number; aborted: boolean } | null>(null);
58
59
  let ping = $state(0);
@@ -67,6 +68,10 @@
67
68
  $effect(() => {
68
69
  const solving = isSolving;
69
70
  untrack(() => {
71
+ // Transitions only: the cloud session re-notifies `isSolving` unchanged on every live
72
+ // event and on the result, and restarting the clock there made a long solve end on 0.0 s.
73
+ if (solving === wasSolving) return;
74
+ wasSolving = solving;
70
75
  if (solving) {
71
76
  startedAt = performance.now();
72
77
  shownThisSolve = show;
@@ -74,7 +79,6 @@
74
79
  finished = null;
75
80
  return;
76
81
  }
77
- if (!startedAt) return;
78
82
  const ms = performance.now() - startedAt;
79
83
  startedAt = 0;
80
84
  if (shownThisSolve) {