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.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(verse): add the Level Hall wing and screen to the agents floor
rubenluetke10-beep9c0fb2bd1da5
diff --git a/docs/agent-society/level-system.md b/docs/agent-society/level-system.mdindex 381918b8ca..76a4c648d6 100644--- a/docs/agent-society/level-system.md+++ b/docs/agent-society/level-system.md@@ -106,10 +106,32 @@ Reduced motion keeps the information (banner, tag, toast) and drops the motion.## 6. Surfaces-- Level card under the floor title (click or `L` opens the progress panel).+- Level card under the floor title (click or `L` opens the Level Hall screen).- Level chip on every name plate; the lead's chip shows the pet's level.-- Progress panel: You / Pet / Agents tabs — level, wear choices, reward track,- the exact rules; Agents is a ranking.+- **The Level Hall** on the agents floor (office-map.md §5f): the Level Wall,+ the Upgrade Studio's stage, a pedestal per reward along the Level Road and the+ level guide. Stepping on the stage opens the screen's Studio page, the guide+ its Overview, a pedestal its reward on the Rewards page.+- **The Level Hall screen**, for the person or their pet (switch in the head):+ - *Overview:* level, title, XP bar with what is missing, the next title, the+ next three unlocks (each opens in the Studio to try on) and the quickest+ repeatable ways to earn.+ - *Studio:* the dressing room. A live 3D preview of the person's figure or+ the pet on the hall's stage wearing the loadout; per slot "automatic",+ "nothing" and every piece as a card with its rarity. An unlocked piece is+ put on with one click; a locked piece is tried on in the preview, marked+ "Try-on" with the level and XP it still needs. A trail makes the figure+ walk a circle; the frame shows on a name plate.+ - *Rewards:* the reward road from the first unlock to the cap with the+ subject's position on it; the chosen step in the preview with its rarity,+ unlock level, missing XP and "Put it on" once open.+ - *How to level:* three steps (earn, level up, unlock), the cost of the next+ levels from the server's curve, and every rule for the person, the pet and+ agents, grouped.+ - *Team:* every agent's level, best first.++ Rarity is a reading of the unlock level only (≤ 5 common, ≤ 15 rare, ≤ 30+ epic, above legendary); it changes nothing in the rulebook.## 7. Contractsdiff --git a/docs/agent-society/office-map.md b/docs/agent-society/office-map.mdindex 4f27c82b9d..8df7396b4c 100644--- a/docs/agent-society/office-map.md+++ b/docs/agent-society/office-map.md@@ -68,6 +68,11 @@ target runs WebGL.- **South strip:** an open reception/lobby with the elevator, the reception deskand the agent board; a walled break room with couches, coffee bar, watercooler, arcade and beanbags.+- **Level Hall (agents floor only):** an east wing one aisle beyond the office,+ across the floor's whole depth, with doors onto the north aisle, the spawn+ point's cross aisle (the main door with the sign) and the south aisle. The+ coding floor keeps the office's footprint without it; both floors share the+ same west edge, so the elevator stands at the same spot on each.- **Furniture** has fixed footprints (`FURNITURE_SIZE`) shared by renderer andnavigation; **spots** are hangout places with pose and facing; **checkpoints**are action places; **obstacles** are every solid footprint.@@ -321,6 +326,16 @@ plays a light column, shockwaves and sparks in the world plus a banner onscreen. Unlocked trails, auras, gadgets and frames are worn in the world.The whole contract lives in [level-system.md](level-system.md).+The Level Hall is the levels' own room on the agents floor, dressed as a+trophy hall in midnight stone and brass: the Level Wall (a live screen with the+person's level, title, XP bar and next reward) over the Upgrade Studio's round+stage in the north, the Level Road down the middle lined with a pedestal per+reward (lowest unlock in the south, highest by the stage; lit once unlocked, a+dark silhouette while locked, the next unlock under a pulsing gold beam; a+click opens it on the reward road), and the double-sided level guide at the+road's start. Its two checkpoints, the stage (`studio`) and the guide+(`levels`), open the Level Hall screen (level-system.md §6).+## 6. Plan1. First map (done 2026-09-28).diff --git a/jarvis/ui/web/frontend/src/components/society/office/CheckpointMarker.tsx b/jarvis/ui/web/frontend/src/components/society/office/CheckpointMarker.tsxindex a8f9a72590..0a4f51b30b 100644--- a/jarvis/ui/web/frontend/src/components/society/office/CheckpointMarker.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/CheckpointMarker.tsx@@ -17,7 +17,12 @@ import { cachedCanvasTexture } from "./canvasMaterials";import type { Checkpoint, CheckpointKind } from "./officeLayout";import { CHECKPOINT_GOLD } from "./officePalette";-export type CheckpointIcon = "spawn" | "plus" | "list" | "team" | "shirt" | "star" | "coffee" | "updown" | "target";+export type CheckpointIcon = "spawn" | "plus" | "list" | "team" | "shirt" | "star" | "coffee" | "updown" | "target" | "sparkle" | "trophy";++/** The Upgrade Studio: a large four-point sparkle and a small one. */+export const SPARKLE_PATH = "M10 3l1.6 5.4L17 10l-5.4 1.6L10 17l-1.6-5.4L3 10l5.4-1.6zM18 14l.8 2.2L21 17l-2.2.8L18 20l-.8-2.2L15 17l2.2-.8z";+/** The level guide: a trophy cup on its stand. */+export const TROPHY_PATH = "M7 4h10v5a5 5 0 0 1-10 0V4zM7 6H4.5a2.5 2.5 0 0 0 2.6 3.6M17 6h2.5a2.5 2.5 0 0 1-2.6 3.6M12 14v3M8 20h8M9.5 17h5";/** Stroke-only icons in a 24 × 24 box (round caps and joins). */export const CHECKPOINT_ICON_PATHS: Record<CheckpointIcon, string> = {@@ -33,11 +38,14 @@ export const CHECKPOINT_ICON_PATHS: Record<CheckpointIcon, string> = {updown: "M8 20V4M4 8l4-4 4 4M16 4v16M12 16l4 4 4-4",// Mission Control: a target with crosshairs.target: "M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18zM12 8a4 4 0 1 1 0 8a4 4 0 1 1 0-8zM12 1v4M12 19v4M1 12h4M19 12h4",+ sparkle: SPARKLE_PATH,+ trophy: TROPHY_PATH,};/** The icon each checkpoint wears, on its floor token and in the reception's list of places. */export const CHECKPOINT_ICON: Record<CheckpointKind, CheckpointIcon> = {spawn: "spawn", launch: "spawn", create: "plus", manage: "list", team: "team", wardrobe: "shirt", lead: "star", break: "coffee", elevator: "updown", mission: "target",+ studio: "sparkle", levels: "trophy",};const TOKEN_RADIUS = 0.36;diff --git a/jarvis/ui/web/frontend/src/components/society/office/GigiFlyer.tsx b/jarvis/ui/web/frontend/src/components/society/office/GigiFlyer.tsxindex 706cb99bef..323ee9e2e4 100644--- a/jarvis/ui/web/frontend/src/components/society/office/GigiFlyer.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/GigiFlyer.tsx@@ -106,7 +106,8 @@ function bodyOffset(pet: CompanionPet, ground: boolean): number {return pet.kind === "gigi" ? MODEL_CENTRE_OFFSET : -pet.heightM / 2;}-function CompanionBody({ pet, drive, reduced, paused, gigi }: {+/** The pet's own body: its authored model, its voxel figure, or Gigi (passed in, so each host sizes it). */+export function CompanionBody({ pet, drive, reduced, paused, gigi }: {pet: CompanionPet; drive: { current: PetDrive }; reduced: boolean; paused: boolean; gigi: ReactNode;}) {if (pet.kind === "model") return <PetModel pet={pet} drive={drive} reduced={reduced} paused={paused} />;@@ -115,7 +116,7 @@ function CompanionBody({ pet, drive, reduced, paused, gigi }: {}/** A missing or broken GLB hides the companion's body; the glow still marks the lead. */-class ModelBoundary extends Component<{ children: ReactNode }, { failed: boolean }> {+export class ModelBoundary extends Component<{ children: ReactNode }, { failed: boolean }> {state = { failed: false };static getDerivedStateFromError() { return { failed: true }; }componentDidCatch(error: Error) { console.warn("Companion model unavailable", error.name); }diff --git a/jarvis/ui/web/frontend/src/components/society/office/LevelHall.tsx b/jarvis/ui/web/frontend/src/components/society/office/LevelHall.tsxnew file mode 100644index 0000000000..8a4702e9a9--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/office/LevelHall.tsx@@ -0,0 +1,707 @@+/**+ * The Level Hall: the agents floor's east wing, built like the trophy hall of+ * a game. Midnight stone and brass, lit from within.+ *+ * - The Level Wall on the north wall: a live screen with the person's level,+ * title, XP bar and the next reward, between two lit brass pillars.+ * - The Upgrade Studio's stage in front of it: a round disc with a glowing+ * rim and a slowly turning ring of marks. Stepping on it opens the studio.+ * - The Level Road down the middle: a lit runway whose chevrons point up the+ * levels, lined with a pedestal per reward. Each pedestal shows its reward+ * as a small hologram in a glass case: lit once unlocked, a dark silhouette+ * while locked, and the next unlock under a pulsing gold beam. A click on a+ * pedestal opens that reward on the reward road.+ * - The level guide at the road's start: a free-standing screen, the same on+ * both faces, listing how XP is earned.+ *+ * Same rules as OfficeProps: every piece is built in local space centred on+ * the origin, front facing +z, inside its `FURNITURE_SIZE` box; the light+ * shaft and the lamps over the stage live in `LevelHallFittings`. The world+ * keeps one palette in light and dark mode (office-map.md §2).+ */+import { memo, useEffect, useMemo, useRef } from "react";+import { useFrame, type ThreeEvent } from "@react-three/fiber";+import {+ AdditiveBlending, CanvasTexture, ConeGeometry, CylinderGeometry, DoubleSide, MeshBasicMaterial, MeshStandardMaterial,+ RepeatWrapping, SphereGeometry, SRGBColorSpace, TorusGeometry, type Group, type Mesh, type Texture,+} from "three";+import { useT } from "@/i18n";+import { Box, matte, Rounded } from "./OfficeFurniture";+import { cachedCanvasTexture, redrawWhenFontsLoad } from "./canvasMaterials";+import { FURNITURE_SIZE, type Furniture, type FurnitureKind } from "./officeLayout";+import { levelFraction, nextUnlock, rewardRoad } from "../progression/cosmetics";+import { EFFECT_COLOURS, FRAME_STYLE, slotOf, type RewardId } from "../progression/levelCatalog";+import { useFrameStyle } from "../progression/LevelHud";+import { PERSON_SUBJECT, type XpRuleRow } from "../progression/progressionApi";+import { useProgression } from "../progression/progressionStore";+import { glowTexture } from "../progression/effects/flairTextures";++type Vec3 = [number, number, number];+type Ctx = CanvasRenderingContext2D;++// ---------------------------------------------------------------------------+// Materials: midnight stone, brass, cream marble and light.+// ---------------------------------------------------------------------------++const C = {+ midnight: "#141b36",+ navy: "#1d2b52",+ ink: "#0d1228",+ brass: "#d9b25c",+ gold: "#ffd76e",+ marble: "#efe8da",+ marbleVein: "#d8cfbf",+ cyan: "#8fe3ff",+ locked: "#3a4570",+} as const;++const HM = {+ midnight: matte(C.midnight, { roughness: 0.35, metalness: 0.25 }),+ navy: matte(C.navy, { roughness: 0.5 }),+ ink: matte(C.ink, { roughness: 0.3, metalness: 0.3 }),+ brass: matte(C.brass, { roughness: 0.28, metalness: 0.75 }),+ marble: matte(C.marble, { roughness: 0.32 }),+ marbleVein: matte(C.marbleVein, { roughness: 0.4 }),+ // Light strips and rings: lit from within, so they read as light in any scene lighting.+ gold: new MeshStandardMaterial({ color: C.gold, emissive: C.gold, emissiveIntensity: 1.5, toneMapped: false }),+ cyan: new MeshStandardMaterial({ color: C.cyan, emissive: C.cyan, emissiveIntensity: 1.3, toneMapped: false }),+ glass: new MeshStandardMaterial({ color: "#d6ecff", transparent: true, opacity: 0.16, roughness: 0.04, depthWrite: false, side: DoubleSide }),+ locked: new MeshStandardMaterial({ color: C.locked, roughness: 0.6, transparent: true, opacity: 0.75 }),+};++const GEO = {+ disc: new CylinderGeometry(1, 1, 1, 48),+ hex: new CylinderGeometry(1, 1, 1, 6),+ ring: new TorusGeometry(1, 0.016, 8, 64),+ ball: new SphereGeometry(1, 14, 10),+ cone: new ConeGeometry(1, 1, 5),+ rotor: new CylinderGeometry(1, 1, 1, 12),+ shaft: new CylinderGeometry(0.55, 1.6, 2.9, 32, 1, true),+ beam: new CylinderGeometry(0.2, 0.26, 1.5, 20, 1, true),+};++const FONT = '"Inter Variable", "Inter", system-ui, sans-serif';++/** Lit material per colour, shared by every hologram. */+const litCache = new Map<string, MeshStandardMaterial>();+function lit(colour: string): MeshStandardMaterial {+ let material = litCache.get(colour);+ if (!material) {+ material = new MeshStandardMaterial({ color: colour, emissive: colour, emissiveIntensity: 0.9, roughness: 0.3, metalness: 0.2, toneMapped: false });+ litCache.set(colour, material);+ }+ return material;+}++// ---------------------------------------------------------------------------+// Live canvas faces+// ---------------------------------------------------------------------------++/**+ * A canvas texture redrawn whenever `signature` changes, and once more when+ * the hall's font has loaded (canvas text drawn before the face arrives would+ * keep the fallback face).+ */+function useLiveTexture(w: number, h: number, signature: string, draw: (ctx: Ctx, w: number, h: number) => void): Texture | null {+ const canvas = useMemo(() => {+ if (typeof document === "undefined") return null;+ const el = document.createElement("canvas");+ el.width = w;+ el.height = h;+ return el;+ }, [w, h]);+ const texture = useMemo(() => {+ if (!canvas) return null;+ const made = new CanvasTexture(canvas);+ made.colorSpace = SRGBColorSpace;+ made.anisotropy = 4;+ return made;+ }, [canvas]);+ useEffect(() => () => texture?.dispose(), [texture]);+ const drawRef = useRef(draw);+ drawRef.current = draw;+ useEffect(() => {+ let ctx: Ctx | null = null;+ try {+ ctx = canvas?.getContext("2d") ?? null;+ } catch {+ // jsdom without the canvas package throws "not implemented": the screen keeps its dark glass, which is honest.+ ctx = null;+ }+ if (!ctx || !texture) return;+ const paint = () => { drawRef.current(ctx!, w, h); texture.needsUpdate = true; };+ paint();+ if (typeof document === "undefined" || !("fonts" in document)) return;+ let live = true;+ document.fonts.load(`700 48px ${FONT}`).then(() => { if (live) paint(); }, () => {+ // A face that fails to load leaves the fallback face already drawn, which stays legible.+ });+ return () => { live = false; };+ }, [signature, canvas, texture, w, h]);+ return texture;+}++function fitText(ctx: Ctx, text: string, maxWidth: number): string {+ if (ctx.measureText(text).width <= maxWidth) return text;+ let cut = text;+ while (cut.length > 1 && ctx.measureText(`${cut}…`).width > maxWidth) cut = cut.slice(0, -1);+ return `${cut}…`;+}++function hexPath(ctx: Ctx, cx: number, cy: number, r: number): void {+ ctx.beginPath();+ for (let i = 0; i < 6; i += 1) {+ const a = Math.PI / 6 + (i * Math.PI) / 3;+ const x = cx + Math.cos(a) * r, y = cy + Math.sin(a) * r;+ if (i === 0) ctx.moveTo(x, y); else ctx.lineTo(x, y);+ }+ ctx.closePath();+}++/** The screen's dark glass: a deep gradient, a faint grid and a soft vignette. */+function screenGround(ctx: Ctx, w: number, h: number): void {+ const bg = ctx.createLinearGradient(0, 0, 0, h);+ bg.addColorStop(0, "#1b2552");+ bg.addColorStop(1, "#0b1030");+ ctx.fillStyle = bg;+ ctx.fillRect(0, 0, w, h);+ ctx.strokeStyle = "rgba(143,227,255,0.06)";+ ctx.lineWidth = 1;+ for (let x = 0; x < w; x += 48) { ctx.beginPath(); ctx.moveTo(x, 0); ctx.lineTo(x, h); ctx.stroke(); }+ for (let y = 0; y < h; y += 48) { ctx.beginPath(); ctx.moveTo(0, y); ctx.lineTo(w, y); ctx.stroke(); }+ const glow = ctx.createRadialGradient(w * 0.3, h * 0.45, 10, w * 0.3, h * 0.45, w * 0.6);+ glow.addColorStop(0, "rgba(255,215,110,0.16)");+ glow.addColorStop(1, "rgba(255,215,110,0)");+ ctx.fillStyle = glow;+ ctx.fillRect(0, 0, w, h);+}++interface WallLines {+ level: number;+ levelWord: string;+ title: string;+ xp: string;+ toNext: string;+ nextLabel: string;+ nextName: string;+ nextAt: string;+ nextColours: [string, string];+ hall: string;+}++function drawWall(ctx: Ctx, w: number, h: number, lines: WallLines, fraction: number, frame: { ring: string; fill: string; ink: string }): void {+ screenGround(ctx, w, h);+ ctx.textBaseline = "middle";+ // The hall's name across the top.+ ctx.fillStyle = "rgba(255,215,110,0.85)";+ ctx.font = `700 34px ${FONT}`;+ ctx.textAlign = "center";+ ctx.fillText(fitText(ctx, lines.hall.toUpperCase(), w - 120), w / 2, 52);+ ctx.textAlign = "left";+ // The level badge: a hexagon in the person's frame colours.+ const bx = 250, by = 330, br = 170;+ ctx.save();+ ctx.shadowColor = frame.ring;+ ctx.shadowBlur = 40;+ hexPath(ctx, bx, by, br);+ ctx.fillStyle = frame.fill;+ ctx.fill();+ ctx.restore();+ hexPath(ctx, bx, by, br);+ ctx.lineWidth = 14;+ ctx.strokeStyle = frame.ring;+ ctx.stroke();+ ctx.fillStyle = frame.ink;+ ctx.textAlign = "center";+ ctx.font = `600 34px ${FONT}`;+ ctx.fillText(lines.levelWord.toUpperCase(), bx, by - 78);+ ctx.font = `800 150px ${FONT}`;+ ctx.fillText(String(lines.level), bx, by + 22);+ ctx.textAlign = "left";+ // Title, XP bar and what is missing.+ const x0 = 480, barW = 600;+ ctx.fillStyle = "#ffffff";+ ctx.font = `800 76px ${FONT}`;+ ctx.fillText(fitText(ctx, lines.title, w - x0 - 60), x0, 230);+ const barY = 318, barH = 34;+ ctx.fillStyle = "rgba(255,255,255,0.12)";+ ctx.beginPath(); ctx.roundRect(x0, barY, barW, barH, barH / 2); ctx.fill();+ const grad = ctx.createLinearGradient(x0, 0, x0 + barW, 0);+ grad.addColorStop(0, "#ffb347");+ grad.addColorStop(1, "#ffe08a");+ ctx.fillStyle = grad;+ ctx.beginPath(); ctx.roundRect(x0, barY, Math.max(barH, barW * fraction), barH, barH / 2); ctx.fill();+ ctx.fillStyle = "#ffe9b0";+ ctx.font = `700 38px ${FONT}`;+ ctx.fillText(lines.xp, x0 + barW + 30, barY + barH / 2);+ ctx.fillStyle = "rgba(255,255,255,0.78)";+ ctx.font = `500 36px ${FONT}`;+ ctx.fillText(fitText(ctx, lines.toNext, w - x0 - 60), x0, 400);+ // The next reward.+ const cardY = 460, cardH = 120, cardW = w - x0 - 60;+ ctx.fillStyle = "rgba(255,255,255,0.07)";+ ctx.beginPath(); ctx.roundRect(x0, cardY, cardW, cardH, 22); ctx.fill();+ ctx.strokeStyle = "rgba(255,215,110,0.45)";+ ctx.lineWidth = 3;+ ctx.stroke();+ const tile = ctx.createLinearGradient(x0 + 24, cardY + 20, x0 + 104, cardY + 100);+ tile.addColorStop(0, lines.nextColours[0]);+ tile.addColorStop(1, lines.nextColours[1]);+ ctx.fillStyle = tile;+ ctx.beginPath(); ctx.roundRect(x0 + 24, cardY + 20, 80, 80, 18); ctx.fill();+ ctx.fillStyle = "rgba(255,215,110,0.95)";+ ctx.font = `700 28px ${FONT}`;+ ctx.fillText(fitText(ctx, lines.nextLabel.toUpperCase(), cardW - 160), x0 + 130, cardY + 38);+ ctx.fillStyle = "#ffffff";+ ctx.font = `700 40px ${FONT}`;+ const name = fitText(ctx, lines.nextName, cardW - 160 - (lines.nextAt ? 220 : 0));+ ctx.fillText(name, x0 + 130, cardY + 82);+ if (lines.nextAt) {+ ctx.textAlign = "right";+ ctx.fillStyle = "rgba(255,255,255,0.7)";+ ctx.font = `600 32px ${FONT}`;+ ctx.fillText(lines.nextAt, x0 + cardW - 28, cardY + 82);+ ctx.textAlign = "left";+ }+}++/** A reward's two tile colours: its frame ring and fill, or its effect's first and last colour. */+export function rewardColours(reward: RewardId): [string, string] {+ if (slotOf(reward) === "frame") {+ const style = FRAME_STYLE[reward as keyof typeof FRAME_STYLE];+ return [style.ring, style.fill];+ }+ const colours = EFFECT_COLOURS[reward as keyof typeof EFFECT_COLOURS];+ return [colours[0], colours[colours.length - 1]];+}++// ---------------------------------------------------------------------------+// The Level Wall+// ---------------------------------------------------------------------------++const WALL = { w: FURNITURE_SIZE.levelWall.w, h: FURNITURE_SIZE.levelWall.h, d: FURNITURE_SIZE.levelWall.d, screenW: 5.0, screenH: 2.08, screenY: 1.72 };++function LevelWall() {+ const t = useT();+ const person = useProgression((s) => s.subjects[PERSON_SUBJECT]);+ const rewards = useProgression((s) => s.snapshot?.rewards);+ const level = person?.level ?? 1;+ const frame = useFrameStyle("person", level);+ const fraction = levelFraction(person);+ const next = rewards ? nextUnlock(rewards, "person", level) : undefined;+ const lines: WallLines = {+ level,+ levelWord: t("society.level.level_n").replace("{0}", "").trim(),+ title: t(`society.level.title.${person?.title || "newcomer"}`),+ xp: person && person.xpForNext > 0 ? t("society.level.xp_of").replace("{0}", String(person.xpIntoLevel)).replace("{1}", String(person.xpForNext)) : "",+ toNext: person && person.xpForNext <= 0 ? t("society.level.max")+ : t("society.level.to_next").replace("{0}", String(person ? person.xpForNext - person.xpIntoLevel : 40)).replace("{1}", String(level + 1)),+ nextLabel: t("society.hall.next_reward"),+ nextName: next ? t(`society.level.reward.${next.rewardId}`) : t("society.hall.all_unlocked"),+ nextAt: next ? t("society.level.locked_at").replace("{0}", String(next.levels.person)) : "",+ nextColours: next ? rewardColours(next.rewardId) : [C.gold, C.brass],+ hall: t("society.office.room_levels"),+ };+ const signature = JSON.stringify([lines, Math.round(fraction * 200), frame]);+ const face = useLiveTexture(1536, 640, signature, (ctx, w, h) => drawWall(ctx, w, h, lines, fraction, frame));+ return (+ <group>+ {/* Backing panel with a brass frame round the screen. */}+ <Box size={[WALL.w, WALL.h, 0.2]} position={[0, WALL.h / 2, -WALL.d / 2 + 0.1]} material={HM.midnight} />+ <Box size={[WALL.screenW + 0.24, WALL.screenH + 0.24, 0.06]} position={[0, WALL.screenY, 0.03]} material={HM.brass} />+ <mesh position={[0, WALL.screenY, 0.065]}>+ <planeGeometry args={[WALL.screenW, WALL.screenH]} />+ {face+ ? <meshStandardMaterial map={face} emissiveMap={face} emissive="#ffffff" emissiveIntensity={0.85} roughness={0.4} />+ : <meshStandardMaterial color={C.ink} roughness={0.3} />}+ </mesh>+ {/* Two lit brass pillars either side, a gold strip along the top and the bottom. */}+ {[-1, 1].map((side) => (+ <group key={side} position={[side * (WALL.w / 2 - 0.3), 0, 0]}>+ <Box size={[0.4, WALL.h, 0.3]} position={[0, WALL.h / 2, -0.02]} material={HM.navy} />+ <Box size={[0.07, WALL.h - 0.4, 0.04]} position={[0, WALL.h / 2, 0.14]} material={HM.gold} cast={false} />+ <Box size={[0.46, 0.08, 0.34]} position={[0, WALL.h - 0.04, -0.02]} material={HM.brass} />+ <Box size={[0.46, 0.12, 0.34]} position={[0, 0.06, -0.02]} material={HM.brass} />+ </group>+ ))}+ <Box size={[WALL.screenW, 0.04, 0.04]} position={[0, WALL.screenY + WALL.screenH / 2 + 0.22, 0.05]} material={HM.gold} cast={false} />+ <Box size={[WALL.screenW, 0.04, 0.04]} position={[0, WALL.screenY - WALL.screenH / 2 - 0.22, 0.05]} material={HM.gold} cast={false} />+ </group>+ );+}++// ---------------------------------------------------------------------------+// The Upgrade Studio's stage+// ---------------------------------------------------------------------------++const STAGE_R = FURNITURE_SIZE.studioStage.w / 2 - 0.04;++/** The stage disc; the Upgrade Studio's preview stands its figure on the same one. */+export function StudioStage() {+ const marks = useRef<Group>(null);+ useFrame((_, dt) => { if (marks.current) marks.current.rotation.y += Math.min(dt, 0.1) * 0.22; });+ const glow = useMemo(() => new MeshBasicMaterial({+ map: glowTexture(), color: C.gold, transparent: true, opacity: 0.35, blending: AdditiveBlending, depthWrite: false,+ }), []);+ useEffect(() => () => glow.dispose(), [glow]);+ return (+ <group>+ {/* Flat on purpose: figures stand at y 0 and auras glow at 0.018 m, so nothing here rises above ~0.015 m. */}+ <mesh geometry={GEO.disc} material={HM.midnight} position={[0, 0.004, 0]} scale={[STAGE_R, 0.008, STAGE_R]} receiveShadow />+ <mesh geometry={GEO.disc} material={HM.brass} position={[0, 0.009, 0]} scale={[STAGE_R * 0.98, 0.002, STAGE_R * 0.98]} />+ <mesh geometry={GEO.disc} material={HM.navy} position={[0, 0.011, 0]} scale={[STAGE_R * 0.9, 0.002, STAGE_R * 0.9]} receiveShadow />+ <mesh geometry={GEO.ring} material={HM.gold} position={[0, 0.013, 0]} rotation={[Math.PI / 2, 0, 0]} scale={[STAGE_R * 0.95, STAGE_R * 0.95, 0.5]} />+ <mesh geometry={GEO.ring} material={HM.brass} position={[0, 0.012, 0]} rotation={[Math.PI / 2, 0, 0]} scale={[STAGE_R * 0.55, STAGE_R * 0.55, 0.4]} />+ <mesh material={glow} position={[0, 0.014, 0]} rotation={[-Math.PI / 2, 0, 0]}>+ <circleGeometry args={[STAGE_R * 0.75, 40]} />+ </mesh>+ <group ref={marks} position={[0, 0.013, 0]}>+ {Array.from({ length: 16 }, (_, i) => {+ const a = (i / 16) * Math.PI * 2, r = STAGE_R * 0.74;+ return <Box key={i} size={[0.14, 0.008, 0.035]} position={[Math.cos(a) * r, 0, Math.sin(a) * r]} material={i % 4 === 0 ? HM.gold : HM.cyan} cast={false} />;+ })}+ </group>+ </group>+ );+}++// ---------------------------------------------------------------------------+// Reward pedestals and their holograms+// ---------------------------------------------------------------------------++/** A reward as a small model, about 0.36 m across: lit in its own colours, or a dark silhouette while locked. */+function RewardMini({ reward, open }: { reward: RewardId; open: boolean }) {+ const slot = slotOf(reward);+ const [a, b] = rewardColours(reward);+ const effect = slot === "frame" ? [a, b] : EFFECT_COLOURS[reward as keyof typeof EFFECT_COLOURS];+ const m = (colour: string) => (open ? lit(colour) : HM.locked);+ if (slot === "frame") {+ return (+ <group rotation={[Math.PI / 2, 0, 0]}>+ <mesh geometry={GEO.hex} material={m(a)} scale={[0.17, 0.05, 0.17]} />+ <mesh geometry={GEO.hex} material={m(b)} position={[0, 0.03, 0]} scale={[0.12, 0.02, 0.12]} />+ <mesh geometry={GEO.hex} material={m(b)} position={[0, -0.03, 0]} scale={[0.12, 0.02, 0.12]} />+ </group>+ );+ }+ if (slot === "trail") {+ // A rising spiral of beads, each in the trail's colours.+ return (+ <group>+ {Array.from({ length: 7 }, (_, i) => {+ const angle = i * 0.95, r = 0.05 + i * 0.018;+ return <mesh key={i} geometry={GEO.ball} material={m(effect[i % effect.length])}+ position={[Math.cos(angle) * r, -0.15 + i * 0.05, Math.sin(angle) * r]} scale={0.022 + i * 0.006} />;+ })}+ </group>+ );+ }+ if (slot === "aura") {+ return (+ <group position={[0, -0.1, 0]}>+ <mesh geometry={GEO.ring} material={m(effect[0])} rotation={[Math.PI / 2, 0, 0]} scale={[0.17, 0.17, 2.4]} />+ <mesh geometry={GEO.ring} material={m(effect[effect.length - 1])} rotation={[Math.PI / 2, 0, 0]} position={[0, 0.03, 0]} scale={[0.11, 0.11, 2]} />+ <mesh geometry={GEO.disc} material={m(effect[0])} scale={[0.07, 0.012, 0.07]} />+ </group>+ );+ }+ if (reward === "gadget_halo") {+ return <mesh geometry={GEO.ring} material={m(effect[0])} rotation={[Math.PI / 2.4, 0, 0]} scale={[0.14, 0.14, 3]} />;+ }+ if (reward === "gadget_crown") {+ return (+ <group position={[0, -0.06, 0]}>+ <mesh geometry={GEO.disc} material={m(effect[0])} position={[0, 0.04, 0]} scale={[0.13, 0.08, 0.13]} />+ {[0, 1, 2, 3, 4].map((i) => {+ const ang = (i / 5) * Math.PI * 2;+ return <mesh key={i} geometry={GEO.cone} material={m(effect[0])} position={[Math.sin(ang) * 0.11, 0.12, Math.cos(ang) * 0.11]} scale={[0.028, 0.08, 0.028]} />;+ })}+ <mesh geometry={GEO.ball} material={m(effect[1] ?? effect[0])} position={[0, 0.05, 0.13]} scale={0.022} />+ </group>+ );+ }+ if (reward === "gadget_wings") {+ // Two fans of long feathers.+ return (+ <group>+ {[-1, 1].map((side) => (+ <group key={side} scale={[side, 1, 1]}>+ {[0, 1, 2, 3].map((i) => (+ <mesh key={i} geometry={GEO.ball} material={m(i % 2 === 0 ? effect[0] : effect[1] ?? effect[0])}+ position={[0.06 + i * 0.035, 0.02 + i * 0.02, 0]} rotation={[0, 0, -0.5 + i * 0.35]} scale={[0.11, 0.022, 0.012]} />+ ))}+ </group>+ ))}+ </group>+ );+ }+ // The helper drone: a body, four rotors and a lens.+ return (+ <group>+ <mesh geometry={GEO.disc} material={m(effect[0])} scale={[0.07, 0.035, 0.07]} />+ {[[-1, -1], [1, -1], [-1, 1], [1, 1]].map(([sx, sz]) => (+ <group key={`${sx}${sz}`} position={[sx * 0.09, 0.02, sz * 0.09]}>+ <Box size={[0.012, 0.012, 0.012]} position={[-sx * 0.04, 0, -sz * 0.04]} material={m(effect[0])} cast={false} />+ <mesh geometry={GEO.rotor} material={m(effect[1] ?? effect[0])} scale={[0.04, 0.006, 0.04]} />+ </group>+ ))}+ <mesh geometry={GEO.ball} material={m(effect[1] ?? effect[0])} position={[0, -0.02, 0.06]} scale={0.016} />+ </group>+ );+}++const PEDESTAL = { holoY: 1.32, caseY: 1.31, caseH: 0.62, caseW: 0.56 };++/** The level plate on a pedestal's front: the unlock level, the reward's name, a padlock while locked. */+function plateMaterial(at: number, name: string, open: boolean, next: boolean, levelWord: string): MeshStandardMaterial {+ const key = `level-plate:${at}:${name}:${open}:${next}:${levelWord}`;+ const draw = (ctx: Ctx, w: number, h: number) => {+ ctx.fillStyle = open ? "#1d2b52" : "#151b33";+ ctx.fillRect(0, 0, w, h);+ ctx.strokeStyle = next ? C.gold : open ? C.brass : "#4a5480";+ ctx.lineWidth = 8;+ ctx.strokeRect(4, 4, w - 8, h - 8);+ ctx.textAlign = "center";+ ctx.textBaseline = "middle";+ ctx.fillStyle = next ? C.gold : open ? "#ffe9b0" : "#9aa3c7";+ ctx.font = `800 54px ${FONT}`;+ ctx.fillText(`${levelWord} ${at}`.trim(), w / 2, 56);+ ctx.fillStyle = open ? "#ffffff" : "#aab2d4";+ ctx.font = `600 30px ${FONT}`;+ ctx.fillText(fitText(ctx, name, w - 40), w / 2, 120);+ if (!open) {+ // A small padlock in the corner.+ ctx.strokeStyle = "#9aa3c7";+ ctx.lineWidth = 5;+ ctx.beginPath(); ctx.arc(w - 40, 34, 11, Math.PI, 0); ctx.stroke();+ ctx.fillStyle = "#9aa3c7";+ ctx.fillRect(w - 56, 34, 32, 24);+ }+ };+ const map = cachedCanvasTexture(key, 384, 168, draw);+ redrawWhenFontsLoad(key, map, [`800 54px ${FONT}`, `600 30px ${FONT}`], draw);+ let material = plateCache.get(key);+ if (!material) {+ material = new MeshStandardMaterial({ color: map ? "#ffffff" : "#1d2b52", map, emissive: "#ffffff", emissiveMap: map, emissiveIntensity: map ? 0.55 : 0, roughness: 0.5 });+ plateCache.set(key, material);+ }+ return material;+}+const plateCache = new Map<string, MeshStandardMaterial>();++function RewardPedestal({ item }: { item: Furniture }) {+ const t = useT();+ const index = Number(item.id.slice("level-pedestal-".length));+ const rewards = useProgression((s) => s.snapshot?.rewards);+ const level = useProgression((s) => s.subjects[PERSON_SUBJECT]?.level ?? 1);+ const road = useMemo(() => (rewards ? rewardRoad(rewards, "person") : []), [rewards]);+ const reward = road[index];+ const at = reward?.levels.person ?? 0;+ const open = !!reward && level >= at;+ const next = !!reward && !!rewards && nextUnlock(rewards, "person", level)?.rewardId === reward.rewardId;+ const holo = useRef<Group>(null);+ const beam = useRef<Mesh>(null);+ useFrame((state, dt) => {+ const step = Math.min(dt, 0.1);+ if (holo.current) {+ holo.current.rotation.y += step * (open ? 0.9 : 0.3);+ holo.current.position.y = PEDESTAL.holoY + (open ? Math.sin(state.clock.elapsedTime * 1.6 + index) * 0.025 : 0);+ }+ if (beam.current) (beam.current.material as MeshBasicMaterial).opacity = 0.18 + 0.14 * Math.sin(state.clock.elapsedTime * 2.6);+ });+ const glow = useMemo(() => new MeshBasicMaterial({+ map: glowTexture(), color: next ? C.gold : open && reward ? rewardColours(reward.rewardId)[0] : "#6b78b0",+ transparent: true, opacity: open || next ? 0.55 : 0.2, blending: AdditiveBlending, depthWrite: false,+ }), [next, open, reward]);+ const beamMaterial = useMemo(() => new MeshBasicMaterial({+ color: C.gold, transparent: true, opacity: 0.25, blending: AdditiveBlending, depthWrite: false, side: DoubleSide,+ }), []);+ useEffect(() => () => { glow.dispose(); beamMaterial.dispose(); }, [glow, beamMaterial]);+ const onClick = (event: ThreeEvent<MouseEvent>) => {+ if (event.delta > 6 || !reward) return;+ event.stopPropagation();+ useProgression.getState().openPanel("rewards", { subject: "person", reward: reward.rewardId });+ };+ const hover = (on: boolean) => (event: ThreeEvent<PointerEvent>) => {+ if (!reward) return;+ event.stopPropagation();+ document.body.style.cursor = on ? "pointer" : "";+ };+ useEffect(() => () => { document.body.style.cursor = ""; }, []);+ const name = reward ? t(`society.level.reward.${reward.rewardId}`) : "";+ const levelWord = t("society.level.lv").replace("{0}", "").trim();+ return (+ <group onClick={onClick} onPointerOver={hover(true)} onPointerOut={hover(false)}>+ {/* Plinth: a brass-banded cream marble column on a midnight base. */}+ <Rounded size={[0.74, 0.12, 0.74]} radius={0.03} position={[0, 0.06, 0]} material={HM.midnight} />+ <Rounded size={[0.56, 0.82, 0.56]} radius={0.04} position={[0, 0.53, 0]} material={HM.marble} />+ <Box size={[0.585, 0.05, 0.585]} position={[0, 0.2, 0]} material={HM.brass} />+ <Box size={[0.585, 0.05, 0.585]} position={[0, 0.86, 0]} material={HM.brass} />+ <Rounded size={[0.68, 0.07, 0.68]} radius={0.02} position={[0, 0.975, 0]} material={HM.midnight} />+ {reward && (+ <mesh position={[0, 0.56, 0.282]} material={plateMaterial(at, name, open, next, levelWord)}>+ <planeGeometry args={[0.46, 0.2]} />+ </mesh>+ )}+ {/* The glass case, its brass cap and the light under the reward. */}+ <mesh position={[0, PEDESTAL.caseY, 0]} material={HM.glass} renderOrder={2}>+ <boxGeometry args={[PEDESTAL.caseW, PEDESTAL.caseH, PEDESTAL.caseW]} />+ </mesh>+ <Box size={[0.6, 0.04, 0.6]} position={[0, PEDESTAL.caseY + PEDESTAL.caseH / 2 + 0.02, 0]} material={HM.brass} />+ <mesh material={glow} position={[0, 1.02, 0]} rotation={[-Math.PI / 2, 0, 0]} renderOrder={1}>+ <circleGeometry args={[0.3, 24]} />+ </mesh>+ {reward && <group ref={holo} position={[0, PEDESTAL.holoY, 0]}><RewardMini reward={reward.rewardId} open={open} /></group>}+ {next && <mesh ref={beam} geometry={GEO.beam} material={beamMaterial} position={[0, 1.02 + 0.75, 0]} renderOrder={3} />}+ </group>+ );+}++// ---------------------------------------------------------------------------+// The Level Road and the level guide+// ---------------------------------------------------------------------------++function roadTexture(): Texture | null {+ return cachedCanvasTexture("level-road", 256, 512, (ctx, w, h) => {+ ctx.fillStyle = "#24336a";+ ctx.fillRect(0, 0, w, h);+ ctx.fillStyle = "rgba(255,255,255,0.04)";+ ctx.fillRect(w * 0.1, 0, w * 0.8, h);+ // Brass edges.+ ctx.fillStyle = "#d9b25c";+ ctx.fillRect(0, 0, 10, h);+ ctx.fillRect(w - 10, 0, 10, h);+ // Chevrons pointing up the levels (north).+ ctx.strokeStyle = "rgba(255,215,110,0.75)";+ ctx.lineWidth = 12;+ ctx.lineCap = "round";+ ctx.lineJoin = "round";+ for (const y of [140, 380]) {+ ctx.beginPath();+ ctx.moveTo(w * 0.28, y + 50);+ ctx.lineTo(w * 0.5, y);+ ctx.lineTo(w * 0.72, y + 50);+ ctx.stroke();+ }+ });+}++function LevelRoad({ w, d }: { w: number; d: number }) {+ const material = useMemo(() => {+ const base = roadTexture();+ const map = base ? base.clone() : null;+ if (map) {+ map.wrapS = RepeatWrapping;+ map.wrapT = RepeatWrapping;+ map.repeat.set(1, Math.max(1, Math.round(d / 2.2)));+ map.needsUpdate = true;+ }+ return new MeshStandardMaterial({+ color: map ? "#ffffff" : "#24336a", map, emissive: "#ffffff", emissiveMap: map, emissiveIntensity: map ? 0.35 : 0, roughness: 0.35,+ });+ }, [d]);+ useEffect(() => () => { material.map?.dispose(); material.dispose(); }, [material]);+ return (+ <mesh material={material} position={[0, 0.008, 0]} rotation={[-Math.PI / 2, 0, 0]} receiveShadow>+ <planeGeometry args={[w, d]} />+ </mesh>+ );+}++interface GuideLines { title: string; subtitle: string; rows: { xp: string; text: string }[]; footer: string }++function drawGuide(ctx: Ctx, w: number, h: number, lines: GuideLines): void {+ screenGround(ctx, w, h);+ ctx.textBaseline = "middle";+ ctx.fillStyle = C.gold;+ ctx.font = `800 64px ${FONT}`;+ ctx.fillText(fitText(ctx, lines.title, w - 100), 56, 74);+ ctx.fillStyle = "rgba(255,255,255,0.72)";+ ctx.font = `500 32px ${FONT}`;+ ctx.fillText(fitText(ctx, lines.subtitle, w - 100), 56, 128);+ const rowH = 70;+ lines.rows.forEach((row, i) => {+ const y = 200 + i * rowH;+ ctx.fillStyle = "rgba(255,255,255,0.06)";+ ctx.beginPath(); ctx.roundRect(48, y - rowH / 2 + 6, w - 96, rowH - 12, 14); ctx.fill();+ ctx.fillStyle = "#ffd76e";+ ctx.font = `800 36px ${FONT}`;+ ctx.fillText(row.xp, 72, y);+ ctx.fillStyle = "#ffffff";+ ctx.font = `500 34px ${FONT}`;+ ctx.fillText(fitText(ctx, row.text, w - 330), 230, y);+ });+ ctx.fillStyle = "rgba(143,227,255,0.85)";+ ctx.font = `600 30px ${FONT}`;+ ctx.fillText(fitText(ctx, lines.footer, w - 100), 56, h - 46);+}++const GUIDE = { w: FURNITURE_SIZE.levelGuide.w, h: FURNITURE_SIZE.levelGuide.h, screenW: 3.08, screenH: 1.7, screenY: 1.5 };+/** The guide lists the person's best-paying rules, at most this many. */+const GUIDE_ROWS = 6;+const NO_RULES: XpRuleRow[] = [];++function LevelGuide() {+ const t = useT();+ const rules = useProgression((s) => s.snapshot?.rules ?? NO_RULES);+ const rows = useMemo(() => rules.filter((r) => r.kind === "person").sort((a, b) => b.xp - a.xp).slice(0, GUIDE_ROWS)+ .map((r) => ({ xp: `+${r.xp} XP`, text: t(`society.level.source.${r.source}`) })), [rules, t]);+ const lines: GuideLines = {+ title: t("society.hall.guide_title"), subtitle: t("society.hall.guide_subtitle"), rows, footer: t("society.hall.guide_footer"),+ };+ const face = useLiveTexture(1280, 704, JSON.stringify(lines), (ctx, w, h) => drawGuide(ctx, w, h, lines));+ const screen = face+ ? <meshStandardMaterial map={face} emissiveMap={face} emissive="#ffffff" emissiveIntensity={0.85} roughness={0.4} />+ : <meshStandardMaterial color={C.ink} roughness={0.3} />;+ return (+ <group>+ {[-1, 1].map((side) => (+ <group key={side} position={[side * (GUIDE.w / 2 - 0.1), 0, 0]}>+ <Box size={[0.1, GUIDE.h - 0.05, 0.12]} position={[0, (GUIDE.h - 0.05) / 2, 0]} material={HM.brass} />+ <Rounded size={[0.2, 0.06, 0.34]} radius={0.02} position={[0, 0.03, 0]} material={HM.midnight} />+ </group>+ ))}+ <Rounded size={[GUIDE.screenW + 0.18, GUIDE.screenH + 0.18, 0.16]} radius={0.04} position={[0, GUIDE.screenY, 0]} material={HM.midnight} />+ <Box size={[GUIDE.screenW + 0.18, 0.03, 0.17]} position={[0, GUIDE.screenY + GUIDE.screenH / 2 + 0.105, 0]} material={HM.gold} cast={false} />+ {/* The same screen on both faces. */}+ <mesh position={[0, GUIDE.screenY, 0.085]}><planeGeometry args={[GUIDE.screenW, GUIDE.screenH]} />{screen}</mesh>+ <mesh position={[0, GUIDE.screenY, -0.085]} rotation={[0, Math.PI, 0]}><planeGeometry args={[GUIDE.screenW, GUIDE.screenH]} />{screen}</mesh>+ </group>+ );+}++/** Renderers of the Level Hall's furniture kinds; merged into OfficeProps' exhaustive table. */+export const LEVEL_HALL_RENDERERS = {+ levelWall: () => <LevelWall />,+ studioStage: () => <StudioStage />,+ rewardPedestal: ({ item }: { item: Furniture }) => <RewardPedestal item={item} />,+ levelRoad: ({ item }: { item: Furniture }) => {+ const size = item.size ?? FURNITURE_SIZE.levelRoad;+ return <LevelRoad w={size.w} d={size.d} />;+ },+ levelGuide: () => <LevelGuide />,+} satisfies Partial<Record<FurnitureKind, (props: { item: Furniture }) => JSX.Element>>;++/**+ * What hangs over the hall rather than stands in it: a brass ring lamp over+ * the stage with a soft shaft of light down to it, and warm lights over the+ * stage and the guide.+ */+export const LevelHallFittings = memo(function LevelHallFittings({ stage, guide }: { stage: Pick<Furniture, "x" | "z">; guide: Pick<Furniture, "x" | "z"> | null }) {+ const shaft = useMemo(() => new MeshBasicMaterial({+ color: "#ffe2a0", transparent: true, opacity: 0.09, blending: AdditiveBlending, depthWrite: false, side: DoubleSide,+ }), []);+ useEffect(() => () => shaft.dispose(), [shaft]);+ const at: Vec3 = [stage.x, 0, stage.z];+ return (+ <>+ <group position={at}>+ <mesh geometry={GEO.ring} material={HM.brass} position={[0, 3.05, 0]} rotation={[Math.PI / 2, 0, 0]} scale={[1.05, 1.05, 3]} />+ <mesh geometry={GEO.ring} material={HM.gold} position={[0, 3.0, 0]} rotation={[Math.PI / 2, 0, 0]} scale={[0.95, 0.95, 2]} />+ <mesh geometry={GEO.shaft} material={shaft} position={[0, 1.5, 0]} renderOrder={1} />+ <pointLight position={[0, 2.6, 0.4]} color="#ffdca0" intensity={6} distance={7} decay={2} />+ </group>+ {guide && <pointLight position={[guide.x, 2.8, guide.z - 1.4]} color="#cfe3ff" intensity={3.5} distance={6} decay={2} />}+ </>+ );+});diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeFullMap.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeFullMap.tsxindex 27dc6e49be..54f1c064af 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeFullMap.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeFullMap.tsx@@ -114,6 +114,8 @@ function FullMapDialog({ onClose, layout, agents, selectedId }: Omit<OfficeFullMbreak: t("society.office.cp_break"),elevator: t("society.office.cp_elevator"),mission: t("society.office.cp_mission"),+ studio: t("society.office.cp_studio"),+ levels: t("society.office.cp_levels"),};const roomLabels: Record<RoomKind, string> = {lead: t("society.office.room_lead"),@@ -130,6 +132,7 @@ function FullMapDialog({ onClose, layout, agents, selectedId }: Omit<OfficeFullMfoyer: t("society.office.room_foyer"),prizes: t("society.office.room_prizes"),snack: t("society.office.room_snack"),+ levels: t("society.office.room_levels"),};const openSpace = t("society.office.open_space");const youLabel = t("society.office.minimap_you");diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeMinimap.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeMinimap.tsxindex e60c6e4245..b31e70d30c 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeMinimap.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeMinimap.tsx@@ -221,6 +221,8 @@ export function OfficeMinimap({ layout, agents, selectedId, onOpenMap }: OfficeMbreak: t("society.office.cp_break"),elevator: t("society.office.cp_elevator"),mission: t("society.office.cp_mission"),+ studio: t("society.office.cp_studio"),+ levels: t("society.office.cp_levels"),};const roomLabels: Record<RoomKind, string> = {lead: t("society.office.room_lead"),@@ -237,6 +239,7 @@ export function OfficeMinimap({ layout, agents, selectedId, onOpenMap }: OfficeMfoyer: t("society.office.room_foyer"),prizes: t("society.office.room_prizes"),snack: t("society.office.room_snack"),+ levels: t("society.office.room_levels"),};const youLabel = t("society.office.minimap_you");const openSpace = t("society.office.open_space");diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeProps.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeProps.tsxindex f85f546376..a99271cef5 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeProps.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeProps.tsx@@ -19,6 +19,7 @@ import { BREAK_RENDERERS } from "./BreakLounge";import { WARDROBE_RENDERERS } from "./WardrobeRoom";import { LOBBY_RENDERERS } from "./LobbyDecor";import { SPAWN_RENDERERS } from "./SpawnPoint";+import { LEVEL_HALL_RENDERERS } from "./LevelHall";import { ARCADE_RENDERERS } from "../arcade/ArcadeHallProps";import { MeetingChair } from "./OfficeChairs";import { Bookshelf, Box, Couch, GEO, MAT, matte, Plant, Rounded, Rug } from "./OfficeFurniture";@@ -565,6 +566,7 @@ export const PROP_RENDERERS: Record<FurnitureKind, (props: { item: Furniture })...WARDROBE_RENDERERS,...LOBBY_RENDERERS,...SPAWN_RENDERERS,+ ...LEVEL_HALL_RENDERERS,...ARCADE_RENDERERS,};diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeRooms.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeRooms.tsxindex 6624f68b60..7a6c252ed3 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeRooms.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeRooms.tsx@@ -26,7 +26,7 @@ function lcg(seed: number): () => number {/** Metres covered by one repeat of each floor pattern. */const PATTERN_METRES: Record<RoomKind, number> = { lead: 2.6, team: 2, wardrobe: 2, reception: 3.2, break: 2.4, command: 3.2, server: 2,- arcade: 2.4, classics: 2, puzzle: 2, action: 2, foyer: 2.4, prizes: 2, snack: 1.6 };+ arcade: 2.4, classics: 2, puzzle: 2, action: 2, foyer: 2.4, prizes: 2, snack: 1.6, levels: 3.2 };function drawFloor(kind: RoomKind, ctx: CanvasRenderingContext2D, w: number, h: number): void {const { base, accents } = ROOM_FLOOR_COLOURS[kind];@@ -75,6 +75,42 @@ function drawFloor(kind: RoomKind, ctx: CanvasRenderingContext2D, w: number, h:const s = 2 + rand() * 4;ctx.fillRect(Math.floor(rand() * w), Math.floor(rand() * h), s, s * (0.6 + rand() * 0.6));}+ } else if (kind === "levels") {+ // Level Hall: large polished slabs of midnight stone, soft lighter clouds and a thin gold vein through each.+ const [a, b, c, gold] = [0, 1, 2, 3].map((i) => accents[i] ?? base);+ const tiles = 2, size = w / tiles;+ for (let ty = 0; ty < tiles; ty += 1) {+ for (let tx = 0; tx < tiles; tx += 1) {+ ctx.fillStyle = [a, b, c][(tx + ty * 2) % 3];+ ctx.fillRect(tx * size, ty * size, size, size);+ for (let i = 0; i < 40; i += 1) {+ ctx.globalAlpha = 0.08 + rand() * 0.1;+ ctx.fillStyle = "#4a5a96";+ ctx.beginPath();+ ctx.ellipse(tx * size + rand() * size, ty * size + rand() * size, 8 + rand() * 26, 5 + rand() * 12, rand() * Math.PI, 0, Math.PI * 2);+ ctx.fill();+ }+ ctx.globalAlpha = 0.55;+ ctx.strokeStyle = gold;+ ctx.lineWidth = 1.2;+ ctx.beginPath();+ let vx = tx * size, vy = ty * size + rand() * size;+ ctx.moveTo(vx, vy);+ while (vx < (tx + 1) * size) {+ vx += 10 + rand() * 18;+ vy += (rand() - 0.5) * 22;+ ctx.lineTo(Math.min(vx, (tx + 1) * size), Math.max(ty * size, Math.min((ty + 1) * size, vy)));+ }+ ctx.stroke();+ ctx.globalAlpha = 1;+ }+ }+ // Brass joints between the slabs.+ ctx.fillStyle = "rgba(217,178,92,0.55)";+ for (let i = 0; i < tiles; i += 1) {+ ctx.fillRect(i * size, 0, 2, h);+ ctx.fillRect(0, i * size, w, 2);+ }} else if (kind === "team") {// Carpet grain: fine speckles in the accent tones, plus a faint weave.for (let i = 0; i < 2600; i += 1) {diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsxindex 449c1e53cd..0f2fab200e 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx@@ -31,6 +31,7 @@ import { TeamBoardFace } from "./TeamBoardFace";import { TeamRoomFittings } from "./TeamRoomDecor";import { BreakLoungeFittings } from "./BreakLounge";import { WardrobeFittings } from "./WardrobeRoom";+import { LevelHallFittings } from "./LevelHall";import { LobbyFittings } from "./LobbyDecor";import { SpawnFittings } from "./SpawnPoint";import { RoomFloors, RoomSign, RoomWalls } from "./OfficeRooms";@@ -189,6 +190,8 @@ function OfficeFloorDressing({ floor, occupants, layout, agents, newcomers, awakconst wardrobeRug = layout.furniture.find((f) => f.kind === "roundRug" && f.room === "wardrobe");const lobbyLamp = layout.furniture.find((f) => f.kind === "lobbyLamp");const spawnTerminal = layout.furniture.find((f) => f.kind === "spawnTerminal");+ const levelStage = layout.furniture.find((f) => f.kind === "studioStage");+ const levelGuide = layout.furniture.find((f) => f.kind === "levelGuide") ?? null;return (<><primitive attach="background" object={background} />@@ -226,6 +229,7 @@ function OfficeFloorDressing({ floor, occupants, layout, agents, newcomers, awak{teamRoom && table && <TeamRoomFittings room={teamRoom} table={table} />}{breakRoom && <BreakLoungeFittings room={breakRoom} furniture={layout.furniture} />}{wardrobeRug && <WardrobeFittings rug={wardrobeRug} />}+ {levelStage && <LevelHallFittings stage={levelStage} guide={levelGuide} />}{lobbyLamp && <LobbyFittings lamp={lobbyLamp} />}{spawnTerminal && <SpawnFittings terminal={spawnTerminal} arrival={layout.arrival} floor={floor} newcomers={newcomers} animate={awake && !reduced} />}</>diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsxindex 02deefb806..cfb1fd08ec 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx@@ -57,7 +57,7 @@ import { useProgressionSync } from "../progression/useProgressionSync";import { useProgression } from "../progression/progressionStore";import { LevelHud, LevelToasts } from "../progression/LevelHud";import { LevelUpBanner } from "../progression/LevelUpBanner";-import { LevelPanel } from "../progression/LevelPanel";+import { LevelHallScreen } from "../progression/hall/LevelHallScreen";import "../progression/progression.css";// Only loaded when a host without its own create dialog (the IDE's side panel) spawns an agent.@@ -348,7 +348,14 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenreturn () => window.removeEventListener("keydown", onKey);}, [toggleGuide]);- // L (or the level card) opens the progress panel, and closes it again.+ // The Level Hall's two checkpoints open its screen: the stage on the studio, the guide on the overview.+ useEffect(() => {+ if (selection?.kind !== "checkpoint" || (selection.id !== "studio" && selection.id !== "levels")) return;+ useProgression.getState().openPanel(selection.id === "studio" ? "studio" : "overview");+ select(null);+ }, [selection, select]);++ // L (or the level card) opens the Level Hall screen, and closes it again.useEffect(() => {const onKey = (event: KeyboardEvent) => {if (event.code !== "KeyL" || event.repeat || event.ctrlKey || event.metaKey || event.altKey) return;@@ -356,12 +363,12 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenif (ownsKeyboard(event.target) && !levels.panel) return;if (useOfficeStore.getState().selection?.kind === "arcade") return;event.preventDefault();- levels.openPanel(levels.panel ? null : "you");+ levels.openPanel(levels.panel ? null : "overview");};window.addEventListener("keydown", onKey);return () => window.removeEventListener("keydown", onKey);}, []);- // The progress panel closes with the map.+ // The Level Hall screen closes with the map.useEffect(() => () => useProgression.getState().openPanel(null), []);// Leaving the map forgets panels and calls; the office opens fresh next time.@@ -395,6 +402,7 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenconst playsAsteroids = selection?.kind === "arcade" && (!playing || playing.kind === "asteroid3d");const titleKey = arcade ? "society.office.arcade_floor_title" : coding ? "society.office.coding_title" : "society.office.title";const playerName = profile.name.trim() || t("society.office.you");+ const playerToyLook = useMemo(() => playerLook(profile), [profile]);const agentNames = useMemo(() => new Map(jarvisAgents.map((a) => [a.agentId, a.name])), [jarvisAgents]);const showHintBar = useOfficeSettings((s) => s.showHintBar);const receptionOpen = selection?.kind === "checkpoint" && selection.id === "create";@@ -417,7 +425,7 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenonPointerMissed={() => select(null)}><OfficeFrameDriver enabled={awake && compact} /><OfficeScene floor={floor} occupants={occupants} ready={ready} layout={layout} grid={grid} walkers={walkers} agents={agents} newcomers={newcomers}- awake={awake} reduced={reduced} overview={overview} player={{ look: playerLook(profile), name: playerName }}+ awake={awake} reduced={reduced} overview={overview} player={{ look: playerToyLook, name: playerName }}selection={selection} nearby={nearby} chats={chats} onOpenScreen={openScreen}elevatorCall={{ lit: picking || !!ride, picking, onPress: pressCall }} /></Canvas>@@ -450,7 +458,7 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen<button type="button" className="office-button" aria-pressed={follow} onClick={() => useOfficeStore.getState().setFollow(true)}>{t("society.office.me")}</button><button type="button" className="office-button" onClick={() => setOverview((v) => v + 1)}>{t("society.office.overview")}</button><button type="button" className="office-button" onClick={() => select({ kind: "checkpoint", id: "wardrobe" })}>{t("society.office.cp_wardrobe")}</button>- <button type="button" className="office-button" aria-keyshortcuts="L" onClick={() => useProgression.getState().openPanel("you")}>+ <button type="button" className="office-button" aria-keyshortcuts="L" onClick={() => useProgression.getState().openPanel("overview")}>{t("society.level.hud_button")}</button><button type="button" className="office-button" aria-pressed={receptionOpen} aria-keyshortcuts="H"@@ -478,7 +486,8 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen{selection && selection.kind !== "arcade" && !(selection.kind === "agent" && selectedPane) && (<div className="office-panel-slot" data-wide={receptionOpen || widePanel || undefined}>{selection.kind === "agent" && selectedAgent && <AgentPanel agent={selectedAgent} actions={actions} onClose={() => select(null)} />}- {selection.kind === "checkpoint" && (+ {/* The Level Hall's checkpoints open their own screen (the effect above), never a side panel. */}+ {selection.kind === "checkpoint" && selection.id !== "studio" && selection.id !== "levels" && (<CheckpointPanel id={selection.id} floor={floor} agents={active} layout={layout} sample={!coding && (roster.data?.sample ?? false)}profile={profile} onProfile={updateProfile} actions={actions} onClose={() => select(null)} />)}@@ -500,7 +509,7 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenlayout={layout} agents={agents} selectedId={selection?.kind === "agent" ? selection.id : null} />{!compact && showHintBar && <p className="office-hud office-help" data-office-ui>{t("society.office.help")}</p>}<LevelToasts names={agentNames} />- <LevelPanel agents={jarvisAgents} playerName={playerName} petName={petName} />+ <LevelHallScreen agents={jarvisAgents} playerName={playerName} petName={petName} playerLook={playerToyLook} /><LevelUpBanner playerName={playerName} petName={petName} />{creating && (<Suspense fallback={null}>diff --git a/jarvis/ui/web/frontend/src/components/society/office/agentsAmbience.ts b/jarvis/ui/web/frontend/src/components/society/office/agentsAmbience.tsindex bf0341b79d..4a5d9c8fd5 100644--- a/jarvis/ui/web/frontend/src/components/society/office/agentsAmbience.ts+++ b/jarvis/ui/web/frontend/src/components/society/office/agentsAmbience.ts@@ -8,7 +8,8 @@* Pure and shared: the layout adds every item to its obstacles, the renderer* builds each piece inside the same box. Everything stands in the 1.6 m* window strip between the departments and the railing, so no desk, room door- * or checkpoint loses its way in.+ * or checkpoint loses its way in. Where the Level Hall stands beyond the east+ * window, the east olives stay away: the hall's doors open onto those aisles.*/import type { Rect } from "./officeLayout";@@ -65,8 +66,11 @@ export function agentsAmbience({ departments, rooms }: AgentsAmbienceFrame): Ageaisles.push((above + rowStarts[i]) / 2);}if (south.length > 0) aisles.push((lastZ + Math.min(...south)) / 2);+ // A wing beyond the east window (the Level Hall) opens its doors onto the cross aisles: no olive may close them.+ const eastWing = rooms.some((r) => r.minX >= colMaxX - 1e-6 && r.minZ < lastZ && r.maxZ > firstZ);aisles.forEach((z, i) => {for (const [side, x] of [["west", colMinX - OLIVE_OUT], ["east", colMaxX + OLIVE_OUT]] as const) {+ if (side === "east" && eastWing) continue;items.push({id: `olive-${side}-${i}`, kind: "olive", facing: side === "west" ? "east" : "west", h: OLIVE_H,minX: x - OLIVE_BOX / 2, maxX: x + OLIVE_BOX / 2, minZ: z - OLIVE_BOX / 2, maxZ: z + OLIVE_BOX / 2,diff --git a/jarvis/ui/web/frontend/src/components/society/office/minimap.ts b/jarvis/ui/web/frontend/src/components/society/office/minimap.tsindex 616be162ca..4b26d1fee9 100644--- a/jarvis/ui/web/frontend/src/components/society/office/minimap.ts+++ b/jarvis/ui/web/frontend/src/components/society/office/minimap.ts@@ -326,6 +326,7 @@ const FURNITURE_PAINT: Partial<Record<FurnitureKind, string>> = {spawnPad: "#d8c08c", spawnTerminal: "#2b2f33",retroCabinet: "#7c5cff", prizeCounter: "#d6457f", tokenMachine: "#e0b23a", clawMachine: "#ff5fa2", airHockey: "#3d8bff",pinball: "#9b5cff", snackCounter: "#c47a3a",+ levelWall: "#1d2b52", studioStage: "#e9c46a", rewardPedestal: "#f0e6cf", levelRoad: "#3a4f8f", levelGuide: "#1d2b52",};export const STATE_RING: Record<MinimapAgentState, string> = {@@ -333,8 +334,9 @@ export const STATE_RING: Record<MinimapAgentState, string> = {};/** Checkpoint icon per checkpoint kind; the same pictures as the 3D tokens (CheckpointMarker). */-export const CHECKPOINT_ICON_KEYS: Record<CheckpointKind, "spawn" | "plus" | "list" | "team" | "shirt" | "star" | "coffee" | "elevator" | "target"> = {+export const CHECKPOINT_ICON_KEYS: Record<CheckpointKind, "spawn" | "plus" | "list" | "team" | "shirt" | "star" | "coffee" | "elevator" | "target" | "sparkle" | "trophy"> = {spawn: "spawn", launch: "spawn", create: "plus", manage: "list", team: "team", wardrobe: "shirt", lead: "star", break: "coffee", elevator: "elevator", mission: "target",+ studio: "sparkle", levels: "trophy",};/** Stroke-only icons in a 24 × 24 box; kept in sync with CheckpointMarker's paths. */@@ -348,6 +350,8 @@ const ICON_PATHS: Record<(typeof CHECKPOINT_ICON_KEYS)[CheckpointKind], string>coffee: "M4 9h12v5a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5V9zM16 10h1.5a2.5 2.5 0 0 1 0 5H16M8 3.5c0 1 1 1 1 2M12 3.5c0 1 1 1 1 2",elevator: "M5 3h14v18H5zM9 10l3-3 3 3M9 14l3 3 3-3",target: "M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18zM12 8a4 4 0 1 1 0 8a4 4 0 1 1 0-8zM12 1v4M12 19v4M1 12h4M19 12h4",+ sparkle: "M10 3l1.6 5.4L17 10l-5.4 1.6L10 17l-1.6-5.4L3 10l5.4-1.6zM18 14l.8 2.2L21 17l-2.2.8L18 20l-.8-2.2L15 17l2.2-.8z",+ trophy: "M7 4h10v5a5 5 0 0 1-10 0V4zM7 6H4.5a2.5 2.5 0 0 0 2.6 3.6M17 6h2.5a2.5 2.5 0 0 1-2.6 3.6M12 14v3M8 20h8M9.5 17h5",};// ------------------------------------------------------------------ drawingdiff --git a/jarvis/ui/web/frontend/src/components/society/office/officeLayout.test.ts b/jarvis/ui/web/frontend/src/components/society/office/officeLayout.test.tsindex 941e6201b0..8f5a924e8f 100644--- a/jarvis/ui/web/frontend/src/components/society/office/officeLayout.test.ts+++ b/jarvis/ui/web/frontend/src/components/society/office/officeLayout.test.ts@@ -1,9 +1,10 @@import { describe, expect, it } from "vitest";import {allDesks, archPosts, buildOfficeLayout, countStates, departmentKey, FURNITURE_SIZE, footprint, groupDepartments,- MAX_DEPARTMENTS, MIN_DEPARTMENTS, COMMAND_DESK, COMMAND_REACH, SPAWN, type OfficeAgentInput,+ MAX_DEPARTMENTS, MIN_DEPARTMENTS, COMMAND_DESK, COMMAND_REACH, LEVEL_HALL, SPAWN, type OfficeAgentInput,} from "./officeLayout";-import { buildNavGrid, isWalkable } from "./officeNav";+import { buildNavGrid, findPath, isWalkable } from "./officeNav";+import { REWARD_IDS } from "../progression/levelCatalog";import { cameraHome, fitDistance, focusBounds } from "./officeCamera";const agent = (id: string, provider: string, extra: Partial<OfficeAgentInput> = {}): OfficeAgentInput => ({@@ -113,8 +114,50 @@ describe("office layout", () => {const plain = buildOfficeLayout(roster);expect(plain).toEqual(buildOfficeLayout(roster, { variant: "agents" }));expect(plain.variant).toBe("agents");- expect(plain.rooms.map((r) => r.kind)).toEqual(["lead", "team", "wardrobe", "reception", "break"]);- expect(plain.checkpoints.map((c) => c.id)).toEqual(["spawn", "create", "manage", "team", "wardrobe", "lead", "break", "elevator"]);+ expect(plain.rooms.map((r) => r.kind)).toEqual(["lead", "team", "wardrobe", "reception", "break", "levels"]);+ expect(plain.checkpoints.map((c) => c.id)).toEqual(["spawn", "create", "manage", "team", "wardrobe", "lead", "studio", "levels", "break", "elevator"]);+ });++ it.each([0, 12, 40])("builds the Level Hall as the agents floor's east wing (%i agents)", (count) => {+ const roster = Array.from({ length: count }, (_, i) => agent(`a${i}`, `P${i % 6}`));+ const layout = buildOfficeLayout(roster);+ const hall = layout.rooms.find((r) => r.kind === "levels")!;+ const office = Math.max(...layout.rooms.filter((r) => r.kind !== "levels").map((r) => r.maxX));+ // One aisle east of the office, across the floor's whole depth, walled with its doors facing the office.+ expect(hall.walled).toBe(true);+ expect(hall.minX - office).toBeCloseTo(LEVEL_HALL.aisle, 9);+ expect(hall.maxX - hall.minX).toBeCloseTo(LEVEL_HALL.width, 9);+ expect(hall.minZ).toBe(Math.min(...layout.rooms.map((r) => r.minZ)));+ expect(hall.maxZ).toBe(Math.max(...layout.rooms.map((r) => r.maxZ)));+ expect(hall.doors.every((d) => d.side === "west")).toBe(true);+ const spawn = layout.checkpoints.find((c) => c.id === "spawn")!;+ expect(hall.doors[0].at).toBe(spawn.z);+ // A pedestal per reward on either side of the road, inside the hall, rising towards the stage.+ const pedestals = layout.furniture.filter((f) => f.kind === "rewardPedestal");+ expect(pedestals.map((p) => p.id)).toEqual(REWARD_IDS.map((_, n) => `level-pedestal-${n}`));+ const cx = (hall.minX + hall.maxX) / 2;+ pedestals.forEach((p, n) => {+ const box = footprint(p);+ expect(box.minX > hall.minX && box.maxX < hall.maxX && box.minZ > hall.minZ && box.maxZ < hall.maxZ, p.id).toBe(true);+ expect(Math.sign(p.x - cx)).toBe(n % 2 === 0 ? -1 : 1);+ if (n >= 2) expect(p.z).toBeLessThan(pedestals[n - 2].z);+ });+ const stage = layout.furniture.find((f) => f.kind === "studioStage")!;+ const studio = layout.checkpoints.find((c) => c.id === "studio")!;+ expect([studio.x, studio.z]).toEqual([stage.x, stage.z]);+ expect(stage.z).toBeLessThan(Math.min(...pedestals.map((p) => p.z)));+ // Both checkpoints are reachable on foot from the spawn point, through each of the hall's doors.+ const grid = buildNavGrid(layout);+ const levels = layout.checkpoints.find((c) => c.id === "levels")!;+ for (const target of [studio.approach!, { x: levels.x, z: levels.z }]) {+ expect(isWalkable(grid, target)).toBe(true);+ expect(findPath(grid, layout.arrival, target)).not.toBeNull();+ }+ for (const door of hall.doors) {+ // The aisle in front of every door stays open: no olive tree closes it.+ expect(isWalkable(grid, { x: office + LEVEL_HALL.aisle / 2, z: door.at }), `door at ${door.at}`).toBe(true);+ expect(isWalkable(grid, { x: hall.minX + 0.6, z: door.at }), `inside door at ${door.at}`).toBe(true);+ }});it("builds the coding floor: workspaces as departments, Mission Control and server room, no lead desks", () => {@@ -128,9 +171,12 @@ describe("office layout", () => {expect(layout.furniture.some((f) => f.room === "lead" || f.room === "wardrobe")).toBe(false);expect(layout.spots.some((s) => s.room === "command")).toBe(true);expect(layout.spots.some((s) => s.room === "server")).toBe(true);- // Both floors share one footprint, and the elevator stands at the same spot on each.+ // Both floors share the office's footprint (the agents floor adds the Level Hall as an east wing),+ // and the elevator stands at the same spot on each.const below = buildOfficeLayout(roster);- expect(layout.bounds).toEqual(below.bounds);+ expect(layout.rooms.some((r) => r.kind === "levels")).toBe(false);+ expect({ ...layout.bounds, maxX: 0 }).toEqual({ ...below.bounds, maxX: 0 });+ expect(below.bounds.maxX - layout.bounds.maxX).toBeCloseTo(LEVEL_HALL.aisle + LEVEL_HALL.width, 9);const lift = (l: typeof layout) => l.checkpoints.find((c) => c.id === "elevator")!;expect(lift(layout).z).toBe(lift(below).z);expect(lift(layout).x - layout.bounds.minX).toBeCloseTo(lift(below).x - below.bounds.minX);@@ -191,7 +237,8 @@ describe("office layout", () => {expect([terminal.x, terminal.z]).toEqual([stop.x, stop.z]);expect([pad.x, pad.z]).toEqual([stop.x, stop.z]);// On the centre line between the two department columns, in a cross aisle nearest the floor's middle.- expect(stop.x).toBeCloseTo((layout.bounds.minX + layout.bounds.maxX) / 2, 9);+ const columns = { minX: Math.min(...layout.departments.map((d) => d.minX)), maxX: Math.max(...layout.departments.map((d) => d.maxX)) };+ expect(stop.x).toBeCloseTo((columns.minX + columns.maxX) / 2, 9);const rowStarts = [...new Set(layout.departments.map((d) => d.minZ))].sort((p, q) => p - q);const crossings = rowStarts.slice(1).map((start, i) => {const above = Math.max(...layout.departments.filter((d) => d.minZ === rowStarts[i]).map((d) => d.maxZ));diff --git a/jarvis/ui/web/frontend/src/components/society/office/officeLayout.ts b/jarvis/ui/web/frontend/src/components/society/office/officeLayout.tsindex d233b8790d..0c41dbca8c 100644--- a/jarvis/ui/web/frontend/src/components/society/office/officeLayout.ts+++ b/jarvis/ui/web/frontend/src/components/society/office/officeLayout.ts@@ -7,9 +7,16 @@* +x east, +z south, origin at the floor centre. The camera looks from the* south-east, so tall rooms stand in the north and the lobby lies in front.*- * ┌──────────── north strip: Lead office · Team room · Wardrobe ───────────┐- * │ departments (open office, 2 columns) · spawn point in the middle │- * └──── south strip: Reception + lobby (Agent board) · Break room ─────────┘+ * ┌──────────── north strip: Lead office · Team room · Wardrobe ───────────┐ ┌───────┐+ * │ departments (open office, 2 columns) · spawn point in the middle │ │ Level │+ * └──── south strip: Reception + lobby (Agent board) · Break room ─────────┘ │ Hall │+ * └───────┘+ *+ * The agents floor adds the Level Hall as an east wing across the whole depth,+ * one aisle beyond the office: the Upgrade Studio's stage under the Level Wall+ * in the north, the Level Road lined with a pedestal per reward down the+ * middle, and the level guide at its start in the south. Its doors open onto+ * the north aisle, the spawn point's cross aisle and the south aisle.** The coding floor (variant "coding", one elevator ride up) keeps the same* frame: its departments are the Agentic IDE workspaces, and the north strip@@ -26,6 +33,7 @@* agents upstairs, and everyone new to the floor appears on its pad.*/import type { AgentRunState, AgentTier } from "../data";+import { REWARD_IDS } from "../progression/levelCatalog";import { agentsAmbience } from "./agentsAmbience";import { codingAmbience } from "./codingAmbience";@@ -70,7 +78,9 @@ export interface Department extends Rect {* ("arcade"), and the "foyer" with the elevator, the prize shop ("prizes") and the "snack" bar.*/export type RoomKind = "lead" | "team" | "wardrobe" | "reception" | "break" | "command" | "server"- | "arcade" | "classics" | "puzzle" | "action" | "foyer" | "prizes" | "snack";+ | "arcade" | "classics" | "puzzle" | "action" | "foyer" | "prizes" | "snack"+ // The agents floor's east wing: the Level Hall.+ | "levels";/** Which floor a layout draws: the society agents' office, the coding agents' floor above it, or the arcade floor on top. */export type OfficeVariant = "agents" | "coding" | "arcade";@@ -92,8 +102,10 @@ export interface WallSegment { x1: number; z1: number; x2: number; z2: number; r* "mission" is Mission Control on the coding floor.* "spawn" (agents floor) and "launch" (coding floor) are the spawn point in the floor's middle:* a new Jarvis agent downstairs, a new coding agent upstairs.+ * "studio" (the Upgrade Studio's stage) and "levels" (the level guide) are the Level Hall's.*/-export type CheckpointKind = "spawn" | "launch" | "create" | "manage" | "team" | "wardrobe" | "lead" | "break" | "elevator" | "mission";+export type CheckpointKind = "spawn" | "launch" | "create" | "manage" | "team" | "wardrobe" | "lead" | "break" | "elevator" | "mission"+ | "studio" | "levels";/** A place the person can walk to (or click from afar) to act. "floor" = the open office, outside every room. */export interface Checkpoint extends Point {@@ -136,7 +148,10 @@ export type FurnitureKind =| "spawnPad" | "spawnTerminal"// Arcade floor: the playable game cabinets (id `cabinet-<gameId>`, see arcade/arcadeGames.ts), the prize// counter, the token changer, a claw machine, an air-hockey table, a pinball machine and a snack-bar counter.- | "retroCabinet" | "prizeCounter" | "tokenMachine" | "clawMachine" | "airHockey" | "pinball" | "snackCounter";+ | "retroCabinet" | "prizeCounter" | "tokenMachine" | "clawMachine" | "airHockey" | "pinball" | "snackCounter"+ // Level Hall (agents floor): the Level Wall over the studio's stage, the round stage itself, a pedestal per reward+ // (id `level-pedestal-<n>`, lowest unlock first), the Level Road between them, the double-sided level guide.+ | "levelWall" | "studioStage" | "rewardPedestal" | "levelRoad" | "levelGuide";/*** Footprint (x-extent × z-extent before rotation) and height of each piece.@@ -233,6 +248,14 @@ export const FURNITURE_SIZE: Record<FurnitureKind, { w: number; d: number; h: nuairHockey: { w: 2.1, d: 1.2, h: 0.95, solid: true },pinball: { w: 0.75, d: 1.45, h: 1.9, solid: true },snackCounter: { w: 2.6, d: 0.8, h: 1.1, solid: true },+ // Level Hall. The wall carries the live level display; the stage is a flat round disc anyone can step on (its+ // ring of lights stays inside the box); a pedestal is a plinth with a glass case and the reward floating in it;+ // the road is a lit floor strip, sized per instance; the guide is a free-standing screen, the same on both faces.+ levelWall: { w: 6.6, d: 0.34, h: 3.1, solid: true },+ studioStage: { w: 3.2, d: 3.2, h: 0.02, solid: false },+ rewardPedestal: { w: 0.8, d: 0.8, h: 1.75, solid: true },+ levelRoad: { w: 1, d: 1, h: 0.02, solid: false },+ levelGuide: { w: 3.4, d: 0.36, h: 2.45, solid: true },};/**@@ -249,7 +272,7 @@ export interface Furniture extends Point {/** Rotation about +y. 0 = the prop's front faces +z (south, towards the camera). */rotationY: number;room: RoomKind | "floor";- /** Only rugs (plain, executive, team, lobby) and the entrance mat are sized per instance (w × d); everything else uses FURNITURE_SIZE. */+ /** Only rugs (plain, executive, team, lobby), the entrance mat and the Level Road are sized per instance (w × d); everything else uses FURNITURE_SIZE. */size?: { w: number; d: number };}@@ -303,6 +326,14 @@ const DEPT_MARGIN_X = 1.1;const DEPT_HEADER_Z = 1.8;const DEPT_FOOTER_Z = 0.8;const AISLE = 3.2;+/**+ * The Level Hall (agents floor only): the aisle between the office and the+ * hall, the hall's width, where the stage stands, and how far the Level Road+ * runs from each end of the hall.+ */+export const LEVEL_HALL = { aisle: AISLE, width: 9.2, stageZ: 4.5, stageR: 1.6, roadNorth: 8.2, roadSouth: 6.4, guideZ: 3.3 } as const;+/** The pedestals stand this far either side of the hall's centre line, the Level Road between them. */+export const PEDESTAL_OFFSET_X = 1.8;/*** Mission Control's desk, in its own space (origin = desk centre, +z = the* side where the chair stands): the desk top and the chair the person works@@ -591,7 +622,16 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:const receptionRoom: Room = { id: "reception", kind: "reception", walled: false, minX, maxX: maxX - breakW, minZ: southMinZ, maxZ: bottomZ, doors: [] };const breakRoom: Room = { id: "break", kind: "break", walled: true, minX: maxX - breakW, maxX, minZ: southMinZ, maxZ: bottomZ,doors: [{ side: "north", at: maxX - breakW / 2, width: 2.2 }, { side: "west", at: southMinZ + SOUTH_DEPTH / 2, width: 2 }] };- const rooms = [leadRoom, teamRoom, wardrobeRoom, receptionRoom, breakRoom];+ // The Level Hall: the agents floor's east wing, one aisle beyond the office, across the whole depth.+ const hallMinX = maxX + LEVEL_HALL.aisle;+ const levelRoom: Room | null = coding ? null : {+ id: "levels", kind: "levels", walled: true, minX: hallMinX, maxX: hallMinX + LEVEL_HALL.width, minZ: topZ, maxZ: bottomZ,+ // The spawn point's cross aisle leads to the main door (it carries the sign); the north and south aisles have one each.+ doors: [plazaZ, northMaxZ + AISLE / 2, southMinZ - AISLE / 2].map((at) => ({ side: "west" as const, at, width: 2 })),+ };+ const outerMaxX = levelRoom ? levelRoom.maxX : maxX;+ const rooms = [leadRoom, teamRoom, wardrobeRoom, receptionRoom, breakRoom, ...(levelRoom ? [levelRoom] : [])];+ const hall = levelRoom ? levelHall(levelRoom) : null;// The lead's executive desk faces south, towards the door and the office. A// second lead gets a partner desk to its east; there is never an empty one.@@ -730,6 +770,7 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:{ id: "break-nook", kind: "readingNook", x: bx0 + 0.53, z: bz0 + 0.58, rotationY: 0, room: "break" },{ id: "break-plant", kind: "breakPlant", x: bx0 + 0.6, z: bottomZ - 0.6, rotationY: 0, room: "break" },{ id: "break-plant-e", kind: "breakPlant", x: breakRoom.maxX - 0.45, z: bz0 + 5.9, rotationY: 0, room: "break" },+ ...(hall?.furniture ?? []),];for (const dept of departments) {furniture.push({ id: `${dept.id}-plant-w`, kind: "plant", x: dept.minX + 0.45, z: dept.maxZ - 0.45, rotationY: 0, room: "floor" });@@ -768,6 +809,7 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:...lobbySpots(receptionRoom),] satisfies Spot[]),{ id: "board", kind: "board", pose: "stand", x: tcx - 0.6, z: topZ + 1.2, facing: Math.PI, room: "team" },+ ...(hall?.spots ?? []),];// Meeting chairs: three per long side of the team table.for (let i = 0; i < 3; i += 1) {@@ -775,7 +817,7 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:spots.push({ id: `meeting-n${i}`, kind: "meeting", pose: "sit", x, z: table.z - 1.25, facing: 0, room: "team" });spots.push({ id: `meeting-s${i}`, kind: "meeting", pose: "sit", x, z: table.z + 1.25, facing: Math.PI, room: "team" });}- // Window spots along the east and west railing, looking out at the stars.+ // Window spots along the east and west railing, looking out at the stars (on the agents floor the east ones look into the Level Hall).for (const dept of departments) {const side = dept.minX <= minX + 0.01 ? "west" : dept.maxX >= maxX - 0.01 ? "east" : null;if (!side) continue;@@ -806,6 +848,7 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:{ id: "team", room: "team", x: tcx + 2.2, z: northMaxZ - 1.05, radius: 0.95 },{ id: "wardrobe", room: "wardrobe", x: wcx, z: tcz + 0.8, radius: 1.5 },{ id: "lead", room: "lead", x: minX + leadW / 2, z: northMaxZ - 1.5, radius: 1.3 },+ ...(hall?.checkpoints ?? []),breakStop,elevatorStop,];@@ -836,7 +879,7 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:];const floor = {- minX: minX - EDGE + RAIL_CLEARANCE, maxX: maxX + EDGE - RAIL_CLEARANCE,+ minX: minX - EDGE + RAIL_CLEARANCE, maxX: outerMaxX + EDGE - RAIL_CLEARANCE,minZ: topZ - EDGE + RAIL_CLEARANCE, maxZ: bottomZ + EDGE - RAIL_CLEARANCE,};return {@@ -847,10 +890,56 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:spawn: { x: rx0 + 1.4, z: bottomZ - 2.6 },arrival,floor,- bounds: { minX: minX - EDGE, maxX: maxX + EDGE, minZ: topZ - EDGE, maxZ: bottomZ + EDGE },+ bounds: { minX: minX - EDGE, maxX: outerMaxX + EDGE, minZ: topZ - EDGE, maxZ: bottomZ + EDGE },};}+/**+ * The Level Hall's fittings, north to south: the Level Wall on the north wall+ * with the Upgrade Studio's round stage in front of it (its checkpoint is the+ * stage itself), the Level Road down the middle with a pedestal per reward on+ * either side — the lowest unlock at the south end, the highest by the stage,+ * so walking up the road is climbing the levels — and at the road's start the+ * double-sided level guide with its checkpoint on the road side. Plants frame+ * the stage, olive trees the guide.+ */+function levelHall(room: Room): { furniture: Furniture[]; spots: Spot[]; checkpoints: Checkpoint[] } {+ const cx = (room.minX + room.maxX) / 2;+ const piece = (id: string, kind: FurnitureKind, x: number, z: number, rotationY = 0, size?: { w: number; d: number }): Furniture =>+ ({ id, kind, x, z, rotationY, room: "levels", ...(size ? { size } : {}) });+ const stageZ = room.minZ + LEVEL_HALL.stageZ;+ const roadMinZ = room.minZ + LEVEL_HALL.roadNorth, roadMaxZ = room.maxZ - LEVEL_HALL.roadSouth;+ const guideZ = room.maxZ - LEVEL_HALL.guideZ;+ // Pedestal n (0 = the lowest unlock) stands on the west side when n is even, the east side when odd, rising northwards.+ const rows = Math.ceil(REWARD_IDS.length / 2);+ const pitch = rows > 1 ? (roadMaxZ - roadMinZ - 1.2) / (rows - 1) : 0;+ const pedestals = REWARD_IDS.map((_, n) => piece(`level-pedestal-${n}`, "rewardPedestal",+ cx + (n % 2 === 0 ? -PEDESTAL_OFFSET_X : PEDESTAL_OFFSET_X), roadMaxZ - 0.6 - Math.floor(n / 2) * pitch, n % 2 === 0 ? Math.PI / 2 : -Math.PI / 2));+ const furniture: Furniture[] = [+ piece("level-wall", "levelWall", cx, room.minZ + 0.08 + FURNITURE_SIZE.levelWall.d / 2),+ piece("level-stage", "studioStage", cx, stageZ),+ piece("level-road", "levelRoad", cx, (roadMinZ + roadMaxZ) / 2, 0, { w: 2.2, d: roadMaxZ - roadMinZ }),+ ...pedestals,+ // The guide faces up the road; its back shows the same screen to the lobby side.+ piece("level-guide", "levelGuide", cx, guideZ, Math.PI),+ piece("level-plant-nw", "designerPlant", room.minX + 0.6, room.minZ + 0.7),+ piece("level-plant-ne", "designerPlant", room.maxX - 0.6, room.minZ + 0.7),+ piece("level-olive-sw", "oliveTree", room.minX + 0.85, room.maxZ - 0.85),+ piece("level-olive-se", "oliveTree", room.maxX - 0.85, room.maxZ - 0.85),+ ];+ const spots: Spot[] = [+ // Agents come to look at the Level Wall and at the top of the road.+ { id: "level-wall-w", kind: "shelf", pose: "stand", x: cx - 2.6, z: room.minZ + 1.5, facing: Math.PI, room: "levels" },+ { id: "level-wall-e", kind: "shelf", pose: "stand", x: cx + 2.6, z: room.minZ + 1.5, facing: Math.PI, room: "levels" },+ { id: "level-road-top", kind: "shelf", pose: "stand", x: cx, z: roadMinZ + 1.4, facing: Math.PI, room: "levels" },+ ];+ const checkpoints: Checkpoint[] = [+ { id: "studio", room: "levels", x: cx, z: stageZ, radius: LEVEL_HALL.stageR, approach: { x: cx, z: stageZ + 0.6 } },+ { id: "levels", room: "levels", x: cx, z: guideZ - 1.45, radius: 1.1 },+ ];+ return { furniture, spots, checkpoints };+}+/** The lobby lounge's sofa, relative to the reception room's west and north edges. */const LOBBY_LOUNGE = { dx: 6.0, dz: 5.35 };/** The agents floor's Agent board totem; the "manage" checkpoint stands in front of it. */diff --git a/jarvis/ui/web/frontend/src/components/society/office/officePalette.ts b/jarvis/ui/web/frontend/src/components/society/office/officePalette.tsindex 5e6ed2ced2..9235070e82 100644--- a/jarvis/ui/web/frontend/src/components/society/office/officePalette.ts+++ b/jarvis/ui/web/frontend/src/components/society/office/officePalette.ts@@ -179,6 +179,8 @@ export const ROOM_FLOOR_COLOURS = {foyer: { base: "#24202e", accents: ["#2c2838", "#1d1a26"] },prizes: { base: "#3a1838", accents: ["#431c41", "#33152f"] },snack: { base: "#5a1e22", accents: ["#e9e2d6", "#4c191c"] },+ // Level Hall: deep midnight-blue polished stone with gold veins.+ levels: { base: "#1c2547", accents: ["#222c55", "#18203e", "#26315e", "#d9b25c"] },} as const;/** Checkpoint gold: floor ring, hexagon token and the label badge. */diff --git a/jarvis/ui/web/frontend/src/components/society/progression/LevelHud.tsx b/jarvis/ui/web/frontend/src/components/society/progression/LevelHud.tsxindex 099b0f6552..172ec2dee5 100644--- a/jarvis/ui/web/frontend/src/components/society/progression/LevelHud.tsx+++ b/jarvis/ui/web/frontend/src/components/society/progression/LevelHud.tsx@@ -78,6 +78,7 @@ export function LevelHud({ playerName, petName, compact }: { playerName: string;const pet = useProgression((s) => s.subjects[petSubject(petId)]);const loaded = useProgression((s) => !!s.snapshot);const open = useProgression((s) => s.openPanel);+ const openHall = () => open("overview", { subject: "person" });if (!loaded) return null;const level = person?.level ?? 1;const fraction = levelFraction(person);@@ -86,7 +87,7 @@ export function LevelHud({ playerName, petName, compact }: { playerName: string;? t("society.level.xp_of").replace("{0}", String(person.xpIntoLevel)).replace("{1}", String(person.xpForNext)): person ? t("society.level.max") : t("society.level.xp_of").replace("{0}", "0").replace("{1}", "40");return (- <button type="button" className="office-card level-hud" data-compact={compact || undefined} onClick={() => open("you")}+ <button type="button" className="office-card level-hud" data-compact={compact || undefined} onClick={openHall}aria-label={t("society.level.open_panel")} aria-keyshortcuts="L"><LevelRing kind="person" level={level} fraction={fraction} size={compact ? 34 : 44} /><span className="level-hud-body">diff --git a/jarvis/ui/web/frontend/src/components/society/progression/LevelPanel.tsx b/jarvis/ui/web/frontend/src/components/society/progression/LevelPanel.tsxdeleted file mode 100644index 9902f86cfd..0000000000--- a/jarvis/ui/web/frontend/src/components/society/progression/LevelPanel.tsx+++ /dev/null@@ -1,280 +0,0 @@-/**- * The progress panel (L, or a click on the level card): three tabs.- *- * - You / Pet: level, title and bar; what to wear in each slot (automatic,- * none, or any unlocked piece); the reward track from level 1 to 50 with- * the next unlock marked; and the exact rules that pay XP.- * - Agents: every agent's level, title and bar, best first, and their rules.- *- * Theme tokens throughout, so it reads in light and dark mode.- */-import { useEffect, useMemo, useRef } from "react";-import { useT } from "@/i18n";-import type { SocietyAgent } from "../data";-import { levelFraction, unlockedFor, type SlotChoice } from "./cosmetics";-import { LevelChip, LevelRing, XpBar } from "./LevelHud";-import { SLOTS, type RewardId, type Slot, type SubjectKind } from "./levelCatalog";-import { agentSubject, PERSON_SUBJECT, petSubject, type RewardRow, type XpRuleRow } from "./progressionApi";-import { useProgression, type PanelTab } from "./progressionStore";-import { RewardIcon } from "./RewardIcon";-import { useLevelSound } from "./levelSounds";--const LEAD_AGENT_ID = "jarvis";--// Stable fallbacks: a selector that returns a fresh [] or {} re-renders forever.-const NO_RULES: XpRuleRow[] = [];-const NO_REWARDS: RewardRow[] = [];-const NO_TITLES: { level: number; title: string }[] = [];-const NO_CHOICES: Partial<Record<Slot, SlotChoice>> = {};--function duration(seconds: number, t: (key: string) => string): string {- return seconds >= 60- ? t("society.level.minutes").replace("{0}", String(Math.round(seconds / 60)))- : t("society.level.seconds").replace("{0}", String(seconds));-}--/** The limit line under a rule: once a day, once per floor, a cooldown, a daily cap. */-export function ruleLimit(rule: XpRuleRow, t: (key: string) => string): string {- if (rule.source === "daily_visit") return t("society.level.limit_daily");- if (rule.source === "floor_discovered") return t("society.level.limit_floor");- if (rule.source === "agent_hired") return t("society.level.limit_agent");- const parts: string[] = [];- if (rule.cooldownS > 0) parts.push(t("society.level.limit_cooldown").replace("{0}", duration(rule.cooldownS, t)));- if (rule.dailyCap > 0) parts.push(t("society.level.limit_cap").replace("{0}", String(rule.dailyCap)));- return parts.join(" · ");-}--function Rules({ kind }: { kind: SubjectKind }) {- const t = useT();- const rules = useProgression((s) => s.snapshot?.rules ?? NO_RULES);- const mine = rules.filter((r) => r.kind === kind);- return (- <section className="level-section">- <h3>{t(`society.level.rules_${kind}`)}</h3>- <ul className="level-rules">- {mine.map((rule) => {- const limit = ruleLimit(rule, t);- return (- <li key={rule.source}>- <span className="level-rule-xp">+{rule.xp}</span>- <span className="level-rule-text">- <span>{t(`society.level.source.${rule.source}`)}</span>- {limit && <em>{limit}</em>}- </span>- </li>- );- })}- </ul>- </section>- );-}--function Wardrobe({ who, kind, level }: { who: "person" | "pet"; kind: SubjectKind; level: number }) {- const t = useT();- const rewards = useProgression((s) => s.snapshot?.rewards ?? NO_REWARDS);- const choices = useProgression((s) => s.choices[who] ?? NO_CHOICES);- const choose = useProgression((s) => s.choose);- const open = useMemo(() => unlockedFor(rewards, kind, level), [rewards, kind, level]);- return (- <section className="level-section">- <h3>{t("society.level.wear")}</h3>- <div className="level-slots">- {SLOTS.map((slot) => {- const inSlot = rewards.filter((r) => r.slot === slot && r.levels[kind] !== null);- if (inSlot.length === 0) return null;- const current: SlotChoice = choices[slot] ?? "auto";- const pick = (choice: SlotChoice) => choose(who, slot, choice);- return (- <div key={slot} className="level-slot" role="group" aria-label={t(`society.level.slot.${slot}`)}>- <span className="level-slot-name">{t(`society.level.slot.${slot}`)}</span>- <div className="office-chips">- <button type="button" className="office-chip" aria-pressed={current === "auto"} onClick={() => pick("auto")}>{t("society.level.auto")}</button>- <button type="button" className="office-chip" aria-pressed={current === "none"} onClick={() => pick("none")}>{t("society.level.none")}</button>- {inSlot.map((reward) => {- const unlocked = open.some((r) => r.rewardId === reward.rewardId);- return (- <button key={reward.rewardId} type="button" className="office-chip level-wear-chip" aria-pressed={current === reward.rewardId}- disabled={!unlocked} onClick={() => pick(reward.rewardId)}- title={unlocked ? undefined : t("society.level.locked_at").replace("{0}", String(reward.levels[kind]))}>- <RewardIcon reward={reward.rewardId} locked={!unlocked} size={16} />- {t(`society.level.reward.${reward.rewardId}`)}- {!unlocked && <small>{t("society.level.lv").replace("{0}", String(reward.levels[kind]))}</small>}- </button>- );- })}- </div>- </div>- );- })}- </div>- </section>- );-}--function Track({ kind, level }: { kind: SubjectKind; level: number }) {- const t = useT();- const rewards = useProgression((s) => s.snapshot?.rewards ?? NO_REWARDS);- const titles = useProgression((s) => s.snapshot?.titles[kind] ?? NO_TITLES);- const steps = useMemo(() => {- const byLevel = new Map<number, { rewards: RewardRow[]; title?: string }>();- for (const r of rewards) {- const at = r.levels[kind];- if (at === null) continue;- const entry = byLevel.get(at) ?? { rewards: [] };- entry.rewards.push(r);- byLevel.set(at, entry);- }- for (const band of titles) {- if (band.level <= 1) continue;- const entry = byLevel.get(band.level) ?? { rewards: [] };- entry.title = band.title;- byLevel.set(band.level, entry);- }- return [...byLevel.entries()].sort((a, b) => a[0] - b[0]);- }, [rewards, titles, kind]);- const nextAt = steps.find(([at]) => at > level)?.[0];- const track = useRef<HTMLOListElement>(null);- // Open on the next unlock, not on level 2.- useEffect(() => {- track.current?.querySelector("[data-next]")?.scrollIntoView({ block: "nearest", inline: "center" });- }, [kind]);- return (- <section className="level-section">- <h3>{t("society.level.track")}</h3>- <ol ref={track} className="level-track">- {steps.map(([at, step]) => (- <li key={at} data-done={level >= at || undefined} data-next={at === nextAt || undefined}>- <span className="level-track-at">{t("society.level.lv").replace("{0}", String(at))}</span>- <span className="level-track-items">- {step.rewards.map((r) => (- <span key={r.rewardId} className="level-track-item">- <RewardIcon reward={r.rewardId as RewardId} locked={level < at} size={26} />- <span>{t(`society.level.reward.${r.rewardId}`)}</span>- </span>- ))}- {step.title && <span className="level-track-title">{t(`society.level.title.${step.title}`)}</span>}- </span>- </li>- ))}- </ol>- </section>- );-}--function SubjectHeader({ kind, subjectId, name }: { kind: SubjectKind; subjectId: string; name: string }) {- const t = useT();- const subject = useProgression((s) => s.subjects[subjectId]);- const level = subject?.level ?? 1;- const fraction = levelFraction(subject);- const left = subject && subject.xpForNext > 0 ? subject.xpForNext - subject.xpIntoLevel : null;- return (- <div className="level-subject">- <LevelRing kind={kind} level={level} fraction={fraction} size={58} />- <div>- <strong>{name}</strong>- <em>{t(`society.level.title.${subject?.title || (kind === "pet" ? "hatchling" : "newcomer")}`)}</em>- <XpBar fraction={fraction} kind={kind} label={t("society.level.xp_label")} />- <span className="level-subject-xp">- {left === null && subject ? t("society.level.max")- : t("society.level.to_next").replace("{0}", String(left ?? 40)).replace("{1}", String(level + 1))}- {subject ? ` · ${t("society.level.total").replace("{0}", String(subject.xp))}` : ""}- </span>- </div>- </div>- );-}--function AgentsTab({ agents }: { agents: readonly SocietyAgent[] }) {- const t = useT();- const subjects = useProgression((s) => s.subjects);- const rows = useMemo(() => agents- .filter((a) => a.agentId !== LEAD_AGENT_ID && a.tier !== "lead")- .map((a) => ({ agent: a, subject: subjects[agentSubject(a.agentId)] }))- .sort((a, b) => (b.subject?.xp ?? 0) - (a.subject?.xp ?? 0) || a.agent.name.localeCompare(b.agent.name)), [agents, subjects]);- return (- <>- <section className="level-section">- <h3>{t("society.level.team")}</h3>- {rows.length === 0 ? <p className="office-hint">{t("society.level.no_agents")}</p> : (- <ol className="level-agents">- {rows.map(({ agent, subject }, i) => (- <li key={agent.agentId}>- <span className="level-agent-rank">{i + 1}</span>- <LevelChip kind="agent" level={subject?.level ?? 1} />- <span className="level-agent-body">- <span><strong>{agent.name}</strong> <em>{t(`society.level.title.${subject?.title || "rookie"}`)}</em></span>- <XpBar fraction={levelFraction(subject)} kind="agent" label={t("society.level.agent_xp_label").replace("{0}", agent.name)} />- </span>- </li>- ))}- </ol>- )}- </section>- <Rules kind="agent" />- </>- );-}--export function LevelPanel({ agents, playerName, petName }: { agents: readonly SocietyAgent[]; playerName: string; petName: string }) {- const t = useT();- const tab = useProgression((s) => s.panel);- const openPanel = useProgression((s) => s.openPanel);- const petId = useProgression((s) => s.petId);- const person = useProgression((s) => s.subjects[PERSON_SUBJECT]);- const pet = useProgression((s) => s.subjects[petSubject(petId)]);- const sound = useLevelSound();- const panel = useRef<HTMLDivElement>(null);- useEffect(() => {- if (!tab) return;- panel.current?.focus();- const onKey = (event: KeyboardEvent) => {- if (event.key !== "Escape") return;- event.stopPropagation();- openPanel(null);- };- window.addEventListener("keydown", onKey, true);- return () => window.removeEventListener("keydown", onKey, true);- }, [tab, openPanel]);- if (!tab) return null;- const tabs: PanelTab[] = ["you", "pet", "agents"];- return (- <div className="level-panel-layer" data-office-ui onPointerDown={(e) => { if (e.target === e.currentTarget) openPanel(null); }}>- <div ref={panel} className="office-card level-panel" role="dialog" aria-modal="false" aria-labelledby="level-panel-title" tabIndex={-1}>- <header className="level-panel-head">- <h2 id="level-panel-title">{t("society.level.panel_title")}</h2>- <div className="level-tabs" role="tablist">- {tabs.map((id) => (- <button key={id} type="button" role="tab" aria-selected={tab === id} className="level-tab" onClick={() => openPanel(id)}>- {id === "pet" ? petName : t(`society.level.tab_${id}`)}- </button>- ))}- </div>- <button type="button" className="office-icon-button" onClick={() => openPanel(null)} aria-label={t("society.office.close")}>×</button>- </header>- <div className="level-panel-body">- {tab === "you" && <>- <SubjectHeader kind="person" subjectId={PERSON_SUBJECT} name={playerName} />- <Wardrobe who="person" kind="person" level={person?.level ?? 1} />- <Track kind="person" level={person?.level ?? 1} />- <Rules kind="person" />- </>}- {tab === "pet" && <>- <SubjectHeader kind="pet" subjectId={petSubject(petId)} name={petName} />- <p className="office-hint">{t("society.level.pet_intro")}</p>- <Wardrobe who="pet" kind="pet" level={pet?.level ?? 1} />- <Track kind="pet" level={pet?.level ?? 1} />- <Rules kind="pet" />- </>}- {tab === "agents" && <AgentsTab agents={agents} />}- </div>- <footer className="level-panel-foot">- <label className="level-sound">- <input type="checkbox" checked={sound.on} onChange={(e) => sound.set(e.target.checked)} />- {t("society.level.sound")}- </label>- <span className="office-hint">{t("society.level.free_note")}</span>- </footer>- </div>- </div>- );-}diff --git a/jarvis/ui/web/frontend/src/components/society/progression/cosmetics.ts b/jarvis/ui/web/frontend/src/components/society/progression/cosmetics.tsindex 1a5aaf7117..975f05fc87 100644--- a/jarvis/ui/web/frontend/src/components/society/progression/cosmetics.ts+++ b/jarvis/ui/web/frontend/src/components/society/progression/cosmetics.ts@@ -31,6 +31,22 @@ export function equippedFor(rewards: readonly RewardRow[], kind: SubjectKind, lereturn loadout;}+/**+ * The rewards a subject kind can ever wear, in the order they unlock (lowest+ * level first; within one level in slot order). The Level Road's pedestals+ * and the reward road on screen both read this order.+ */+export function rewardRoad(rewards: readonly RewardRow[], kind: SubjectKind): RewardRow[] {+ return rewards+ .filter((r) => r.levels[kind] !== null)+ .sort((a, b) => (a.levels[kind] ?? 0) - (b.levels[kind] ?? 0) || SLOTS.indexOf(a.slot) - SLOTS.indexOf(b.slot));+}++/** The first reward on the road the subject has not unlocked yet; undefined once everything is open. */+export function nextUnlock(rewards: readonly RewardRow[], kind: SubjectKind, level: number): RewardRow | undefined {+ return rewardRoad(rewards, kind).find((r) => (r.levels[kind] ?? 0) > level);+}+/** XP gathered into the current level and the level's size, from the curve the server sent. */export function progressFor(levelXp: readonly number[], totalXp: number, level: number): { into: number; size: number } {const start = levelXp[level - 1] ?? 0;diff --git a/jarvis/ui/web/frontend/src/components/society/progression/hall/LevelHallScreen.tsx b/jarvis/ui/web/frontend/src/components/society/progression/hall/LevelHallScreen.tsxnew file mode 100644index 0000000000..d8370cbf94--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/progression/hall/LevelHallScreen.tsx@@ -0,0 +1,250 @@+/**+ * The Level Hall screen: the game menu behind the hall's checkpoints, the+ * level card and `L`. Five pages for the person or their pet (the pet IS+ * Jarvis in the Verse):+ *+ * - Overview: the level, title and XP bar, the next unlocks and the quickest+ * ways to earn.+ * - Studio: the dressing room. Every slot's pieces as cards; an unlocked+ * piece is put on with one click, a locked one is tried on in the live+ * preview with the level it needs.+ * - Rewards: the reward road from level 1 to the cap, every step's pieces and+ * titles, and the chosen step in the preview.+ * - Guide: how levelling works — three steps, what the next levels cost, and+ * every rule that pays XP for you, your pet and your agents.+ * - Team: every agent's level, best first.+ *+ * The chrome uses theme tokens (light and dark); the stage, the level badge+ * and the rarity colours are the game's own and read in both modes.+ */+import { useEffect, useMemo, useRef } from "react";+import { useT } from "@/i18n";+import { useCompanionPet } from "../../companion/companionPetStore";+import type { SocietyAgent } from "../../data";+import type { ToyLook } from "../../office/toyFigureModel";+import { levelFraction, rewardRoad } from "../cosmetics";+import { LevelChip, XpBar } from "../LevelHud";+import { useLevelSound } from "../levelSounds";+import { agentSubject, PERSON_SUBJECT, petSubject, type RewardRow, type XpRuleRow } from "../progressionApi";+import { HALL_TABS, useProgression, type HallTab } from "../progressionStore";+import { groupRules, quickWins, upcomingLevelCosts, xpToReach } from "./hallModel";+import { LevelHero, RewardCard, RuleRow, Section, TabIcon, type HallWho } from "./hallParts";+import { RewardsTab } from "./RewardsTab";+import { StudioTab } from "./StudioTab";+import "./hall.css";++const LEAD_AGENT_ID = "jarvis";+// Stable fallbacks: a selector that returns a fresh [] or {} re-renders forever.+const NO_RULES: XpRuleRow[] = [];+const NO_REWARDS: RewardRow[] = [];+const NO_CURVE: number[] = [0];++/** Stroke icons in a 24 × 24 box for the page tabs. */+const TAB_ICON: Record<HallTab, string> = {+ overview: "M12 2.8l8 4.6v9.2l-8 4.6-8-4.6V7.4zM12 8v4l3 2",+ studio: "M10 3l1.6 5.4L17 10l-5.4 1.6L10 17l-1.6-5.4L3 10l5.4-1.6zM18 14l.8 2.2L21 17l-2.2.8L18 20l-.8-2.2L15 17l2.2-.8z",+ rewards: "M4 10h16v10H4zM2.5 6.5h19V10h-19zM12 6.5V20M12 6.5C10 3 6.5 3 6.5 5s3 1.5 5.5 1.5M12 6.5C14 3 17.5 3 17.5 5s-3 1.5-5.5 1.5",+ guide: "M4 4.5h6a2 2 0 0 1 2 2V20a2 2 0 0 0-2-2H4zM20 4.5h-6a2 2 0 0 0-2 2V20a2 2 0 0 1 2-2h6z",+ team: "M9 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM3 20c0-3.3 2.7-5.5 6-5.5s6 2.2 6 5.5M16.5 11a2.5 2.5 0 1 0 0-5M18 14.5c2 .6 3.5 2.4 3.5 5",+};++function OverviewTab({ who }: { who: HallWho }) {+ const t = useT();+ const open = useProgression((s) => s.openPanel);+ const rewards = useProgression((s) => s.snapshot?.rewards ?? NO_REWARDS);+ const rules = useProgression((s) => s.snapshot?.rules ?? NO_RULES);+ const curve = useProgression((s) => s.snapshot?.levelXp ?? NO_CURVE);+ const subject = useProgression((s) => s.subjects[who.subjectId]);+ const level = subject?.level ?? 1;+ const road = useMemo(() => rewardRoad(rewards, who.kind), [rewards, who.kind]);+ const upcoming = road.filter((r) => (r.levels[who.kind] ?? 0) > level).slice(0, 3);+ // With everything open, the page shows the three best pieces instead.+ const best = upcoming.length === 0 ? road.slice(-3).reverse() : [];+ const wins = useMemo(() => quickWins(rules, who.kind, 4), [rules, who.kind]);+ return (+ <div className="hall-overview">+ <LevelHero who={who} />+ {who.kind === "pet" && <p className="hall-hint hall-wide">{t("society.level.pet_intro")}</p>}+ <Section title={t(upcoming.length > 0 ? "society.hall.next_rewards" : "society.hall.best_pieces")} aside={+ <button type="button" className="hall-link" onClick={() => open("rewards")}>{t("society.hall.road_all")}</button>}>+ {upcoming.length === 0 && <p className="hall-hint">{t("society.hall.all_unlocked")}</p>}+ {upcoming.length + best.length > 0 && (+ <div className="hall-cards">+ {[...upcoming, ...best].map((reward) => (+ <RewardCard key={reward.rewardId} reward={reward} kind={who.kind} level={level}+ xpMissing={xpToReach(curve, subject?.xp ?? 0, reward.levels[who.kind] ?? 1)}+ onClick={() => open("studio", { reward: reward.rewardId })} />+ ))}+ </div>+ )}+ {upcoming.length > 0 && <p className="hall-hint">{t("society.hall.try_hint")}</p>}+ </Section>+ <Section title={t("society.hall.quick_title")} aside={+ <button type="button" className="hall-link" onClick={() => open("guide")}>{t("society.hall.quick_all")}</button>}>+ <ul className="hall-rules">{wins.map((rule) => <RuleRow key={rule.source} rule={rule} />)}</ul>+ </Section>+ </div>+ );+}++function GuideTab({ who, petName }: { who: HallWho; petName: string }) {+ const t = useT();+ const rules = useProgression((s) => s.snapshot?.rules ?? NO_RULES);+ const curve = useProgression((s) => s.snapshot?.levelXp ?? NO_CURVE);+ const level = useProgression((s) => s.subjects[who.subjectId]?.level ?? 1);+ const costs = upcomingLevelCosts(curve, level, 3);+ const steps = [1, 2, 3] as const;+ const sections = [+ { kind: "person" as const, title: t("society.hall.section_you") },+ { kind: "pet" as const, title: t("society.hall.section_pet").replace("{0}", petName) },+ { kind: "agent" as const, title: t("society.hall.section_agents") },+ ];+ return (+ <div className="hall-guide">+ <ol className="hall-steps">+ {steps.map((n) => (+ <li key={n}>+ <span className="hall-step-n">{n}</span>+ <strong>{t(`society.hall.step${n}_title`)}</strong>+ <p>{t(`society.hall.step${n}_body`)}</p>+ {n === 2 && costs.length > 0 && (+ <ul className="hall-costs">+ {costs.map((c) => <li key={c.level}>{t("society.hall.cost_line").replace("{0}", String(c.level)).replace("{1}", String(c.xp))}</li>)}+ </ul>+ )}+ </li>+ ))}+ </ol>+ {sections.map((section) => (+ <Section key={section.kind} title={section.title} className="hall-guide-section">+ {groupRules(rules, section.kind).map((group) => (+ <div key={group.id} className="hall-rule-group">+ <h4>{t(`society.hall.group.${group.id}`).replace("{0}", petName)}</h4>+ <ul className="hall-rules">{group.rules.map((rule) => <RuleRow key={rule.source} rule={rule} />)}</ul>+ </div>+ ))}+ </Section>+ ))}+ <p className="hall-hint">{t("society.hall.limits_note")}</p>+ </div>+ );+}++function TeamTab({ agents }: { agents: readonly SocietyAgent[] }) {+ const t = useT();+ const subjects = useProgression((s) => s.subjects);+ const rows = useMemo(() => agents+ .filter((a) => a.agentId !== LEAD_AGENT_ID && a.tier !== "lead")+ .map((a) => ({ agent: a, subject: subjects[agentSubject(a.agentId)] }))+ .sort((a, b) => (b.subject?.xp ?? 0) - (a.subject?.xp ?? 0) || a.agent.name.localeCompare(b.agent.name)), [agents, subjects]);+ return (+ <div className="hall-team">+ <Section title={t("society.level.team")}>+ {rows.length === 0 ? <p className="hall-empty">{t("society.level.no_agents")}</p> : (+ <ol className="hall-ranking">+ {rows.map(({ agent, subject }, i) => (+ <li key={agent.agentId} data-podium={i < 3 ? i + 1 : undefined}>+ <span className="hall-rank">{i + 1}</span>+ <LevelChip kind="agent" level={subject?.level ?? 1} />+ <span className="hall-rank-body">+ <span><strong>{agent.name}</strong> <em>{t(`society.level.title.${subject?.title || "rookie"}`)}</em></span>+ <XpBar fraction={levelFraction(subject)} kind="agent" label={t("society.level.agent_xp_label").replace("{0}", agent.name)} />+ </span>+ <span className="hall-rank-xp">{t("society.level.total").replace("{0}", String(subject?.xp ?? 0))}</span>+ </li>+ ))}+ </ol>+ )}+ </Section>+ <p className="hall-hint">{t("society.hall.team_note")}</p>+ </div>+ );+}++export function LevelHallScreen({ agents, playerName, petName, playerLook }: {+ agents: readonly SocietyAgent[]; playerName: string; petName: string; playerLook: ToyLook;+}) {+ const t = useT();+ const tab = useProgression((s) => s.panel);+ const subjectChoice = useProgression((s) => s.hallSubject);+ const openPanel = useProgression((s) => s.openPanel);+ const setSubject = useProgression((s) => s.setHallSubject);+ const petId = useProgression((s) => s.petId);+ const loaded = useProgression((s) => !!s.snapshot);+ const companion = useCompanionPet((s) => s.pet);+ const sound = useLevelSound();+ const panel = useRef<HTMLDivElement>(null);+ const open = !!tab;+ // Focus moves into the screen when it opens, not on every page change (that would pull it off the clicked tab).+ useEffect(() => {+ if (open) panel.current?.focus({ preventScroll: true });+ }, [open]);+ useEffect(() => {+ if (!open) return;+ const onKey = (event: KeyboardEvent) => {+ if (event.key !== "Escape") return;+ event.stopPropagation();+ openPanel(null);+ };+ window.addEventListener("keydown", onKey, true);+ return () => window.removeEventListener("keydown", onKey, true);+ }, [open, openPanel]);+ // The team page has no subject; the subject switch steps aside there.+ const who: HallWho = useMemo(() => (subjectChoice === "pet"+ ? { who: "pet", kind: "pet", subjectId: petSubject(petId), name: petName, preview: { kind: "pet", pet: companion } }+ : { who: "person", kind: "person", subjectId: PERSON_SUBJECT, name: playerName, preview: { kind: "person", look: playerLook } }),+ [subjectChoice, petId, petName, companion, playerName, playerLook]);+ if (!tab) return null;+ return (+ <div className="hall-layer" data-office-ui onPointerDown={(e) => { if (e.target === e.currentTarget) openPanel(null); }}>+ {/* data-state="open" marks a modal for the office's keyboard guard: no walking or E behind the screen. */}+ <div ref={panel} className="hall" role="dialog" data-state="open" aria-modal="true" aria-labelledby="hall-title" tabIndex={-1}>+ <header className="hall-head">+ <div className="hall-brand">+ <span className="hall-brand-mark" aria-hidden><TabIcon path="M7 4h10v5a5 5 0 0 1-10 0V4zM7 6H4.5a2.5 2.5 0 0 0 2.6 3.6M17 6h2.5a2.5 2.5 0 0 1-2.6 3.6M12 14v3M8 20h8M9.5 17h5" size={20} /></span>+ <span>+ <h2 id="hall-title">{t("society.hall.title")}</h2>+ <small>{t("society.hall.subtitle")}</small>+ </span>+ </div>+ {tab !== "team" && (+ <div className="hall-subject" role="radiogroup" aria-label={t("society.hall.subject_label")}>+ {(["person", "pet"] as const).map((id) => (+ <button key={id} type="button" role="radio" aria-checked={subjectChoice === id} onClick={() => setSubject(id)}>+ {id === "person" ? t("society.hall.subject_you") : petName}+ </button>+ ))}+ </div>+ )}+ <button type="button" className="hall-close" onClick={() => openPanel(null)} aria-label={t("society.office.close")}>+ <TabIcon path="M6 6l12 12M18 6L6 18" size={18} />+ </button>+ </header>+ <nav className="hall-tabs" role="tablist" aria-label={t("society.hall.title")}>+ {HALL_TABS.map((id) => (+ <button key={id} type="button" role="tab" aria-selected={tab === id} className="hall-tab" onClick={() => openPanel(id)}>+ <TabIcon path={TAB_ICON[id]} />+ <span>{t(`society.hall.tab_${id}`)}</span>+ </button>+ ))}+ </nav>+ <div className="hall-body" role="tabpanel" data-tab={tab}>+ {!loaded ? <p className="hall-empty">{t("society.hall.loading")}</p> : <>+ {tab === "overview" && <OverviewTab who={who} />}+ {tab === "studio" && <StudioTab key={who.who} who={who} />}+ {tab === "rewards" && <RewardsTab key={who.who} who={who} />}+ {tab === "guide" && <GuideTab who={who} petName={petName} />}+ {tab === "team" && <TeamTab agents={agents} />}+ </>}+ </div>+ <footer className="hall-foot">+ <label className="hall-sound">+ <input type="checkbox" checked={sound.on} onChange={(e) => sound.set(e.target.checked)} />+ {t("society.level.sound")}+ </label>+ <span>{t("society.level.free_note")}</span>+ </footer>+ </div>+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/society/progression/hall/LoadoutPreview.tsx b/jarvis/ui/web/frontend/src/components/society/progression/hall/LoadoutPreview.tsxnew file mode 100644index 0000000000..d9671afeb1--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/progression/hall/LoadoutPreview.tsx@@ -0,0 +1,197 @@+/**+ * The Upgrade Studio's live preview: the person's own figure or their pet on+ * the hall's stage, wearing a loadout — the one they wear, or one with a+ * locked piece put on to try. Trails only show in motion, so with a trail on+ * the figure walks a slow circle round the stage; otherwise it stands while+ * the stage turns. Drag turns it by hand.+ *+ * One canvas through `useWebglSurface` (AP-32: the context is handed back on+ * unmount and rebuilt when the browser takes it), rendering only while on+ * screen (`useCanvasAwake`). The stage is the game's own room, so it keeps+ * the hall's midnight look in light and dark mode, like the world itself.+ */+import { Component, Suspense, useLayoutEffect, useMemo, useRef, type ErrorInfo, type PointerEvent as ReactPointerEvent, type ReactNode } from "react";+import { Canvas, useFrame, useThree } from "@react-three/fiber";+import { useReducedMotion } from "framer-motion";+import type { Group } from "three";+import { useCanvasAwake } from "@/hooks/useCanvasAwake";+import { useWebglSurface } from "@/hooks/useWebglSurface";+import { useT } from "@/i18n";+import { CompanionModel } from "../../companion/AgentFollower";+import { defaultCompanion } from "../../companion/appearance";+import { companionFlies, type CompanionPet } from "../../companion/petCompanions";+import type { PetDrive } from "../../companion/PetModel";+import type { FigureDrive } from "../../figures/FigureRig";+import { CompanionBody, GIGI_OFFICE_SIZE_M, ModelBoundary } from "../../office/GigiFlyer";+import { StudioStage } from "../../office/LevelHall";+import { OFFICE_FIGURE_HEIGHT_M } from "../../office/OfficeAgents";+import { ToyFigure } from "../../office/ToyFigure";+import type { ToyLook } from "../../office/toyFigureModel";+import type { Loadout } from "../cosmetics";+import { AngelWings } from "../effects/AngelWings";+import { CosmeticTrail, type FlairSource, type TrailKind } from "../effects/CosmeticTrail";+import { CosmeticAura, CosmeticGadget, type AuraKind, type GadgetKind } from "../effects/CosmeticWear";++/** The walk round the stage: radius in metres and speed in m/s. */+const WALK_R = 0.95;+const WALK_SPEED = 0.85;+/** How fast the stage turns while the figure stands, rad/s. */+const TURN_SPEED = 0.35;+/** Flying pets hover this high over the stage. */+const HOVER_M = 0.32;+/** A pet is drawn this tall on the stage, so a 0.3 m teapot reads as well as the person does. */+const PET_SHOWN_M = 0.78;++export type PreviewSubject = { kind: "person"; look: ToyLook } | { kind: "pet"; pet: CompanionPet };++/** Where the figure stands this frame, shared by the figure and every flair that follows it. */+interface Pose { x: number; z: number; heading: number; moving: boolean }++function PreviewScene({ subject, loadout, paused, reduced, spin }: {+ subject: PreviewSubject; loadout: Loadout; paused: boolean; reduced: boolean; spin: { current: number };+}) {+ const walking = !!loadout.trail && !reduced;+ const pose = useRef<Pose>({ x: 0, z: 0, heading: 0, moving: false });+ const clock = useRef(0);+ const body = useRef<Group>(null);+ const turntable = useRef<Group>(null);+ const figureDrive = useRef<FigureDrive>({ mode: "idle", speed: 0 });+ const petDrive = useRef<PetDrive>({ speed: 0, mood: "idle" });+ const pet = subject.kind === "pet" ? subject.pet : null;+ const flies = pet ? companionFlies(pet) : false;+ // A pet stands on the same stage, drawn larger (its own group scales; the stage does not), so its walk shrinks to match.+ const grow = pet ? PET_SHOWN_M / pet.heightM : 1;+ const lift = flies ? HOVER_M / grow : 0;+ const top = pet ? lift + pet.heightM + 0.04 : OFFICE_FIGURE_HEIGHT_M + 0.02;+ const walkR = WALK_R / grow;+ const scale = pet ? 0.5 : 1;+ const gigi = useMemo(() => ({ ...defaultCompanion("jarvis"), sizeM: GIGI_OFFICE_SIZE_M }), []);++ useFrame((_, rawDt) => {+ const dt = paused ? 0 : Math.min(rawDt, 0.1);+ clock.current += dt;+ const p = pose.current;+ if (walking) {+ const angle = (clock.current * WALK_SPEED) / WALK_R;+ p.x = Math.cos(angle) * walkR;+ p.z = Math.sin(angle) * walkR;+ // Heading along the circle (counter-clockwise seen from above).+ p.heading = Math.atan2(-Math.sin(angle), Math.cos(angle));+ p.moving = true;+ } else {+ p.x = 0;+ p.z = 0;+ p.heading = 0;+ p.moving = false;+ }+ figureDrive.current.mode = p.moving ? "walk" : "idle";+ figureDrive.current.speed = p.moving ? WALK_SPEED : 0;+ petDrive.current.speed = p.moving ? WALK_SPEED : 0;+ if (body.current) {+ body.current.position.set(p.x, lift + (flies && !reduced ? Math.sin(clock.current * 2.2) * 0.04 : 0), p.z);+ body.current.rotation.y = p.heading;+ }+ // The stage turns while the figure stands; a drag adds its own turn.+ if (turntable.current) {+ if (!walking && !reduced) spin.current += dt * TURN_SPEED;+ turntable.current.rotation.y = spin.current;+ }+ });++ // Flair reads the pose in the turntable's frame, so it turns with the figure.+ const ground: FlairSource = () => ({ x: pose.current.x, z: pose.current.z, heading: pose.current.heading });+ const head: FlairSource = () => ({ x: pose.current.x, z: pose.current.z, y: top });+ return (+ <>+ <hemisphereLight args={["#dfe8ff", "#1a1f3a", 0.9]} />+ <directionalLight position={[2.5, 4, 3]} intensity={1.4} color="#fff4e2" />+ <pointLight position={[0, 2.6, 0.6]} intensity={5} distance={6} decay={2} color="#ffdca0" />+ <pointLight position={[-2, 1.4, -2]} intensity={3} distance={6} decay={2} color="#8fb8ff" />+ <group ref={turntable}>+ <StudioStage />+ <group scale={grow}>+ <group ref={body}>+ {pet ? (+ <ModelBoundary key={pet.id}>+ <Suspense fallback={null}>+ <CompanionBody pet={pet} drive={petDrive} reduced={reduced} paused={paused} gigi={<CompanionModel appearance={gigi} lead />} />+ </Suspense>+ </ModelBoundary>+ ) : (+ <ToyFigure look={(subject as Extract<PreviewSubject, { kind: "person" }>).look} drive={figureDrive} paused={paused} heightM={OFFICE_FIGURE_HEIGHT_M}+ back={loadout.gadget === "gadget_wings" ? <AngelWings drive={figureDrive} paused={paused} reduced={reduced} /> : undefined} />+ )}+ </group>+ {loadout.aura && <CosmeticAura key={loadout.aura} kind={loadout.aura as AuraKind} source={ground} scale={scale} paused={paused} reduced={reduced} />}+ {walking && <CosmeticTrail key={loadout.trail} kind={loadout.trail as TrailKind} source={ground} scale={scale} paused={paused} />}+ {loadout.gadget && loadout.gadget !== "gadget_wings" && (+ <CosmeticGadget key={loadout.gadget} kind={loadout.gadget as GadgetKind} source={head} top={top} scale={scale} paused={paused} reduced={reduced} />+ )}+ </group>+ </group>+ <CameraFrame />+ </>+ );+}++/** Frames the whole stage with the walk circle on it; a tall, narrow box stands further back. */+function CameraFrame() {+ const camera = useThree((s) => s.camera);+ const size = useThree((s) => s.size);+ useLayoutEffect(() => {+ const narrow = size.width / Math.max(1, size.height) < 0.9;+ const distance = 4.9 * (narrow ? 1.22 : 1);+ camera.position.set(0, 2.0, distance);+ camera.lookAt(0, 0.5, 0);+ camera.updateProjectionMatrix();+ }, [camera, size]);+ return null;+}++export function LoadoutPreview({ subject, loadout, label }: { subject: PreviewSubject; loadout: Loadout; label: string }) {+ const t = useT();+ const host = useRef<HTMLDivElement>(null);+ const { generation } = useWebglSurface(host);+ const awake = useCanvasAwake(host);+ const reduced = useReducedMotion() ?? false;+ const spin = useRef(0.4);+ const drag = useRef<{ x: number; id: number } | null>(null);+ const onPointerDown = (e: ReactPointerEvent<HTMLDivElement>) => {+ if (e.button !== 0) return;+ drag.current = { x: e.clientX, id: e.pointerId };+ e.currentTarget.setPointerCapture(e.pointerId);+ };+ const onPointerMove = (e: ReactPointerEvent<HTMLDivElement>) => {+ const d = drag.current;+ if (!d || d.id !== e.pointerId) return;+ spin.current += (e.clientX - d.x) * 0.012;+ d.x = e.clientX;+ };+ const onPointerUp = (e: ReactPointerEvent<HTMLDivElement>) => { if (drag.current?.id === e.pointerId) drag.current = null; };+ return (+ <div ref={host} className="hall-preview" role="img" aria-label={label}+ onPointerDown={onPointerDown} onPointerMove={onPointerMove} onPointerUp={onPointerUp} onPointerCancel={onPointerUp}>+ <PreviewBoundary fallback={<p className="hall-preview-fallback">{t("society.figure.unavailable")}</p>}>+ <Canvas key={generation} dpr={[1, 1.5]} frameloop={awake ? "always" : "never"}+ gl={{ antialias: true, alpha: true, powerPreference: "low-power" }} camera={{ fov: 30, near: 0.1, far: 40, position: [0, 1.75, 4.1] }}+ onCreated={({ gl }) => gl.setClearColor(0x000000, 0)}>+ <Suspense fallback={null}>+ <PreviewScene subject={subject} loadout={loadout} paused={!awake} reduced={reduced} spin={spin} />+ </Suspense>+ </Canvas>+ </PreviewBoundary>+ {/* A trail only shows in motion; with reduced motion the figure stands, so say why the try-on looks the same. */}+ {reduced && loadout.trail && <p className="hall-preview-note">{t("society.hall.trail_reduced")}</p>}+ </div>+ );+}++class PreviewBoundary extends Component<{ fallback: ReactNode; children: ReactNode }, { failed: boolean }> {+ state = { failed: false };+ static getDerivedStateFromError(): { failed: boolean } { return { failed: true }; }+ componentDidCatch(error: Error, info: ErrorInfo): void {+ // A WebGL that cannot be created is a stated fallback, not a silent one.+ console.warn("[society] studio preview fell back to text:", error.message, info.componentStack);+ }+ render(): ReactNode { return this.state.failed ? this.props.fallback : this.props.children; }+}diff --git a/jarvis/ui/web/frontend/src/components/society/progression/hall/RewardsTab.tsx b/jarvis/ui/web/frontend/src/components/society/progression/hall/RewardsTab.tsxnew file mode 100644index 0000000000..9d730a8976--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/progression/hall/RewardsTab.tsx@@ -0,0 +1,151 @@+/**+ * The reward road: every level that brings something — pieces to wear and+ * new titles — from the first unlock to the cap, as one horizontal road with+ * the subject's own position on it. Choosing a step shows it below: the+ * subject in the preview wearing that piece, how rare it is, at which level+ * it opens and how much XP is still missing, and a button to put it on once+ * it is open.+ */+import { useEffect, useMemo, useRef, useState } from "react";+import { useT } from "@/i18n";+import { equippedFor, rewardRoad, type SlotChoice } from "../cosmetics";+import { slotOf, type RewardId, type Slot } from "../levelCatalog";+import type { RewardRow } from "../progressionApi";+import { useProgression } from "../progressionStore";+import { RewardIcon } from "../RewardIcon";+import { rarityOf, xpToReach } from "./hallModel";+import { LockGlyph, TabIcon, type HallWho } from "./hallParts";+import { LoadoutPreview } from "./LoadoutPreview";+import { FramePlate } from "./StudioTab";++const NO_REWARDS: RewardRow[] = [];+const NO_TITLES: { level: number; title: string }[] = [];+const NO_CURVE: number[] = [0];+const NO_CHOICES: Partial<Record<Slot, SlotChoice>> = {};++interface Step { level: number; rewards: RewardRow[]; title?: string }++/** The road's steps: each level with a reward or a new title, lowest first. */+export function roadSteps(road: readonly RewardRow[], titles: readonly { level: number; title: string }[], kind: "person" | "pet"): Step[] {+ const byLevel = new Map<number, Step>();+ for (const reward of road) {+ const at = reward.levels[kind] ?? 0;+ const step = byLevel.get(at) ?? { level: at, rewards: [] };+ step.rewards.push(reward);+ byLevel.set(at, step);+ }+ for (const band of titles) {+ if (band.level <= 1) continue;+ const step = byLevel.get(band.level) ?? { level: band.level, rewards: [] };+ step.title = band.title;+ byLevel.set(band.level, step);+ }+ return [...byLevel.values()].sort((a, b) => a.level - b.level);+}++export function RewardsTab({ who }: { who: HallWho }) {+ const t = useT();+ const rewards = useProgression((s) => s.snapshot?.rewards ?? NO_REWARDS);+ const titles = useProgression((s) => s.snapshot?.titles[who.kind] ?? NO_TITLES);+ const curve = useProgression((s) => s.snapshot?.levelXp ?? NO_CURVE);+ const subject = useProgression((s) => s.subjects[who.subjectId]);+ const choices = useProgression((s) => s.choices[who.who] ?? NO_CHOICES);+ const choose = useProgression((s) => s.choose);+ const focus = useProgression((s) => s.focusReward);+ const level = subject?.level ?? 1;+ const road = useMemo(() => rewardRoad(rewards, who.kind), [rewards, who.kind]);+ const steps = useMemo(() => roadSteps(road, titles, who.kind), [road, titles, who.kind]);+ const nextStep = steps.find((s) => s.level > level);+ const initial = (focus && road.find((r) => r.rewardId === focus)) || nextStep?.rewards[0] || road[road.length - 1];+ const [selected, setSelected] = useState<{ level: number; reward: RewardId | null }>(() => ({+ level: initial ? initial.levels[who.kind] ?? 1 : nextStep?.level ?? 1, reward: initial?.rewardId ?? null,+ }));+ const step = steps.find((s) => s.level === selected.level) ?? nextStep ?? steps[0];+ const reward = step?.rewards.find((r) => r.rewardId === selected.reward) ?? step?.rewards[0];+ const equipped = useMemo(() => equippedFor(rewards, who.kind, level, choices), [rewards, who.kind, level, choices]);+ const loadout = reward ? { ...equipped, [slotOf(reward.rewardId)]: reward.rewardId } : equipped;+ const track = useRef<HTMLOListElement>(null);+ // Open on the chosen step, not on the first one.+ useEffect(() => {+ track.current?.querySelector("[aria-pressed='true']")?.scrollIntoView({ block: "nearest", inline: "center" });+ }, []);+ if (!step) return <p className="hall-empty">{t("society.hall.all_unlocked")}</p>;+ const open = level >= step.level;+ const missing = xpToReach(curve, subject?.xp ?? 0, step.level);+ const worn = reward ? equipped[reward.slot] === reward.rewardId : false;+ return (+ <div className="hall-rewards">+ <p className="hall-lead">{t("society.hall.road_body")}</p>+ <ol ref={track} className="hall-road">+ {steps.map((s, i) => {+ const done = level >= s.level;+ const here = s === nextStep;+ return (+ <li key={s.level} data-done={done || undefined} data-here={here || undefined}>+ {here && <span className="hall-road-here">{t("society.hall.road_here").replace("{0}", String(level))}</span>}+ <button type="button" className="hall-road-step" aria-pressed={s.level === step.level}+ onClick={() => setSelected({ level: s.level, reward: s.rewards[0]?.rewardId ?? null })}>+ <span className="hall-road-level">{t("society.level.lv").replace("{0}", String(s.level))}</span>+ <span className="hall-road-icons">+ {s.rewards.map((r) => <RewardIcon key={r.rewardId} reward={r.rewardId} size={28} />)}+ {s.title && <span className="hall-road-title-mark" aria-hidden><TabIcon path="M7 3.5h10v17l-5-3.6-5 3.6z" size={16} /></span>}+ </span>+ {s.title && <span className="hall-road-title">{t(`society.level.title.${s.title}`)}</span>}+ {!done && <LockGlyph />}+ </button>+ {i < steps.length - 1 && <span className="hall-road-link" aria-hidden />}+ </li>+ );+ })}+ </ol>++ <div className="hall-detail">+ <div className="hall-stage hall-stage-small">+ <LoadoutPreview subject={who.preview} loadout={loadout} label={t("society.hall.preview_label").replace("{0}", who.name)} />+ {reward?.slot === "frame" && (+ <div className="hall-stage-bottom"><FramePlate name={who.name} level={step.level} frame={reward.rewardId} /></div>+ )}+ </div>+ <div className="hall-detail-info">+ <span className="hall-detail-kicker" data-open={open || undefined}>+ {open ? t("society.hall.reward_open").replace("{0}", String(step.level)) : t("society.hall.reward_locked").replace("{0}", String(step.level))}+ </span>+ {step.rewards.length > 1 && (+ <div className="hall-detail-pick" role="group" aria-label={t("society.level.lv").replace("{0}", String(step.level))}>+ {step.rewards.map((r) => (+ <button key={r.rewardId} type="button" aria-pressed={r.rewardId === reward?.rewardId}+ onClick={() => setSelected({ level: step.level, reward: r.rewardId })}>+ <RewardIcon reward={r.rewardId} size={22} />+ {t(`society.level.reward.${r.rewardId}`)}+ </button>+ ))}+ </div>+ )}+ {reward && (+ <>+ <h3>{t(`society.level.reward.${reward.rewardId}`)}</h3>+ <span className="hall-card-meta">+ <span className="hall-rarity" data-rarity={rarityOf(step.level)}>{t(`society.hall.rarity.${rarityOf(step.level)}`)}</span>+ <span>{t(`society.level.slot.${reward.slot}`)}</span>+ </span>+ <p>{t(`society.hall.slot_hint.${reward.slot}`)}</p>+ </>+ )}+ {step.title && (+ <p className="hall-detail-title">+ {t("society.level.title_line").replace("{0}", t(`society.level.title.${step.title}`))}+ </p>+ )}+ {!open && <p className="hall-detail-missing">{t("society.hall.reward_missing").replace("{0}", missing.toLocaleString())}</p>}+ {reward && open && (+ worn+ ? <span className="hall-detail-worn">{t("society.hall.wearing_now")}</span>+ : <button type="button" className="hall-button hall-button-primary" onClick={() => choose(who.who, reward.slot, reward.rewardId)}>+ {t("society.hall.put_on")}+ </button>+ )}+ </div>+ </div>+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/society/progression/hall/StudioTab.tsx b/jarvis/ui/web/frontend/src/components/society/progression/hall/StudioTab.tsxnew file mode 100644index 0000000000..bb5c3fdc39--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/progression/hall/StudioTab.tsx@@ -0,0 +1,137 @@+/**+ * The Upgrade Studio: the dressing room for the person and their pet.+ *+ * The live preview on the left wears the current loadout. On the right, one+ * slot at a time (frame, trail, aura, gadget): "automatic" (always the best+ * unlocked piece), "nothing", and every piece the subject can ever wear as a+ * card. An unlocked piece is put on with one click; a locked one is tried on+ * in the preview, marked as a try-on with the level and XP it still needs.+ * The frame is not worn on the body, so the preview shows it on a name plate.+ */+import { useMemo, useState } from "react";+import { useT } from "@/i18n";+import { equippedFor, rewardRoad, type SlotChoice } from "../cosmetics";+import { FRAME_STYLE, SLOTS, slotOf, type RewardId, type Slot } from "../levelCatalog";+import type { RewardRow } from "../progressionApi";+import { useProgression } from "../progressionStore";+import { RewardIcon } from "../RewardIcon";+import { rarityOf, xpToReach } from "./hallModel";+import { LevelHero, LockGlyph, TabIcon, type HallWho } from "./hallParts";+import { LoadoutPreview } from "./LoadoutPreview";++const NO_REWARDS: RewardRow[] = [];+const NO_CURVE: number[] = [0];+const NO_CHOICES: Partial<Record<Slot, SlotChoice>> = {};++/** The level number on a name plate in the frame a loadout wears: how the frame looks where it is worn. */+export function FramePlate({ name, level, frame }: { name: string; level: number; frame: RewardId | undefined }) {+ const style = FRAME_STYLE[(frame ?? "frame_none") as keyof typeof FRAME_STYLE];+ return (+ <span className="hall-plate">+ <span>{name}</span>+ <span className="level-chip" style={{ background: style.fill, color: style.ink, boxShadow: `inset 0 0 0 1.5px ${style.ring}, 0 0 10px ${style.ring}66` }}>{level}</span>+ </span>+ );+}++export function StudioTab({ who }: { who: HallWho }) {+ const t = useT();+ const rewards = useProgression((s) => s.snapshot?.rewards ?? NO_REWARDS);+ const curve = useProgression((s) => s.snapshot?.levelXp ?? NO_CURVE);+ const subject = useProgression((s) => s.subjects[who.subjectId]);+ const choices = useProgression((s) => s.choices[who.who] ?? NO_CHOICES);+ const choose = useProgression((s) => s.choose);+ const focus = useProgression((s) => s.focusReward);+ const level = subject?.level ?? 1;+ const road = useMemo(() => rewardRoad(rewards, who.kind), [rewards, who.kind]);+ const focusRow = focus ? road.find((r) => r.rewardId === focus) : undefined;+ const [slot, setSlot] = useState<Slot>(focusRow?.slot ?? "gadget");+ const [tryOn, setTryOn] = useState<RewardId | null>(focusRow && (focusRow.levels[who.kind] ?? 0) > level ? focusRow.rewardId : null);+ const equipped = useMemo(() => equippedFor(rewards, who.kind, level, choices), [rewards, who.kind, level, choices]);+ const loadout = tryOn ? { ...equipped, [slotOf(tryOn)]: tryOn } : equipped;+ const slots = SLOTS.filter((s) => road.some((r) => r.slot === s));+ const inSlot = road.filter((r) => r.slot === slot);+ const current: SlotChoice = choices[slot] ?? "auto";+ const tryRow = tryOn ? road.find((r) => r.rewardId === tryOn) : undefined;+ const tryAt = tryRow?.levels[who.kind] ?? 0;++ const pick = (choice: SlotChoice) => { choose(who.who, slot, choice); setTryOn(null); };++ return (+ <div className="hall-studio">+ <div className="hall-stage">+ <LoadoutPreview subject={who.preview} loadout={loadout}+ label={t("society.hall.preview_label").replace("{0}", who.name)} />+ <div className="hall-stage-top">+ <LevelHero who={who} compact />+ </div>+ <div className="hall-stage-bottom">+ {tryRow ? (+ <div className="hall-tryon" role="status">+ <span className="hall-tryon-badge">{t("society.hall.try_on")}</span>+ <span>+ <strong>{t(`society.level.reward.${tryRow.rewardId}`)}</strong>+ <em>{t("society.hall.try_on_line").replace("{0}", String(tryAt))+ .replace("{1}", xpToReach(curve, subject?.xp ?? 0, tryAt).toLocaleString())}</em>+ </span>+ <button type="button" className="hall-button" onClick={() => setTryOn(null)}>{t("society.hall.try_on_back")}</button>+ </div>+ ) : (+ <FramePlate name={who.name} level={level} frame={loadout.frame} />+ )}+ <span className="hall-stage-hint">{t("society.hall.drag_hint")}</span>+ </div>+ </div>++ <div className="hall-wardrobe">+ <p className="hall-lead">{who.who === "person" ? t("society.hall.studio_body_you") : t("society.hall.studio_body").replace("{0}", who.name)}</p>+ <div className="hall-slots" role="tablist" aria-label={t("society.hall.slots_label")}>+ {slots.map((s) => {+ const worn = loadout[s];+ return (+ <button key={s} type="button" role="tab" aria-selected={slot === s} className="hall-slot" onClick={() => setSlot(s)}>+ {worn ? <RewardIcon reward={worn} size={26} /> : <span className="hall-slot-empty" aria-hidden />}+ <span>{t(`society.level.slot.${s}`)}</span>+ </button>+ );+ })}+ </div>+ <p className="hall-hint">{t(`society.hall.slot_hint.${slot}`)}</p>+ <div className="hall-items" role="group" aria-label={t(`society.level.slot.${slot}`)}>+ <button type="button" className="hall-item hall-item-plain" aria-pressed={current === "auto" && !tryOn} onClick={() => pick("auto")}>+ <span className="hall-item-tile" aria-hidden><TabIcon path="M12 3v3M12 18v3M3 12h3M18 12h3M6 6l2 2M16 16l2 2M6 18l2-2M16 8l2-2" size={22} /></span>+ <strong>{t("society.level.auto")}</strong>+ <em>{t("society.hall.auto_hint")}</em>+ </button>+ <button type="button" className="hall-item hall-item-plain" aria-pressed={current === "none" && !tryOn} onClick={() => pick("none")}>+ <span className="hall-item-tile" aria-hidden><TabIcon path="M5 5l14 14M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18z" size={22} /></span>+ <strong>{t("society.level.none")}</strong>+ <em>{t("society.hall.none_hint")}</em>+ </button>+ {inSlot.map((reward) => {+ const at = reward.levels[who.kind] ?? 0;+ const open = level >= at;+ const worn = equipped[slot] === reward.rewardId;+ const pressed = tryOn ? tryOn === reward.rewardId : current === reward.rewardId;+ const rarity = rarityOf(at);+ return (+ <button key={reward.rewardId} type="button" className="hall-item" data-rarity={rarity} data-open={open || undefined}+ aria-pressed={pressed}+ aria-label={open ? undefined : t("society.hall.locked_aria").replace("{0}", t(`society.level.reward.${reward.rewardId}`)).replace("{1}", String(at))}+ onClick={() => (open ? pick(reward.rewardId) : setTryOn(reward.rewardId))}>+ <RewardIcon reward={reward.rewardId} size={46} />+ <strong>{t(`society.level.reward.${reward.rewardId}`)}</strong>+ <span className="hall-rarity" data-rarity={rarity}>{t(`society.hall.rarity.${rarity}`)}</span>+ <em data-open={open || undefined}>+ {worn ? t("society.hall.equipped") : open ? t("society.hall.unlocked") : t("society.level.locked_at").replace("{0}", String(at))}+ </em>+ {!open && <LockGlyph />}+ {worn && <span className="hall-item-check" aria-hidden><TabIcon path="M5 12.5l4.5 4.5L19 7.5" size={14} /></span>}+ </button>+ );+ })}+ </div>+ </div>+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/society/progression/hall/hall.css b/jarvis/ui/web/frontend/src/components/society/progression/hall/hall.cssnew file mode 100644index 0000000000..5abfedbe61--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/progression/hall/hall.css@@ -0,0 +1,215 @@+/*+ * The Level Hall screen. The chrome (panel, tabs, cards, text) uses theme+ * tokens, so light and dark mode both read. The game's own pieces keep one+ * look in both modes: the gold of levels, the teal of the pet, the rarity+ * colours of rewards, and the midnight stage the preview stands on (the same+ * room as the hall in the world).+ */++.hall-layer { position:absolute; inset:0; z-index:50; display:flex; align-items:center; justify-content:center; padding:16px; background:rgb(0 0 0 / .38); backdrop-filter:blur(2px); }+.hall { display:flex; flex-direction:column; width:min(1120px, 100%); height:min(800px, 100%); overflow:hidden; border:1px solid hsl(var(--border)); border-radius:18px; background:hsl(var(--popover)); color:hsl(var(--popover-foreground)); box-shadow:0 24px 70px rgb(0 0 0 / .4); animation:hall-in .28s cubic-bezier(.2,.9,.3,1) both; }+.hall:focus { outline:none; }+@keyframes hall-in { from { opacity:0; transform:translateY(12px) scale(.985); } to { opacity:1; transform:none; } }++/* ---------- head, tabs, foot ---------- */+.hall-head { display:flex; align-items:center; gap:14px; padding:14px 16px 10px 18px; }+.hall-brand { display:flex; align-items:center; gap:11px; flex:1; min-width:0; }+.hall-brand-mark { display:inline-flex; flex:none; align-items:center; justify-content:center; width:38px; height:38px; border-radius:11px; color:#2a1c00; background:linear-gradient(145deg, #ffe08a, #f0a92b); box-shadow:0 0 0 1px rgb(255 255 255 / .35) inset, 0 4px 14px rgb(240 169 43 / .35); }+.hall-brand h2 { margin:0; font-size:17px; font-weight:800; letter-spacing:-.01em; }+.hall-brand small { display:block; margin-top:1px; font-size:12px; color:hsl(var(--muted-foreground)); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }+.hall-subject { display:inline-flex; flex:none; gap:2px; padding:3px; border-radius:999px; background:hsl(var(--secondary)); }+.hall-subject button { border:0; border-radius:999px; padding:5px 13px; background:none; color:hsl(var(--muted-foreground)); font:inherit; font-size:12.5px; font-weight:600; cursor:pointer; }+.hall-subject button[aria-checked="true"] { background:hsl(var(--popover)); color:hsl(var(--foreground)); box-shadow:0 1px 3px rgb(0 0 0 / .18); }+.hall-subject button:focus-visible, .hall-close:focus-visible, .hall-tab:focus-visible { outline:2px solid hsl(var(--ring)); outline-offset:1px; }+.hall-close { display:inline-flex; flex:none; align-items:center; justify-content:center; width:34px; height:34px; border:0; border-radius:10px; background:none; color:hsl(var(--muted-foreground)); cursor:pointer; }+.hall-close:hover { background:hsl(var(--secondary)); color:hsl(var(--foreground)); }+.hall-tabs { display:flex; gap:2px; padding:0 12px; border-bottom:1px solid hsl(var(--border)); overflow-x:auto; scrollbar-width:none; }+.hall-tab { display:inline-flex; flex:none; align-items:center; gap:7px; padding:10px 12px 9px; border:0; border-bottom:2px solid transparent; background:none; color:hsl(var(--muted-foreground)); font:inherit; font-size:13px; font-weight:600; cursor:pointer; }+.hall-tab:hover { color:hsl(var(--foreground)); }+.hall-tab[aria-selected="true"] { color:hsl(var(--foreground)); border-bottom-color:#f0a92b; }+.hall-tab[aria-selected="true"] svg { color:#f0a92b; }+.hall-body { flex:1; min-height:0; overflow:auto; padding:18px; font-size:13px; }+.hall-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:9px 18px 11px; border-top:1px solid hsl(var(--border)); font-size:12px; color:hsl(var(--muted-foreground)); }+.hall-sound { display:inline-flex; align-items:center; gap:7px; color:hsl(var(--foreground)); cursor:pointer; }+.hall-sound input { accent-color:#f0a92b; }++/* ---------- shared ---------- */+.hall-section { display:flex; flex-direction:column; gap:10px; min-width:0; }+.hall-section > header { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }+.hall-section h3 { margin:0; font-size:11px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:hsl(var(--muted-foreground)); }+.hall-link { border:0; padding:0; background:none; color:hsl(var(--accent)); font:inherit; font-size:12.5px; font-weight:600; cursor:pointer; }+.hall-link:hover { text-decoration:underline; }+.hall-lead { margin:0; font-size:13.5px; color:hsl(var(--foreground)); }+.hall-hint { margin:0; font-size:12px; color:hsl(var(--muted-foreground)); }+.hall-empty { margin:0; padding:24px; text-align:center; color:hsl(var(--muted-foreground)); }+.hall-button { border:1px solid hsl(var(--border)); border-radius:10px; padding:8px 14px; background:hsl(var(--background)); color:hsl(var(--foreground)); font:inherit; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; }+.hall-button:hover { background:hsl(var(--secondary)); }+.hall-button:focus-visible, .hall-card:focus-visible, .hall-item:focus-visible, .hall-slot:focus-visible, .hall-road-step:focus-visible { outline:2px solid hsl(var(--ring)); outline-offset:2px; }+.hall-button-primary { align-self:flex-start; border-color:transparent; background:linear-gradient(180deg, #ffd96e, #f0a92b); color:#2a1c00; font-weight:800; box-shadow:0 4px 14px rgb(240 169 43 / .35); }+.hall-button-primary:hover { background:linear-gradient(180deg, #ffe28a, #f5b23d); }++/* Rarity: one colour per tier, the same in both modes; text mixes it with the theme ink to stay legible. */+[data-rarity="common"] { --rar:148 163 184; }+[data-rarity="rare"] { --rar:59 130 246; }+[data-rarity="epic"] { --rar:168 85 247; }+[data-rarity="legendary"] { --rar:245 158 11; }+.hall-rarity { display:inline-flex; align-items:center; padding:1px 7px; border-radius:999px; background:rgb(var(--rar) / .16); color:color-mix(in srgb, rgb(var(--rar)) 72%, hsl(var(--foreground))); font-size:10px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }+.hall-lock { position:absolute; top:9px; right:9px; color:hsl(var(--muted-foreground)); }+/* A locked piece keeps its colours, dimmed: every card is also a preview of what is coming. */+.hall-card:not([data-open]) .level-reward-icon, .hall-item[data-rarity]:not([data-open]) .level-reward-icon,+.hall-road > li:not([data-done]) .level-reward-icon { filter:saturate(.6) brightness(.82); opacity:.78; }++/* ---------- level hero ---------- */+.hall-hero { display:flex; align-items:center; gap:22px; padding:18px 22px; border:1px solid rgb(245 184 61 / .35); border-radius:16px; background:radial-gradient(120% 160% at 0% 0%, rgb(245 184 61 / .18), transparent 60%), hsl(var(--secondary) / .6); }+.hall-hero[data-kind="pet"] { border-color:rgb(45 212 191 / .38); background:radial-gradient(120% 160% at 0% 0%, rgb(45 212 191 / .16), transparent 60%), hsl(var(--secondary) / .6); }+.hall-hero[data-compact] { gap:14px; padding:10px 14px; }+.hall-hero .level-ring b { font-size:34px; }+.hall-hero[data-compact] .level-ring b { font-size:22px; }+.hall-hero-body { display:flex; flex-direction:column; gap:6px; flex:1; min-width:0; }+.hall-hero-name { font-size:21px; font-weight:800; letter-spacing:-.01em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }+.hall-hero[data-compact] .hall-hero-name { font-size:15px; }+.hall-hero-title { align-self:flex-start; padding:2px 10px; border-radius:999px; background:rgb(245 184 61 / .18); color:color-mix(in srgb, #f0a92b 70%, hsl(var(--foreground))); font-size:12px; font-weight:800; }+.hall-hero[data-kind="pet"] .hall-hero-title { background:rgb(45 212 191 / .16); color:color-mix(in srgb, #14b8a6 70%, hsl(var(--foreground))); }+.hall-hero .level-bar { height:10px; margin-top:4px; }+.hall-hero[data-compact] .level-bar { height:7px; }+.hall-hero-xp { display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; font-size:13px; font-variant-numeric:tabular-nums; }+.hall-hero-xp span { color:hsl(var(--muted-foreground)); }+.hall-hero[data-compact] .hall-hero-xp { font-size:11.5px; }+.hall-hero-meta { display:flex; gap:16px; flex-wrap:wrap; font-size:12px; color:hsl(var(--muted-foreground)); }++/* ---------- overview ---------- */+.hall-overview { display:grid; grid-template-columns:minmax(0, 1.35fr) minmax(0, 1fr); gap:18px; align-items:start; }+.hall-overview > .hall-hero, .hall-overview > .hall-wide { grid-column:1 / -1; }+.hall-cards { display:grid; grid-template-columns:1fr; gap:8px; }+.hall-card { position:relative; display:flex; align-items:center; gap:12px; width:100%; padding:11px 34px 11px 11px; border:1px solid hsl(var(--border)); border-left:3px solid rgb(var(--rar)); border-radius:12px; background:hsl(var(--background)); color:inherit; font:inherit; text-align:left; cursor:pointer; transition:background .12s, transform .12s; }+.hall-card:hover { background:hsl(var(--secondary)); transform:translateX(2px); }+.hall-card-text { display:flex; flex-direction:column; gap:3px; min-width:0; }+.hall-card-text strong { font-size:14px; }+.hall-card-meta { display:flex; align-items:center; gap:8px; font-size:11.5px; color:hsl(var(--muted-foreground)); }+.hall-card-state { font-size:11.5px; color:hsl(var(--muted-foreground)); font-variant-numeric:tabular-nums; }+.hall-card-state[data-open] { color:hsl(var(--success)); font-weight:600; }+.hall-rules { display:grid; grid-template-columns:repeat(auto-fill, minmax(250px, 1fr)); gap:6px 10px; margin:0; padding:0; list-style:none; }+.hall-overview .hall-rules { grid-template-columns:1fr; }+.hall-rule { display:flex; align-items:flex-start; gap:10px; padding:8px 10px; border-radius:10px; background:hsl(var(--secondary) / .55); }+.hall-rule-xp { flex:none; min-width:40px; padding:2px 6px; border-radius:7px; background:rgb(245 184 61 / .2); color:color-mix(in srgb, #f0a92b 60%, hsl(var(--foreground))); font-size:12px; font-weight:800; text-align:center; font-variant-numeric:tabular-nums; }+.hall-rule-text { display:flex; flex-direction:column; gap:2px; font-size:13px; }+.hall-rule-text em { font-style:normal; font-size:11px; color:hsl(var(--muted-foreground)); }++/* ---------- the stage (game look in both modes) ---------- */+.hall-stage { position:relative; min-height:440px; overflow:hidden; border-radius:16px; background:radial-gradient(90% 70% at 50% 38%, #2b3c7c 0%, #151d3d 58%, #0a0f2c 100%); box-shadow:inset 0 0 0 1px rgb(255 215 110 / .22); color:#fff; }+.hall-stage-small { min-height:330px; }+.hall-preview { position:absolute; inset:0; cursor:grab; touch-action:none; }+.hall-preview:active { cursor:grabbing; }+.hall-preview-note { position:absolute; left:12px; right:12px; top:50%; margin:0; padding:6px 10px; border-radius:10px; background:rgb(10 15 44 / .8); color:rgb(255 255 255 / .85); font-size:12px; text-align:center; pointer-events:none; }+.hall-preview-fallback { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; margin:0; padding:20px; text-align:center; color:rgb(255 255 255 / .7); }+.hall-stage-top { position:absolute; top:12px; left:12px; right:12px; pointer-events:none; }+.hall-stage .hall-hero { border-color:rgb(255 215 110 / .3); background:rgb(10 15 44 / .62); backdrop-filter:blur(6px); color:#fff; }+.hall-stage .hall-hero[data-kind="pet"] { border-color:rgb(94 234 212 / .35); }+.hall-stage .hall-hero-title { color:#ffe08a; background:rgb(255 210 94 / .18); }+.hall-stage .hall-hero[data-kind="pet"] .hall-hero-title { color:#99f6e4; background:rgb(94 234 212 / .16); }+.hall-stage .hall-hero-xp span, .hall-stage .hall-hero-meta { color:rgb(255 255 255 / .7); }+.hall-stage .level-bar { background:rgb(255 255 255 / .16); }+.hall-stage .level-ring-track { stroke:rgb(255 255 255 / .2); }+.hall-stage-bottom { position:absolute; left:12px; right:12px; bottom:12px; display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none; }+.hall-stage-bottom > * { pointer-events:auto; }+.hall-stage-hint { font-size:11px; color:rgb(255 255 255 / .55); pointer-events:none !important; }+.hall-plate { display:inline-flex; align-items:center; gap:8px; padding:4px 6px 4px 12px; border-radius:999px; background:rgb(14 18 36 / .85); box-shadow:0 0 0 1px rgb(255 255 255 / .12); color:#fff; font-size:13px; font-weight:700; }+.hall-plate .level-chip { min-width:26px; height:22px; font-size:12px; }+.hall-tryon { display:flex; align-items:center; gap:12px; max-width:100%; padding:8px 8px 8px 10px; border:1px solid #ffd25e; border-radius:12px; background:rgb(26 18 2 / .97); color:#fff3c4; box-shadow:0 0 24px rgb(255 210 94 / .3); }+.hall-tryon > span:nth-child(2) { display:flex; flex-direction:column; gap:1px; min-width:0; }+.hall-tryon strong { font-size:13px; }+.hall-tryon em { font-style:normal; font-size:11.5px; color:rgb(255 243 196 / .8); }+.hall-tryon-badge { flex:none; padding:3px 8px; border-radius:999px; background:#ffd25e; color:#2a1c00; font-size:10px; font-weight:900; letter-spacing:.1em; text-transform:uppercase; }+.hall-tryon .hall-button { border-color:rgb(255 210 94 / .5); background:rgb(255 255 255 / .08); color:#fff3c4; font-size:12px; padding:6px 10px; }+.hall-tryon .hall-button:hover { background:rgb(255 255 255 / .16); }++/* ---------- studio ---------- */+.hall-studio { display:grid; grid-template-columns:minmax(300px, 1.05fr) minmax(0, 1fr); gap:18px; min-height:100%; }+.hall-studio .hall-stage { min-height:520px; }+.hall-wardrobe { display:flex; flex-direction:column; gap:12px; min-width:0; }+.hall-slots { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:8px; }+.hall-slot { display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 6px 9px; border:1px solid hsl(var(--border)); border-radius:12px; background:hsl(var(--background)); color:hsl(var(--muted-foreground)); font:inherit; font-size:12px; font-weight:700; cursor:pointer; }+.hall-slot:hover { background:hsl(var(--secondary)); color:hsl(var(--foreground)); }+.hall-slot[aria-selected="true"] { border-color:#f0a92b; background:rgb(245 184 61 / .1); color:hsl(var(--foreground)); box-shadow:0 0 0 3px rgb(245 184 61 / .16); }+.hall-slot-empty { width:26px; height:26px; border:1.5px dashed hsl(var(--border)); border-radius:8px; }+.hall-items { display:grid; grid-template-columns:repeat(auto-fill, minmax(146px, 1fr)); gap:10px; }+.hall-item { position:relative; display:flex; flex-direction:column; align-items:center; gap:6px; padding:16px 10px 12px; border:1px solid hsl(var(--border)); border-bottom:3px solid rgb(var(--rar, 148 163 184)); border-radius:14px; background:hsl(var(--background)); color:inherit; font:inherit; text-align:center; cursor:pointer; transition:transform .12s, background .12s, box-shadow .12s; }+.hall-item:hover { transform:translateY(-2px); background:hsl(var(--secondary)); }+.hall-item[aria-pressed="true"] { border-color:#f0a92b; box-shadow:0 0 0 3px rgb(245 184 61 / .22); }+.hall-item[data-open] .level-reward-icon { box-shadow:0 0 16px rgb(var(--rar) / .55), inset 0 0 0 1px rgb(255 255 255 / .35); }+.hall-item strong { font-size:13px; line-height:1.25; }+.hall-item em { font-style:normal; font-size:11px; color:hsl(var(--muted-foreground)); font-variant-numeric:tabular-nums; }+.hall-item em[data-open] { color:hsl(var(--success)); font-weight:600; }+.hall-item-plain { border-bottom-color:hsl(var(--border)); }+.hall-item-tile { display:inline-flex; align-items:center; justify-content:center; width:46px; height:46px; border-radius:8px; background:hsl(var(--secondary)); color:hsl(var(--muted-foreground)); }+.hall-item-check { position:absolute; top:8px; left:8px; display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:50%; background:#22c55e; color:#fff; }++/* ---------- reward road ---------- */+.hall-rewards { display:flex; flex-direction:column; gap:14px; }+.hall-road { display:flex; align-items:center; margin:0; padding:30px 4px 10px; list-style:none; overflow-x:auto; scroll-snap-type:x proximity; }+.hall-road > li { position:relative; display:flex; flex:none; align-items:center; scroll-snap-align:center; }+.hall-road-step { position:relative; display:flex; flex-direction:column; align-items:center; gap:7px; min-width:104px; padding:10px 10px 12px; border:1px solid hsl(var(--border)); border-radius:14px; background:hsl(var(--background)); color:inherit; font:inherit; cursor:pointer; transition:transform .12s, box-shadow .12s; }+.hall-road-step:hover { background:hsl(var(--secondary)); }+.hall-road > li[data-done] .hall-road-step { border-color:rgb(245 184 61 / .55); background:rgb(245 184 61 / .08); }+.hall-road-step[aria-pressed="true"] { transform:translateY(-3px); border-color:#f0a92b; box-shadow:0 0 0 3px rgb(245 184 61 / .22), 0 8px 18px rgb(0 0 0 / .14); }+.hall-road-level { font-size:12.5px; font-weight:800; font-variant-numeric:tabular-nums; }+.hall-road-icons { display:flex; align-items:center; gap:4px; }+.hall-road-title-mark { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:8px; background:hsl(var(--secondary)); color:hsl(var(--muted-foreground)); }+.hall-road-title { padding:2px 8px; border-radius:999px; background:hsl(var(--secondary)); font-size:10.5px; font-weight:700; white-space:nowrap; }+.hall-road-step .hall-lock { top:6px; right:6px; }+.hall-road-link { width:26px; height:3px; border-radius:2px; background:hsl(var(--border)); }+.hall-road > li[data-done] .hall-road-link { background:linear-gradient(90deg, #f0a92b, #ffd25e); }+.hall-road-here { position:absolute; top:-26px; left:0; padding:2px 9px; border-radius:999px; background:#f0a92b; color:#2a1c00; font-size:10.5px; font-weight:800; white-space:nowrap; box-shadow:0 2px 8px rgb(240 169 43 / .4); }+.hall-detail { display:grid; grid-template-columns:minmax(280px, 1fr) minmax(0, 1fr); gap:20px; align-items:stretch; }+.hall-detail-info { display:flex; flex-direction:column; justify-content:center; gap:10px; min-width:0; }+.hall-detail-info h3 { margin:0; font-size:24px; font-weight:800; letter-spacing:-.01em; }+.hall-detail-info p { margin:0; color:hsl(var(--muted-foreground)); }+.hall-detail-kicker { font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:hsl(var(--muted-foreground)); }+.hall-detail-kicker[data-open] { color:hsl(var(--success)); }+.hall-detail-pick { display:flex; gap:6px; flex-wrap:wrap; }+.hall-detail-pick button { display:inline-flex; align-items:center; gap:6px; padding:4px 10px 4px 4px; border:1px solid hsl(var(--border)); border-radius:999px; background:hsl(var(--background)); color:inherit; font:inherit; font-size:12px; font-weight:600; cursor:pointer; }+.hall-detail-pick button[aria-pressed="true"] { border-color:#f0a92b; background:rgb(245 184 61 / .1); }+.hall-detail-title { font-weight:700; color:hsl(var(--foreground)) !important; }+.hall-detail-missing { font-size:15px; font-weight:700; color:color-mix(in srgb, #f0a92b 70%, hsl(var(--foreground))) !important; }+.hall-detail-worn { align-self:flex-start; padding:5px 12px; border-radius:999px; background:hsl(var(--success) / .14); color:hsl(var(--success)); font-size:12.5px; font-weight:700; }++/* ---------- guide ---------- */+.hall-guide { display:flex; flex-direction:column; gap:20px; }+.hall-steps { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; margin:0; padding:0; list-style:none; }+.hall-steps > li { display:flex; flex-direction:column; gap:6px; padding:16px; border:1px solid hsl(var(--border)); border-radius:14px; background:hsl(var(--secondary) / .5); }+.hall-steps strong { font-size:15px; }+.hall-steps p { margin:0; color:hsl(var(--muted-foreground)); line-height:1.45; }+.hall-step-n { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:linear-gradient(145deg, #ffe08a, #f0a92b); color:#2a1c00; font-size:14px; font-weight:900; }+.hall-costs { display:flex; flex-direction:column; gap:2px; margin:4px 0 0; padding:0; list-style:none; font-size:12px; font-variant-numeric:tabular-nums; }+.hall-rule-group h4 { margin:2px 0 8px; font-size:13px; font-weight:700; }+.hall-guide-section { padding-top:4px; }++/* ---------- team ---------- */+.hall-team { display:flex; flex-direction:column; gap:12px; }+.hall-ranking { display:flex; flex-direction:column; gap:4px; margin:0; padding:0; list-style:none; }+.hall-ranking li { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:10px; }+.hall-ranking li:hover { background:hsl(var(--secondary) / .6); }+.hall-rank { width:24px; text-align:center; font-size:13px; font-weight:800; color:hsl(var(--muted-foreground)); }+.hall-ranking li[data-podium="1"] .hall-rank { color:#e0a10b; }+.hall-ranking li[data-podium="2"] .hall-rank { color:#94a3b8; }+.hall-ranking li[data-podium="3"] .hall-rank { color:#c07a45; }+.hall-rank-body { display:flex; flex-direction:column; gap:5px; flex:1; min-width:0; }+.hall-rank-body em { font-style:normal; font-size:11.5px; color:hsl(var(--muted-foreground)); }+.hall-rank-xp { font-size:12px; color:hsl(var(--muted-foreground)); font-variant-numeric:tabular-nums; white-space:nowrap; }++@media (max-width:820px) {+ .hall-overview, .hall-studio, .hall-detail { grid-template-columns:1fr; }+ .hall-studio .hall-stage { min-height:360px; }+ .hall-steps { grid-template-columns:1fr; }+ .hall-brand small { display:none; }+}+@media (max-width:520px) {+ .hall-layer { padding:0; }+ .hall { border-radius:0; height:100%; }+ .hall-hero { flex-direction:column; align-items:flex-start; }+ .hall-slots { grid-template-columns:repeat(2, minmax(0, 1fr)); }+}+@media (prefers-reduced-motion: reduce) {+ .hall, .hall-card, .hall-item, .hall-road-step { animation:none; transition:none; }+ .hall-card:hover, .hall-item:hover, .hall-road-step[aria-pressed="true"] { transform:none; }+}diff --git a/jarvis/ui/web/frontend/src/components/society/progression/hall/hall.test.tsx b/jarvis/ui/web/frontend/src/components/society/progression/hall/hall.test.tsxnew file mode 100644index 0000000000..8b2156356c--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/progression/hall/hall.test.tsx@@ -0,0 +1,130 @@+import { cleanup, fireEvent, render, screen, within } from "@testing-library/react";+import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";+import { loadLocaleChunk } from "@/i18n";+import { nextUnlock, rewardRoad } from "../cosmetics";+import type { ProgressionSnapshot, RewardRow, XpRuleRow } from "../progressionApi";+import { useProgression } from "../progressionStore";+import type { ToyLook } from "../../office/toyFigureModel";+import { groupRules, nextTitle, quickWins, rarityOf, upcomingLevelCosts, xpToReach } from "./hallModel";+import { LevelHallScreen } from "./LevelHallScreen";+import { roadSteps } from "./RewardsTab";++const REWARDS: RewardRow[] = [+ { rewardId: "gadget_drone", slot: "gadget", levels: { person: 10, agent: 12, pet: 9 } },+ { rewardId: "frame_bronze", slot: "frame", levels: { person: 3, agent: 3, pet: 3 } },+ { rewardId: "frame_silver", slot: "frame", levels: { person: 10, agent: 10, pet: 10 } },+ { rewardId: "trail_footprints", slot: "trail", levels: { person: 2, agent: null, pet: null } },+ { rewardId: "gadget_wings", slot: "gadget", levels: { person: 40, agent: 45, pet: null } },+];+const CURVE = [0, 40, 105, 195, 310, 450, 615, 805, 1020, 1260];+const rule = (source: XpRuleRow["source"], kind: XpRuleRow["kind"], xp: number): XpRuleRow =>+ ({ source, kind, xp, trigger: "server", cooldownS: 0, dailyCap: 0 });+const RULES: XpRuleRow[] = [+ rule("chat_turn", "person", 5), rule("agent_hired", "person", 50), rule("daily_visit", "person", 25),+ rule("quest_completed", "person", 20), rule("walk_together", "pet", 3), rule("task_done", "agent", 40),+];++function snapshot(): ProgressionSnapshot {+ return {+ subjects: [{ subjectId: "person", kind: "person", xp: 130, level: 3, xpIntoLevel: 25, xpForNext: 90, title: "newcomer" }],+ petId: "gigi", recent: [], latestSeq: 0, maxLevel: 50, levelXp: CURVE, rules: RULES, rewards: REWARDS,+ titles: { person: [{ level: 1, title: "newcomer" }, { level: 5, title: "apprentice" }], agent: [], pet: [] },+ };+}++describe("hall model", () => {+ it("grades rewards by the level they open at", () => {+ expect([2, 5, 6, 15, 16, 30, 31, 50].map(rarityOf)).toEqual(["common", "common", "rare", "rare", "epic", "epic", "legendary", "legendary"]);+ });++ it("measures what is missing on the server's curve", () => {+ expect(xpToReach(CURVE, 130, 5)).toBe(180);+ expect(xpToReach(CURVE, 999, 2)).toBe(0);+ expect(xpToReach(CURVE, 0, 99)).toBe(0);+ expect(upcomingLevelCosts(CURVE, 3, 3)).toEqual([{ level: 4, xp: 90 }, { level: 5, xp: 115 }, { level: 6, xp: 140 }]);+ expect(upcomingLevelCosts(CURVE, 9, 3)).toEqual([{ level: 10, xp: 240 }]);+ });++ it("orders the road by unlock level, slot order within a level, and skips what a kind never wears", () => {+ expect(rewardRoad(REWARDS, "person").map((r) => r.rewardId))+ .toEqual(["trail_footprints", "frame_bronze", "frame_silver", "gadget_drone", "gadget_wings"]);+ expect(rewardRoad(REWARDS, "pet").map((r) => r.rewardId)).toEqual(["frame_bronze", "gadget_drone", "frame_silver"]);+ expect(nextUnlock(REWARDS, "person", 3)?.rewardId).toBe("frame_silver");+ expect(nextUnlock(REWARDS, "person", 40)).toBeUndefined();+ });++ it("builds road steps from rewards and title bands", () => {+ const steps = roadSteps(rewardRoad(REWARDS, "person"), [{ level: 1, title: "newcomer" }, { level: 5, title: "apprentice" }, { level: 10, title: "operator" }], "person");+ expect(steps.map((s) => s.level)).toEqual([2, 3, 5, 10, 40]);+ expect(steps.find((s) => s.level === 10)).toMatchObject({ title: "operator" });+ expect(steps.find((s) => s.level === 10)!.rewards.map((r) => r.rewardId)).toEqual(["frame_silver", "gadget_drone"]);+ expect(nextTitle([{ level: 5, title: "apprentice" }, { level: 1, title: "newcomer" }], 3)).toEqual({ level: 5, title: "apprentice" });+ expect(nextTitle([{ level: 5, title: "apprentice" }], 5)).toBeUndefined();+ });++ it("groups the rules for the guide and picks repeatable quick wins", () => {+ const extra = { ...rule("chat_turn", "person", 1), source: "future_rule" as XpRuleRow["source"] };+ expect(groupRules([...RULES, extra], "person").map((g) => [g.id, g.rules.map((r) => r.source)])).toEqual([+ ["jarvis", ["chat_turn"]], ["team", ["quest_completed", "agent_hired"]], ["verse", ["daily_visit"]], ["other", ["future_rule"]],+ ]);+ expect(groupRules(RULES, "pet")).toEqual([{ id: "pet", rules: [RULES[4]] }]);+ expect(quickWins(RULES, "person", 2).map((r) => r.source)).toEqual(["daily_visit", "quest_completed"]);+ });+});++describe("Level Hall screen", () => {+ beforeAll(async () => { await loadLocaleChunk("society"); });+ beforeEach(() => {+ useProgression.setState({ snapshot: null, subjects: {}, panel: null, hallSubject: "person", focusReward: null, choices: {} });+ useProgression.getState().hydrate(snapshot(), []);+ });+ afterEach(() => { cleanup(); useProgression.getState().openPanel(null); });++ const look = {} as ToyLook;+ const mount = () => render(<LevelHallScreen agents={[]} playerName="Ruby" petName="Gigi" playerLook={look} />);++ it("stays closed until a page is opened", () => {+ mount();+ expect(screen.queryByRole("dialog")).toBeNull();+ });++ it("opens on the overview with five pages and the next unlocks", () => {+ useProgression.getState().openPanel("overview");+ mount();+ const dialog = screen.getByRole("dialog");+ const tabs = within(dialog).getAllByRole("tab");+ expect(tabs).toHaveLength(5);+ expect(tabs[0].getAttribute("aria-selected")).toBe("true");+ expect(within(dialog).getByText("Ruby")).toBeTruthy();+ // The next unlock (silver frame at level 10) opens in the studio, ready to try on.+ const cards = dialog.querySelectorAll(".hall-card");+ expect(cards.length).toBe(3);+ fireEvent.click(cards[0]);+ expect(useProgression.getState()).toMatchObject({ panel: "studio", focusReward: "frame_silver" });+ });++ it("switches between the person and the pet, and lists every way to earn on the guide", () => {+ useProgression.getState().openPanel("guide");+ mount();+ expect(screen.getAllByText("Gigi").length).toBeGreaterThan(0);+ const radios = screen.getAllByRole("radio");+ fireEvent.click(radios[1]);+ expect(useProgression.getState().hallSubject).toBe("pet");+ expect(document.querySelectorAll(".hall-rule")).toHaveLength(RULES.length);+ });++ it("closes on Escape", () => {+ useProgression.getState().openPanel("team");+ mount();+ fireEvent.keyDown(window, { key: "Escape" });+ expect(useProgression.getState().panel).toBeNull();+ });++ it("forgets a focused reward when another page opens without one", () => {+ const store = useProgression.getState();+ store.openPanel("rewards", { reward: "gadget_drone", subject: "pet" });+ expect(useProgression.getState()).toMatchObject({ panel: "rewards", focusReward: "gadget_drone", hallSubject: "pet" });+ useProgression.getState().openPanel("guide");+ expect(useProgression.getState()).toMatchObject({ focusReward: null, hallSubject: "pet" });+ });+});diff --git a/jarvis/ui/web/frontend/src/components/society/progression/hall/hallModel.ts b/jarvis/ui/web/frontend/src/components/society/progression/hall/hallModel.tsnew file mode 100644index 0000000000..d4a6b311d4--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/progression/hall/hallModel.ts@@ -0,0 +1,72 @@+/**+ * What the Level Hall screen computes from the server's numbers. Pure: the+ * curve, the rules and the reward levels all come from the snapshot; nothing+ * here re-derives the rulebook.+ */+import type { SubjectKind, XpSource } from "../levelCatalog";+import type { XpRuleRow } from "../progressionApi";++/** How rare a reward feels, by the level it unlocks at: the colour of its card. */+export type Rarity = "common" | "rare" | "epic" | "legendary";++export function rarityOf(unlockLevel: number): Rarity {+ if (unlockLevel <= 5) return "common";+ if (unlockLevel <= 15) return "rare";+ if (unlockLevel <= 30) return "epic";+ return "legendary";+}++/** XP still missing until `target` is reached (0 once it is); `levelXp[i]` is the total at which level i + 1 starts. */+export function xpToReach(levelXp: readonly number[], totalXp: number, target: number): number {+ const start = levelXp[target - 1];+ if (start === undefined) return 0;+ return Math.max(0, start - totalXp);+}++/** The size of each of the next `count` levels after `level`, for "every level takes a little more". */+export function upcomingLevelCosts(levelXp: readonly number[], level: number, count: number): { level: number; xp: number }[] {+ const out: { level: number; xp: number }[] = [];+ for (let next = level + 1; next <= level + count; next += 1) {+ const start = levelXp[next - 2], end = levelXp[next - 1];+ if (start === undefined || end === undefined) break;+ out.push({ level: next, xp: end - start });+ }+ return out;+}++/** The next title band above `level`, if any. */+export function nextTitle(bands: readonly { level: number; title: string }[], level: number): { level: number; title: string } | undefined {+ return [...bands].sort((a, b) => a.level - b.level).find((band) => band.level > level);+}++/** How the guide groups the ways to earn XP, per subject kind; a source the rulebook adds later lands in "other". */+export const RULE_GROUPS: Record<SubjectKind, readonly { id: string; sources: readonly XpSource[] }[]> = {+ person: [+ { id: "jarvis", sources: ["chat_turn", "voice_turn"] },+ { id: "team", sources: ["quest_posted", "quest_completed", "mission_completed", "agent_hired"] },+ { id: "verse", sources: ["daily_visit", "floor_discovered", "dog_petted", "dog_treat", "arcade_round", "arcade_record", "team_meeting"] },+ ],+ pet: [{ id: "pet", sources: ["jarvis_answered", "delegated", "walk_together"] }],+ agent: [{ id: "agent", sources: ["task_done", "quest_done", "answered_teammate", "task_blocked"] }],+};++/** A subject kind's rules sorted into the guide's groups, in the group's order; empty groups are dropped. */+export function groupRules(rules: readonly XpRuleRow[], kind: SubjectKind): { id: string; rules: XpRuleRow[] }[] {+ const mine = rules.filter((r) => r.kind === kind);+ const groups = RULE_GROUPS[kind].map((group) => ({+ id: group.id,+ rules: group.sources.map((source) => mine.find((r) => r.source === source)).filter((r): r is XpRuleRow => !!r),+ }));+ const known = new Set(RULE_GROUPS[kind].flatMap((g) => g.sources));+ const other = mine.filter((r) => !known.has(r.source));+ if (other.length > 0) groups.push({ id: "other", rules: other });+ return groups.filter((g) => g.rules.length > 0);+}++/** The quickest everyday ways to earn: the highest-paying repeatable rules first. */+export function quickWins(rules: readonly XpRuleRow[], kind: SubjectKind, count: number): XpRuleRow[] {+ return rules+ .filter((r) => r.kind === kind && r.source !== "agent_hired" && r.source !== "floor_discovered")+ .sort((a, b) => b.xp - a.xp || a.source.localeCompare(b.source))+ .slice(0, count);+}diff --git a/jarvis/ui/web/frontend/src/components/society/progression/hall/hallParts.tsx b/jarvis/ui/web/frontend/src/components/society/progression/hall/hallParts.tsxnew file mode 100644index 0000000000..33a77f935b--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/progression/hall/hallParts.tsx@@ -0,0 +1,128 @@+/**+ * Pieces the Level Hall screen's pages share: the tab icons, the level hero,+ * reward cards, the padlock and the XP rule rows.+ */+import type { ReactNode } from "react";+import { useT } from "@/i18n";+import { levelFraction } from "../cosmetics";+import { LevelRing, XpBar } from "../LevelHud";+import type { RewardRow, XpRuleRow } from "../progressionApi";+import { useProgression } from "../progressionStore";+import { RewardIcon } from "../RewardIcon";+import { nextTitle, rarityOf } from "./hallModel";+import type { PreviewSubject } from "./LoadoutPreview";+import { ruleLimit } from "./ruleLimit";++const NO_TITLES: { level: number; title: string }[] = [];++export function TabIcon({ path, size = 16 }: { path: string; size?: number }) {+ return (+ <svg viewBox="0 0 24 24" width={size} height={size} aria-hidden fill="none" stroke="currentColor" strokeWidth={1.8} strokeLinecap="round" strokeLinejoin="round">+ <path d={path} />+ </svg>+ );+}++/** Whose page this is, everything the pages need to know about them. */+export interface HallWho {+ who: "person" | "pet";+ kind: "person" | "pet";+ subjectId: string;+ name: string;+ preview: PreviewSubject;+}++export function Section({ title, aside, children, className }: { title: string; aside?: ReactNode; children: ReactNode; className?: string }) {+ return (+ <section className={`hall-section${className ? ` ${className}` : ""}`}>+ <header><h3>{title}</h3>{aside}</header>+ {children}+ </section>+ );+}++/** The level hero: ring, name, title, bar and what is missing. */+export function LevelHero({ who, compact = false }: { who: HallWho; compact?: boolean }) {+ const t = useT();+ const subject = useProgression((s) => s.subjects[who.subjectId]);+ const titles = useProgression((s) => s.snapshot?.titles[who.kind] ?? NO_TITLES);+ const level = subject?.level ?? 1;+ const fraction = levelFraction(subject);+ const atCap = !!subject && subject.xpForNext <= 0;+ const upcoming = nextTitle(titles, level);+ return (+ <div className="hall-hero" data-kind={who.kind} data-compact={compact || undefined}>+ <LevelRing kind={who.kind} level={level} fraction={fraction} size={compact ? 76 : 120} />+ <div className="hall-hero-body">+ <span className="hall-hero-name">{who.name}</span>+ <span className="hall-hero-title">{t(`society.level.title.${subject?.title || (who.kind === "pet" ? "hatchling" : "newcomer")}`)}</span>+ <XpBar fraction={fraction} kind={who.kind} label={t("society.level.xp_label")} />+ <span className="hall-hero-xp">+ <b>{atCap ? t("society.level.max") : t("society.level.xp_of").replace("{0}", String(subject?.xpIntoLevel ?? 0)).replace("{1}", String(subject?.xpForNext ?? 40))}</b>+ {!atCap && <span>{t("society.level.to_next").replace("{0}", String(subject ? subject.xpForNext - subject.xpIntoLevel : 40)).replace("{1}", String(level + 1))}</span>}+ </span>+ {!compact && (+ <span className="hall-hero-meta">+ <span>{t("society.level.total").replace("{0}", String(subject?.xp ?? 0))}</span>+ <span>{upcoming+ ? t("society.hall.next_title").replace("{0}", t(`society.level.title.${upcoming.title}`)).replace("{1}", String(upcoming.level))+ : t("society.hall.top_title")}</span>+ </span>+ )}+ </div>+ </div>+ );+}++/** A reward as a card: its tile, name, slot and rarity, and whether it is open. */+export function RewardCard({ reward, kind, level, onClick, pressed, badge, xpMissing }: {+ reward: RewardRow; kind: "person" | "pet"; level: number; onClick?: () => void; pressed?: boolean; badge?: string; xpMissing?: number;+}) {+ const t = useT();+ const at = reward.levels[kind] ?? 0;+ const open = level >= at;+ const rarity = rarityOf(at);+ const body = (+ <>+ <RewardIcon reward={reward.rewardId} size={44} />+ <span className="hall-card-text">+ <strong>{t(`society.level.reward.${reward.rewardId}`)}</strong>+ <span className="hall-card-meta">+ <span className="hall-rarity" data-rarity={rarity}>{t(`society.hall.rarity.${rarity}`)}</span>+ <span>{t(`society.level.slot.${reward.slot}`)}</span>+ </span>+ <span className="hall-card-state" data-open={open || undefined}>+ {badge ?? (open ? t("society.hall.unlocked") : xpMissing !== undefined+ ? `${t("society.level.locked_at").replace("{0}", String(at))} · ${t("society.hall.xp_needed").replace("{0}", xpMissing.toLocaleString())}`+ : t("society.level.locked_at").replace("{0}", String(at)))}+ </span>+ </span>+ {!open && <LockGlyph />}+ </>+ );+ return onClick+ ? <button type="button" className="hall-card" data-rarity={rarity} data-open={open || undefined} aria-pressed={pressed} onClick={onClick}>{body}</button>+ : <div className="hall-card" data-rarity={rarity} data-open={open || undefined}>{body}</div>;+}++export function LockGlyph() {+ return (+ <svg className="hall-lock" viewBox="0 0 24 24" width={14} height={14} aria-hidden fill="none" stroke="currentColor" strokeWidth={2} strokeLinecap="round">+ <rect x="5" y="11" width="14" height="9" rx="2" /><path d="M8 11V8a4 4 0 0 1 8 0v3" />+ </svg>+ );+}++export function RuleRow({ rule }: { rule: XpRuleRow }) {+ const t = useT();+ const limit = ruleLimit(rule, t);+ return (+ <li className="hall-rule">+ <span className="hall-rule-xp">+{rule.xp}</span>+ <span className="hall-rule-text">+ <span>{t(`society.level.source.${rule.source}`)}</span>+ {limit && <em>{limit}</em>}+ </span>+ </li>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/society/progression/hall/ruleLimit.ts b/jarvis/ui/web/frontend/src/components/society/progression/hall/ruleLimit.tsnew file mode 100644index 0000000000..59cc138ab0--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/progression/hall/ruleLimit.ts@@ -0,0 +1,18 @@+/** The limit line under an XP rule: once a day, once per floor, a cooldown, a daily cap. */+import type { XpRuleRow } from "../progressionApi";++function duration(seconds: number, t: (key: string) => string): string {+ return seconds >= 60+ ? t("society.level.minutes").replace("{0}", String(Math.round(seconds / 60)))+ : t("society.level.seconds").replace("{0}", String(seconds));+}++export function ruleLimit(rule: XpRuleRow, t: (key: string) => string): string {+ if (rule.source === "daily_visit") return t("society.level.limit_daily");+ if (rule.source === "floor_discovered") return t("society.level.limit_floor");+ if (rule.source === "agent_hired") return t("society.level.limit_agent");+ const parts: string[] = [];+ if (rule.cooldownS > 0) parts.push(t("society.level.limit_cooldown").replace("{0}", duration(rule.cooldownS, t)));+ if (rule.dailyCap > 0) parts.push(t("society.level.limit_cap").replace("{0}", String(rule.dailyCap)));+ return parts.join(" · ");+}diff --git a/jarvis/ui/web/frontend/src/components/society/progression/progressionStore.ts b/jarvis/ui/web/frontend/src/components/society/progression/progressionStore.tsindex c4a4d20a8f..dab111f123 100644--- a/jarvis/ui/web/frontend/src/components/society/progression/progressionStore.ts+++ b/jarvis/ui/web/frontend/src/components/society/progression/progressionStore.ts@@ -35,7 +35,15 @@ export const CHEER_MS = 2200;const MAX_POPUPS = 12;const MAX_TOASTS = 4;-export type PanelTab = "you" | "pet" | "agents";+/**+ * The Level Hall screen's pages: where you stand, the Upgrade Studio (what you+ * and your pet wear, with a live preview), the reward road, how XP is earned,+ * and the team ranking. The hall's checkpoints, the level card and `L` open it.+ */+export type HallTab = "overview" | "studio" | "rewards" | "guide" | "team";+export const HALL_TABS: readonly HallTab[] = ["overview", "studio", "rewards", "guide", "team"];+/** Whose level the screen shows: the person's own, or their pet's (the pet IS Jarvis in the Verse). */+export type HallSubject = "person" | "pet";interface ProgressionState {snapshot: ProgressionSnapshot | null;@@ -48,7 +56,10 @@ interface ProgressionState {popups: XpPopup[];bursts: Burst[];cheerUntil: number;- panel: PanelTab | null;+ panel: HallTab | null;+ hallSubject: HallSubject;+ /** A reward to show on the reward road (a pedestal in the hall was clicked); null = the next unlock. */+ focusReward: RewardId | null;choices: ChoiceBook;hydrate: (snapshot: ProgressionSnapshot, away: Celebration[]) => void;apply: (award: AwardEvent, nowMs?: number) => void;@@ -56,7 +67,9 @@ interface ProgressionState {dismissBanner: () => void;dismissToast: (id: number) => void;expire: (nowMs: number) => void;- openPanel: (tab: PanelTab | null) => void;+ /** Open the Level Hall screen on a page (null closes it), optionally for a subject and a reward. */+ openPanel: (tab: HallTab | null, options?: { subject?: HallSubject; reward?: RewardId | null }) => void;+ setHallSubject: (subject: HallSubject) => void;choose: (who: "person" | "pet", slot: Slot, choice: SlotChoice) => void;}@@ -79,6 +92,8 @@ export const useProgression = create<ProgressionState>((set, get) => ({bursts: [],cheerUntil: 0,panel: null,+ hallSubject: "person",+ focusReward: null,choices: loadChoices(),hydrate: (snapshot, away) => set((s) => {// A push can land before the read that was already on its way: never roll a subject back.@@ -124,7 +139,13 @@ export const useProgression = create<ProgressionState>((set, get) => ({const bursts = s.bursts.filter((b) => nowMs - b.bornMs < BURST_MS);if (popups.length !== s.popups.length || bursts.length !== s.bursts.length) set({ popups, bursts });},- openPanel: (panel) => set({ panel }),+ openPanel: (panel, options = {}) => set((s) => ({+ panel,+ hallSubject: options.subject ?? s.hallSubject,+ focusReward: options.reward !== undefined ? options.reward : panel === "rewards" ? s.focusReward : null,+ })),+ // A reward focused for one subject means nothing for the other: switching forgets it.+ setHallSubject: (hallSubject) => set((s) => (s.hallSubject === hallSubject ? s : { hallSubject, focusReward: null })),choose: (who, slot, choice) => set((s) => {const choices: ChoiceBook = { ...s.choices, [who]: { ...(s.choices[who] ?? {}), [slot]: choice } };saveChoices(choices);diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json b/jarvis/ui/web/frontend/src/i18n/locales/society/de.jsonindex fdca7830b2..5b9c48dab3 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json@@ -1123,6 +1123,11 @@"room_foyer": "Foyer","room_prizes": "Preisshop","room_snack": "Snackbar",+ "cp_studio": "Umkleide",+ "cp_studio_hint": "Rüste dich und dein Pet mit deinen Belohnungen aus",+ "cp_levels": "Level-Tafel",+ "cp_levels_hint": "Dein Level, deine Belohnungen und wie du aufsteigst",+ "room_levels": "Level-Halle","dog_treat": "Knochen geben","dog_take_bone": "Leckerli nehmen","dog_pet": "Hund streicheln",@@ -1338,8 +1343,8 @@}},"level": {- "hud_button": "Fortschritt",- "open_panel": "Deinen Fortschritt öffnen",+ "hud_button": "Level-Halle",+ "open_panel": "Level-Halle öffnen","level_n": "Level {0}","lv": "Lv {0}","xp_of": "{0} / {1} XP",@@ -1355,19 +1360,14 @@"banner_aria": "{0} hat Level {1} erreicht. Zum Schließen klicken.","title_line": "Neuer Titel: {0}","unlocked": "Freigeschaltet",- "equip_hint": "Unter Fortschritt (L) wählst du, was du trägst.",- "equip_hint_pet": "Unter Fortschritt (L) wählst du, was dein Pet trägt.",+ "equip_hint": "Anlegen in der Umkleide der Level-Halle (L).",+ "equip_hint_pet": "Deinem Pet anlegen in der Umkleide der Level-Halle (L).","burst_you": "Level","burst_pet": "Level","burst_agent": "Level",- "panel_title": "Fortschritt",- "tab_you": "Du",- "tab_agents": "Agenten",- "wear": "Ausrüstung","auto": "Automatisch","none": "Nichts","locked_at": "Ab Level {0}",- "track": "Belohnungspfad","to_next": "Noch {0} XP bis Level {1}","total": "{0} XP insgesamt","team": "Team-Rangliste",@@ -1459,6 +1459,85 @@"delegated": "Jarvis gibt eine Aufgabe an einen Agenten","walk_together": "50 m zusammen laufen"}+ },+ "hall": {+ "title": "Level-Halle",+ "subtitle": "Dein Level, deine Ausrüstung und was du als Nächstes freischaltest",+ "subject_label": "Wessen Fortschritt",+ "subject_you": "Du",+ "tab_overview": "Überblick",+ "tab_studio": "Umkleide",+ "tab_rewards": "Belohnungen",+ "tab_guide": "So levelst du",+ "tab_team": "Team",+ "loading": "Level werden geladen …",+ "next_reward": "Nächste Belohnung",+ "all_unlocked": "Alles freigeschaltet",+ "next_rewards": "Als Nächstes frei",+ "best_pieces": "Deine besten Teile",+ "road_all": "Ganze Belohnungsstraße",+ "try_hint": "Klick auf eine Belohnung, um sie in der Umkleide anzuprobieren.",+ "next_title": "Nächster Titel: {0} ab Level {1}",+ "top_title": "Höchster Titel erreicht",+ "quick_title": "Schnell XP sammeln",+ "quick_all": "Alle Wege ansehen",+ "xp_needed": "noch {0} XP",+ "unlocked": "Freigeschaltet",+ "equipped": "Angelegt",+ "rarity": {+ "common": "Gewöhnlich",+ "rare": "Selten",+ "epic": "Episch",+ "legendary": "Legendär"+ },+ "studio_body": "Wähle für jeden Platz, was {0} trägt. Gesperrtes kannst du anprobieren.",+ "studio_body_you": "Wähle für jeden Platz, was du trägst. Gesperrtes kannst du anprobieren.",+ "slots_label": "Plätze",+ "slot_hint": {+ "frame": "Der Rahmen um die Levelnummer am Namensschild und auf der Level-Karte.",+ "trail": "Eine Spur, die beim Laufen zurückbleibt.",+ "aura": "Ein Leuchten am Boden darunter.",+ "gadget": "Ein Gadget an oder über der Figur."+ },+ "auto_hint": "Immer das beste freie Teil",+ "none_hint": "Dieser Platz bleibt leer",+ "locked_aria": "{0}, gesperrt bis Level {1}. Zum Anprobieren klicken.",+ "preview_label": "{0} auf der Bühne der Umkleide",+ "drag_hint": "Zum Drehen ziehen",+ "trail_reduced": "Spuren sieht man nur in Bewegung. Mit reduzierter Bewegung bleibt die Vorschau stehen.",+ "try_on": "Anprobe",+ "try_on_line": "Frei ab Level {0} · noch {1} XP",+ "try_on_back": "Zurück zu meiner Ausrüstung",+ "road_body": "Jede Stufe auf der Straße bringt etwas Neues. Wähl eine aus, um sie an dir zu sehen.",+ "road_here": "Du · Lv {0}",+ "reward_open": "Freigeschaltet bei Level {0}",+ "reward_locked": "Wird frei bei Level {0}",+ "reward_missing": "Dir fehlen noch {0} XP",+ "wearing_now": "Trägst du gerade",+ "put_on": "Jetzt anlegen",+ "guide_title": "So steigst du auf",+ "guide_subtitle": "Jede echte Aktion bringt XP. Hier steht, wie viel.",+ "guide_footer": "Tritt an die Tafel (E), um alles zu sehen.",+ "step1_title": "XP sammeln",+ "step1_body": "Rede mit Jarvis, gib deinem Team Arbeit, entdecke das Verse. Jede Aktion zählt.",+ "step2_title": "Aufsteigen",+ "step2_body": "Ist die Leiste voll, erreichst du das nächste Level. Jedes Level braucht etwas mehr XP.",+ "step3_title": "Freischalten",+ "step3_body": "Neue Level bringen Titel und Ausrüstung. Leg sie in der Umkleide an.",+ "cost_line": "Level {0}: {1} XP",+ "section_you": "Für dich",+ "section_pet": "Für {0}",+ "section_agents": "Für deine Agenten",+ "group": {+ "jarvis": "Mit Jarvis reden",+ "team": "Team und Aufgaben",+ "verse": "Im Jarvis Verse",+ "pet": "So sammelt {0} XP",+ "agent": "So sammeln Agenten XP",+ "other": "Weitere"+ },+ "limits_note": "Grenzen halten es fair: Manche Aktionen zählen nur ein paar Mal am Tag.",+ "team_note": "Agenten steigen durch erledigte Arbeit auf und tragen immer ihre besten Teile."}}}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json b/jarvis/ui/web/frontend/src/i18n/locales/society/en.jsonindex 8756f4334f..0250e94436 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json@@ -1123,6 +1123,11 @@"room_foyer": "Foyer","room_prizes": "Prize shop","room_snack": "Snack bar",+ "cp_studio": "Studio",+ "cp_studio_hint": "Gear up yourself and your pet with your rewards",+ "cp_levels": "Level board",+ "cp_levels_hint": "Your level, your rewards and how to level up",+ "room_levels": "Level Hall","dog_treat": "Give the bone","dog_take_bone": "Take a dog treat","dog_pet": "Pet the dog",@@ -1338,8 +1343,8 @@}},"level": {- "hud_button": "Progress",- "open_panel": "Open your progress",+ "hud_button": "Level Hall",+ "open_panel": "Open the Level Hall","level_n": "Level {0}","lv": "Lv {0}","xp_of": "{0} / {1} XP",@@ -1355,19 +1360,14 @@"banner_aria": "{0} reached level {1}. Click to close.","title_line": "New title: {0}","unlocked": "Unlocked",- "equip_hint": "Choose what you wear under Progress (L).",- "equip_hint_pet": "Choose what your pet wears under Progress (L).",+ "equip_hint": "Put it on in the Level Hall studio (L).",+ "equip_hint_pet": "Put it on your pet in the Level Hall studio (L).","burst_you": "Level","burst_pet": "Level","burst_agent": "Level",- "panel_title": "Progress",- "tab_you": "You",- "tab_agents": "Agents",- "wear": "Wearing","auto": "Automatic","none": "None","locked_at": "Unlocks at level {0}",- "track": "Reward track","to_next": "{0} XP to level {1}","total": "{0} XP in total","team": "Team ranking",@@ -1459,6 +1459,85 @@"delegated": "Jarvis hands a task to an agent","walk_together": "Walk 50 m together"}+ },+ "hall": {+ "title": "Level Hall",+ "subtitle": "Your level, your gear and what you unlock next",+ "subject_label": "Whose progress",+ "subject_you": "You",+ "tab_overview": "Overview",+ "tab_studio": "Studio",+ "tab_rewards": "Rewards",+ "tab_guide": "How to level",+ "tab_team": "Team",+ "loading": "Loading levels…",+ "next_reward": "Next reward",+ "all_unlocked": "Everything unlocked",+ "next_rewards": "Unlock next",+ "best_pieces": "Your best pieces",+ "road_all": "Whole reward road",+ "try_hint": "Click a reward to try it on in the studio.",+ "next_title": "Next title: {0} at level {1}",+ "top_title": "Highest title reached",+ "quick_title": "Quick XP",+ "quick_all": "All ways to earn",+ "xp_needed": "{0} XP to go",+ "unlocked": "Unlocked",+ "equipped": "Equipped",+ "rarity": {+ "common": "Common",+ "rare": "Rare",+ "epic": "Epic",+ "legendary": "Legendary"+ },+ "studio_body": "Choose what {0} wears in every slot. Locked pieces can be tried on.",+ "studio_body_you": "Choose what you wear in every slot. Locked pieces can be tried on.",+ "slots_label": "Slots",+ "slot_hint": {+ "frame": "The frame round the level number on the name plate and the level card.",+ "trail": "A trail left behind while walking.",+ "aura": "A glow on the floor underneath.",+ "gadget": "A gadget on or above the figure."+ },+ "auto_hint": "Always the best unlocked piece",+ "none_hint": "This slot stays empty",+ "locked_aria": "{0}, locked until level {1}. Try it on.",+ "preview_label": "{0} on the studio stage",+ "drag_hint": "Drag to turn",+ "trail_reduced": "Trails only show in motion. With reduced motion turned on, the preview stands still.",+ "try_on": "Try-on",+ "try_on_line": "Unlocks at level {0} · {1} XP to go",+ "try_on_back": "Back to my gear",+ "road_body": "Every step on the road brings something new. Pick one to see it on you.",+ "road_here": "You · Lv {0}",+ "reward_open": "Unlocked at level {0}",+ "reward_locked": "Unlocks at level {0}",+ "reward_missing": "{0} XP still to go",+ "wearing_now": "You are wearing it",+ "put_on": "Put it on",+ "guide_title": "How to level up",+ "guide_subtitle": "Every real action earns XP. Here is how much.",+ "guide_footer": "Step up to the board (E) to see everything.",+ "step1_title": "Earn XP",+ "step1_body": "Talk to Jarvis, give your team work, explore the Verse. Every action counts.",+ "step2_title": "Level up",+ "step2_body": "When the bar is full you reach the next level. Each level takes a little more XP.",+ "step3_title": "Unlock",+ "step3_body": "New levels bring titles and gear. Put them on in the studio.",+ "cost_line": "Level {0}: {1} XP",+ "section_you": "For you",+ "section_pet": "For {0}",+ "section_agents": "For your agents",+ "group": {+ "jarvis": "Talking to Jarvis",+ "team": "Team and tasks",+ "verse": "In the Jarvis Verse",+ "pet": "How {0} earns XP",+ "agent": "How agents earn XP",+ "other": "More"+ },+ "limits_note": "Limits keep it fair: some actions only count a few times a day.",+ "team_note": "Agents level up from finished work and always wear their best unlocks."}}}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json b/jarvis/ui/web/frontend/src/i18n/locales/society/es.jsonindex 0ac7945079..4d6eb682a2 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json@@ -1123,6 +1123,11 @@"room_foyer": "Vestíbulo","room_prizes": "Tienda de premios","room_snack": "Bar de aperitivos",+ "cp_studio": "Probador",+ "cp_studio_hint": "Equípate a ti y a tu mascota con tus recompensas",+ "cp_levels": "Panel de niveles",+ "cp_levels_hint": "Tu nivel, tus recompensas y cómo subir",+ "room_levels": "Sala de niveles","dog_treat": "Darle el hueso","dog_take_bone": "Coger una golosina","dog_pet": "Acariciar al perro",@@ -1338,8 +1343,8 @@}},"level": {- "hud_button": "Progreso",- "open_panel": "Abrir tu progreso",+ "hud_button": "Sala de niveles",+ "open_panel": "Abrir la sala de niveles","level_n": "Nivel {0}","lv": "Nv {0}","xp_of": "{0} / {1} XP",@@ -1355,19 +1360,14 @@"banner_aria": "{0} ha llegado al nivel {1}. Haz clic para cerrar.","title_line": "Nuevo título: {0}","unlocked": "Desbloqueado",- "equip_hint": "Elige lo que llevas en Progreso (L).",- "equip_hint_pet": "Elige lo que lleva tu mascota en Progreso (L).",+ "equip_hint": "Póntelo en el probador de la sala de niveles (L).",+ "equip_hint_pet": "Pónselo a tu mascota en el probador de la sala de niveles (L).","burst_you": "Nivel","burst_pet": "Nivel","burst_agent": "Nivel",- "panel_title": "Progreso",- "tab_you": "Tú",- "tab_agents": "Agentes",- "wear": "Equipamiento","auto": "Automático","none": "Nada","locked_at": "Se desbloquea en el nivel {0}",- "track": "Camino de recompensas","to_next": "{0} XP para el nivel {1}","total": "{0} XP en total","team": "Clasificación del equipo",@@ -1459,6 +1459,85 @@"delegated": "Jarvis pasa una tarea a un agente","walk_together": "Caminar 50 m juntos"}+ },+ "hall": {+ "title": "Sala de niveles",+ "subtitle": "Tu nivel, tu equipo y lo próximo que desbloqueas",+ "subject_label": "Progreso de quién",+ "subject_you": "Tú",+ "tab_overview": "Resumen",+ "tab_studio": "Probador",+ "tab_rewards": "Recompensas",+ "tab_guide": "Cómo subir de nivel",+ "tab_team": "Equipo",+ "loading": "Cargando niveles…",+ "next_reward": "Próxima recompensa",+ "all_unlocked": "Todo desbloqueado",+ "next_rewards": "Lo próximo",+ "best_pieces": "Tus mejores piezas",+ "road_all": "Todo el camino de recompensas",+ "try_hint": "Haz clic en una recompensa para probártela en el probador.",+ "next_title": "Próximo título: {0} en el nivel {1}",+ "top_title": "Título más alto alcanzado",+ "quick_title": "XP rápida",+ "quick_all": "Todas las formas de ganar",+ "xp_needed": "faltan {0} XP",+ "unlocked": "Desbloqueado",+ "equipped": "Equipado",+ "rarity": {+ "common": "Común",+ "rare": "Raro",+ "epic": "Épico",+ "legendary": "Legendario"+ },+ "studio_body": "Elige lo que lleva {0} en cada hueco. Lo bloqueado se puede probar.",+ "studio_body_you": "Elige lo que llevas en cada hueco. Lo bloqueado se puede probar.",+ "slots_label": "Huecos",+ "slot_hint": {+ "frame": "El marco del número de nivel en la placa con el nombre y en la tarjeta de nivel.",+ "trail": "Una estela que queda al caminar.",+ "aura": "Un brillo en el suelo debajo.",+ "gadget": "Un accesorio sobre o encima de la figura."+ },+ "auto_hint": "Siempre la mejor pieza desbloqueada",+ "none_hint": "Este hueco queda vacío",+ "locked_aria": "{0}, bloqueado hasta el nivel {1}. Pruébatelo.",+ "preview_label": "{0} en el escenario del probador",+ "drag_hint": "Arrastra para girar",+ "trail_reduced": "Las estelas solo se ven en movimiento. Con el movimiento reducido, la vista previa se queda quieta.",+ "try_on": "Prueba",+ "try_on_line": "Se desbloquea en el nivel {0} · faltan {1} XP",+ "try_on_back": "Volver a mi equipo",+ "road_body": "Cada paso del camino trae algo nuevo. Elige uno para verlo puesto.",+ "road_here": "Tú · Nv {0}",+ "reward_open": "Desbloqueado en el nivel {0}",+ "reward_locked": "Se desbloquea en el nivel {0}",+ "reward_missing": "Te faltan {0} XP",+ "wearing_now": "Lo llevas puesto",+ "put_on": "Ponérmelo",+ "guide_title": "Cómo subir de nivel",+ "guide_subtitle": "Cada acción real da XP. Aquí ves cuánta.",+ "guide_footer": "Acércate al panel (E) para verlo todo.",+ "step1_title": "Gana XP",+ "step1_body": "Habla con Jarvis, dale trabajo a tu equipo, explora el Verse. Cada acción cuenta.",+ "step2_title": "Sube de nivel",+ "step2_body": "Cuando la barra se llena, alcanzas el siguiente nivel. Cada nivel pide un poco más de XP.",+ "step3_title": "Desbloquea",+ "step3_body": "Los niveles nuevos traen títulos y equipo. Póntelos en el probador.",+ "cost_line": "Nivel {0}: {1} XP",+ "section_you": "Para ti",+ "section_pet": "Para {0}",+ "section_agents": "Para tus agentes",+ "group": {+ "jarvis": "Hablar con Jarvis",+ "team": "Equipo y tareas",+ "verse": "En el Jarvis Verse",+ "pet": "Cómo gana XP {0}",+ "agent": "Cómo ganan XP los agentes",+ "other": "Más"+ },+ "limits_note": "Los límites lo mantienen justo: algunas acciones solo cuentan unas pocas veces al día.",+ "team_note": "Los agentes suben de nivel con el trabajo terminado y siempre llevan sus mejores piezas."}}}