- {/* Tether lines between branched cards */}
-
-
- {Object.values(cards).map((card) => {
- const sid = card.session_id;
-
- let origin = spawnOriginsRef.current[sid];
- if (origin) {
- delete spawnOriginsRef.current[sid];
- } else {
- const glow = glowingAgentCards[sid];
- if (glow && !revealSpawnedRef.current.has(sid)) {
- revealSpawnedRef.current.add(sid);
- const srcCard = cards[glow.sourceId];
- if (srcCard) {
- const srcH = measuredHeightsRef.current[glow.sourceId]
- ?? (expandedSessionIds.includes(glow.sourceId)
- ? Math.max(EXPANDED_CARD_MIN_H, srcCard.height)
- : srcCard.height);
- origin = {
- x: srcCard.x + srcCard.width,
- y: srcCard.y + srcH / 2,
- type: 'branch' as const,
- };
- }
- }
- }
-
- let exitTarget: { x: number; y: number } | undefined;
- const glow = glowingAgentCards[sid];
- if (glow) {
- const srcCard = cards[glow.sourceId];
- if (srcCard) {
- const srcH = measuredHeightsRef.current[glow.sourceId]
- ?? (expandedSessionIds.includes(glow.sourceId)
- ? Math.max(EXPANDED_CARD_MIN_H, srcCard.height)
- : srcCard.height);
- exitTarget = {
- x: srcCard.x + srcCard.width,
- y: srcCard.y + srcH / 2,
- };
- }
- }
-
- let snapColumn: { x: number; width: number } | undefined;
- if (glow) {
- const srcCard = cards[glow.sourceId];
- if (srcCard) {
- snapColumn = {
- x: srcCard.x + srcCard.width + GRID_GAP * 12,
- width: DEFAULT_CARD_W,
- };
- }
- }
-
- const isSel = selection.isSelected(sid);
- return (
-
- );
- })}
-
- {Object.values(viewCards).map((vc) => {
- const output = outputs[vc.output_id];
- if (!output) return null;
- return (
-
- );
- })}
- {Object.values(browserCards).map((bc) => (
-
- ))}
- {Object.values(notes).map((n) => (
-
- ))}
- {/* Marquee selection rectangle */}
- {selection.marquee && (
-
- )}
-
- )}
-