Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix([issue-705]): CyberCity canvas crash from drei <Line> fat-line geometry

[._.]/ Adam Eivy6e86631973e8
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index ea36e1a023..afbd4b0ee4 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -103,6 +103,7 @@
## Fixed
+- **[issue-705] CyberCity no longer crashes when light connectors are on screen** — the memory district's category bridges and the goal-tree links rendered through a line primitive that depended on a fat-line geometry method (`computeLineDistances`) missing from this build's 3D stack, which crashed the whole CyberCity canvas as soon as either was visible. Those connectors now draw as native glowing tubes — no dependency on that method — so the city renders cleanly, with a bit more presence to the links as a bonus.
- **Security settings reachable from the sidebar** — the Settings → Security tab now has its own entry in the sidebar's Settings group, so you can open it without typing the URL or going through ⌘K. The tab, its route, and command-palette/voice navigation already existed; only the sidebar link was missing.
- **[issue-729] Style-probe renders stay put across federated machines** — a universe's base style-probe images are now kept local to each machine, so syncing with an older peer no longer wipes them and a probe render no longer surfaces a phantom sync conflict.
- **[issue-717] No stray React warnings when you navigate away mid-action** — buttons that run an async task (save, generate, sync) no longer log an "update on an unmounted component" warning if you leave the page before the task finishes.
diff --git a/client/src/components/city/CityGoalMonuments.jsx b/client/src/components/city/CityGoalMonuments.jsx
index 65e5ce6e17..dba5d5c695 100644
--- a/client/src/components/city/CityGoalMonuments.jsx
+++ b/client/src/components/city/CityGoalMonuments.jsx
@@ -1,6 +1,7 @@
import { useMemo, useRef } from 'react';
import { useFrame } from '@react-three/fiber';
-import { Text, Line } from '@react-three/drei';
+import { Text } from '@react-three/drei';
+import CityTubeLine from './CityTubeLine';
import { PIXEL_FONT_URL } from './cityConstants';
import { computeGoalMonuments, computeGoalForest, MONUMENTS, FOREST } from '../../utils/cityGoalMonuments';
@@ -129,12 +130,11 @@ function GoalForest({ forest, shimmerRef, shimmerId }) {
</group>
))}
{cluster.links.map((link) => (
- <Line
+ <CityTubeLine
key={link.childId}
points={[link.from, link.to]}
color={cluster.spire.color}
- lineWidth={1.5}
- transparent
+ radius={0.06}
opacity={0.4}
/>
))}
diff --git a/client/src/components/city/CityMemoryDistrict.jsx b/client/src/components/city/CityMemoryDistrict.jsx
index e89c05342c..687ba6cdb3 100644
--- a/client/src/components/city/CityMemoryDistrict.jsx
+++ b/client/src/components/city/CityMemoryDistrict.jsx
@@ -1,7 +1,8 @@
import { useMemo, useRef } from 'react';
import { useFrame } from '@react-three/fiber';
-import { Text, Line } from '@react-three/drei';
+import { Text } from '@react-three/drei';
import { PIXEL_FONT_URL } from './cityConstants';
+import CityTubeLine from './CityTubeLine';
import { computeMemoryDistrict, MEMORY_DISTRICT } from '../../utils/cityMemoryDistrict';
// CyberCity's memory / knowledge district (roadmap 3.2): the user's long-term memory graph
@@ -124,12 +125,11 @@ export default function CityMemoryDistrict({ memoryGraph, inboxDepth = 0, settin
// Arc the midpoint up so bridges read as light arcs, not flat lines.
const mid = [(from[0] + to[0]) / 2, MEMORY_DISTRICT.bridgeY + 2 + Math.min(bridge.weight, 6) * 0.3, (from[2] + to[2]) / 2];
return (
- <Line
+ <CityTubeLine
key={i}
points={[from, mid, to]}
color="#67e8f9"
- lineWidth={Math.min(1 + bridge.weight * 0.5, 4)}
- transparent
+ radius={Math.min(0.05 + bridge.weight * 0.03, 0.22)}
opacity={Math.min(0.25 + bridge.weight * 0.12, 0.8)}
/>
);
diff --git a/client/src/components/city/CityTubeLine.jsx b/client/src/components/city/CityTubeLine.jsx
new file mode 100644
index 0000000000..2615613f90
--- /dev/null
+++ b/client/src/components/city/CityTubeLine.jsx
@@ -0,0 +1,27 @@
+import { useMemo } from 'react';
+import * as THREE from 'three';
+
+// A thin glowing connector rendered as a native-three tube along a curve through `points`.
+// Used for CyberCity's light bridges (memory district) and goal-tree links. We deliberately do
+// NOT use drei's <Line>: it builds a three-stdlib Line2 whose fat-line geometry needs
+// `computeLineDistances`, and the bundled three-stdlib instance mismatches the app's three
+// (0.182), so that method is missing on the reconciled object and the whole Canvas crashes
+// ("m.computeLineDistances is not a function"). A TubeGeometry needs none of that, gives real
+// width (native LineBasicMaterial ignores linewidth anyway), and reads better as a glow.
+export default function CityTubeLine({ points, color, radius = 0.08, opacity = 0.5, segments = 24 }) {
+ const geometry = useMemo(() => {
+ const pts = (points || []).filter(Boolean).map((p) => new THREE.Vector3(p[0], p[1], p[2]));
+ if (pts.length < 2) return null;
+ const curve = new THREE.CatmullRomCurve3(pts);
+ // Tubular segments scale with point count so a multi-point arc stays smooth.
+ return new THREE.TubeGeometry(curve, Math.max(segments, pts.length * 8), radius, 6, false);
+ }, [points, radius, segments]);
+
+ if (!geometry) return null;
+
+ return (
+ <mesh geometry={geometry}>
+ <meshBasicMaterial color={color} transparent opacity={opacity} toneMapped={false} />
+ </mesh>
+ );
+}