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

address review: extract shared CoSAvatarOrbitControls to dedupe avatar configs

Adam Eivy4f4b8dfd37c8
diff --git a/client/src/components/cos/CoSAvatarOrbitControls.jsx b/client/src/components/cos/CoSAvatarOrbitControls.jsx
new file mode 100644
index 0000000000..54480e6a96
--- /dev/null
+++ b/client/src/components/cos/CoSAvatarOrbitControls.jsx
@@ -0,0 +1,14 @@
+import { OrbitControls } from '@react-three/drei';
+
+export default function CoSAvatarOrbitControls() {
+ return (
+ <OrbitControls
+ enablePan={false}
+ enableZoom={false}
+ enableDamping
+ dampingFactor={0.08}
+ rotateSpeed={0.6}
+ makeDefault
+ />
+ );
+}
diff --git a/client/src/components/cos/CyberCoSAvatar.jsx b/client/src/components/cos/CyberCoSAvatar.jsx
index 0b4a2ab875..a2aeddd0de 100644
--- a/client/src/components/cos/CyberCoSAvatar.jsx
+++ b/client/src/components/cos/CyberCoSAvatar.jsx
@@ -1,8 +1,9 @@
import { useRef, useMemo } from 'react';
import { Canvas, useFrame } from '@react-three/fiber';
-import { Float, MeshDistortMaterial, OrbitControls, Sparkles } from '@react-three/drei';
+import { Float, MeshDistortMaterial, Sparkles } from '@react-three/drei';
import * as THREE from 'three';
import { AGENT_STATES } from './constants';
+import CoSAvatarOrbitControls from './CoSAvatarOrbitControls';
// Holographic wireframe skull/head geometry
function CyberHead({ color, state, speaking }) {
@@ -426,14 +427,7 @@ function Scene({ state, speaking }) {
<GroundGlow color={color} />
{/* Drag-to-rotate controls */}
- <OrbitControls
- enablePan={false}
- enableZoom={false}
- enableDamping
- dampingFactor={0.08}
- rotateSpeed={0.6}
- makeDefault
- />
+ <CoSAvatarOrbitControls />
</>
);
}
diff --git a/client/src/components/cos/EsotericCoSAvatar.jsx b/client/src/components/cos/EsotericCoSAvatar.jsx
index fc1f9c1358..121c6be44d 100644
--- a/client/src/components/cos/EsotericCoSAvatar.jsx
+++ b/client/src/components/cos/EsotericCoSAvatar.jsx
@@ -1,8 +1,9 @@
import { useRef, useMemo } from 'react';
import { Canvas, useFrame } from '@react-three/fiber';
-import { Float, MeshDistortMaterial, OrbitControls, Sparkles, Stars } from '@react-three/drei';
+import { Float, MeshDistortMaterial, Sparkles, Stars } from '@react-three/drei';
import * as THREE from 'three';
import { AGENT_STATES } from './constants';
+import CoSAvatarOrbitControls from './CoSAvatarOrbitControls';
// Central mystical core - an artifact of unknown origin
function EsotericCore({ color, state, speaking }) {
@@ -193,14 +194,7 @@ function Scene({ state, speaking }) {
{/* Background stars for depth */}
<Stars radius={100} depth={50} count={1000} factor={4} saturation={0} fade speed={1} />
- <OrbitControls
- enablePan={false}
- enableZoom={false}
- enableDamping
- dampingFactor={0.08}
- rotateSpeed={0.6}
- makeDefault
- />
+ <CoSAvatarOrbitControls />
</>
);
}
diff --git a/client/src/components/cos/MuseCoSAvatar.jsx b/client/src/components/cos/MuseCoSAvatar.jsx
index 8c8a93bccf..8a161e2c4a 100644
--- a/client/src/components/cos/MuseCoSAvatar.jsx
+++ b/client/src/components/cos/MuseCoSAvatar.jsx
@@ -1,8 +1,9 @@
import { useRef, useMemo, useEffect, useState, Suspense } from 'react';
import { Canvas, useFrame } from '@react-three/fiber';
-import { useGLTF, OrbitControls, Sparkles } from '@react-three/drei';
+import { useGLTF, Sparkles } from '@react-three/drei';
import * as THREE from 'three';
import { AGENT_STATES } from './constants';
+import CoSAvatarOrbitControls from './CoSAvatarOrbitControls';
const MODEL_URL = '/api/avatar/model.glb';
@@ -137,14 +138,7 @@ function Scene({ state, speaking }) {
<StateEffects color={color} state={state} />
<GroundGlow color={color} />
- <OrbitControls
- enablePan={false}
- enableZoom={false}
- enableDamping
- dampingFactor={0.08}
- rotateSpeed={0.6}
- makeDefault
- />
+ <CoSAvatarOrbitControls />
</>
);
}
diff --git a/client/src/components/cos/NexusCoSAvatar.jsx b/client/src/components/cos/NexusCoSAvatar.jsx
index 5db1fc5fe1..a6c37408e6 100644
--- a/client/src/components/cos/NexusCoSAvatar.jsx
+++ b/client/src/components/cos/NexusCoSAvatar.jsx
@@ -1,8 +1,9 @@
import { useRef, useMemo } from 'react';
import { Canvas, useFrame } from '@react-three/fiber';
-import { Float, MeshDistortMaterial, OrbitControls, Sparkles } from '@react-three/drei';
+import { Float, MeshDistortMaterial, Sparkles } from '@react-three/drei';
import * as THREE from 'three';
import { AGENT_STATES } from './constants';
+import CoSAvatarOrbitControls from './CoSAvatarOrbitControls';
// Central brain-like neural core
function NeuralCore({ color, state, speaking }) {
@@ -359,14 +360,7 @@ function Scene({ state, speaking }) {
color={color}
/>
- <OrbitControls
- enablePan={false}
- enableZoom={false}
- enableDamping
- dampingFactor={0.08}
- rotateSpeed={0.6}
- makeDefault
- />
+ <CoSAvatarOrbitControls />
</>
);
}
diff --git a/client/src/components/cos/SigilCoSAvatar.jsx b/client/src/components/cos/SigilCoSAvatar.jsx
index c5c3b76411..e3c38bd124 100644
--- a/client/src/components/cos/SigilCoSAvatar.jsx
+++ b/client/src/components/cos/SigilCoSAvatar.jsx
@@ -1,8 +1,9 @@
import { useMemo, useRef } from 'react';
import { Canvas, useFrame } from '@react-three/fiber';
-import { Float, MeshDistortMaterial, OrbitControls, Sparkles } from '@react-three/drei';
+import { Float, MeshDistortMaterial, Sparkles } from '@react-three/drei';
import * as THREE from 'three';
import { AGENT_STATES } from './constants';
+import CoSAvatarOrbitControls from './CoSAvatarOrbitControls';
function SigilCore({ color, state, speaking }) {
const coreRef = useRef();
@@ -274,14 +275,7 @@ function Scene({ state, speaking }) {
color={color}
/>
- <OrbitControls
- enablePan={false}
- enableZoom={false}
- enableDamping
- dampingFactor={0.08}
- rotateSpeed={0.6}
- makeDefault
- />
+ <CoSAvatarOrbitControls />
</>
);
}