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(office): reception becomes the map help centre with controls and settings
rubenluetke10-beep91dd4c90f7a8
diff --git a/jarvis/ui/web/frontend/src/components/society/office/CheckpointMarker.tsx b/jarvis/ui/web/frontend/src/components/society/office/CheckpointMarker.tsxindex 4d1e593a5d..b3c67bdab7 100644--- a/jarvis/ui/web/frontend/src/components/society/office/CheckpointMarker.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/CheckpointMarker.tsx@@ -14,7 +14,7 @@ import {import { useT } from "@/i18n";import { plateScale } from "./OfficeAgents";import { cachedCanvasTexture } from "./canvasMaterials";-import type { Checkpoint } from "./officeLayout";+import type { Checkpoint, CheckpointKind } from "./officeLayout";import { CHECKPOINT_GOLD } from "./officePalette";export type CheckpointIcon = "plus" | "list" | "team" | "shirt" | "star" | "coffee" | "updown";@@ -31,6 +31,11 @@ export const CHECKPOINT_ICON_PATHS: Record<CheckpointIcon, string> = {updown: "M8 20V4M4 8l4-4 4 4M16 4v16M12 16l4 4 4-4",};+/** The icon each checkpoint wears, on its floor token and in the reception's list of places. */+export const CHECKPOINT_ICON: Record<CheckpointKind, CheckpointIcon> = {+ create: "plus", manage: "list", team: "team", wardrobe: "shirt", lead: "star", break: "coffee", elevator: "updown",+};+const TOKEN_RADIUS = 0.36;const TOKEN_DEPTH = 0.1;/** Height of the token centre above the floor. */@@ -96,7 +101,7 @@ function faceMaterial(icon: CheckpointIcon): MeshStandardMaterial {return material;}-function IconSvg({ icon }: { icon: CheckpointIcon }) {+export function IconSvg({ icon }: { icon: CheckpointIcon }) {return (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2.4} strokeLinecap="round" strokeLinejoin="round" aria-hidden><path d={CHECKPOINT_ICON_PATHS[icon]} />diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficePanels.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficePanels.tsxindex bb57ef5374..2e1b104b9e 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficePanels.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficePanels.tsx@@ -16,6 +16,7 @@ import { agentPositions } from "./walkerRegistry";import { AgentTalkPanel, CALL_MS } from "./AgentTalkPanel";import type { PlayerProfile } from "./playerProfile";import { WardrobePanel } from "./WardrobePanel";+import { ReceptionPanel } from "./ReceptionPanel";export interface OfficeActions {@@ -131,18 +132,6 @@ function ElevatorPanel({ floor, info }: { floor: OfficeFloor; info: ElevatorInfo);}-function CreatePanel({ actions }: { actions: OfficeActions }) {- const t = useT();- return (- <>- <p>{t("society.office.create_body")}</p>- <button type="button" className="office-action office-action-primary" disabled={!actions.onCreateAgent} onClick={() => actions.onCreateAgent?.()}>- {t("society.office.create_action")}- </button>- </>- );-}-function ManagePanel({ agents, actions }: { agents: SocietyAgent[]; actions: OfficeActions }) {const t = useT();const store = useOfficeStore();@@ -313,7 +302,7 @@ export function CheckpointPanel({ id, floor = "agents", agents, layout, sample,const t = useT();return (<PanelShell title={t(`society.office.cp_${id}`)} subtitle={t(`society.office.cp_${id}_hint`)} onClose={onClose}>- {id === "create" && <CreatePanel actions={actions} />}+ {id === "create" && <ReceptionPanel floor={floor} layout={layout} onCreateAgent={actions.onCreateAgent} />}{id === "manage" && <ManagePanel agents={agents} actions={actions} />}{id === "team" && <TeamPanel agents={agents} layout={layout} sample={sample} actions={actions} />}{id === "wardrobe" && <WardrobePanel profile={profile} onProfile={onProfile} agents={agents} sample={sample} />}diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficePlayer.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficePlayer.tsxindex 9b5b40329f..f6d147b1d8 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficePlayer.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficePlayer.tsx@@ -17,6 +17,7 @@ import { agentPositions, bodiesExcept } from "./walkerRegistry";import { OFFICE_FIGURE_HEIGHT_M } from "./OfficeAgents";import { seatOf, type OfficeLayout } from "./officeLayout";import { chairInReach, useLeadSeat } from "./leadSeat";+import { isRunning, useOfficeSettings } from "./officeSettings";/** The person's pace: a brisk walk, and a sprint on Shift (m/s). */export const PLAYER_WALK_SPEED = 2.0;@@ -165,7 +166,7 @@ export function OfficePlayer({ layout, grid, look, name, awake, reduced }: {// Keyboard movement, relative to where the camera looks.let ix = 0, iz = 0;for (const code of pressed.current) { ix += MOVE_KEYS[code][0]; iz += MOVE_KEYS[code][1]; }- const speed = run.current ? PLAYER_SPRINT_SPEED : PLAYER_WALK_SPEED;+ const speed = isRunning(run.current, useOfficeSettings.getState().alwaysRun) ? PLAYER_SPRINT_SPEED : PLAYER_WALK_SPEED;let moved = 0;if (ix !== 0 || iz !== 0) {player.path = [];diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsxindex c24104bab6..3465e28d30 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx@@ -21,21 +21,17 @@ import { useEventStore } from "@/store/events";import type { DeskChat } from "./useDeskChats";import { FurniturePiece, MeetingChairs } from "./OfficeProps";import { RoomFloors, RoomSign, RoomWalls } from "./OfficeRooms";-import { CheckpointMarker, type CheckpointIcon } from "./CheckpointMarker";+import { CHECKPOINT_ICON, CheckpointMarker } from "./CheckpointMarker";import { OFFICE_FIGURE_HEIGHT_M, OfficeAgents, type WalkerContext } from "./OfficeAgents";import { OfficePlayer } from "./OfficePlayer";import { PlayerBubble } from "./OfficeBubbles";import { OfficeCameraRig } from "./OfficeCameraRig";-import { allDesks, type CheckpointKind, type Department, type OfficeLayout, type Point } from "./officeLayout";+import { allDesks, type Department, type OfficeLayout, type Point } from "./officeLayout";import { isWalkable, nearestWalkable, type NavGrid } from "./officeNav";import { DEPARTMENT_TINTS, OFFICE } from "./officePalette";import { officeSession, player as playerBody, useOfficeStore, type OfficeFloor, type Selection } from "./officeStore";import { arrivalPose } from "./officeFloors";-const CHECKPOINT_ICON: Record<CheckpointKind, CheckpointIcon> = {- create: "plus", manage: "list", team: "team", wardrobe: "shirt", lead: "star", break: "coffee", elevator: "updown",-};-/** The person's character as a mover for Gigi to follow (the body object itself, mutated every frame). */const PLAYER_OWNER = { current: playerBody };diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsxindex c14b9c9b98..ff18cce6b3 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx@@ -34,6 +34,7 @@ import { AgentPanel, CheckpointPanel, PaneAgentPanel, type OfficeActions } fromimport type { WalkerContext } from "./OfficeAgents";import { ownsKeyboard } from "./OfficePlayer";import { ArcadeCabinet } from "./ArcadeCabinet";+import { useOfficeSettings, useReceptionTab } from "./officeSettings";import "./office.css";import "./officeHud.css";import "./officeMinimap.css";@@ -242,6 +243,24 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenreturn () => document.removeEventListener("keydown", onKey, true);}, [select]);+ // H (or the HUD button) opens reception on the controls guide from anywhere, and closes it again.+ const toggleGuide = useCallback(() => {+ const current = useOfficeStore.getState().selection;+ if (current?.kind === "checkpoint" && current.id === "create") { select(null); return; }+ useReceptionTab.getState().setTab("controls");+ select({ kind: "checkpoint", id: "create" });+ }, [select]);+ useEffect(() => {+ const onKey = (event: KeyboardEvent) => {+ if (event.code !== "KeyH" || event.repeat || event.ctrlKey || event.metaKey || event.altKey || ownsKeyboard(event.target)) return;+ if (useOfficeStore.getState().selection?.kind === "arcade") return;+ event.preventDefault();+ toggleGuide();+ };+ window.addEventListener("keydown", onKey);+ return () => window.removeEventListener("keydown", onKey);+ }, [toggleGuide]);+// Leaving the map forgets panels and calls; the office opens fresh next time.useEffect(() => () => {const store = useOfficeStore.getState();@@ -266,6 +285,8 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen: null;const titleKey = coding ? "society.office.coding_title" : "society.office.title";const playerName = profile.name.trim() || t("society.office.you");+ const showHintBar = useOfficeSettings((s) => s.showHintBar);+ const receptionOpen = selection?.kind === "checkpoint" && selection.id === "create";return (<section className={compact ? "office-stage office-stage-compact" : "office-stage"} aria-label={t(titleKey)}@@ -307,6 +328,10 @@ 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-pressed={receptionOpen} aria-keyshortcuts="H"+ 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) && (@@ -318,7 +343,7 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen{selection?.kind === "arcade" && <ArcadeCabinet onClose={() => select(null)} />}{selection && selection.kind !== "arcade" && (- <div className="office-panel-slot">+ <div className="office-panel-slot" data-wide={receptionOpen || undefined}>{selection.kind === "agent" && selectedAgent && (selectedPane? <PaneAgentPanel occupant={selectedPane} onOpen={() => openPaneSession(selectedPane.pane)} onClose={() => select(null)} />: <AgentPanel agent={selectedAgent} actions={actions} onClose={() => select(null)} />)}@@ -348,7 +373,7 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenonOpenMap={() => setMapOpen(true)} />}<OfficeFullMap open={mapOpen} onOpen={() => setMapOpen(true)} onClose={() => setMapOpen(false)}layout={layout} agents={agents} selectedId={selection?.kind === "agent" ? selection.id : null} />- {!compact && <p className="office-hud office-help" data-office-ui>{t("society.office.help")}</p>}+ {!compact && showHintBar && <p className="office-hud office-help" data-office-ui>{t("society.office.help")}</p>}</section>);}diff --git a/jarvis/ui/web/frontend/src/components/society/office/ReceptionPanel.tsx b/jarvis/ui/web/frontend/src/components/society/office/ReceptionPanel.tsxnew file mode 100644index 0000000000..7408658922--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/office/ReceptionPanel.tsx@@ -0,0 +1,170 @@+/**+ * Reception: the office's front desk and help centre. Three tabs — a welcome+ * with hiring and every place on the floor, the complete controls guide (from+ * officeControls), and the map's settings (officeSettings). H opens it on the+ * controls tab from anywhere, so nobody has to find the desk to learn the keys.+ */+import { useId, useRef, type KeyboardEvent as ReactKeyboardEvent } from "react";+import { useT } from "@/i18n";+import type { OfficeLayout } from "./officeLayout";+import { useOfficeStore, type OfficeFloor } from "./officeStore";+import { CHECKPOINT_ICON, IconSvg } from "./CheckpointMarker";+import { CONTROL_GROUPS, controlsFor, mouseGesture, type OfficeControl } from "./officeControls";+import { useOfficeSettings, useReceptionTab, type ReceptionTab } from "./officeSettings";+import "./reception.css";++const TABS: readonly ReceptionTab[] = ["welcome", "controls", "settings"];++function KeyCaps({ control }: { control: OfficeControl }) {+ const t = useT();+ return (+ <span className="office-rx-keys">+ {control.keys.map((alt, i) => (+ <span key={i} className="office-rx-alt">+ {i > 0 && <span className="office-rx-or">{t("society.office.guide.or")}</span>}+ {alt.map((cap, j) => {+ if (cap === "+") return <span key={j} className="office-rx-plus" aria-hidden>+</span>;+ const gesture = mouseGesture(cap);+ return gesture+ ? <kbd key={j} className="office-rx-cap" data-mouse>{t(`society.office.guide.mouse_${gesture}`)}</kbd>+ : <kbd key={j} className="office-rx-cap">{cap === "Space" ? t("society.office.guide.key_space") : cap}</kbd>;+ })}+ </span>+ ))}+ </span>+ );+}++function ControlsTab({ floor }: { floor: OfficeFloor }) {+ const t = useT();+ return (+ <div className="office-rx-groups">+ {CONTROL_GROUPS.map((group) => (+ <section key={group} className="office-rx-group" aria-label={t(`society.office.guide.group_${group}`)}>+ <h3>{t(`society.office.guide.group_${group}`)}</h3>+ <ul>+ {controlsFor(group, floor).map((control) => (+ <li key={control.id}>+ <span className="office-rx-what">{t(`society.office.guide.ctl_${control.id}`)}</span>+ <KeyCaps control={control} />+ </li>+ ))}+ </ul>+ </section>+ ))}+ </div>+ );+}++function Toggle({ label, hint, checked, onChange }: { label: string; hint: string; checked: boolean; onChange: (next: boolean) => void }) {+ const hintId = useId();+ return (+ <div className="office-rx-setting">+ <div>+ <strong>{label}</strong>+ <span id={hintId}>{hint}</span>+ </div>+ <button type="button" role="switch" className="office-rx-switch" aria-checked={checked} aria-label={label}+ aria-describedby={hintId} onClick={() => onChange(!checked)}>+ <i aria-hidden />+ </button>+ </div>+ );+}++function SettingsTab() {+ const t = useT();+ const settings = useOfficeSettings();+ return (+ <>+ <p className="office-hint">{t("society.office.guide.settings_intro")}</p>+ <div className="office-rx-settings">+ <Toggle label={t("society.office.guide.set_always_run")} hint={t("society.office.guide.set_always_run_hint")}+ checked={settings.alwaysRun} onChange={(alwaysRun) => settings.set({ alwaysRun })} />+ <Toggle label={t("society.office.guide.set_hint_bar")} hint={t("society.office.guide.set_hint_bar_hint")}+ checked={settings.showHintBar} onChange={(showHintBar) => settings.set({ showHintBar })} />+ </div>+ <button type="button" className="office-link office-rx-reset" onClick={settings.reset}>{t("society.office.guide.set_reset")}</button>+ </>+ );+}++function WelcomeTab({ floor, layout, onCreateAgent }: { floor: OfficeFloor; layout: OfficeLayout; onCreateAgent?: () => void }) {+ const t = useT();+ const places = layout.checkpoints.filter((cp) => cp.id !== "create");+ const walk = (x: number, z: number) => {+ const store = useOfficeStore.getState();+ store.select(null);+ store.requestWalk({ x, z });+ };+ return (+ <>+ {floor === "agents" && (+ <div className="office-rx-hero">+ <span className="office-rx-icon" data-tone="gold"><IconSvg icon="plus" /></span>+ <div>+ <strong>{t("society.office.guide.hero_title")}</strong>+ <p>{t("society.office.create_body")}</p>+ <button type="button" className="office-action office-action-primary" disabled={!onCreateAgent} onClick={() => onCreateAgent?.()}>+ {t("society.office.create_action")}+ </button>+ </div>+ </div>+ )}+ <h3 className="office-rx-heading">{t("society.office.guide.places")}</h3>+ <ul className="office-rx-places">+ {places.map((cp) => {+ const name = t(`society.office.cp_${cp.id}`);+ return (+ <li key={cp.id}>+ <span className="office-rx-icon"><IconSvg icon={CHECKPOINT_ICON[cp.id]} /></span>+ <span className="office-rx-place">+ <strong>{name}</strong>+ <span>{t(`society.office.cp_${cp.id}_hint`)}</span>+ </span>+ <button type="button" className="office-mini" aria-label={t("society.office.guide.place_walk_label").replace("{0}", name)}+ onClick={() => walk(cp.x, cp.z)}>{t("society.office.guide.place_walk")}</button>+ </li>+ );+ })}+ </ul>+ <p className="office-rx-tip"><kbd className="office-rx-cap">H</kbd>{t("society.office.guide.tip_guide")}</p>+ </>+ );+}++export function ReceptionPanel({ floor, layout, onCreateAgent }: { floor: OfficeFloor; layout: OfficeLayout; onCreateAgent?: () => void }) {+ const t = useT();+ const tab = useReceptionTab((s) => s.tab);+ const setTab = useReceptionTab((s) => s.setTab);+ const baseId = useId();+ const tabRefs = useRef<(HTMLButtonElement | null)[]>([]);+ // Arrow keys move between tabs (WAI-ARIA tabs pattern); the map's walking keys listen on the window, not here.+ const onTabKey = (event: ReactKeyboardEvent<HTMLDivElement>) => {+ const step = event.key === "ArrowRight" ? 1 : event.key === "ArrowLeft" ? -1 : 0;+ if (!step) return;+ event.preventDefault();+ event.stopPropagation();+ const next = TABS[(TABS.indexOf(tab) + step + TABS.length) % TABS.length]!;+ setTab(next);+ tabRefs.current[TABS.indexOf(next)]?.focus();+ };+ return (+ <div className="office-reception">+ <div className="office-rx-tabs" role="tablist" aria-label={t("society.office.guide.tablist")} onKeyDown={onTabKey}>+ {TABS.map((id, i) => (+ <button key={id} ref={(el) => { tabRefs.current[i] = el; }} type="button" role="tab" id={`${baseId}-${id}`}+ aria-selected={tab === id} aria-controls={`${baseId}-${id}-panel`} tabIndex={tab === id ? 0 : -1}+ className="office-rx-tab" onClick={() => setTab(id)}>+ {t(`society.office.guide.tab_${id}`)}+ </button>+ ))}+ </div>+ <div role="tabpanel" id={`${baseId}-${tab}-panel`} aria-labelledby={`${baseId}-${tab}`} className="office-rx-body">+ {tab === "welcome" && <WelcomeTab floor={floor} layout={layout} onCreateAgent={onCreateAgent} />}+ {tab === "controls" && <ControlsTab floor={floor} />}+ {tab === "settings" && <SettingsTab />}+ </div>+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/society/office/officeControls.test.ts b/jarvis/ui/web/frontend/src/components/society/office/officeControls.test.tsnew file mode 100644index 0000000000..f512889298--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/office/officeControls.test.ts@@ -0,0 +1,44 @@+import { describe, expect, it } from "vitest";+import en from "@/i18n/locales/society/en.json";+import { CONTROL_GROUPS, controlsFor, mouseGesture, OFFICE_CONTROLS } from "./officeControls";+import { isRunning } from "./officeSettings";++const guide = (en as { society: { office: { guide: Record<string, string> } } }).society.office.guide;++describe("office controls guide", () => {+ it("names every control, group and mouse gesture in the locale", () => {+ for (const group of CONTROL_GROUPS) expect(guide[`group_${group}`]).toBeTruthy();+ for (const control of OFFICE_CONTROLS) {+ expect(guide[`ctl_${control.id}`], control.id).toBeTruthy();+ for (const cap of control.keys.flat()) {+ const gesture = mouseGesture(cap);+ if (gesture) expect(guide[`mouse_${gesture}`], cap).toBeTruthy();+ }+ }+ });++ it("keeps control ids unique and every group filled", () => {+ const ids = OFFICE_CONTROLS.map((c) => c.id);+ expect(new Set(ids).size).toBe(ids.length);+ for (const group of CONTROL_GROUPS) expect(controlsFor(group, "coding").length).toBeGreaterThan(0);+ });++ it("drops the lead chair on the coding floor", () => {+ expect(controlsFor("interact", "agents").some((c) => c.id === "sit")).toBe(true);+ expect(controlsFor("interact", "coding").some((c) => c.id === "sit")).toBe(false);+ });++ it("lists the hotkeys the office handles", () => {+ const caps = new Set(OFFICE_CONTROLS.flatMap((c) => c.keys.flat()));+ for (const key of ["W", "Shift", "E", "T", "M", "H", "Esc", "Space", "P"]) expect(caps.has(key), key).toBe(true);+ });+});++describe("always run", () => {+ it("makes Shift walk instead of run", () => {+ expect(isRunning(false, false)).toBe(false);+ expect(isRunning(true, false)).toBe(true);+ expect(isRunning(false, true)).toBe(true);+ expect(isRunning(true, true)).toBe(false);+ });+});diff --git a/jarvis/ui/web/frontend/src/components/society/office/officeControls.ts b/jarvis/ui/web/frontend/src/components/society/office/officeControls.tsnew file mode 100644index 0000000000..d49d892ad9--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/office/officeControls.ts@@ -0,0 +1,55 @@+/**+ * Every way to act in the office, in one list: the reception's controls guide+ * renders it, and a new hotkey is added here next to its handler so the guide+ * never goes stale. A binding is a list of alternatives; each alternative is a+ * row of key caps ("+" joins a chord, e.g. Ctrl + drag). Caps starting with+ * "mouse:" are mouse gestures and get a translated label; every other cap is+ * printed as is.+ */++export type ControlGroup = "move" | "camera" | "interact" | "map" | "arcade";++export interface OfficeControl {+ id: string;+ group: ControlGroup;+ keys: readonly (readonly string[])[];+ /** Only on the agents floor (the coding floor has no lead chair). */+ agentsOnly?: boolean;+}++export const CONTROL_GROUPS: readonly ControlGroup[] = ["move", "camera", "interact", "map", "arcade"];++export type MouseGesture = "click" | "double" | "drag" | "right_drag" | "wheel";++export const OFFICE_CONTROLS: readonly OfficeControl[] = [+ { id: "walk", group: "move", keys: [["W", "A", "S", "D"], ["↑", "←", "↓", "→"]] },+ { id: "run", group: "move", keys: [["Shift"]] },+ { id: "click_walk", group: "move", keys: [["mouse:click"]] },+ { id: "rotate", group: "camera", keys: [["mouse:drag"]] },+ { id: "pan", group: "camera", keys: [["mouse:right_drag"], ["Ctrl/⌘", "+", "mouse:drag"]] },+ { id: "zoom", group: "camera", keys: [["mouse:wheel"]] },+ { id: "interact", group: "interact", keys: [["E"]] },+ { id: "talk", group: "interact", keys: [["T"]] },+ { id: "sit", group: "interact", keys: [["E"]], agentsOnly: true },+ { id: "screen", group: "interact", keys: [["mouse:click"]] },+ { id: "close", group: "interact", keys: [["Esc"]] },+ { id: "map", group: "map", keys: [["M"]] },+ { id: "guide", group: "map", keys: [["H"]] },+ { id: "minimap_focus", group: "map", keys: [["mouse:click"]] },+ { id: "minimap_walk", group: "map", keys: [["mouse:double"]] },+ { id: "minimap_zoom", group: "map", keys: [["mouse:wheel"]] },+ { id: "arcade_fly", group: "arcade", keys: [["W", "A", "S", "D"], ["↑", "←", "↓", "→"]] },+ { id: "arcade_shoot", group: "arcade", keys: [["Space"]] },+ { id: "arcade_pause", group: "arcade", keys: [["P"]] },+ { id: "arcade_leave", group: "arcade", keys: [["E"], ["Esc"]] },+];++/** The mouse gesture a cap names, or null for a plain key. */+export function mouseGesture(cap: string): MouseGesture | null {+ return cap.startsWith("mouse:") ? (cap.slice(6) as MouseGesture) : null;+}++/** The controls of one group that apply on this floor. */+export function controlsFor(group: ControlGroup, floor: "agents" | "coding"): OfficeControl[] {+ return OFFICE_CONTROLS.filter((c) => c.group === group && (!c.agentsOnly || floor === "agents"));+}diff --git a/jarvis/ui/web/frontend/src/components/society/office/officeSettings.ts b/jarvis/ui/web/frontend/src/components/society/office/officeSettings.tsnew file mode 100644index 0000000000..5805006a56--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/office/officeSettings.ts@@ -0,0 +1,73 @@+/**+ * The office's own settings, kept per viewer in browser storage. Reception is+ * their home: every setting the map gains (and, later, rebindable keys) lands+ * in this one store and in the reception's Settings tab.+ */+import { create } from "zustand";++export interface OfficeSettings {+ /** Walk at sprint pace by default; Shift then slows to a walk. */+ alwaysRun: boolean;+ /** Show the one-line controls reminder at the bottom of the map. */+ showHintBar: boolean;+}++export const DEFAULT_OFFICE_SETTINGS: OfficeSettings = { alwaysRun: false, showHintBar: true };++const STORAGE_KEY = "jarvis.office.settings.v1";++export function loadOfficeSettings(): OfficeSettings {+ try {+ const raw = typeof localStorage === "undefined" ? null : localStorage.getItem(STORAGE_KEY);+ if (!raw) return { ...DEFAULT_OFFICE_SETTINGS };+ const parsed = JSON.parse(raw) as Partial<OfficeSettings>;+ return {+ alwaysRun: typeof parsed.alwaysRun === "boolean" ? parsed.alwaysRun : DEFAULT_OFFICE_SETTINGS.alwaysRun,+ showHintBar: typeof parsed.showHintBar === "boolean" ? parsed.showHintBar : DEFAULT_OFFICE_SETTINGS.showHintBar,+ };+ } catch (error) {+ // Blocked or corrupt storage: the defaults are a complete, working set.+ console.warn("Office settings unreadable, using defaults", error);+ return { ...DEFAULT_OFFICE_SETTINGS };+ }+}++function saveOfficeSettings(settings: OfficeSettings): void {+ try {+ localStorage.setItem(STORAGE_KEY, JSON.stringify(settings));+ } catch (error) {+ // The setting still applies for this visit; it just will not survive a reload.+ console.warn("Office settings not saved", error);+ }+}++interface OfficeSettingsState extends OfficeSettings {+ set: (patch: Partial<OfficeSettings>) => void;+ reset: () => void;+}++export const useOfficeSettings = create<OfficeSettingsState>((set, get) => ({+ ...loadOfficeSettings(),+ set: (patch) => {+ set(patch);+ const { alwaysRun, showHintBar } = get();+ saveOfficeSettings({ alwaysRun, showHintBar });+ },+ reset: () => {+ set({ ...DEFAULT_OFFICE_SETTINGS });+ saveOfficeSettings({ ...DEFAULT_OFFICE_SETTINGS });+ },+}));++/** Sprint when exactly one of "Shift held" and "always run" is on. */+export function isRunning(shiftHeld: boolean, alwaysRun: boolean): boolean {+ return shiftHeld !== alwaysRun;+}++/** The reception's tabs; H opens reception on the controls tab from anywhere. */+export type ReceptionTab = "welcome" | "controls" | "settings";++export const useReceptionTab = create<{ tab: ReceptionTab; setTab: (tab: ReceptionTab) => void }>((set) => ({+ tab: "welcome",+ setTab: (tab) => set({ tab }),+}));diff --git a/jarvis/ui/web/frontend/src/components/society/office/reception.css b/jarvis/ui/web/frontend/src/components/society/office/reception.cssnew file mode 100644index 0000000000..b44049240f--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/office/reception.css@@ -0,0 +1,64 @@+/* Reception: the office's help centre. Theme tokens only, so light and dark mode both work. */+.office-panel-slot[data-wide] { width:min(430px, calc(100% - 28px)); }+.office-reception { display:flex; flex-direction:column; gap:10px; min-height:0; }++/* Tabs: a segmented control. */+.office-rx-tabs { display:grid; grid-template-columns:repeat(3, 1fr); gap:3px; padding:3px; border-radius:10px; background:hsl(var(--secondary) / .7); border:1px solid hsl(var(--border)); }+.office-rx-tab { border:0; border-radius:7px; padding:6px 8px; background:transparent; color:hsl(var(--muted-foreground)); font-size:12px; font-weight:600; cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; transition:background .15s, color .15s; }+.office-rx-tab:hover { color:hsl(var(--foreground)); }+.office-rx-tab[aria-selected="true"] { background:hsl(var(--background)); color:hsl(var(--foreground)); box-shadow:0 1px 3px rgb(0 0 0 / .18); }+.office-rx-tab:focus-visible { outline:2px solid hsl(var(--ring)); outline-offset:1px; }+.office-rx-body { display:flex; flex-direction:column; gap:10px; }++/* Icon tiles: a checkpoint's icon, as on its floor token. */+.office-rx-icon { flex:none; display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:9px; background:hsl(var(--secondary)); color:hsl(var(--foreground)); border:1px solid hsl(var(--border)); }+.office-rx-icon svg { width:16px; height:16px; }+.office-rx-icon[data-tone="gold"] { background:#f5b83d; color:#1f1300; border-color:transparent; }++/* Welcome: hiring first, then every place on the floor. */+.office-rx-hero { display:flex; gap:11px; padding:11px; border-radius:11px; border:1px solid hsl(var(--border)); background:linear-gradient(135deg, hsl(var(--primary) / .1), hsl(var(--secondary) / .45)); }+.office-rx-hero > div { display:flex; flex-direction:column; align-items:flex-start; gap:6px; min-width:0; }+.office-rx-hero strong { font-size:13px; }+.office-rx-hero p { color:hsl(var(--muted-foreground)); }+.office-rx-heading { margin:2px 0 0; font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:hsl(var(--muted-foreground)); }+.office-rx-places { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }+.office-rx-places li { display:flex; align-items:center; gap:9px; padding:5px 6px; border-radius:9px; }+.office-rx-places li:hover { background:hsl(var(--secondary) / .6); }+.office-rx-place { flex:1; min-width:0; display:flex; flex-direction:column; }+.office-rx-place strong { font-size:12px; }+.office-rx-place span { font-size:11px; color:hsl(var(--muted-foreground)); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }+.office-rx-places .office-mini { flex:none; }+.office-rx-tip { display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:9px; border:1px dashed hsl(var(--border)); font-size:11px; color:hsl(var(--muted-foreground)); }++/* Key caps: a raised key for keys, a softer pill for mouse gestures. */+.office-rx-cap { display:inline-flex; align-items:center; justify-content:center; min-width:22px; height:22px; padding:0 6px; border-radius:6px; border:1px solid hsl(var(--border)); border-bottom-width:2px; background:hsl(var(--background)); color:hsl(var(--foreground)); font-family:inherit; font-size:11px; font-weight:700; line-height:1; white-space:nowrap; }+.office-rx-cap[data-mouse] { border-bottom-width:1px; border-radius:999px; font-weight:600; background:hsl(var(--secondary) / .8); }+.office-rx-keys { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:4px; }+.office-rx-alt { display:inline-flex; align-items:center; gap:3px; }+.office-rx-or { margin:0 3px 0 1px; font-size:10.5px; color:hsl(var(--muted-foreground)); }+.office-rx-plus { font-size:11px; color:hsl(var(--muted-foreground)); }++/* Controls: one card per group, a row per action. */+.office-rx-groups { display:flex; flex-direction:column; gap:8px; }+.office-rx-group { border:1px solid hsl(var(--border)); border-radius:11px; padding:8px 10px 4px; background:hsl(var(--background) / .5); }+.office-rx-group h3 { margin:0 0 4px; font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:hsl(var(--muted-foreground)); }+.office-rx-group ul { list-style:none; margin:0; padding:0; }+.office-rx-group li { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:6px 0; border-top:1px solid hsl(var(--border) / .6); }+.office-rx-group li:first-child { border-top:0; }+.office-rx-what { min-width:0; }++/* Settings: a row per setting with a switch. */+.office-rx-settings { display:flex; flex-direction:column; border:1px solid hsl(var(--border)); border-radius:11px; overflow:hidden; }+.office-rx-setting { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 11px; }+.office-rx-setting + .office-rx-setting { border-top:1px solid hsl(var(--border)); }+.office-rx-setting > div { display:flex; flex-direction:column; gap:2px; min-width:0; }+.office-rx-setting strong { font-size:12px; }+.office-rx-setting span { font-size:11px; color:hsl(var(--muted-foreground)); }+.office-rx-switch { flex:none; position:relative; width:36px; height:20px; border-radius:999px; border:1px solid hsl(var(--border)); background:hsl(var(--secondary)); cursor:pointer; padding:0; transition:background .15s; }+.office-rx-switch i { position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:hsl(var(--muted-foreground)); transition:transform .15s, background .15s; }+.office-rx-switch[aria-checked="true"] { background:hsl(var(--primary)); border-color:transparent; }+.office-rx-switch[aria-checked="true"] i { transform:translateX(16px); background:hsl(var(--primary-foreground)); }+.office-rx-switch:focus-visible { outline:2px solid hsl(var(--ring)); outline-offset:2px; }+.office-rx-reset { align-self:flex-start; }++@media (prefers-reduced-motion: reduce) { .office-rx-tab, .office-rx-switch, .office-rx-switch i { transition:none; } }diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json b/jarvis/ui/web/frontend/src/i18n/locales/society/de.jsonindex d01bbddd5f..0c3b2f7b68 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json@@ -735,7 +735,7 @@"open_agent": "{0} öffnen","overview": "Übersicht","ledger": "Agentenliste",- "help": "WASD / Pfeile laufen · Shift rennt · Boden anklicken zum Hingehen · E interagiert · T halten zum Sprechen · Ziehen dreht · Scrollen zoomt · M öffnet die Karte",+ "help": "WASD laufen · Shift rennt · E benutzen · M Karte · H Hilfe & Einstellungen","sample": "Beispiel-Agenten – das Backend ist noch nicht erreichbar.","overflow": "Nur die ersten {0} Agenten haben einen Schreibtisch; die Liste zeigt alle.","open_space": "Open Space",@@ -770,7 +770,7 @@"break_call": "Kaffeepause ausrufen","break_release": "Alle zurück an die Arbeit","cp_create": "Empfang",- "cp_create_hint": "Neuen Agenten erstellen",+ "cp_create_hint": "Hilfe, Steuerung, Einstellungen und neue Agenten","cp_manage": "Agenten-Board","cp_manage_hint": "Alle Agenten sehen und verwalten","cp_team": "Teamraum",@@ -783,6 +783,56 @@"cp_break_hint": "Kaffeepause ausrufen","cp_elevator": "Aufzug","cp_elevator_hint": "Ins andere Stockwerk fahren",+ "guide": {+ "tablist": "Bereiche des Empfangs",+ "tab_welcome": "Willkommen",+ "tab_controls": "Steuerung",+ "tab_settings": "Einstellungen",+ "hud_button": "Hilfe & Einstellungen",+ "hero_title": "Dein Team erweitern",+ "places": "Orte im Büro",+ "place_walk": "Hingehen",+ "place_walk_label": "Zu {0} gehen",+ "tip_guide": "öffnet diese Hilfe überall auf der Karte; noch einmal drücken schließt sie.",+ "or": "oder",+ "group_move": "Bewegen",+ "group_camera": "Kamera",+ "group_interact": "Interagieren",+ "group_map": "Karte & Hilfe",+ "group_arcade": "Arcade (Pausenraum)",+ "ctl_walk": "Laufen",+ "ctl_run": "Rennen, solange gedrückt",+ "ctl_click_walk": "Boden anklicken, um hinzugehen",+ "ctl_rotate": "Ansicht drehen",+ "ctl_pan": "Ansicht verschieben",+ "ctl_zoom": "Rein- und rauszoomen",+ "ctl_interact": "Benutzen, was in der Nähe ist: reden, Ort öffnen",+ "ctl_talk": "Halten, um mit einem Agenten zu sprechen (in seinem Panel)",+ "ctl_sit": "Auf den Chefsessel setzen; E noch einmal steht auf",+ "ctl_screen": "Monitor anklicken öffnet den Chat dieses Agenten",+ "ctl_close": "Panel oder Karte schließen",+ "ctl_map": "Große Karte öffnen oder schließen",+ "ctl_guide": "Diese Hilfe öffnen oder schließen",+ "ctl_minimap_focus": "Minikarte anklicken, um dorthin zu schauen",+ "ctl_minimap_walk": "Doppelklick auf die Minikarte, um hinzugehen",+ "ctl_minimap_zoom": "Minikarte zoomen",+ "ctl_arcade_fly": "Fliegen",+ "ctl_arcade_shoot": "Schießen oder Runde starten",+ "ctl_arcade_pause": "Pause",+ "ctl_arcade_leave": "Arcade verlassen",+ "mouse_click": "Klick",+ "mouse_double": "Doppelklick",+ "mouse_drag": "Ziehen",+ "mouse_right_drag": "Rechts ziehen",+ "mouse_wheel": "Mausrad",+ "key_space": "Leertaste",+ "settings_intro": "Deine Einstellungen für die Bürokarte, gespeichert auf diesem Gerät.",+ "set_always_run": "Immer rennen",+ "set_always_run_hint": "Standardmäßig rennen; Shift halten zum Gehen.",+ "set_hint_bar": "Steuerungsleiste",+ "set_hint_bar_hint": "Die kurze Tastenübersicht unten auf der Karte anzeigen.",+ "set_reset": "Auf Standard zurücksetzen"+ },"coding_title": "Coding-Etage","coding_subtitle": "Coding-Sessions auf der Etage: {0}","coding_empty": "Kein Coding-Agent läuft. Starte einen in der IDE, dann bekommt er hier einen Schreibtisch.",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json b/jarvis/ui/web/frontend/src/i18n/locales/society/en.jsonindex 696c241143..994834d782 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json@@ -735,7 +735,7 @@"open_agent": "Open {0}","overview": "Overview","ledger": "Agents list",- "help": "WASD / arrows walk · Shift runs · Click the floor to walk there · E interacts · Hold T to speak · Drag rotates · Scroll zooms · M opens the map",+ "help": "WASD walk · Shift runs · E interacts · M map · H help & settings","sample": "Sample agents — the backend is not reachable yet.","overflow": "Only the first {0} agents have a desk; the list shows everyone.","open_space": "Open space",@@ -770,7 +770,7 @@"break_call": "Call a coffee break","break_release": "Everyone back to their day","cp_create": "Reception",- "cp_create_hint": "Create a new agent",+ "cp_create_hint": "Help, controls, settings and new agents","cp_manage": "Agent board","cp_manage_hint": "See and manage every agent","cp_team": "Team room",@@ -783,6 +783,56 @@"cp_break_hint": "Call a coffee break","cp_elevator": "Elevator","cp_elevator_hint": "Ride to the other floor",+ "guide": {+ "tablist": "Reception sections",+ "tab_welcome": "Welcome",+ "tab_controls": "Controls",+ "tab_settings": "Settings",+ "hud_button": "Help & settings",+ "hero_title": "Grow your team",+ "places": "Places in the office",+ "place_walk": "Walk there",+ "place_walk_label": "Walk to {0}",+ "tip_guide": "opens this help from anywhere on the map; press it again to close.",+ "or": "or",+ "group_move": "Moving",+ "group_camera": "Camera",+ "group_interact": "Interacting",+ "group_map": "Map & help",+ "group_arcade": "Arcade (break room)",+ "ctl_walk": "Walk",+ "ctl_run": "Run while held",+ "ctl_click_walk": "Click the floor to walk there",+ "ctl_rotate": "Rotate the view",+ "ctl_pan": "Move the view",+ "ctl_zoom": "Zoom in and out",+ "ctl_interact": "Use what is nearby: talk, open a place",+ "ctl_talk": "Hold to speak to an agent (in its panel)",+ "ctl_sit": "Sit in the lead chair; E again stands up",+ "ctl_screen": "Click a monitor to open that agent's chat",+ "ctl_close": "Close a panel or the map",+ "ctl_map": "Open or close the big map",+ "ctl_guide": "Open or close this help",+ "ctl_minimap_focus": "Click the minimap to look there",+ "ctl_minimap_walk": "Double-click the minimap to walk there",+ "ctl_minimap_zoom": "Zoom the minimap",+ "ctl_arcade_fly": "Fly",+ "ctl_arcade_shoot": "Shoot, or start a round",+ "ctl_arcade_pause": "Pause",+ "ctl_arcade_leave": "Leave the arcade",+ "mouse_click": "Click",+ "mouse_double": "Double-click",+ "mouse_drag": "Drag",+ "mouse_right_drag": "Right-drag",+ "mouse_wheel": "Scroll wheel",+ "key_space": "Space",+ "settings_intro": "Your settings for the office map, saved on this device.",+ "set_always_run": "Always run",+ "set_always_run_hint": "Run by default; hold Shift to walk.",+ "set_hint_bar": "Controls bar",+ "set_hint_bar_hint": "Show the short controls reminder at the bottom of the map.",+ "set_reset": "Reset to defaults"+ },"coding_title": "Coding floor","coding_subtitle": "Coding sessions on the floor: {0}","coding_empty": "No coding agent is running. Start one in the IDE and it takes a desk here.",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json b/jarvis/ui/web/frontend/src/i18n/locales/society/es.jsonindex 4852da531d..91dfbe74d9 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json@@ -735,7 +735,7 @@"open_agent": "Abrir {0}","overview": "Vista general","ledger": "Lista de agentes",- "help": "WASD / flechas para andar · Shift corre · Clic en el suelo para ir · E interactúa · Mantén T para hablar · Arrastrar gira · Rueda para zoom · M abre el mapa",+ "help": "WASD caminar · Shift corre · E usar · M mapa · H ayuda y ajustes","sample": "Agentes de ejemplo: el backend aún no está disponible.","overflow": "Solo los primeros {0} agentes tienen escritorio; la lista muestra a todos.","open_space": "Espacio abierto",@@ -770,7 +770,7 @@"break_call": "Pausa de café","break_release": "Todos de vuelta a lo suyo","cp_create": "Recepción",- "cp_create_hint": "Crear un agente nuevo",+ "cp_create_hint": "Ayuda, controles, ajustes y agentes nuevos","cp_manage": "Tablero de agentes","cp_manage_hint": "Ver y gestionar todos los agentes","cp_team": "Sala de equipos",@@ -783,6 +783,56 @@"cp_break_hint": "Hacer una pausa de café","cp_elevator": "Ascensor","cp_elevator_hint": "Subir o bajar de planta",+ "guide": {+ "tablist": "Secciones de la recepción",+ "tab_welcome": "Bienvenida",+ "tab_controls": "Controles",+ "tab_settings": "Ajustes",+ "hud_button": "Ayuda y ajustes",+ "hero_title": "Amplía tu equipo",+ "places": "Lugares de la oficina",+ "place_walk": "Ir",+ "place_walk_label": "Ir a {0}",+ "tip_guide": "abre esta ayuda desde cualquier punto del mapa; púlsala otra vez para cerrarla.",+ "or": "o",+ "group_move": "Moverse",+ "group_camera": "Cámara",+ "group_interact": "Interactuar",+ "group_map": "Mapa y ayuda",+ "group_arcade": "Arcade (sala de descanso)",+ "ctl_walk": "Caminar",+ "ctl_run": "Correr mientras la mantienes",+ "ctl_click_walk": "Haz clic en el suelo para ir allí",+ "ctl_rotate": "Girar la vista",+ "ctl_pan": "Mover la vista",+ "ctl_zoom": "Acercar y alejar",+ "ctl_interact": "Usar lo que está cerca: hablar, abrir un lugar",+ "ctl_talk": "Mantén para hablar con un agente (en su panel)",+ "ctl_sit": "Sentarte en la silla del líder; E otra vez te levanta",+ "ctl_screen": "Haz clic en un monitor para abrir el chat de ese agente",+ "ctl_close": "Cerrar un panel o el mapa",+ "ctl_map": "Abrir o cerrar el mapa grande",+ "ctl_guide": "Abrir o cerrar esta ayuda",+ "ctl_minimap_focus": "Haz clic en el minimapa para mirar allí",+ "ctl_minimap_walk": "Doble clic en el minimapa para ir allí",+ "ctl_minimap_zoom": "Zoom del minimapa",+ "ctl_arcade_fly": "Volar",+ "ctl_arcade_shoot": "Disparar o empezar una partida",+ "ctl_arcade_pause": "Pausa",+ "ctl_arcade_leave": "Salir del arcade",+ "mouse_click": "Clic",+ "mouse_double": "Doble clic",+ "mouse_drag": "Arrastrar",+ "mouse_right_drag": "Arrastrar con botón derecho",+ "mouse_wheel": "Rueda",+ "key_space": "Espacio",+ "settings_intro": "Tus ajustes del mapa de la oficina, guardados en este dispositivo.",+ "set_always_run": "Correr siempre",+ "set_always_run_hint": "Corre por defecto; mantén Shift para caminar.",+ "set_hint_bar": "Barra de controles",+ "set_hint_bar_hint": "Mostrar el breve recordatorio de controles abajo del mapa.",+ "set_reset": "Restablecer valores"+ },"coding_title": "Planta de código","coding_subtitle": "Sesiones de código en la planta: {0}","coding_empty": "No hay ningún agente de código en marcha. Inicia uno en el IDE y ocupará un escritorio aquí.",