feat: add tagged red thread connections

This commit is contained in:
2026-08-14 16:37:50 +02:00
parent 46bb2ba5ec
commit f97dceb4fe
12 changed files with 201 additions and 37 deletions
+15
View File
@@ -11,12 +11,27 @@ import {
normalizeCase,
panViewport,
relationPosition,
threadCurve,
timelinePositionPercent,
timelineRange,
zoomFromWheel,
zoomFromPinch,
} from './boardDomain'
describe('red thread geometry', () => {
it('turns tightness into a taut or visibly sagging bezier curve', () => {
const taut = threadCurve({ x: 0, y: 0 }, { x: 120, y: 60 }, 100)
const slack = threadCurve({ x: 0, y: 0 }, { x: 120, y: 60 }, 0)
expect(taut.midpoint).toEqual({ x: 60, y: 30 })
expect(slack.midpoint.y).toBeGreaterThan(taut.midpoint.y)
expect(slack.path).toMatch(/^M 0 0 C /)
})
it('clamps tightness to its normalized percentage range', () => {
expect(threadCurve({ x: 0, y: 0 }, { x: 100, y: 0 }, 200)).toEqual(threadCurve({ x: 0, y: 0 }, { x: 100, y: 0 }, 100))
})
})
const folder: Evidence = {
id: 'folder-1',
type: 'folder',