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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat(city): add daylight awareness to stars, celestial, shooting stars, ground, and neon lights
Adam Eivy58735352ff11
diff --git a/.changelog/v0.12.x.md b/.changelog/v0.12.x.mdindex 62acbbbf38..53f3b23f4e 100644--- a/.changelog/v0.12.x.md+++ b/.changelog/v0.12.x.md@@ -450,6 +450,15 @@ This release adds branch management and automated release workflow capabilities- `client/src/services/api.js` — Added `getCosRecentTasks(limit)` API function- `client/src/components/CosDashboardWidget.jsx` — Added collapsible Recent Tasks section with expanded/collapsed states, task list with status icons, and summary dot indicators+### CyberCity — Daytime/Nighttime Lighting Awareness+- **`daylightFactor` preset system**: Each time-of-day preset now includes a `daylightFactor` (0.0–1.0) and `groundColor` that drives all daylight-reactive scene behavior — midnight=0.0, sunrise=0.3, sunset=0.2, noon=1.0+- **Star fade**: Starfield fragment shader multiplies alpha by `(1 - daylightFactor)`, smoothly fading 1500 stars to invisible at noon+- **Celestial fade**: Planet, ring, orbital paths, and moons lerp material opacity toward zero during daytime via shared `nightFactorRef`+- **Shooting star suppression**: New stars blocked from spawning when `daylightFactor > 0.5`; in-flight stars scale head and trail opacity by `nightFactor`+- **Ground illumination**: Ground plane material color lerps per-frame from dark night (`#0a0a20`) to illuminated day (`#3a4055`) using preset's `groundColor`+- **Neon light dimming**: All 9 neon point lights, animated accent lights, and searchlight scale by `neonScaleRef` = `1 - daylight * 0.7` — cyberpunk neon stays visible at 30% during noon, full intensity at night+- **Smooth transitions**: All components use the existing `delta * 3` lerp pattern for seamless preset-to-preset transitions with no visual popping+### CyberCity — Billboard Text Fix & Visual Polish- **Fixed mirrored billboard text**: All holographic billboards and neon street signs had text facing inward toward city center, causing mirrored/backward text when viewed from the default camera position outside the city. Flipped rotations to face outward and added solid back-blocker planes to prevent text bleed-through from any viewing angle- **Bloom post-processing**: Added `@react-three/postprocessing` with subtle bloom effect (intensity 0.8, luminance threshold 0.3) that makes all neon elements, emissive materials, and light sources glow realistically — the single biggest visual upgrade for the cyberpunk aestheticdiff --git a/client/src/components/city/CityCelestial.jsx b/client/src/components/city/CityCelestial.jsxindex 975fba2dc6..ef43beadf4 100644--- a/client/src/components/city/CityCelestial.jsx+++ b/client/src/components/city/CityCelestial.jsx@@ -4,7 +4,7 @@ import * as THREE from 'three';import { CITY_COLORS } from './cityConstants';// Orbital ring line geometry-function OrbitalRing({ radius, tilt, color, opacity = 0.15 }) {+function OrbitalRing({ radius, tilt, color, opacity = 0.15, nightFactorRef }) {const points = useMemo(() => {const pts = [];const segments = 128;@@ -20,23 +20,31 @@ function OrbitalRing({ radius, tilt, color, opacity = 0.15 }) {}, [radius]);const geometry = useMemo(() => new THREE.BufferGeometry().setFromPoints(points), [points]);+ const matRef = useRef();++ useFrame(() => {+ if (matRef.current) {+ matRef.current.opacity = opacity * nightFactorRef.current;+ }+ });return (<group rotation={[tilt, 0, 0]}><line geometry={geometry}>- <lineBasicMaterial color={color} transparent opacity={opacity} />+ <lineBasicMaterial ref={matRef} color={color} transparent opacity={opacity} /></line></group>);}// Small moon/asteroid sphere-function Moon({ position, size = 0.4, color = '#64748b' }) {+function Moon({ position, size = 0.4, color = '#64748b', nightFactorRef }) {const ref = useRef();useFrame(({ clock }) => {if (!ref.current) return;ref.current.rotation.y = clock.getElapsedTime() * 0.2;+ ref.current.material.opacity = nightFactorRef.current;});return (@@ -47,23 +55,42 @@ function Moon({ position, size = 0.4, color = '#64748b' }) {emissive={color}emissiveIntensity={0.1}roughness={0.8}+ transparent+ opacity={1}/></mesh>);}-export default function CityCelestial() {+export default function CityCelestial({ settings }) {const planetRef = useRef();const ringGroupRef = useRef();+ const ringMatRef = useRef();+ const nightFactorRef = useRef(1);- useFrame(({ clock }) => {+ const timeOfDay = settings?.timeOfDay ?? 'sunset';+ const preset = CITY_COLORS.timeOfDay[timeOfDay] ?? CITY_COLORS.timeOfDay.sunset;+ const targetDaylight = preset.daylightFactor ?? 0;++ useFrame(({ clock }, delta) => {const t = clock.getElapsedTime();+ const lf = Math.min(1, delta * 3);++ // Lerp night factor+ const targetNight = 1 - targetDaylight;+ nightFactorRef.current += (targetNight - nightFactorRef.current) * lf;+ const nf = nightFactorRef.current;+if (planetRef.current) {planetRef.current.rotation.y = t * 0.05;+ planetRef.current.material.opacity = nf;}if (ringGroupRef.current) {ringGroupRef.current.rotation.y = t * 0.01;}+ if (ringMatRef.current) {+ ringMatRef.current.opacity = 0.2 * nf;+ }});return (@@ -76,6 +103,8 @@ export default function CityCelestial() {emissive={CITY_COLORS.planet}emissiveIntensity={0.2}roughness={0.6}+ transparent+ opacity={1}/></mesh>@@ -84,6 +113,7 @@ export default function CityCelestial() {<mesh rotation={[Math.PI / 2, 0, 0]}><ringGeometry args={[4.2, 5.5, 64]} /><meshBasicMaterial+ ref={ringMatRef}color={CITY_COLORS.planet}transparentopacity={0.2}@@ -93,12 +123,12 @@ export default function CityCelestial() {</group>{/* Orbital paths */}- <OrbitalRing radius={12} tilt={0.3} color={CITY_COLORS.orbit} opacity={0.1} />- <OrbitalRing radius={18} tilt={0.5} color={CITY_COLORS.orbit} opacity={0.07} />+ <OrbitalRing radius={12} tilt={0.3} color={CITY_COLORS.orbit} opacity={0.1} nightFactorRef={nightFactorRef} />+ <OrbitalRing radius={18} tilt={0.5} color={CITY_COLORS.orbit} opacity={0.07} nightFactorRef={nightFactorRef} />{/* Moons */}- <Moon position={[10, 2, -3]} size={0.5} color="#64748b" />- <Moon position={[-14, -1, 8]} size={0.35} color="#475569" />+ <Moon position={[10, 2, -3]} size={0.5} color="#64748b" nightFactorRef={nightFactorRef} />+ <Moon position={[-14, -1, 8]} size={0.35} color="#475569" nightFactorRef={nightFactorRef} /></group>);}diff --git a/client/src/components/city/CityGround.jsx b/client/src/components/city/CityGround.jsxindex f22bd7f9ae..0e10b82889 100644--- a/client/src/components/city/CityGround.jsx+++ b/client/src/components/city/CityGround.jsx@@ -55,6 +55,18 @@ function RollingFog() {export default function CityGround({ settings }) {const reflectionsEnabled = settings?.reflectionsEnabled ?? true;+ const groundMatRef = useRef();++ const timeOfDay = settings?.timeOfDay ?? 'sunset';+ const preset = CITY_COLORS.timeOfDay[timeOfDay] ?? CITY_COLORS.timeOfDay.sunset;+ const groundColorTarget = useRef(new THREE.Color(preset.groundColor ?? '#0a0a20'));+ groundColorTarget.current.set(preset.groundColor ?? '#0a0a20');++ useFrame((_, delta) => {+ if (!groundMatRef.current) return;+ const lf = Math.min(1, delta * 3);+ groundMatRef.current.color.lerp(groundColorTarget.current, lf);+ });const puddles = useMemo(() => {const result = [];@@ -81,6 +93,7 @@ export default function CityGround({ settings }) {<mesh rotation={[-Math.PI / 2, 0, 0]} position={[0, -0.02, 0]}><planeGeometry args={[120, 120]} /><meshStandardMaterial+ ref={groundMatRef}color="#0a0a20"metalness={0.4}roughness={0.7}diff --git a/client/src/components/city/CityLights.jsx b/client/src/components/city/CityLights.jsxindex 3748e0d6f9..17d16d8c73 100644--- a/client/src/components/city/CityLights.jsx+++ b/client/src/components/city/CityLights.jsx@@ -4,14 +4,15 @@ import * as THREE from 'three';import { CITY_COLORS } from './cityConstants';// Animated accent light that slowly shifts color, with reactive brightness-function AnimatedLight({ position, baseColor, baseIntensity, distance, shiftRange = 0.1, speed = 0.5, brightnessRef }) {+function AnimatedLight({ position, baseColor, baseIntensity, distance, shiftRange = 0.1, speed = 0.5, brightnessRef, neonScaleRef }) {const ref = useRef();useFrame(({ clock }) => {if (!ref.current) return;const b = brightnessRef.current;+ const ns = neonScaleRef?.current ?? 1;const t = clock.getElapsedTime();- ref.current.intensity = (baseIntensity + Math.sin(t * speed) * baseIntensity * shiftRange) * b;+ ref.current.intensity = (baseIntensity + Math.sin(t * speed) * baseIntensity * shiftRange) * b * ns;});return (@@ -26,7 +27,7 @@ function AnimatedLight({ position, baseColor, baseIntensity, distance, shiftRang}// Sweeping searchlight effect with reactive brightness-function Searchlight({ brightnessRef }) {+function Searchlight({ brightnessRef, neonScaleRef }) {const ref = useRef();useFrame(({ clock }) => {@@ -36,7 +37,8 @@ function Searchlight({ brightnessRef }) {const radius = 25;ref.current.position.x = Math.cos(angle) * radius;ref.current.position.z = Math.sin(angle) * radius;- ref.current.intensity = 0.6 * brightnessRef.current;+ const ns = neonScaleRef?.current ?? 1;+ ref.current.intensity = 0.6 * brightnessRef.current * ns;ref.current.target.position.set(0, 0, 0);ref.current.target.updateMatrixWorld();});@@ -57,12 +59,13 @@ function Searchlight({ brightnessRef }) {}// Static point light that updates intensity every frame from brightness ref-function ReactivePointLight({ position, baseIntensity, color, distance, brightnessRef }) {+function ReactivePointLight({ position, baseIntensity, color, distance, brightnessRef, neonScaleRef }) {const ref = useRef();useFrame(() => {if (!ref.current) return;- ref.current.intensity = baseIntensity * brightnessRef.current;+ const ns = neonScaleRef?.current ?? 1;+ ref.current.intensity = baseIntensity * brightnessRef.current * ns;});return (@@ -77,13 +80,16 @@ function ReactivePointLight({ position, baseIntensity, color, distance, brightne}export default function CityLights({ settings }) {- // Neon point lights only scale with ambient brightness slider (not daylight factor)const brightnessRef = useRef(settings?.ambientBrightness ?? 1.2);brightnessRef.current = settings?.ambientBrightness ?? 1.2;const timeOfDay = settings?.timeOfDay ?? 'sunset';const preset = CITY_COLORS.timeOfDay[timeOfDay] ?? CITY_COLORS.timeOfDay.sunset;+ // Neon scale: dim neon point lights during daytime (30% at noon, 100% at night)+ const neonScaleRef = useRef(1);+ const targetNeonScale = 1.0 - (preset.daylightFactor ?? 0) * 0.7;+// Hemisphere light refs — provides natural sky fill (like Unreal Engine's Sky Light)const hemiRef = useRef();const hemiSkyTarget = useRef(new THREE.Color(preset.hemiSkyColor));@@ -103,6 +109,9 @@ export default function CityLights({ settings }) {useFrame((_, delta) => {const lf = Math.min(1, delta * 3);+ // Lerp neon scale+ neonScaleRef.current += (targetNeonScale - neonScaleRef.current) * lf;+// Hemisphere light — main daytime fillif (hemiRef.current) {hemiRef.current.color.lerp(hemiSkyTarget.current, lf);@@ -123,23 +132,23 @@ export default function CityLights({ settings }) {<hemisphereLight ref={hemiRef} color="#1a1a3a" groundColor="#0a0a20" intensity={0.3} /><ambientLight ref={ambientRef} intensity={0.18} color="#1a1a3a" />{/* Main overhead cyan */}- <ReactivePointLight position={[0, 30, 0]} baseIntensity={1.2} color="#06b6d4" distance={100} brightnessRef={brightnessRef} />+ <ReactivePointLight position={[0, 30, 0]} baseIntensity={1.2} color="#06b6d4" distance={100} brightnessRef={brightnessRef} neonScaleRef={neonScaleRef} />{/* Secondary overhead fill - broad white/blue */}- <ReactivePointLight position={[0, 20, 10]} baseIntensity={0.5} color="#4488cc" distance={90} brightnessRef={brightnessRef} />+ <ReactivePointLight position={[0, 20, 10]} baseIntensity={0.5} color="#4488cc" distance={90} brightnessRef={brightnessRef} neonScaleRef={neonScaleRef} />{/* Magenta accent from left - animated color shift */}- <AnimatedLight position={[-20, 12, -15]} baseColor="#ec4899" baseIntensity={0.7} distance={60} speed={0.3} shiftRange={0.15} brightnessRef={brightnessRef} />+ <AnimatedLight position={[-20, 12, -15]} baseColor="#ec4899" baseIntensity={0.7} distance={60} speed={0.3} shiftRange={0.15} brightnessRef={brightnessRef} neonScaleRef={neonScaleRef} />{/* Blue accent from right - animated shift */}- <AnimatedLight position={[20, 12, 15]} baseColor="#3b82f6" baseIntensity={0.7} distance={60} speed={0.4} shiftRange={0.12} brightnessRef={brightnessRef} />+ <AnimatedLight position={[20, 12, 15]} baseColor="#3b82f6" baseIntensity={0.7} distance={60} speed={0.4} shiftRange={0.12} brightnessRef={brightnessRef} neonScaleRef={neonScaleRef} />{/* Purple from behind - more presence */}- <ReactivePointLight position={[0, 15, -25]} baseIntensity={0.5} color="#8b5cf6" distance={60} brightnessRef={brightnessRef} />+ <ReactivePointLight position={[0, 15, -25]} baseIntensity={0.5} color="#8b5cf6" distance={60} brightnessRef={brightnessRef} neonScaleRef={neonScaleRef} />{/* Warm orange ground level accent */}- <ReactivePointLight position={[10, 3, 5]} baseIntensity={0.35} color="#f97316" distance={35} brightnessRef={brightnessRef} />+ <ReactivePointLight position={[10, 3, 5]} baseIntensity={0.35} color="#f97316" distance={35} brightnessRef={brightnessRef} neonScaleRef={neonScaleRef} />{/* Additional green accent - ground level from opposite side */}- <ReactivePointLight position={[-12, 3, 8]} baseIntensity={0.2} color="#22c55e" distance={25} brightnessRef={brightnessRef} />+ <ReactivePointLight position={[-12, 3, 8]} baseIntensity={0.2} color="#22c55e" distance={25} brightnessRef={brightnessRef} neonScaleRef={neonScaleRef} />{/* Red warning accent from below-right */}- <ReactivePointLight position={[15, 2, -10]} baseIntensity={0.15} color="#f43f5e" distance={22} brightnessRef={brightnessRef} />+ <ReactivePointLight position={[15, 2, -10]} baseIntensity={0.15} color="#f43f5e" distance={22} brightnessRef={brightnessRef} neonScaleRef={neonScaleRef} />{/* Sweeping searchlight */}- <Searchlight brightnessRef={brightnessRef} />+ <Searchlight brightnessRef={brightnessRef} neonScaleRef={neonScaleRef} /></>);}diff --git a/client/src/components/city/CityScene.jsx b/client/src/components/city/CityScene.jsxindex 201261625a..742d34d67e 100644--- a/client/src/components/city/CityScene.jsx+++ b/client/src/components/city/CityScene.jsx@@ -43,9 +43,9 @@ export default function CityScene({ apps, agentMap, onBuildingClick, cosStatus,><CitySky settings={settings} /><CityLights settings={settings} />- <CityStarfield />- <CityShootingStars playSfx={playSfx} />- <CityCelestial />+ <CityStarfield settings={settings} />+ <CityShootingStars playSfx={playSfx} settings={settings} />+ <CityCelestial settings={settings} /><CitySkyline /><CityGround settings={settings} /><CityRoads positions={positions} />diff --git a/client/src/components/city/CityShootingStars.jsx b/client/src/components/city/CityShootingStars.jsxindex 2a2ecf2f94..d6aa56ee1e 100644--- a/client/src/components/city/CityShootingStars.jsx+++ b/client/src/components/city/CityShootingStars.jsx@@ -1,6 +1,7 @@import { useRef, useMemo } from 'react';import { useFrame } from '@react-three/fiber';import * as THREE from 'three';+import { CITY_COLORS } from './cityConstants';// Vertex shader for shooting star trailconst TRAIL_VERT = `@@ -25,7 +26,7 @@ const TRAIL_FRAG = ``;// A single shooting star with glowing head and fading trail-function ShootingStar({ index, playSfx }) {+function ShootingStar({ index, playSfx, daylightRef }) {const groupRef = useRef();const headRef = useRef();const trailRef = useRef();@@ -63,8 +64,12 @@ function ShootingStar({ index, playSfx }) {const t = clock.getElapsedTime();const s = state.current;+ const daylight = daylightRef?.current ?? 0;+ const nightFactor = 1 - daylight;+if (!s.active) {- if (t > s.nextSpawn) {+ // Block spawning when daylight > 0.5+ if (t > s.nextSpawn && daylight <= 0.5) {// Spawn a new shooting stars.active = true;s.progress = 0;@@ -112,11 +117,11 @@ function ShootingStar({ index, playSfx }) {const headY = s.startPos[1] + s.direction[1] * totalDist * s.progress;const headZ = s.startPos[2] + s.direction[2] * totalDist * s.progress;- // Update head glow+ // Update head glow (scale opacity by nightFactor)if (headRef.current) {headRef.current.visible = true;headRef.current.position.set(headX, headY, headZ);- headRef.current.material.opacity = Math.min(1, (1 - s.progress) * 2);+ headRef.current.material.opacity = Math.min(1, (1 - s.progress) * 2) * nightFactor;}// Update trail geometry@@ -134,7 +139,7 @@ function ShootingStar({ index, playSfx }) {if (matRef.current) {matRef.current.uniforms.uColor.value.set(s.color[0], s.color[1], s.color[2]);- matRef.current.uniforms.uOpacity.value = Math.min(1, (1 - s.progress) * 2.5);+ matRef.current.uniforms.uOpacity.value = Math.min(1, (1 - s.progress) * 2.5) * nightFactor;}});@@ -185,13 +190,23 @@ function ShootingStar({ index, playSfx }) {);}-export default function CityShootingStars({ playSfx }) {+export default function CityShootingStars({ playSfx, settings }) {+ const daylightRef = useRef(0);+ const timeOfDay = settings?.timeOfDay ?? 'sunset';+ const preset = CITY_COLORS.timeOfDay[timeOfDay] ?? CITY_COLORS.timeOfDay.sunset;+ const targetDaylight = preset.daylightFactor ?? 0;++ useFrame((_, delta) => {+ const lf = Math.min(1, delta * 3);+ daylightRef.current += (targetDaylight - daylightRef.current) * lf;+ });+return (<group>{/* 3 potential shooting stars, staggered spawn times */}- <ShootingStar index={0} playSfx={playSfx} />- <ShootingStar index={1} playSfx={playSfx} />- <ShootingStar index={2} playSfx={playSfx} />+ <ShootingStar index={0} playSfx={playSfx} daylightRef={daylightRef} />+ <ShootingStar index={1} playSfx={playSfx} daylightRef={daylightRef} />+ <ShootingStar index={2} playSfx={playSfx} daylightRef={daylightRef} /></group>);}diff --git a/client/src/components/city/CityStarfield.jsx b/client/src/components/city/CityStarfield.jsxindex d2fb797bf9..4799508625 100644--- a/client/src/components/city/CityStarfield.jsx+++ b/client/src/components/city/CityStarfield.jsx@@ -1,6 +1,7 @@import { useRef, useMemo } from 'react';import { useFrame } from '@react-three/fiber';import * as THREE from 'three';+import { CITY_COLORS } from './cityConstants';const STAR_VERT = `attribute float size;@@ -22,6 +23,7 @@ const STAR_FRAG = `varying float vPhase;varying vec3 vColor;uniform float uTime;+ uniform float uDaylight;void main() {// Soft circular pointfloat d = length(gl_PointCoord - vec2(0.5));@@ -29,13 +31,16 @@ const STAR_FRAG = `float alpha = smoothstep(0.5, 0.15, d);// Twinkle: slow shimmer unique per starfloat twinkle = 0.7 + 0.3 * sin(uTime * (0.4 + vPhase * 0.6) + vPhase * 6.2831);- gl_FragColor = vec4(vColor, alpha * twinkle);+ // Fade out during daytime+ float nightFactor = 1.0 - uDaylight;+ gl_FragColor = vec4(vColor, alpha * twinkle * nightFactor);}`;-export default function CityStarfield() {+export default function CityStarfield({ settings }) {const pointsRef = useRef();const matRef = useRef();+ const daylightRef = useRef(0);const { positions, sizes, phases, colors } = useMemo(() => {const count = 1500;@@ -77,11 +82,19 @@ export default function CityStarfield() {return { positions: pos, sizes: sz, phases: ph, colors: col };}, []);- useFrame(({ clock }) => {+ const timeOfDay = settings?.timeOfDay ?? 'sunset';+ const preset = CITY_COLORS.timeOfDay[timeOfDay] ?? CITY_COLORS.timeOfDay.sunset;+ const targetDaylight = preset.daylightFactor ?? 0;++ useFrame(({ clock }, delta) => {if (!pointsRef.current) return;pointsRef.current.rotation.y = clock.getElapsedTime() * 0.003;+ // Lerp daylight uniform toward target+ const lf = Math.min(1, delta * 3);+ daylightRef.current += (targetDaylight - daylightRef.current) * lf;if (matRef.current) {matRef.current.uniforms.uTime.value = clock.getElapsedTime();+ matRef.current.uniforms.uDaylight.value = daylightRef.current;}});@@ -97,7 +110,7 @@ export default function CityStarfield() {ref={matRef}vertexShader={STAR_VERT}fragmentShader={STAR_FRAG}- uniforms={{ uTime: { value: 0 } }}+ uniforms={{ uTime: { value: 0 }, uDaylight: { value: 0 } }}transparentblending={THREE.AdditiveBlending}depthWrite={false}diff --git a/client/src/components/city/cityConstants.js b/client/src/components/city/cityConstants.jsindex d20f2f4d9b..4b835d1e58 100644--- a/client/src/components/city/cityConstants.js+++ b/client/src/components/city/cityConstants.js@@ -35,6 +35,8 @@ export const CITY_COLORS = {sunIntensity: 2.0,sunScale: 1.0,isMoon: false,+ daylightFactor: 0.3,+ groundColor: '#1a1a30',// Hemisphere sky light (Unreal Engine "sky light" equivalent)hemiSkyColor: '#ff9966',hemiGroundColor: '#1a1020',@@ -54,6 +56,8 @@ export const CITY_COLORS = {sunIntensity: 5.0,sunScale: 0.7,isMoon: false,+ daylightFactor: 1.0,+ groundColor: '#3a4055',hemiSkyColor: '#aaccee',hemiGroundColor: '#334455',hemiIntensity: 2.0,@@ -72,6 +76,8 @@ export const CITY_COLORS = {sunIntensity: 1.5,sunScale: 1.0,isMoon: false,+ daylightFactor: 0.2,+ groundColor: '#151525',hemiSkyColor: '#ff6644',hemiGroundColor: '#0a0a20',hemiIntensity: 0.3,@@ -90,6 +96,8 @@ export const CITY_COLORS = {sunIntensity: 0.12,sunScale: 0.6,isMoon: true,+ daylightFactor: 0.0,+ groundColor: '#0a0a20',hemiSkyColor: '#111122',hemiGroundColor: '#050508',hemiIntensity: 0.05,