dsh-talk-map 0.1.41 → 0.1.42

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 (2) hide show
  1. package/client/client.js +17 -3
  2. package/package.json +1 -1
package/client/client.js CHANGED
@@ -13170,12 +13170,26 @@ function StackDrawer(props) {
13170
13170
  measure();
13171
13171
  });
13172
13172
  observer.observe(scroller);
13173
- const settle = [60, 160, 320, 600].map((delay) => window.setTimeout(() => {
13173
+ let signature = "";
13174
+ let stableFrames = 0;
13175
+ let frame2 = 0;
13176
+ const tick = () => {
13174
13177
  measure();
13175
- }, delay));
13178
+ const next = [...scroller.querySelectorAll("[data-card-id]")].map((element) => {
13179
+ const r = element.getBoundingClientRect();
13180
+ return `${Math.round(r.left)},${Math.round(r.top)},${Math.round(r.width)},${Math.round(r.height)}`;
13181
+ }).join("|");
13182
+ stableFrames = next === signature ? stableFrames + 1 : 0;
13183
+ signature = next;
13184
+ frame2 += 1;
13185
+ if (stableFrames < 3 || frame2 < 12) {
13186
+ raf = window.requestAnimationFrame(tick);
13187
+ }
13188
+ };
13189
+ let raf = window.requestAnimationFrame(tick);
13176
13190
  return () => {
13177
13191
  observer.disconnect();
13178
- for (const timer4 of settle) window.clearTimeout(timer4);
13192
+ window.cancelAnimationFrame(raf);
13179
13193
  };
13180
13194
  }, [props.links, props.items, query, visibleItems.length]);
13181
13195
  (0, import_react10.useEffect)(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-talk-map",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "Visual conversation map for DeepSeek Harness: an infinite whiteboard where every session is a card — drag to arrange, double-click to start a chat in place, draw an edge to fork a new session with injected context. Built for ADHD-friendly spatial memory. · DSH 可视化对话地图:会话即卡片,双击即聊,连线分叉带上下文的新对话。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",