Merge cloud venue biomes into dashboard weather and Emberwake biome chip.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

This commit is contained in:
AetherForge
2026-06-07 10:02:23 -07:00
parent bb7bbe6c97
commit bbace3e4bb
4 changed files with 86 additions and 34 deletions

View File

@@ -12,7 +12,8 @@ import { SacredMotif } from '../Visual/sacredGeometry/motifs';
import SetupBanner from '../SetupBanner';
import { getSetupStatus } from '../../help/setupStatus';
import { resolvePageWeather } from '../../help/pageWeather';
import { mergeScoutBiomeWeather, type ScoutConstellationSnapshot } from '../../help/scoutBiomeWeather';
import { mergeBiomeWeather, type CloudVenueSnapshot } from '../../help/cloudVenueBiomeWeather';
import { type ScoutConstellationSnapshot } from '../../help/scoutBiomeWeather';
import { isDashboardRoute } from '../../help/routeEffects';
import { api } from '../../api/client';
import { usePresence } from '../../context/PresenceContext';
@@ -45,7 +46,9 @@ function operatorDeckId(pathname: string): string {
return 'dashboard';
}
const NAV_BASE = [
type NavItem = { readonly to: string; readonly label: string; readonly icon: string; readonly glow?: boolean };
const NAV_BASE: readonly NavItem[] = [
{ to: '/dashboard', label: 'Command Deck', icon: 'deck' },
{ to: '/crucible', label: 'Crucible', icon: 'crucible' },
{ to: '/activity', label: 'Activity Feed', icon: 'activity' },
@@ -57,15 +60,15 @@ const NAV_BASE = [
{ to: '/builds', label: 'Builds', icon: 'builds' },
{ to: '/emberwake', label: 'Emberwake', icon: 'ember' },
{ to: '/settings', label: 'Calibrate', icon: 'gear' },
] as const;
];
const SEER_NAV = { to: '/seer', label: 'Seer', icon: 'seer' } as const;
const SEER_NAV: NavItem = { to: '/seer', label: 'Seer', icon: 'seer' };
function buildNav(aiControlEnabled: boolean) {
function buildNav(aiControlEnabled: boolean): NavItem[] {
if (!aiControlEnabled) {
return [...NAV_BASE];
}
const items = [...NAV_BASE];
const items: NavItem[] = [...NAV_BASE];
const calibrateIdx = items.findIndex((i) => i.to === '/settings');
items.splice(calibrateIdx, 0, SEER_NAV);
return items;
@@ -310,14 +313,18 @@ export default function Layout({ children }: LayoutProps) {
if (latestMessage?.type !== 'scout_constellations') return null;
return latestMessage.payload as ScoutConstellationSnapshot;
}, [latestMessage]);
const cloudBiome = useMemo(() => {
if (latestMessage?.type !== 'cloud_venue_biomes') return null;
return latestMessage.payload as CloudVenueSnapshot;
}, [latestMessage]);
const pageWeather = useMemo(() => {
const base = resolvePageWeather(location.pathname);
const path = location.pathname.split('?')[0].replace(/\/$/, '') || '/';
if (path === '/emberwake' || path === '/spread' || path === '/dashboard' || path === '/agents') {
return mergeScoutBiomeWeather(base, scoutBiome);
return mergeBiomeWeather(base, scoutBiome, cloudBiome);
}
return base;
}, [location.pathname, scoutBiome]);
}, [location.pathname, scoutBiome, cloudBiome]);
const showDeckEffects = isDashboardRoute(location.pathname);
const moreActive = MOBILE_MORE.some((item) => location.pathname === item.to);
const mobileShortLabel: Record<string, string> = {