@agentprojectcontext/apx 1.73.0 → 1.73.1

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.
@@ -18,7 +18,7 @@
18
18
  <link rel="apple-touch-icon" href="/favicon/dark/apple-touch-icon.png" media="(prefers-color-scheme: dark)" />
19
19
  <link rel="manifest" href="/favicon/white/site.webmanifest" media="(prefers-color-scheme: light)" />
20
20
  <link rel="manifest" href="/favicon/dark/site.webmanifest" media="(prefers-color-scheme: dark)" />
21
- <script type="module" crossorigin src="/assets/index-D2b7Sqvg.js"></script>
21
+ <script type="module" crossorigin src="/assets/index-CqlRznhf.js"></script>
22
22
  <link rel="stylesheet" crossorigin href="/assets/index-CUeIhw7z.css">
23
23
  </head>
24
24
  <body class="bg-background text-foreground antialiased">
@@ -78,6 +78,9 @@ export function BrainGraph({
78
78
  const linksRef = useRef<SimLink[]>([]);
79
79
  const dragRef = useRef<SimNode | null>(null);
80
80
  const panRef = useRef<{ x: number; y: number } | null>(null);
81
+ // Press bookkeeping so a drag is never mistaken for a click (which navigates).
82
+ const downRef = useRef<{ x: number; y: number } | null>(null);
83
+ const movedRef = useRef(false);
81
84
  const viewRef = useRef({ tx: 0, ty: 0, k: 1 });
82
85
  const fitRef = useRef<() => void>(() => {});
83
86
  const [, setVersion] = useState(0);
@@ -194,6 +197,8 @@ export function BrainGraph({
194
197
  if (roleOf(n) === "core") return;
195
198
  e.stopPropagation();
196
199
  dragRef.current = n;
200
+ downRef.current = { x: e.clientX, y: e.clientY };
201
+ movedRef.current = false;
197
202
  (e.target as Element).setPointerCapture?.(e.pointerId);
198
203
  simRef.current?.alphaTarget(0.3).restart();
199
204
  };
@@ -203,6 +208,8 @@ export function BrainGraph({
203
208
  };
204
209
  const onMove = (e: React.PointerEvent) => {
205
210
  if (dragRef.current) {
211
+ const d = downRef.current;
212
+ if (d && !movedRef.current && Math.hypot(e.clientX - d.x, e.clientY - d.y) > 4) movedRef.current = true;
206
213
  const w = worldFromClient(e.clientX, e.clientY);
207
214
  dragRef.current.fx = w.x; dragRef.current.fy = w.y;
208
215
  return;
@@ -222,6 +229,8 @@ export function BrainGraph({
222
229
  panRef.current = null;
223
230
  simRef.current?.alphaTarget(0);
224
231
  };
232
+ // Native click fires reliably on pointerup; skip it when the press was a drag.
233
+ const onNodeClickGuarded = (n: SimNode) => () => { if (!movedRef.current) pick(n); };
225
234
 
226
235
  const simNodes = nodesRef.current;
227
236
  const links = linksRef.current;
@@ -342,7 +351,7 @@ export function BrainGraph({
342
351
  const showLabel = isHub || isSel || !hideLeafLabels;
343
352
  return (
344
353
  <g key={n.id} transform={`translate(${n.x},${n.y})`} className="cursor-grab active:cursor-grabbing"
345
- onPointerDown={onNodeDown(n)} onClick={() => pick(n)}>
354
+ onPointerDown={onNodeDown(n)} onClick={onNodeClickGuarded(n)}>
346
355
  <circle r={r} fill={color} filter="url(#brain-glow)" opacity={0.3}>
347
356
  <animate attributeName="r" values={`${r};${r + 6};${r}`} dur={`${beat}s`} begin={begin} repeatCount="indefinite" />
348
357
  <animate attributeName="opacity" values="0.32;0.08;0.32" dur={`${beat}s`} begin={begin} repeatCount="indefinite" />