dsh-talk-map 0.1.27 → 0.1.29

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 -11
  2. package/package.json +1 -1
package/client/client.js CHANGED
@@ -448,7 +448,7 @@ var zh = {
448
448
  "digest.empty": "这条对话还没有摘要,先刷新摘要再来看。",
449
449
  "digest.copy": "复制",
450
450
  "digest.close": "关闭",
451
- "global.searchPlaceholder": "搜地图上的卡片(标题/正文)· v0.1.27",
451
+ "global.searchPlaceholder": "搜地图上的卡片(标题/正文)· v0.1.29",
452
452
  "global.searchRun": "搜索",
453
453
  "global.searchTitle": "搜索地图",
454
454
  "font.group": "文字大小",
@@ -599,7 +599,7 @@ var en = {
599
599
  "menu.noGroup": "Remove from group (free card)",
600
600
  "menu.open": "Open conversation",
601
601
  "menu.markUnread": "Mark as unread",
602
- "global.searchPlaceholder": "Search cards on the map · v0.1.27",
602
+ "global.searchPlaceholder": "Search cards on the map · v0.1.29",
603
603
  "global.searchRun": "Search",
604
604
  "global.searchTitle": "Search the map",
605
605
  "font.group": "Text size",
@@ -12263,10 +12263,6 @@ function boardBoxes() {
12263
12263
  }
12264
12264
  return boxes;
12265
12265
  }
12266
- function containsPoint(box, x, y) {
12267
- const pad = 40;
12268
- return x >= box.x - pad && x <= box.x + box.w + pad && y >= box.y - pad && y <= box.y + box.h + pad;
12269
- }
12270
12266
  function TalkMapEdge(props) {
12271
12267
  const data = props.data ?? {};
12272
12268
  const synced = data.sync === "synced";
@@ -12281,12 +12277,14 @@ function TalkMapEdge(props) {
12281
12277
  const obstacles = data.obstacles;
12282
12278
  const measuredBoxes = boardBoxes();
12283
12279
  const sameCorner = (box, other) => other !== void 0 && Math.abs(box.x - other.x) < 6 && Math.abs(box.y - other.y) < 6;
12284
- const merged = (measuredBoxes.length > 0 ? measuredBoxes : obstacles ?? []).filter((box) => !sameCorner(box, data.fromRect)).filter((box) => !sameCorner(box, data.toRect)).filter((box) => !sameCorner(box, data.fromRect)).filter((box) => !sameCorner(box, data.toRect)).filter((box) => !containsPoint(box, props.sourceX, props.sourceY)).filter((box) => !containsPoint(box, props.targetX, props.targetY));
12280
+ const merged = (obstacles !== void 0 && obstacles.length > 0 ? obstacles : measuredBoxes).filter((box) => !sameCorner(box, data.fromRect)).filter((box) => !sameCorner(box, data.toRect)).filter((box) => !sameCorner(box, data.fromRect)).filter((box) => !sameCorner(box, data.toRect));
12285
12281
  const route = merged.length === 0 ? void 0 : routeBetween(
12286
12282
  {
12287
- start: { x: props.sourceX, y: props.sourceY },
12283
+ // Rounded to whole flow pixels: anchors carry sub-pixel noise after a zoom,
12284
+ // which shifted the clipped endpoints by a pixel between renders.
12285
+ start: { x: Math.round(props.sourceX), y: Math.round(props.sourceY) },
12288
12286
  startFace: faceOf(props.sourcePosition),
12289
- end: { x: props.targetX, y: props.targetY },
12287
+ end: { x: Math.round(props.targetX), y: Math.round(props.targetY) },
12290
12288
  endFace: faceOf(props.targetPosition)
12291
12289
  },
12292
12290
  // The endpoints' real boxes: the router excludes them from the obstacle
@@ -12313,7 +12311,7 @@ function TalkMapEdge(props) {
12313
12311
  }
12314
12312
  return false;
12315
12313
  };
12316
- const guardBoxes = merged.filter((box) => !containsPoint(box, props.sourceX, props.sourceY)).filter((box) => !containsPoint(box, props.targetX, props.targetY));
12314
+ const guardBoxes = merged;
12317
12315
  const blockedRoute = routeHitsCard(route, guardBoxes);
12318
12316
  if (typeof window !== "undefined") {
12319
12317
  const w = window;
@@ -14174,7 +14172,15 @@ function CanvasInner(props) {
14174
14172
  const timer4 = window.setTimeout(() => setBoardTick((value) => value + 1), 150);
14175
14173
  return () => window.clearTimeout(timer4);
14176
14174
  }, []);
14177
- const obstaclesFor = (fromCardId, toCardId) => Object.entries(renderedBoxes()).filter(([id2]) => id2 !== fromCardId && id2 !== toCardId).map(([, box]) => box);
14175
+ const obstaclesFor = (fromCardId, toCardId) => {
14176
+ const rendered = renderedBoxes();
14177
+ const boxes = { ...rendered };
14178
+ for (const [id2, card] of Object.entries(canvasState.cards)) {
14179
+ if (boxes[id2] !== void 0) continue;
14180
+ boxes[id2] = { x: card.x, y: card.y, w: CARD_W, h: CARD_H };
14181
+ }
14182
+ return Object.entries(boxes).map(([, box]) => box);
14183
+ };
14178
14184
  const boxOf = (cardId) => renderedBoxes()[cardId];
14179
14185
  const routingObstacles = () => Object.entries(canvasState.cards).map(([id2, card]) => ({
14180
14186
  id: id2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-talk-map",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
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",