@andespindola/brainlink 0.1.0-beta.160 → 0.1.0-beta.161

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.
@@ -343,14 +343,19 @@ li small {
343
343
 
344
344
  .content-dialog {
345
345
  position: fixed;
346
+ top: 12px;
347
+ right: 12px;
348
+ bottom: 12px;
349
+ left: 12px;
346
350
  top: max(12px, env(safe-area-inset-top));
347
351
  right: max(12px, env(safe-area-inset-right));
352
+ bottom: max(12px, env(safe-area-inset-bottom));
353
+ left: max(12px, calc(100vw - 780px));
348
354
  margin: 0;
349
- width: min(760px, calc(100vw - 32px));
350
- height: min(calc(100vh - 24px), 920px);
351
- height: min(calc(100dvh - 24px), 920px);
352
- max-height: calc(100vh - 24px);
353
- max-height: calc(100dvh - 24px);
355
+ width: auto;
356
+ height: auto;
357
+ max-width: none;
358
+ max-height: none;
354
359
  padding: 0;
355
360
  border: 1px solid var(--line);
356
361
  border-radius: 8px;
@@ -375,6 +380,9 @@ li small {
375
380
 
376
381
  .content-dialog header {
377
382
  display: flex;
383
+ position: sticky;
384
+ top: 0;
385
+ z-index: 1;
378
386
  align-items: flex-start;
379
387
  justify-content: space-between;
380
388
  gap: 18px;
@@ -383,6 +391,10 @@ li small {
383
391
  background: var(--panel);
384
392
  }
385
393
 
394
+ .content-dialog header > div {
395
+ min-width: 0;
396
+ }
397
+
386
398
  .content-dialog h2,
387
399
  .content-dialog p {
388
400
  margin: 0;
@@ -441,6 +453,10 @@ li small {
441
453
  display: grid;
442
454
  grid-template-columns: repeat(2, minmax(0, 1fr));
443
455
  gap: 10px;
456
+ min-height: 0;
457
+ max-height: min(42vh, 360px);
458
+ max-height: min(42dvh, 360px);
459
+ overflow: auto;
444
460
  padding: 14px 22px;
445
461
  border-bottom: 1px solid var(--line);
446
462
  }
@@ -554,6 +570,7 @@ li small {
554
570
 
555
571
  .content-meta {
556
572
  grid-template-columns: 1fr;
573
+ max-height: 34vh;
557
574
  max-height: 34dvh;
558
575
  overflow: auto;
559
576
  padding: 10px 14px;
@@ -32,6 +32,8 @@ let hoverX = null
32
32
  let hoverY = null
33
33
  let lastFrameAt = 0
34
34
  let lastVisibleEdges = 0
35
+ let interactionUntil = 0
36
+ let settledRenderTimer = null
35
37
  let edgePositionsBuffer = new Float32Array(0)
36
38
  let pointPositionsBuffer = new Float32Array(0)
37
39
  let pointSizesBuffer = new Float32Array(0)
@@ -354,6 +356,20 @@ const clear = () => {
354
356
  gl.clear(gl.COLOR_BUFFER_BIT)
355
357
  }
356
358
 
359
+ const isCameraInteracting = (now) => now < interactionUntil
360
+
361
+ const scheduleSettledRender = (now) => {
362
+ if (settledRenderTimer) {
363
+ return
364
+ }
365
+ const delay = Math.max(32, interactionUntil - now + 16)
366
+ settledRenderTimer = setTimeout(() => {
367
+ settledRenderTimer = null
368
+ dirty = true
369
+ requestRender()
370
+ }, delay)
371
+ }
372
+
357
373
  const renderFrame = (now) => {
358
374
  renderScheduled = false
359
375
  if (!dirty) {
@@ -374,7 +390,13 @@ const renderFrame = (now) => {
374
390
 
375
391
  cullVisibleNodes()
376
392
  clear()
377
- drawEdges()
393
+ const cameraInteracting = isCameraInteracting(now)
394
+ if (!cameraInteracting || state.edgeCount < 1200) {
395
+ drawEdges()
396
+ } else {
397
+ lastVisibleEdges = 0
398
+ scheduleSettledRender(now)
399
+ }
378
400
 
379
401
  drawNodeLayer(
380
402
  (index) => state.visible[index] === 1 && state.selected[index] === 0 && state.highlighted[index] === 0,
@@ -442,6 +464,7 @@ const setCamera = (nextCamera) => {
442
464
  camera.x = Number.isFinite(nextCamera.x) ? Number(nextCamera.x) : camera.x
443
465
  camera.y = Number.isFinite(nextCamera.y) ? Number(nextCamera.y) : camera.y
444
466
  camera.scale = Number.isFinite(nextCamera.scale) ? Math.max(0.0002, Math.min(8, Number(nextCamera.scale))) : camera.scale
467
+ interactionUntil = performance.now() + 140
445
468
  dirty = true
446
469
  requestRender()
447
470
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andespindola/brainlink",
3
- "version": "0.1.0-beta.160",
3
+ "version": "0.1.0-beta.161",
4
4
  "description": "Local-first knowledge memory for agents with Markdown, backlinks, indexing and context retrieval.",
5
5
  "type": "module",
6
6
  "license": "MIT",