Skip to content

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

feat(office): ride the elevator only by pressing its call button

rubenluetke10-beep94ed11ea7a41
diff --git a/jarvis/ui/web/frontend/src/components/society/office/ElevatorCallButton.tsx b/jarvis/ui/web/frontend/src/components/society/office/ElevatorCallButton.tsx
new file mode 100644
index 0000000000..0ee85ded15
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/society/office/ElevatorCallButton.tsx
@@ -0,0 +1,117 @@
+/**
+ * The elevator's call button, on the shaft to the right of the doors.
+ *
+ * Riding needs a press of this button: a click on it (or E while standing at
+ * the elevator) lights it, then the doors close. On the agents floor it
+ * shows an up arrow, on the coding floor a down arrow. While the person
+ * stands at the elevator it breathes softly and a pill above it says where it
+ * goes; clicking it from afar only walks the character over (see
+ * `elevatorCall.ts`).
+ */
+import { useEffect, useMemo, useRef } from "react";
+import { Html } from "@react-three/drei";
+import { useFrame, type ThreeEvent } from "@react-three/fiber";
+import { MeshStandardMaterial } from "three";
+import { useT } from "@/i18n";
+import { cachedCanvasTexture } from "./canvasMaterials";
+import { callButtonPose } from "./elevatorCall";
+import type { Furniture } from "./officeLayout";
+import type { OfficeFloor } from "./officeStore";
+
+const BUTTON_RADIUS = 0.09;
+const IDLE = "#3b3f48";
+const LIT = "#f5b83d";
+
+/** A white arrow on a transparent square; "up" points to +y. */
+function arrowTexture(direction: "up" | "down") {
+ return cachedCanvasTexture(`elevator-arrow:${direction}`, 128, 128, (ctx, w, h) => {
+ ctx.clearRect(0, 0, w, h);
+ ctx.fillStyle = "#ffffff";
+ ctx.beginPath();
+ const tip = direction === "up" ? h * 0.24 : h * 0.76;
+ const base = direction === "up" ? h * 0.7 : h * 0.3;
+ ctx.moveTo(w / 2, tip);
+ ctx.lineTo(w * 0.24, base);
+ ctx.lineTo(w * 0.76, base);
+ ctx.closePath();
+ ctx.fill();
+ });
+}
+
+export function ElevatorCallButton({ shaft, floor, near, lit, count, animate, onPress }: {
+ shaft: Furniture;
+ floor: OfficeFloor;
+ /** The person stands at the elevator: the button invites a press. */
+ near: boolean;
+ /** Pressed: glowing until the ride starts. */
+ lit: boolean;
+ /** How many work on the other floor; null while unknown. */
+ count: number | null;
+ animate: boolean;
+ onPress: () => void;
+}) {
+ const t = useT();
+ const pose = callButtonPose(shaft);
+ const up = floor === "agents";
+ const button = useMemo(() => new MeshStandardMaterial({ color: IDLE, roughness: 0.35, metalness: 0.3, emissive: LIT, emissiveIntensity: 0 }), []);
+ const arrow = useMemo(() => new MeshStandardMaterial({
+ map: arrowTexture(up ? "up" : "down"), transparent: true, depthWrite: false, roughness: 0.5,
+ emissive: "#ffffff", emissiveIntensity: 0.25,
+ }), [up]);
+ useEffect(() => () => button.dispose(), [button]);
+ useEffect(() => () => arrow.dispose(), [arrow]);
+ useEffect(() => () => { document.body.style.cursor = ""; }, []);
+
+ const pulse = useRef(0);
+ useFrame((_, delta) => {
+ if (lit) { button.color.set(LIT); button.emissiveIntensity = 1.1; return; }
+ button.color.set(IDLE);
+ if (near && animate) {
+ pulse.current += delta;
+ button.emissiveIntensity = 0.25 + (Math.sin(pulse.current * 4) + 1) * 0.2;
+ } else {
+ button.emissiveIntensity = near ? 0.45 : 0;
+ }
+ });
+
+ const press = (event: ThreeEvent<MouseEvent>) => {
+ // A drag that ends on the button rotated the camera; only a real click presses.
+ if (event.delta > 6) return;
+ event.stopPropagation();
+ onPress();
+ };
+ const label = t(up ? "society.office.floor_up" : "society.office.floor_down");
+ const countText = count === null ? null
+ : t(up ? "society.office.elevator_up_count" : "society.office.elevator_down_count").replace("{0}", String(count));
+
+ return (
+ <group position={[pose.x, pose.y, pose.z]} rotation={[0, pose.rotationY, 0]} name="elevator-call-button">
+ {/* The steel plate covers the shaft's painted indicator. */}
+ <mesh position={[0, 0, -0.005]}>
+ <boxGeometry args={[0.26, 0.44, 0.02]} />
+ <meshStandardMaterial color="#c7ccd4" roughness={0.35} metalness={0.3} />
+ </mesh>
+ <mesh rotation={[Math.PI / 2, 0, 0]} position={[0, 0, 0.012]} material={button}>
+ <cylinderGeometry args={[BUTTON_RADIUS, BUTTON_RADIUS, 0.02, 32]} />
+ </mesh>
+ <mesh position={[0, 0, 0.0231]} material={arrow} raycast={() => null}>
+ <planeGeometry args={[BUTTON_RADIUS * 1.6, BUTTON_RADIUS * 1.6]} />
+ </mesh>
+ {near && !lit && (
+ <Html center position={[0, 0.62, 0.05]} zIndexRange={[24, 0]} pointerEvents="none">
+ <span className="office-call-pill" data-office-ui>
+ <b>{label}</b>
+ <small>{t("society.office.elevator_press")}{countText ? ` · ${countText}` : ""}</small>
+ </span>
+ </Html>
+ )}
+ {/* The click target: a see-through pad a little larger than the button, so it is easy to hit from a distance. */}
+ <mesh position={[0, 0, 0.03]} onClick={press}
+ onPointerOver={(event) => { event.stopPropagation(); document.body.style.cursor = "pointer"; }}
+ onPointerOut={() => { document.body.style.cursor = ""; }}>
+ <planeGeometry args={[0.32, 0.5]} />
+ <meshBasicMaterial transparent opacity={0} depthWrite={false} />
+ </mesh>
+ </group>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficePanels.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficePanels.tsx
index a9c2e74d1a..f18243d54a 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/OfficePanels.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficePanels.tsx
@@ -8,7 +8,7 @@ import { useEffect, useId, useRef, useState } from "react";
import { useT } from "@/i18n";
import type { SocietyAgent } from "../data";
import type { CheckpointKind, OfficeLayout, Point } from "./officeLayout";
-import { otherFloor, player, useOfficeStore, type OfficeFloor } from "./officeStore";
+import { player, useOfficeStore, type OfficeFloor } from "./officeStore";
import type { PaneOccupant } from "./codingFloor";
import { agentPositions } from "./walkerRegistry";
import { AgentTalkPanel, CALL_MS } from "./AgentTalkPanel";
@@ -113,28 +113,6 @@ export function PaneAgentPanel({ occupant, onOpen, onClose }: { occupant: PaneOc
);
}
-/** Counts of both floors shown in the elevator; `null` = not known yet. */
-export interface ElevatorInfo { jarvis: number; coding: number | null; onRide: (to: OfficeFloor) => void }
-
-function ElevatorPanel({ floor, info }: { floor: OfficeFloor; info: ElevatorInfo }) {
- const t = useT();
- const to = otherFloor(floor);
- const count = to === "coding" ? info.coding : info.jarvis;
- return (
- <>
- <p>{t(to === "coding" ? "society.office.elevator_up_body" : "society.office.elevator_down_body")}</p>
- {count !== null && (
- <p className="office-hint" role="status">
- {t(to === "coding" ? "society.office.elevator_up_count" : "society.office.elevator_down_count").replace("{0}", String(count))}
- </p>
- )}
- <button type="button" className="office-action office-action-primary" onClick={() => info.onRide(to)}>
- {t(to === "coding" ? "society.office.elevator_up" : "society.office.elevator_down")}
- </button>
- </>
- );
-}
-
function ManagePanel({ agents, actions }: { agents: SocietyAgent[]; actions: OfficeActions }) {
const t = useT();
const store = useOfficeStore();
@@ -215,10 +193,9 @@ function BreakPanel({ agents, layout }: { agents: SocietyAgent[]; layout: Office
);
}
-export function CheckpointPanel({ id, floor = "agents", agents, layout, sample, profile, onProfile, actions, onClose, elevator }: {
+export function CheckpointPanel({ id, floor = "agents", agents, layout, sample, profile, onProfile, actions, onClose }: {
id: CheckpointKind; floor?: OfficeFloor; agents: SocietyAgent[]; layout: OfficeLayout; sample: boolean;
profile: PlayerProfile; onProfile: (next: PlayerProfile) => void; actions: OfficeActions; onClose: () => void;
- elevator?: ElevatorInfo;
}) {
const t = useT();
return (
@@ -229,7 +206,6 @@ export function CheckpointPanel({ id, floor = "agents", agents, layout, sample,
{id === "wardrobe" && <WardrobePanel profile={profile} onProfile={onProfile} agents={agents} sample={sample} />}
{id === "lead" && <LeadPanel agents={agents} actions={actions} />}
{id === "break" && <BreakPanel agents={agents} layout={layout} />}
- {id === "elevator" && elevator && <ElevatorPanel floor={floor} info={elevator} />}
</PanelShell>
);
}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficePlayer.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficePlayer.tsx
index b890d3077a..cc286c8a98 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/OfficePlayer.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficePlayer.tsx
@@ -207,7 +207,8 @@ export function OfficePlayer({ layout, grid, look, name, awake, reduced }: {
const chair = chairInReach(layout.lead.desks, player);
if (useLeadSeat.getState().near !== (chair?.id ?? null)) useLeadSeat.getState().set({ near: chair?.id ?? null });
const nearby = chair ? null : nearestInteractable(layout);
- if (!sameSelection(nearby, nearbyRef.current)) { nearbyRef.current = nearby; store.setNearby(nearby); }
+ // Compared with the store too: a floor switch clears the store's reading while the character still stands at the elevator.
+ if (!sameSelection(nearby, nearbyRef.current) || !sameSelection(nearby, store.nearby)) { nearbyRef.current = nearby; store.setNearby(nearby); }
});
return (
diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx
index b8c6eb5522..75fc6ae29c 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx
@@ -24,6 +24,7 @@ import { FurniturePiece, MeetingChairs } from "./OfficeProps";
import { TeamBoardFace } from "./TeamBoardFace";
import { RoomFloors, RoomSign, RoomWalls } from "./OfficeRooms";
import { CHECKPOINT_ICON, CheckpointMarker } from "./CheckpointMarker";
+import { ElevatorCallButton } from "./ElevatorCallButton";
import { OFFICE_FIGURE_HEIGHT_M, OfficeAgents, type WalkerContext } from "./OfficeAgents";
import { OfficePlayer } from "./OfficePlayer";
import { PlayerBubble } from "./OfficeBubbles";
@@ -162,11 +163,15 @@ export interface OfficeSceneProps {
nearby: Selection | null;
chats: ReadonlyMap<string, DeskChat>;
onOpenScreen: (agentId: string, screen: Point & { y: number }, facing: number) => void;
+ /** The elevator's call button: lit after a press, how many work on the other floor, and the press itself. */
+ elevatorCall: { lit: boolean; count: number | null; onPress: () => void };
}
-export function OfficeScene({ floor, occupants, ready, layout, grid, walkers, agents, newcomers, awake, reduced, overview, player, selection, nearby, chats, onOpenScreen }: OfficeSceneProps) {
+export function OfficeScene({ floor, occupants, ready, layout, grid, walkers, agents, newcomers, awake, reduced, overview, player, selection, nearby, chats, onOpenScreen, elevatorCall }: OfficeSceneProps) {
const t = useT();
const desks = useMemo(() => allDesks(layout), [layout]);
+ const shaft = layout.furniture.find((f) => f.kind === "elevator");
+ const atLift = nearby?.kind === "checkpoint" && nearby.id === "elevator";
// Lead desks carry their own size and are built as executive desks, not bench instances.
const benchDesks = useMemo(() => desks.filter((d) => !d.size), [desks]);
const leadRoom = layout.rooms.find((r) => r.kind === "lead");
@@ -214,11 +219,16 @@ export function OfficeScene({ floor, occupants, ready, layout, grid, walkers, ag
{layout.furniture.map((item) => <FurniturePiece key={item.id} item={item} />)}
{table && <MeetingChairs table={table} />}
{board && <TeamBoardFace board={board} enabled={floor === "agents"} />}
- {layout.checkpoints.map((cp) => (
+ {/* At the elevator its call button takes over from the floating token, which would hide it. */}
+ {layout.checkpoints.filter((cp) => cp.id !== "elevator" || !atLift).map((cp) => (
<CheckpointMarker key={cp.id} checkpoint={cp} label={t(`society.office.cp_${cp.id}`)} icon={CHECKPOINT_ICON[cp.id]}
active={(nearby?.kind === "checkpoint" && nearby.id === cp.id) || (selection?.kind === "checkpoint" && selection.id === cp.id)}
animate={awake && !reduced} onActivate={() => select({ kind: "checkpoint", id: cp.id })} />
))}
+ {shaft && (
+ <ElevatorCallButton shaft={shaft} floor={floor} lit={elevatorCall.lit} count={elevatorCall.count} animate={awake && !reduced}
+ near={atLift} onPress={elevatorCall.onPress} />
+ )}
<FloorArrival floor={floor} layout={layout} grid={grid} ready={ready} />
<OfficePlayer layout={layout} grid={grid} look={player.look} name={player.name} awake={awake} reduced={reduced} />
<PlayerBubble height={OFFICE_FIGURE_HEIGHT_M + 0.49} />
diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx
index dd9c0ed9d2..d609bf5ae8 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx
@@ -30,6 +30,7 @@ import { useCodingFloorOccupants, type PaneOccupant } from "./codingFloor";
import { openPaneSession } from "./codingNavigate";
import { useDprBudget } from "./useDprBudget";
import { knownOnFloor, noteArrivals } from "./officeFloors";
+import { atElevator, CALL_PRESS_MS } from "./elevatorCall";
import { loadProfile, playerLook, saveProfile, type PlayerProfile } from "./playerProfile";
import { AgentPanel, CheckpointPanel, PaneAgentPanel, type OfficeActions } from "./OfficePanels";
import type { WalkerContext } from "./OfficeAgents";
@@ -133,9 +134,9 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen
const follow = useOfficeStore((s) => s.follow);
const select = useOfficeStore((s) => s.select);
- // The elevator panel tells how many are upstairs, so it wakes the coding roster too.
- const elevatorOpen = selection?.kind === "checkpoint" && selection.id === "elevator";
- const codingFloor = useCodingFloorOccupants(coding || elevatorOpen);
+ // The call button tells how many are upstairs, so standing at the elevator wakes the coding roster too.
+ const atLift = nearby?.kind === "checkpoint" && nearby.id === "elevator";
+ const codingFloor = useCodingFloorOccupants(coding || atLift);
const jarvisAgents = useMemo(() => (roster.data?.agents ?? []).filter((a) => a.lifecycle !== "archived"), [roster.data]);
const codingAgents = useMemo(() => codingFloor.occupants.map((o) => o.agent), [codingFloor.occupants]);
const active = coding ? codingAgents : jarvisAgents;
@@ -211,6 +212,28 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen
rideTimer.current = setTimeout(() => setRide((r) => (r?.phase === "riding" ? { to, phase: "opening" } : r)), RIDE_MAX_MS);
}, DOORS_MS);
}, [reduced, ride]);
+ // Riding takes a press of the call button beside the doors, standing at the
+ // elevator. A press from afar (a click on the button, the floor token or E
+ // anywhere) walks the character over instead; it never rides from a distance.
+ const [callLit, setCallLit] = useState(false);
+ const callTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
+ useEffect(() => () => clearTimeout(callTimer.current), []);
+ const pressCall = useCallback(() => {
+ if (ride || callLit) return;
+ const lift = layout.checkpoints.find((cp) => cp.id === "elevator");
+ if (!atElevator(player, lift)) {
+ if (lift) useOfficeStore.getState().requestWalk({ x: lift.x, z: lift.z });
+ return;
+ }
+ setCallLit(true);
+ callTimer.current = setTimeout(() => { setCallLit(false); takeElevator(otherFloor(useOfficeStore.getState().floor)); }, CALL_PRESS_MS);
+ }, [ride, callLit, layout, takeElevator]);
+ // E at the elevator, or a click on its floor token, presses the button instead of opening a panel.
+ useEffect(() => {
+ if (selection?.kind !== "checkpoint" || selection.id !== "elevator") return;
+ select(null);
+ pressCall();
+ }, [selection, select, pressCall]);
useEffect(() => {
if (ride?.phase === "riding" && floor === ride.to && ready) {
clearTimeout(rideTimer.current);
@@ -308,7 +331,9 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen
onPointerMissed={() => select(null)}>
<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 }}
- selection={selection} nearby={nearby} chats={chats} onOpenScreen={openScreen} />
+ selection={selection} nearby={nearby} chats={chats} onOpenScreen={openScreen}
+ elevatorCall={{ lit: callLit, onPress: pressCall,
+ count: coding ? jarvisAgents.length : codingFloor.loaded ? codingFloor.occupants.length : null }} />
</Canvas>
</Suspense>
</RenderBoundary>
@@ -339,8 +364,6 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen
onClick={toggleGuide}>
{t("society.office.guide.hud_button")}
</button>
- <button type="button" className="office-button" data-office-floor-switch disabled={!!ride}
- onClick={() => takeElevator(otherFloor(floor))}>{t(coding ? "society.office.floor_down" : "society.office.floor_up")}</button>
{(!coding || !compact || onOpenLedger) && (
<button type="button" className="office-button" onClick={openList}>
{t(coding ? (compact ? "society.office.ledger_coding" : "society.office.open_ide") : "society.office.ledger")}
@@ -356,8 +379,7 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen
: <AgentPanel agent={selectedAgent} actions={actions} onClose={() => select(null)} />)}
{selection.kind === "checkpoint" && (
<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)}
- elevator={{ jarvis: jarvisAgents.length, coding: codingFloor.loaded ? codingFloor.occupants.length : null, onRide: takeElevator }} />
+ profile={profile} onProfile={updateProfile} actions={actions} onClose={() => select(null)} />
)}
</div>
)}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/codingFloor.ts b/jarvis/ui/web/frontend/src/components/society/office/codingFloor.ts
index 43b0055e8b..2c30f8ab7d 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/codingFloor.ts
+++ b/jarvis/ui/web/frontend/src/components/society/office/codingFloor.ts
@@ -138,7 +138,6 @@ function toAgent(pane: WorkspacePaneRow, department: string, dot: AgentDotKind):
denies: [],
approvalRules: { requireApproval: [], alwaysAllow: [] },
permissionCeiling: "ask",
- approvalMode: null,
dailyBudgetUsd: 0,
checkpoint: "idle",
state: paneRunState(pane, dot),
diff --git a/jarvis/ui/web/frontend/src/components/society/office/elevatorCall.test.ts b/jarvis/ui/web/frontend/src/components/society/office/elevatorCall.test.ts
new file mode 100644
index 0000000000..5933151e63
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/society/office/elevatorCall.test.ts
@@ -0,0 +1,42 @@
+import { describe, expect, it } from "vitest";
+import { atElevator, CALL_BUTTON_LOCAL, callButtonPose } from "./elevatorCall";
+import { buildOfficeLayout } from "./officeLayout";
+
+describe("callButtonPose", () => {
+ it("keeps the local offset for an unrotated prop", () => {
+ const pose = callButtonPose({ x: 2, z: 3, rotationY: 0 });
+ expect(pose.x).toBeCloseTo(2 + CALL_BUTTON_LOCAL.x);
+ expect(pose.z).toBeCloseTo(3 + CALL_BUTTON_LOCAL.z);
+ expect(pose.y).toBe(CALL_BUTTON_LOCAL.y);
+ });
+
+ it("turns the offset with the prop (doors facing +x)", () => {
+ const pose = callButtonPose({ x: 0, z: 0, rotationY: Math.PI / 2 });
+ // Local +z (out of the doors) becomes world +x; local +x (right of the doors) becomes world -z.
+ expect(pose.x).toBeCloseTo(CALL_BUTTON_LOCAL.z);
+ expect(pose.z).toBeCloseTo(-CALL_BUTTON_LOCAL.x);
+ expect(pose.rotationY).toBeCloseTo(Math.PI / 2);
+ });
+
+ it("sits within reach of the elevator checkpoint on both floors", () => {
+ for (const variant of ["agents", "coding"] as const) {
+ const layout = buildOfficeLayout([], { variant });
+ const shaft = layout.furniture.find((f) => f.kind === "elevator");
+ const cp = layout.checkpoints.find((c) => c.id === "elevator");
+ expect(shaft && cp).toBeTruthy();
+ const pose = callButtonPose(shaft!);
+ expect(Math.hypot(pose.x - cp!.x, pose.z - cp!.z)).toBeLessThan(2.2);
+ }
+ });
+});
+
+describe("atElevator", () => {
+ const cp = { x: 0, z: 0, radius: 1.2 };
+ it("is true inside the checkpoint radius only", () => {
+ expect(atElevator({ x: 0.5, z: 0.5 }, cp)).toBe(true);
+ expect(atElevator({ x: 3, z: 0 }, cp)).toBe(false);
+ });
+ it("is false on a plan without an elevator", () => {
+ expect(atElevator({ x: 0, z: 0 }, undefined)).toBe(false);
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/components/society/office/elevatorCall.ts b/jarvis/ui/web/frontend/src/components/society/office/elevatorCall.ts
new file mode 100644
index 0000000000..887ef73bdc
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/society/office/elevatorCall.ts
@@ -0,0 +1,29 @@
+/**
+ * The elevator's call button: where it sits on the shaft and who may press it.
+ *
+ * Riding takes a deliberate press of the button beside the doors, the way a
+ * real elevator works: the person walks up to the elevator and clicks the
+ * button (or presses E there). A click from across the floor only walks the
+ * character over; it never rides from afar.
+ */
+import type { Checkpoint, Furniture, Point } from "./officeLayout";
+
+/** The button plate in the elevator prop's own frame: right of the doors, at hand height, just proud of the shaft face. */
+export const CALL_BUTTON_LOCAL = { x: 0.9, y: 1.15, z: 0.13 } as const;
+
+/** How long the lit button shows before the doors start to close. */
+export const CALL_PRESS_MS = 650;
+
+export interface CallButtonPose { x: number; y: number; z: number; rotationY: number }
+
+/** World pose of the call button for the elevator prop `item` (rotation about +y, as the prop is drawn). */
+export function callButtonPose(item: Pick<Furniture, "x" | "z" | "rotationY">): CallButtonPose {
+ const { x: lx, y, z: lz } = CALL_BUTTON_LOCAL;
+ const cos = Math.cos(item.rotationY), sin = Math.sin(item.rotationY);
+ return { x: item.x + lx * cos + lz * sin, y, z: item.z - lx * sin + lz * cos, rotationY: item.rotationY };
+}
+
+/** Is the character standing at the elevator, close enough to press its button? */
+export function atElevator(body: Point, checkpoint: Pick<Checkpoint, "x" | "z" | "radius"> | undefined): boolean {
+ return !!checkpoint && Math.hypot(body.x - checkpoint.x, body.z - checkpoint.z) <= checkpoint.radius;
+}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/officeFloors.css b/jarvis/ui/web/frontend/src/components/society/office/officeFloors.css
index e775dfe9c7..5ae5919512 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/officeFloors.css
+++ b/jarvis/ui/web/frontend/src/components/society/office/officeFloors.css
@@ -19,6 +19,11 @@
.office-elevator-sign { transition:none; }
}
+/* The pill over the elevator's call button. Like the name pills it is part of the diorama, which keeps one palette in both modes. */
+.office-call-pill { display:inline-flex; flex-direction:column; align-items:center; gap:1px; padding:4px 10px; border-radius:10px; background:rgb(24 26 32 / .86); color:#f8fafc; white-space:nowrap; user-select:none; pointer-events:none; box-shadow:0 2px 8px rgb(0 0 0 / .35); }
+.office-call-pill b { font-size:12px; font-weight:700; }
+.office-call-pill small { font-size:10px; color:#f5b83d; font-weight:600; }
+
/* A coding session's facts in its panel. */
.office-facts { display:grid; grid-template-columns:auto 1fr; gap:3px 10px; margin:0; }
.office-facts dt { color:hsl(var(--muted-foreground)); font-size:11px; }
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json
index c29a0929df..d888fe9ff7 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json
@@ -805,7 +805,7 @@
"cp_break": "Pausenraum",
"cp_break_hint": "Kaffeepause ausrufen",
"cp_elevator": "Aufzug",
- "cp_elevator_hint": "Ins andere Stockwerk fahren",
+ "cp_elevator_hint": "Den Ruf-Knopf neben den Türen drücken",
"guide": {
"tablist": "Bereiche des Empfangs",
"tab_welcome": "Willkommen",
@@ -891,12 +891,9 @@
"pane_prompt": "Letzter Prompt",
"pane_unasked": "Noch nichts gefragt.",
"pane_open": "Session öffnen",
- "elevator_up_body": "Die Coding-Agenten arbeiten ein Stockwerk höher: Jede laufende IDE-Session hat dort einen Schreibtisch, ihr Terminal live auf dem Monitor.",
- "elevator_down_body": "Die Jarvis-Agenten arbeiten ein Stockwerk tiefer.",
+ "elevator_press": "Knopf anklicken",
"elevator_up_count": "Gerade oben: {0}",
"elevator_down_count": "Gerade unten: {0}",
- "elevator_up": "Hoch zur Coding-Etage",
- "elevator_down": "Runter ins Agenten-Büro",
"arcade_prompt": "Asteroid Run spielen",
"arcade_title": "Asteroid Run",
"arcade_score": "Punkte",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json
index ee7ea0aae6..c887ed86fb 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json
@@ -805,7 +805,7 @@
"cp_break": "Break room",
"cp_break_hint": "Call a coffee break",
"cp_elevator": "Elevator",
- "cp_elevator_hint": "Ride to the other floor",
+ "cp_elevator_hint": "Press the call button beside the doors",
"guide": {
"tablist": "Reception sections",
"tab_welcome": "Welcome",
@@ -891,12 +891,9 @@
"pane_prompt": "Last prompt",
"pane_unasked": "Nothing asked yet.",
"pane_open": "Open session",
- "elevator_up_body": "The coding agents work one floor up: every running IDE session has a desk there, its terminal live on the monitor.",
- "elevator_down_body": "The Jarvis agents work one floor down.",
+ "elevator_press": "Click the button",
"elevator_up_count": "Upstairs right now: {0}",
"elevator_down_count": "Downstairs right now: {0}",
- "elevator_up": "Up to the coding floor",
- "elevator_down": "Down to the agents office",
"arcade_prompt": "Play Asteroid Run",
"arcade_title": "Asteroid Run",
"arcade_score": "Score",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json
index 4660ca1b69..27d0f2d226 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json
@@ -805,7 +805,7 @@
"cp_break": "Sala de descanso",
"cp_break_hint": "Hacer una pausa de café",
"cp_elevator": "Ascensor",
- "cp_elevator_hint": "Subir o bajar de planta",
+ "cp_elevator_hint": "Pulsa el botón de llamada junto a las puertas",
"guide": {
"tablist": "Secciones de la recepción",
"tab_welcome": "Bienvenida",
@@ -891,12 +891,9 @@
"pane_prompt": "Último prompt",
"pane_unasked": "Todavía no se le ha pedido nada.",
"pane_open": "Abrir sesión",
- "elevator_up_body": "Los agentes de código trabajan una planta más arriba: cada sesión del IDE en marcha tiene allí un escritorio, con su terminal en directo en el monitor.",
- "elevator_down_body": "Los agentes de Jarvis trabajan una planta más abajo.",
+ "elevator_press": "Haz clic en el botón",
"elevator_up_count": "Arriba ahora mismo: {0}",
"elevator_down_count": "Abajo ahora mismo: {0}",
- "elevator_up": "Subir a la planta de código",
- "elevator_down": "Bajar a la oficina de agentes",
"arcade_prompt": "Jugar a Asteroid Run",
"arcade_title": "Asteroid Run",
"arcade_score": "Puntos",