Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(office): give the coding floor its own look

rubenluetke10-beep92b5e8082d70
diff --git a/docs/agent-society/office-map.md b/docs/agent-society/office-map.md
index 0d92f43bb1..7236951286 100644
--- a/docs/agent-society/office-map.md
+++ b/docs/agent-society/office-map.md
@@ -167,6 +167,14 @@ the floor plan differ.
narrow panel to 520 px once; the user can drag it back. There a monitor click
focuses the pane in the grid right next to it, and the office's "open the
ledger" action brings the Agents tab forward.
+- **Its own look** (`CodingFloorLook.tsx`, `CODING_SCENE` / `CODING_STUDIOS`
+ in `officePalette.ts`): same plan as the agents office, none of its
+ surfaces. A violet night instead of navy, a fine terrazzo floor instead of
+ warm planks, and a glowing cyan rim under the slab edge. Every workspace
+ department is furnished as a studio of its own — carpet pattern (grid,
+ stripes, checker, dots, diagonal, zigzag) with a border, a painted sign wall,
+ and desk and chair colours — cycled by the department's index. All of it is
+ flat or outside the railing, so navigation is unchanged.
## 5c. Lead office as an executive suite (2026-09-29)
diff --git a/jarvis/ui/web/frontend/src/components/society/office/CodingFloorLook.tsx b/jarvis/ui/web/frontend/src/components/society/office/CodingFloorLook.tsx
new file mode 100644
index 0000000000..5b2742a3a1
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/society/office/CodingFloorLook.tsx
@@ -0,0 +1,200 @@
+/**
+ * The coding floor's own look. It shares the agents office's plan — rooms,
+ * desks, paths — but none of its surfaces: terrazzo instead of planks, a
+ * glowing rim around the slab, and every workspace department furnished as a
+ * studio of its own (carpet pattern, wall colour, desks and chairs).
+ *
+ * Purely visual. Nothing here is an obstacle: the carpet and rim are flat or
+ * outside the railing, so navigation stays exactly the layout's.
+ */
+import { useEffect, useMemo } from "react";
+import type { ThreeEvent } from "@react-three/fiber";
+import { MeshStandardMaterial, RepeatWrapping, type Texture } from "three";
+import { useT } from "@/i18n";
+import type { SocietyAgent } from "../data";
+import { cachedCanvasTexture } from "./canvasMaterials";
+import { DeskInstances, type DeskTone } from "./DeskInstances";
+import { Box, matte, Railing, SignWall } from "./OfficeFurniture";
+import type { Department, OfficeLayout } from "./officeLayout";
+import { CODING_SCENE, CODING_STUDIOS, type CarpetPattern, type StudioStyle } from "./officePalette";
+
+/** The studio a department is furnished as: cycles through the set by the department's tint index. */
+export function studioStyle(index: number): StudioStyle {
+ const n = CODING_STUDIOS.length;
+ return CODING_STUDIOS[((index % n) + n) % n];
+}
+
+/** Metres covered by one repeat of the terrazzo tile and of a carpet pattern. */
+const TERRAZZO_METRES = 2.4;
+const CARPET_METRES = 2.4;
+/** The rug's border band around the patterned field. */
+const BORDER_M = 0.22;
+
+/** Deterministic pseudo-random numbers, so the chips never shimmer between loads. */
+function lcg(seed: number): () => number {
+ let state = seed >>> 0;
+ return () => {
+ state = (state * 1664525 + 1013904223) >>> 0;
+ return state / 0x1_0000_0000;
+ };
+}
+
+function drawTerrazzo(ctx: CanvasRenderingContext2D, w: number, h: number): void {
+ const { base, seam, chips } = CODING_SCENE.terrazzo;
+ const rand = lcg(0x7e22a);
+ ctx.fillStyle = base;
+ ctx.fillRect(0, 0, w, h);
+ for (let i = 0; i < 1400; i += 1) {
+ ctx.fillStyle = chips[Math.floor(rand() * chips.length)];
+ const size = 0.8 + rand() * 1.8;
+ ctx.beginPath();
+ ctx.ellipse(rand() * w, rand() * h, size, size * (0.5 + rand() * 0.5), rand() * Math.PI, 0, Math.PI * 2);
+ ctx.fill();
+ }
+ // Four slabs per tile: seams on the tile's edges and centre lines, so it wraps seamlessly.
+ ctx.fillStyle = seam;
+ for (const at of [0, w / 2]) {
+ ctx.fillRect(at, 0, 2, h);
+ ctx.fillRect(0, at, w, 2);
+ }
+}
+
+function drawCarpet(pattern: CarpetPattern, carpet: string, weave: string, ctx: CanvasRenderingContext2D, w: number, h: number): void {
+ ctx.fillStyle = carpet;
+ ctx.fillRect(0, 0, w, h);
+ ctx.fillStyle = weave;
+ switch (pattern) {
+ case "grid":
+ for (let at = 0; at < w; at += 32) { ctx.fillRect(at, 0, 3, h); ctx.fillRect(0, at, w, 3); }
+ break;
+ case "stripes":
+ for (let y = 0; y < h; y += 64) ctx.fillRect(0, y, w, 26);
+ break;
+ case "checker":
+ for (let y = 0; y < h; y += 64) for (let x = 0; x < w; x += 64) if (((x + y) / 64) % 2 === 0) ctx.fillRect(x, y, 64, 64);
+ break;
+ case "dots":
+ for (let y = 16; y < h; y += 32) for (let x = (y / 32) % 2 === 0 ? 0 : 16; x < w + 16; x += 32) {
+ ctx.beginPath();
+ ctx.arc(x, y, 6, 0, Math.PI * 2);
+ ctx.fill();
+ }
+ break;
+ case "diagonal":
+ // 45° bands drawn across a doubled span, so the tile wraps on both axes.
+ ctx.save();
+ ctx.beginPath();
+ ctx.rect(0, 0, w, h);
+ ctx.clip();
+ for (let k = -h; k < w + h; k += 32) {
+ ctx.beginPath();
+ ctx.moveTo(k, 0); ctx.lineTo(k + 14, 0); ctx.lineTo(k + 14 + h, h); ctx.lineTo(k + h, h);
+ ctx.closePath();
+ ctx.fill();
+ }
+ ctx.restore();
+ break;
+ case "zigzag":
+ ctx.lineWidth = 10;
+ ctx.strokeStyle = weave;
+ for (let y = 16; y < h + 32; y += 48) {
+ ctx.beginPath();
+ for (let x = 0; x <= w; x += 32) ctx.lineTo(x, y + ((x / 32) % 2 === 0 ? 0 : 20));
+ ctx.stroke();
+ }
+ break;
+ }
+}
+
+/** A cached base texture, cloned per surface with its own repeat. */
+function repeated(base: Texture | null, repeatX: number, repeatZ: number): Texture | null {
+ if (!base) return null;
+ const map = base.clone();
+ map.wrapS = map.wrapT = RepeatWrapping;
+ map.anisotropy = 8;
+ map.repeat.set(repeatX, repeatZ);
+ map.needsUpdate = true;
+ return map;
+}
+
+/** Studio materials are shared by every department that cycles onto the same style. */
+const studioMaterials = new Map<StudioStyle, { tone: DeskTone; wall: MeshStandardMaterial; slat: MeshStandardMaterial; border: MeshStandardMaterial }>();
+function studioKit(style: StudioStyle) {
+ let kit = studioMaterials.get(style);
+ if (!kit) {
+ kit = {
+ tone: {
+ top: matte(style.deskTop), body: matte(style.deskBody), leg: matte(style.deskLeg),
+ chair: matte(style.chair), seat: matte(style.seat),
+ },
+ wall: matte(style.wall),
+ slat: matte(style.slat),
+ border: matte(style.border, { roughness: 0.95 }),
+ };
+ studioMaterials.set(style, kit);
+ }
+ return kit;
+}
+
+/** The slab, railing and floor of the coding floor: terrazzo, a dark edge and a glowing rim. */
+export function CodingSlab({ layout, onFloorClick }: { layout: OfficeLayout; onFloorClick: (event: ThreeEvent<MouseEvent>) => void }) {
+ const { minX, maxX, minZ, maxZ } = layout.bounds;
+ const w = maxX - minX, d = maxZ - minZ, cx = (minX + maxX) / 2, cz = (minZ + maxZ) / 2;
+ const floor = useMemo(() => {
+ const map = repeated(cachedCanvasTexture("coding:terrazzo", 256, 256, drawTerrazzo), w / TERRAZZO_METRES, d / TERRAZZO_METRES);
+ return new MeshStandardMaterial({ color: map ? "#ffffff" : CODING_SCENE.terrazzo.base, map, roughness: 0.55 });
+ }, [w, d]);
+ const edge = useMemo(() => matte(CODING_SCENE.slabEdge, { roughness: 0.7 }), []);
+ const rim = useMemo(() => new MeshStandardMaterial({
+ color: CODING_SCENE.rim, emissive: CODING_SCENE.rim, emissiveIntensity: 1.4, roughness: 0.4, toneMapped: false,
+ }), []);
+ useEffect(() => () => { floor.map?.dispose(); floor.dispose(); edge.dispose(); rim.dispose(); }, [floor, edge, rim]);
+ const band = 0.06;
+ return (
+ <group>
+ <Box size={[w, 0.6, d]} position={[cx, -0.3, cz]} material={edge} cast={false} />
+ {/* The glowing rim runs just below the floor's edge on all four sides. */}
+ <Box size={[w + band, band, band]} position={[cx, -0.06, minZ]} material={rim} cast={false} />
+ <Box size={[w + band, band, band]} position={[cx, -0.06, maxZ]} material={rim} cast={false} />
+ <Box size={[band, band, d + band]} position={[minX, -0.06, cz]} material={rim} cast={false} />
+ <Box size={[band, band, d + band]} position={[maxX, -0.06, cz]} material={rim} cast={false} />
+ <mesh position={[cx, 0.001, cz]} rotation={[-Math.PI / 2, 0, 0]} material={floor} receiveShadow onClick={onFloorClick}>
+ <planeGeometry args={[w, d]} />
+ </mesh>
+ <Railing from={[minX + 0.2, minZ + 0.2]} to={[maxX - 0.2, minZ + 0.2]} />
+ <Railing from={[maxX - 0.2, minZ + 0.2]} to={[maxX - 0.2, maxZ - 0.2]} />
+ <Railing from={[maxX - 0.2, maxZ - 0.2]} to={[minX + 0.2, maxZ - 0.2]} />
+ <Railing from={[minX + 0.2, maxZ - 0.2]} to={[minX + 0.2, minZ + 0.2]} />
+ </group>
+ );
+}
+
+/** One workspace department as a studio: bordered patterned rug, painted sign wall, desks in its own colours. */
+export function CodingStudio({ dept, agents }: { dept: Department; agents: ReadonlyMap<string, SocietyAgent> }) {
+ const t = useT();
+ const style = studioStyle(dept.tint);
+ const kit = studioKit(style);
+ const w = dept.maxX - dept.minX, d = dept.maxZ - dept.minZ;
+ const cx = (dept.minX + dept.maxX) / 2, cz = (dept.minZ + dept.maxZ) / 2;
+ const fieldW = w - BORDER_M * 2, fieldD = d - BORDER_M * 2;
+ const carpet = useMemo(() => {
+ const base = cachedCanvasTexture(`coding:carpet:${style.pattern}:${style.carpet}:${style.weave}`, 256, 256,
+ (ctx, cw, ch) => drawCarpet(style.pattern, style.carpet, style.weave, ctx, cw, ch));
+ const map = repeated(base, fieldW / CARPET_METRES, fieldD / CARPET_METRES);
+ return new MeshStandardMaterial({ color: map ? "#ffffff" : style.carpet, map, roughness: 0.95 });
+ }, [style, fieldW, fieldD]);
+ useEffect(() => () => { carpet.map?.dispose(); carpet.dispose(); }, [carpet]);
+ return (
+ <group>
+ <mesh position={[cx, 0.005, cz]} rotation={[-Math.PI / 2, 0, 0]} material={kit.border} receiveShadow>
+ <planeGeometry args={[w, d]} />
+ </mesh>
+ <mesh position={[cx, 0.007, cz]} rotation={[-Math.PI / 2, 0, 0]} material={carpet} receiveShadow>
+ <planeGeometry args={[fieldW, fieldD]} />
+ </mesh>
+ <SignWall label={dept.label || t("society.office.open_space")} width={w - 0.4} position={[cx, 0, dept.minZ + 0.1]}
+ tone={{ wall: kit.wall, slat: kit.slat }} />
+ <DeskInstances desks={dept.desks} agents={agents} tone={kit.tone} />
+ </group>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/DeskInstances.tsx b/jarvis/ui/web/frontend/src/components/society/office/DeskInstances.tsx
index 622fa7e7a6..c22e57c4d0 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/DeskInstances.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/DeskInstances.tsx
@@ -5,31 +5,37 @@
* north at its monitor); a desk facing south is rotated half a turn.
*/
import { useLayoutEffect, useMemo, useRef } from "react";
-import { BufferGeometry, Euler, InstancedMesh, Matrix4, PlaneGeometry, Quaternion, Vector3, type Material } from "three";
+import { BufferGeometry, Euler, InstancedMesh, Matrix4, PlaneGeometry, Quaternion, Vector3, type Material, type MeshStandardMaterial } from "three";
import { RoundedBoxGeometry } from "three-stdlib";
import type { SocietyAgent } from "../data";
import { GEO, MAT, screenMaterial } from "./OfficeFurniture";
import type { DeskSlot } from "./officeLayout";
import type { ScreenFace } from "./screenTextures";
-interface Part { geometry: BufferGeometry; material: Material; position: [number, number, number]; scale?: [number, number, number]; cast: boolean }
+/** Which surface of a workstation a part is; a desk tone recolours parts by role. */
+type PartRole = "top" | "body" | "leg" | "monitor" | "keyboard" | "chair" | "seat";
+
+/** Per-department materials for the parts that carry a room's style (the monitor and keyboard stay). */
+export type DeskTone = Partial<Record<Exclude<PartRole, "monitor" | "keyboard">, MeshStandardMaterial>>;
+
+interface Part { role: PartRole; geometry: BufferGeometry; material: Material; position: [number, number, number]; scale?: [number, number, number]; cast: boolean }
const CHAIR_Z = 0.62;
const rounded = (w: number, h: number, d: number, r: number) => new RoundedBoxGeometry(w, h, d, 2, r);
const PARTS: Part[] = [
- { geometry: rounded(1.5, 0.06, 0.8, 0.02), material: MAT.deskTop, position: [0, 0.74, 0], cast: true },
- { geometry: GEO.box, material: MAT.deskBody, position: [0.53, 0.36, 0], scale: [0.36, 0.7, 0.72], cast: true },
- { geometry: GEO.box, material: MAT.deskLeg, position: [-0.7, 0.36, 0], scale: [0.05, 0.7, 0.7], cast: true },
- { geometry: GEO.box, material: MAT.deskBody, position: [0, 0.94, -0.41], scale: [1.5, 0.34, 0.03], cast: true },
- { geometry: GEO.box, material: MAT.monitor, position: [0, 0.87, -0.22], scale: [0.08, 0.2, 0.08], cast: true },
- { geometry: GEO.box, material: MAT.monitor, position: [0, 0.78, -0.22], scale: [0.24, 0.02, 0.16], cast: true },
- { geometry: rounded(0.72, 0.44, 0.05, 0.02), material: MAT.monitor, position: [0, 1.18, -0.24], cast: true },
- { geometry: GEO.box, material: MAT.keyboard, position: [0, 0.78, 0.24], scale: [0.42, 0.02, 0.14], cast: true },
- { geometry: GEO.cyl, material: MAT.chair, position: [0, 0.03, CHAIR_Z], scale: [0.3, 0.04, 0.3], cast: true },
- { geometry: GEO.cyl, material: MAT.chair, position: [0, 0.25, CHAIR_Z], scale: [0.03, 0.42, 0.03], cast: false },
- { geometry: rounded(0.5, 0.08, 0.48, 0.03), material: MAT.chairSeat, position: [0, 0.48, CHAIR_Z], cast: true },
- { geometry: rounded(0.48, 0.5, 0.07, 0.03), material: MAT.chairSeat, position: [0, 0.78, CHAIR_Z + 0.24], cast: true },
+ { role: "top", geometry: rounded(1.5, 0.06, 0.8, 0.02), material: MAT.deskTop, position: [0, 0.74, 0], cast: true },
+ { role: "body", geometry: GEO.box, material: MAT.deskBody, position: [0.53, 0.36, 0], scale: [0.36, 0.7, 0.72], cast: true },
+ { role: "leg", geometry: GEO.box, material: MAT.deskLeg, position: [-0.7, 0.36, 0], scale: [0.05, 0.7, 0.7], cast: true },
+ { role: "body", geometry: GEO.box, material: MAT.deskBody, position: [0, 0.94, -0.41], scale: [1.5, 0.34, 0.03], cast: true },
+ { role: "monitor", geometry: GEO.box, material: MAT.monitor, position: [0, 0.87, -0.22], scale: [0.08, 0.2, 0.08], cast: true },
+ { role: "monitor", geometry: GEO.box, material: MAT.monitor, position: [0, 0.78, -0.22], scale: [0.24, 0.02, 0.16], cast: true },
+ { role: "monitor", geometry: rounded(0.72, 0.44, 0.05, 0.02), material: MAT.monitor, position: [0, 1.18, -0.24], cast: true },
+ { role: "keyboard", geometry: GEO.box, material: MAT.keyboard, position: [0, 0.78, 0.24], scale: [0.42, 0.02, 0.14], cast: true },
+ { role: "chair", geometry: GEO.cyl, material: MAT.chair, position: [0, 0.03, CHAIR_Z], scale: [0.3, 0.04, 0.3], cast: true },
+ { role: "chair", geometry: GEO.cyl, material: MAT.chair, position: [0, 0.25, CHAIR_Z], scale: [0.03, 0.42, 0.03], cast: false },
+ { role: "seat", geometry: rounded(0.5, 0.08, 0.48, 0.03), material: MAT.chairSeat, position: [0, 0.48, CHAIR_Z], cast: true },
+ { role: "seat", geometry: rounded(0.48, 0.5, 0.07, 0.03), material: MAT.chairSeat, position: [0, 0.78, CHAIR_Z + 0.24], cast: true },
];
const SCREEN_GEOMETRY = new PlaneGeometry(0.66, 0.38);
@@ -43,7 +49,7 @@ function deskMatrix(desk: DeskSlot, local: [number, number, number], scale: [num
return world.multiply(part);
}
-function PartInstances({ part, desks }: { part: Part; desks: DeskSlot[] }) {
+function PartInstances({ part, desks, material }: { part: Part; desks: DeskSlot[]; material: Material }) {
const ref = useRef<InstancedMesh>(null);
useLayoutEffect(() => {
const mesh = ref.current;
@@ -53,7 +59,7 @@ function PartInstances({ part, desks }: { part: Part; desks: DeskSlot[] }) {
mesh.instanceMatrix.needsUpdate = true;
mesh.computeBoundingSphere();
}, [desks, part]);
- return <instancedMesh ref={ref} args={[part.geometry, part.material, Math.max(1, desks.length)]} castShadow={part.cast} receiveShadow frustumCulled={false} />;
+ return <instancedMesh ref={ref} args={[part.geometry, material, Math.max(1, desks.length)]} castShadow={part.cast} receiveShadow frustumCulled={false} />;
}
function ScreenInstances({ face, desks }: { face: ScreenFace; desks: DeskSlot[] }) {
@@ -69,8 +75,8 @@ function ScreenInstances({ face, desks }: { face: ScreenFace; desks: DeskSlot[]
return <instancedMesh key={Math.max(1, desks.length)} ref={ref} args={[SCREEN_GEOMETRY, screenMaterial(face), Math.max(1, desks.length)]} frustumCulled={false} />;
}
-/** All desks with the monitor face each one's agent state calls for. */
-export function DeskInstances({ desks, agents }: { desks: DeskSlot[]; agents: ReadonlyMap<string, SocietyAgent> }) {
+/** All desks with the monitor face each one's agent state calls for; `tone` restyles the desk and chair. */
+export function DeskInstances({ desks, agents, tone }: { desks: DeskSlot[]; agents: ReadonlyMap<string, SocietyAgent>; tone?: DeskTone }) {
const byFace = useMemo(() => {
const groups = new Map<ScreenFace, DeskSlot[]>(FACES.map((f) => [f, []]));
for (const desk of desks) {
@@ -81,7 +87,10 @@ export function DeskInstances({ desks, agents }: { desks: DeskSlot[]; agents: Re
}, [desks, agents]);
return (
<group>
- {PARTS.map((part, i) => <PartInstances key={`${i}:${desks.length}`} part={part} desks={desks} />)}
+ {PARTS.map((part, i) => {
+ const material = (part.role !== "monitor" && part.role !== "keyboard" && tone?.[part.role]) || part.material;
+ return <PartInstances key={`${i}:${desks.length}:${material.uuid}`} part={part} desks={desks} material={material} />;
+ })}
{FACES.map((face) => (byFace.get(face)!.length > 0 ? <ScreenInstances key={face} face={face} desks={byFace.get(face)!} /> : null))}
</group>
);
diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeFurniture.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeFurniture.tsx
index 5cdf9a5e67..4f49fc165c 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeFurniture.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeFurniture.tsx
@@ -207,13 +207,16 @@ function signTexture(label: string): Texture | null {
return texture;
}
-/** A department's back wall: white partition, dark-wood name board, slatted wood panels. */
-export function SignWall({ label, width, position }: { label: string; width: number; position: [number, number, number] }) {
+/** A department's back wall: white partition, dark-wood name board, slatted wood panels; `tone` repaints wall and slats. */
+export function SignWall({ label, width, position, tone }: {
+ label: string; width: number; position: [number, number, number];
+ tone?: { wall: MeshStandardMaterial; slat: MeshStandardMaterial };
+}) {
const texture = signTexture(label);
const slats = Math.max(2, Math.floor(width / 0.5));
return (
<group position={position}>
- <Box size={[width, 1.9, 0.14]} position={[0, 0.95, 0]} material={MAT.wall} />
+ <Box size={[width, 1.9, 0.14]} position={[0, 0.95, 0]} material={tone?.wall ?? MAT.wall} />
<Box size={[width * 0.52, 0.5, 0.05]} position={[0, 1.35, 0.1]} material={MAT.sign} />
{texture && (
<mesh position={[0, 1.35, 0.13]}>
@@ -224,7 +227,7 @@ export function SignWall({ label, width, position }: { label: string; width: num
{Array.from({ length: slats }, (_, i) => {
const x = -width / 2 + 0.25 + i * ((width - 0.5) / (slats - 1));
if (Math.abs(x) < width * 0.3) return null;
- return <Box key={i} size={[0.12, 1.7, 0.05]} position={[x, 0.95, 0.1]} material={MAT.woodDark} />;
+ return <Box key={i} size={[0.12, 1.7, 0.05]} position={[x, 0.95, 0.1]} material={tone?.slat ?? MAT.woodDark} />;
})}
</group>
);
diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx
index b25c7e7af1..b8c6eb5522 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx
@@ -12,6 +12,7 @@ import type { SocietyAgent } from "../data";
import type { ToyLook } from "./toyFigureModel";
import { Railing, SignWall } from "./OfficeFurniture";
import { DeskInstances } from "./DeskInstances";
+import { CodingSlab, CodingStudio } from "./CodingFloorLook";
import { ExecutiveDesks, LeadOfficeLight } from "./LeadSuite";
import { LiveMonitors } from "./LiveMonitors";
import { TerminalMonitors } from "./TerminalMonitors";
@@ -29,7 +30,7 @@ import { PlayerBubble } from "./OfficeBubbles";
import { OfficeCameraRig } from "./OfficeCameraRig";
import { allDesks, type Department, type OfficeLayout, type Point } from "./officeLayout";
import { isWalkable, nearestWalkable, type NavGrid } from "./officeNav";
-import { DEPARTMENT_TINTS, OFFICE } from "./officePalette";
+import { CODING_SCENE, DEPARTMENT_TINTS, OFFICE } from "./officePalette";
import { officeSession, player as playerBody, useOfficeStore, type OfficeFloor, type Selection } from "./officeStore";
import { arrivalPose } from "./officeFloors";
@@ -169,7 +170,10 @@ export function OfficeScene({ floor, occupants, ready, layout, grid, walkers, ag
// Lead desks carry their own size and are built as executive desks, not bench instances.
const benchDesks = useMemo(() => desks.filter((d) => !d.size), [desks]);
const leadRoom = layout.rooms.find((r) => r.kind === "lead");
- const background = useMemo(() => new Color(OFFICE.space), []);
+ const coding = floor === "coding";
+ // The coding floor floats in a violet night of its own, so a glance tells the floors apart.
+ const space = coding ? CODING_SCENE.space : OFFICE.space;
+ const background = useMemo(() => new Color(space), [space]);
const { minX, maxX, minZ, maxZ } = layout.bounds;
const span = Math.max(maxX - minX, maxZ - minZ);
const select = useOfficeStore((s) => s.select);
@@ -184,20 +188,24 @@ export function OfficeScene({ floor, occupants, ready, layout, grid, walkers, ag
return (
<>
<primitive attach="background" object={background} />
- <fog attach="fog" args={[OFFICE.space, span * 2.2, span * 4.5]} />
+ <fog attach="fog" args={[space, span * 2.2, span * 4.5]} />
<Stars radius={span * 3} depth={span} count={2500} factor={4} saturation={0} fade speed={reduced ? 0 : 0.3} />
- <hemisphereLight args={["#dfe9ff", "#6b5a48", 0.9]} />
+ <hemisphereLight args={coding ? [CODING_SCENE.sky, CODING_SCENE.ground, 0.95] : ["#dfe9ff", "#6b5a48", 0.9]} />
<ambientLight intensity={0.25} />
<directionalLight position={[maxX + 10, 26, maxZ + 6]} intensity={1.6} castShadow
shadow-mapSize={[2048, 2048]} shadow-bias={-0.0004} shadow-normalBias={0.03}
shadow-camera-left={-span * 0.7} shadow-camera-right={span * 0.7}
shadow-camera-top={span * 0.7} shadow-camera-bottom={-span * 0.7} shadow-camera-far={120} />
- <Slab layout={layout} onFloorClick={onFloorClick} />
+ {coding ? <CodingSlab layout={layout} onFloorClick={onFloorClick} /> : <Slab layout={layout} onFloorClick={onFloorClick} />}
<RoomFloors rooms={layout.rooms} />
<RoomWalls walls={layout.walls} />
{layout.rooms.map((room) => <RoomSign key={room.id} room={room} label={t(`society.office.room_${room.kind}`)} />)}
- {layout.departments.map((dept) => <DepartmentArea key={dept.id} dept={dept} />)}
- <DeskInstances desks={benchDesks} agents={agents} />
+ {coding
+ ? layout.departments.map((dept) => <CodingStudio key={dept.id} dept={dept} agents={agents} />)
+ : <>
+ {layout.departments.map((dept) => <DepartmentArea key={dept.id} dept={dept} />)}
+ <DeskInstances desks={benchDesks} agents={agents} />
+ </>}
<ExecutiveDesks desks={desks} agents={agents} onOpenScreen={onOpenScreen} />
{leadRoom && <LeadOfficeLight room={leadRoom} />}
{floor === "coding"
diff --git a/jarvis/ui/web/frontend/src/components/society/office/codingFloorLook.test.ts b/jarvis/ui/web/frontend/src/components/society/office/codingFloorLook.test.ts
new file mode 100644
index 0000000000..d259d7069d
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/society/office/codingFloorLook.test.ts
@@ -0,0 +1,25 @@
+import { describe, expect, it } from "vitest";
+
+import { studioStyle } from "./CodingFloorLook";
+import { CODING_SCENE, CODING_STUDIOS, DEPARTMENT_TINTS, OFFICE } from "./officePalette";
+
+describe("coding floor look", () => {
+ it("furnishes the six departments a floor can hold as six different studios", () => {
+ const styles = Array.from({ length: 6 }, (_, i) => studioStyle(i));
+ expect(new Set(styles).size).toBe(6);
+ expect(new Set(styles.map((s) => s.pattern)).size).toBe(6);
+ expect(new Set(styles.map((s) => s.carpet)).size).toBe(6);
+ expect(new Set(styles.map((s) => s.wall)).size).toBe(6);
+ });
+
+ it("cycles the studios for any tint index, never failing on one past the set", () => {
+ expect(studioStyle(CODING_STUDIOS.length)).toBe(studioStyle(0));
+ expect(studioStyle(-1)).toBe(studioStyle(CODING_STUDIOS.length - 1));
+ });
+
+ it("shares no floor colour with the agents office below", () => {
+ expect(CODING_SCENE.space).not.toBe(OFFICE.space);
+ const below = new Set<string>(DEPARTMENT_TINTS);
+ for (const studio of CODING_STUDIOS) expect(below.has(studio.carpet)).toBe(false);
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/components/society/office/officePalette.ts b/jarvis/ui/web/frontend/src/components/society/office/officePalette.ts
index 48a8d7a0d2..5e8a74757e 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/officePalette.ts
+++ b/jarvis/ui/web/frontend/src/components/society/office/officePalette.ts
@@ -39,6 +39,55 @@ export const OFFICE = {
/** Carpet tints per department — soft, desaturated, readable next to wood. */
export const DEPARTMENT_TINTS = ["#9aa6b8", "#a9b59a", "#b8a39a", "#a39ab8", "#9ab5b1", "#b8b19a"] as const;
+/**
+ * The coding floor's own look, so the two floors never read as copies: a
+ * violet night instead of navy, cool terrazzo instead of warm planks, a glowing
+ * rim around the slab, and a studio style per department.
+ */
+export const CODING_SCENE = {
+ space: "#140e2e",
+ slabEdge: "#2a2542",
+ rim: "#5eead4",
+ sky: "#d9e2ff",
+ ground: "#4d4868",
+ terrazzo: { base: "#dde1e8", seam: "rgba(120,128,145,0.3)", chips: ["#c3c9d4", "#efcdbf", "#c2dcd5", "#d2cae6", "#a6adbb", "#f6f7f9"] },
+} as const;
+
+export type CarpetPattern = "grid" | "stripes" | "checker" | "dots" | "diagonal" | "zigzag";
+
+export interface StudioStyle {
+ pattern: CarpetPattern;
+ /** Carpet base, its pattern tone, and the rug border. */
+ carpet: string;
+ weave: string;
+ border: string;
+ /** The department's back wall and its slats. */
+ wall: string;
+ slat: string;
+ /** Desk top, cabinet, leg, chair base and seat. */
+ deskTop: string;
+ deskBody: string;
+ deskLeg: string;
+ chair: string;
+ seat: string;
+}
+
+/** One studio per workspace department, cycled; every one differs in pattern, colours and furniture. */
+export const CODING_STUDIOS: readonly StudioStyle[] = [
+ { pattern: "grid", carpet: "#3b4a6b", weave: "#4d5e82", border: "#5eead4", wall: "#2f3b57", slat: "#5eead4",
+ deskTop: "#6b4a33", deskBody: "#23262d", deskLeg: "#3a3d44", chair: "#23262d", seat: "#3aa99a" },
+ { pattern: "stripes", carpet: "#a7b98f", weave: "#95a87e", border: "#e8d9a8", wall: "#e9efe0", slat: "#7c9a5e",
+ deskTop: "#e6d2ad", deskBody: "#fbfaf6", deskLeg: "#c9c4b8", chair: "#4b5a3a", seat: "#7c9a5e" },
+ { pattern: "checker", carpet: "#d99a7b", weave: "#c9876a", border: "#f3e3cf", wall: "#f5e6d8", slat: "#b5654a",
+ deskTop: "#f0e2cb", deskBody: "#fdf8f0", deskLeg: "#d8cbb8", chair: "#6b3a2a", seat: "#c46a4c" },
+ { pattern: "dots", carpet: "#b9aed6", weave: "#d6cdee", border: "#7d6bb0", wall: "#ece6f7", slat: "#8b79c0",
+ deskTop: "#fbfbfb", deskBody: "#d9d7e2", deskLeg: "#a9a6b8", chair: "#3a3350", seat: "#7a4f8f" },
+ { pattern: "diagonal", carpet: "#7fb9b8", weave: "#6aa6a5", border: "#1f5f6b", wall: "#dcefee", slat: "#2e7c85",
+ deskTop: "#d9b98f", deskBody: "#e7eeee", deskLeg: "#9fb3b5", chair: "#1f3b4d", seat: "#2d5f86" },
+ { pattern: "zigzag", carpet: "#e2c070", weave: "#d0aa55", border: "#3a3024", wall: "#fbf1d6", slat: "#b8862e",
+ deskTop: "#5b3a25", deskBody: "#2c2a28", deskLeg: "#46423d", chair: "#2c2a28", seat: "#e0a93a" },
+];
+
/** Colours of the room props (lobby, team room, wardrobe, break room). */
export const PROP_COLOURS = {
steel: "#aab2bc",