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(verse): third and first person in a roomy IDE side panel, a click takes the keys (#937)

Ruben Lütkeb8e7d2b8aa7e
diff --git a/docs/verse/README.md b/docs/verse/README.md
index 21314f1507..34ad9e79a2 100644
--- a/docs/verse/README.md
+++ b/docs/verse/README.md
@@ -85,7 +85,10 @@ commander faces it while walking. The wheel moves the third-person camera
between 1.2 and 5 m; scrolling in past that is first person, scrolling out of
first person comes back. The camera never passes through walls. The view
settings set mouse sensitivity, inverted look and the field of view of each
-person. The IDE side panel keeps the plate. Details: [`realtime.md`](realtime.md)
+person. The IDE side panel offers all three views once it is at least
+480 × 360 CSS px (rendered at the low quality tier unless the person pins
+high); a smaller panel keeps the plate. A click on the panel takes the keys
+from the terminal beside it. Details: [`realtime.md`](realtime.md)
("Views").
## Decks
diff --git a/docs/verse/realtime.md b/docs/verse/realtime.md
index 6df97be432..dbf683157e 100644
--- a/docs/verse/realtime.md
+++ b/docs/verse/realtime.md
@@ -8,10 +8,12 @@ The plate pipeline photographs a deck from one fixed angle. The realtime
export turns the same Blender scene into a 3D scene the browser walks through
at eye level, so the person steers the commander in third person from behind
their shoulder or in first person through their eyes, with shooter mouse look,
-as in a game. The plate stays: it is the bird's-eye view (key 1) and the IDE
-side panel's view.
+as in a game. The plate stays: it is the bird's-eye view (key 1) and the view
+of an IDE side panel smaller than 480 × 360 CSS px (`COMPACT_EYE_MIN` in
+`engine/stageView.ts`); a larger side panel walks at eye level like the
+full-size stage, on the low quality tier while the setting is "auto".
-| | Plate (bird's-eye, compact panel) | Realtime (full-size stage, third or first person) |
+| | Plate (bird's-eye, small panel) | Realtime (full-size stage or roomy panel, third or first person) |
|---|---|---|
| Camera | orthographic, 60° down, fixed | perspective, over the shoulder or at eye height, shooter mouse look |
| Light | Cycles path tracing, baked into the photograph | Cycles bake of the diffuse light into lightmaps + live reflections |
diff --git a/dodaios/ui/web/frontend/src/components/society/verse/VerseStage.tsx b/dodaios/ui/web/frontend/src/components/society/verse/VerseStage.tsx
index 964297d037..758c6362f3 100644
--- a/dodaios/ui/web/frontend/src/components/society/verse/VerseStage.tsx
+++ b/dodaios/ui/web/frontend/src/components/society/verse/VerseStage.tsx
@@ -4,10 +4,12 @@
* Each deck is a photograph rendered offline (the plate); the stage puts the
* live crew, their screens and the ship's small lights into it with a camera
* that matches the photograph exactly (BRIEF §3). Decks exported as eye-level
- * scenes (docs/verse/realtime.md) are walked on the full-size stage in third
- * person (over the commander's shoulder) or first person (through their
- * eyes), both with shooter mouse look; the plate stays the bird's-eye view
- * and the IDE panel's view. V cycles the three views, 1/2/3 pick one, and
+ * scenes (docs/verse/realtime.md) are walked on the full-size stage, and in
+ * an IDE side panel of at least COMPACT_EYE_MIN, in third person (over the
+ * commander's shoulder) or first person (through their eyes), both with
+ * shooter mouse look; the plate stays the bird's-eye view and the view of a
+ * smaller panel. A press on the stage takes the keyboard focus (the IDE's
+ * terminal usually holds it), so the keys reach the ship. V cycles the three views, 1/2/3 pick one, and
* the wheel hands third person over to first. The person is the commanding
* officer, steered in third or first person (the keys walk them, the camera
* follows) or sent by clicks from a bird's-eye view; the agents are officers
@@ -43,7 +45,8 @@ import { hasMouseLook, releaseMouseLook, requestMouseLook } from "./engine/realt
import { controlModeOf, cycleView, isShooterView, resolveView, viewForKey, type Person, type VerseView } from "./engine/realtime/viewMode";
import { eyePick } from "./engine/realtime/eyePick";
import { useViewSettings } from "./engine/realtime/viewSettings";
-import { eyeCapable as canWalkAtEyeLevel } from "./engine/stageView";
+import { COMPACT_EYE_MIN, eyeCapable as canWalkAtEyeLevel } from "./engine/stageView";
+import { typesText, useStageFocus } from "./engine/stageFocus";
import { pickBody, pickStation } from "./engine/picking";
import { worldToPlate } from "./engine/plateMath";
import { screenToPlate } from "./engine/view";
@@ -130,11 +133,6 @@ function duelAnyDeck(): boolean {
}
}
-function typesText(target: EventTarget | null): boolean {
- const el = target as HTMLElement | null;
- return !!el && (el.isContentEditable || ["INPUT", "TEXTAREA", "SELECT"].includes(el.tagName));
-}
-
const sameHover = (a: Hover, b: Hover) => a === b || (!!a && !!b && a.kind === b.kind && a.id === b.id);
export function VerseStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenGroup, initialDeck, compact = false, active = true }: VerseStageProps) {
@@ -144,6 +142,8 @@ export function VerseStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenG
const surfaceRef = useRef<HTMLDivElement>(null);
const visible = useCanvasAwake(hostRef);
const awake = active && visible;
+ // A press on the stage takes the keys from the terminal beside it (stageFocus.ts); the hint says so until then.
+ const { keysReach, onPointerDownCapture } = useStageFocus(hostRef, awake);
const reduced = useReducedMotion() ?? false;
const { generation } = useWebglSurface(hostRef);
const webgl = useWebglSupported();
@@ -230,8 +230,27 @@ export function VerseStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenG
// The view (viewMode.ts): bird's-eye (the keys pan over the whole deck), third or first person (the keys walk the
// commander, the camera follows). The person's last choice is kept in this browser.
const chosenView = useViewSettings((s) => s.view);
- // The full-size stage walks an exported deck at eye level; the plate stays the bird's-eye view and the compact view.
- const eyeCapable = !!deck && canWalkAtEyeLevel({ compact, realtime: !!deck.realtime, failed: eyeFailed.has(deck.id) });
+ // The compact stage's size decides whether it is roomy enough to walk at eye level.
+ const [stageSize, setStageSize] = useState<{ width: number; height: number }>({ width: 0, height: 0 });
+ useEffect(() => {
+ const el = hostRef.current;
+ if (!compact || !el) return;
+ const measure = () => {
+ const width = Math.round(el.clientWidth), height = Math.round(el.clientHeight);
+ setStageSize((s) => (s.width === width && s.height === height ? s : { width, height }));
+ };
+ measure();
+ if (typeof ResizeObserver === "undefined") return;
+ const observer = new ResizeObserver(measure);
+ observer.observe(el);
+ return () => observer.disconnect();
+ }, [compact]);
+ // The full-size stage, and a side panel of at least COMPACT_EYE_MIN, walk an exported deck at eye level; the plate
+ // stays the bird's-eye view and the view of a smaller panel.
+ const eyeCapable = !!deck && canWalkAtEyeLevel({
+ compact, width: stageSize.width, height: stageSize.height, realtime: !!deck.realtime, failed: eyeFailed.has(deck.id),
+ });
+ const tooSmall = compact && !!deck?.realtime && !eyeFailed.has(deck.id) && !eyeCapable;
const view = resolveView(chosenView, eyeCapable);
const mode = controlModeOf(view);
const eyeOn = eyeCapable && mode === "follow";
@@ -258,7 +277,9 @@ export function VerseStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenG
// The person's mouse settings turn the eye-level camera; the quality goes to its renderer.
const sensitivity = useViewSettings((s) => s.sensitivity);
const invertY = useViewSettings((s) => s.invertY);
- const quality = useViewSettings((s) => s.quality);
+ // The side panel shares the GPU with the IDE beside it: on "auto" it renders at the low tier.
+ const chosenQuality = useViewSettings((s) => s.quality);
+ const quality = compact && chosenQuality === "auto" ? "low" : chosenQuality;
const fovThird = useViewSettings((s) => s.fovThird);
const fovFirst = useViewSettings((s) => s.fovFirst);
useEffect(() => {
@@ -860,7 +881,15 @@ export function VerseStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenG
const fallback = <div className="verse-fallback" role="status">{chunkReady ? t("verse.stage.unavailable") : null}</div>;
return (
- <div ref={hostRef} className="verse-stage" data-compact={compact} tabIndex={-1} aria-label={chunkReady ? t("verse.stage.title") : undefined}>
+ <div
+ ref={hostRef}
+ className="verse-stage"
+ data-compact={compact}
+ data-keys={keysReach ? "stage" : "elsewhere"}
+ tabIndex={-1}
+ aria-label={chunkReady ? t("verse.stage.title") : undefined}
+ onPointerDownCapture={onPointerDownCapture}
+ >
{!webgl ? fallback : (
<RenderBoundary key={generation} fallback={fallback}>
<div ref={surfaceRef} className="verse-surface">
@@ -907,6 +936,7 @@ export function VerseStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenG
t={t}
view={view}
firstAvailable={eyeCapable}
+ firstUnavailable={tooSmall ? fill(t("verse.tools.first_too_small"), COMPACT_EYE_MIN) : undefined}
onView={showView}
onLift={() => setPanel("lift")}
onCommander={() => { if (runtime.control.mode === "follow") runtime.control.reframe = true; else focusOn(COMMANDER_ID); }}
@@ -915,9 +945,13 @@ export function VerseStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpenG
onHelp={() => say(t(eyeOn ? "verse.stage.help_eye" : "verse.stage.help"), HELP_MS)}
/>}
{shooter && !dueling && <div className="verse-reticle" data-locked={locked} data-on={hover ? "" : undefined} aria-hidden />}
- {shooter && !dueling && !locked && !panel && plateReady && (
+ {shooter && !dueling && !locked && !panel && plateReady && keysReach && (
<div className="verse-look-hint" aria-hidden>{t("verse.tools.click_to_look")}</div>
)}
+ {/* The keys go elsewhere (the IDE's terminal): one click on the stage brings them here. */}
+ {!keysReach && !locked && !panel && plateReady && (
+ <div className="verse-look-hint verse-keys-hint" role="status">{t("verse.tools.click_for_keys")}</div>
+ )}
{dueling && (
<DuelHud runtime={runtime} controller={duel} phase={duelPhase} locked={locked} t={t}
onResume={() => { duel.resume(); duelActions.current.lockAim(); }}
diff --git a/dodaios/ui/web/frontend/src/components/society/verse/engine/realtime/eyeLevelGame.test.tsx b/dodaios/ui/web/frontend/src/components/society/verse/engine/realtime/eyeLevelGame.test.tsx
index 651ed7dc89..a1b41f989b 100644
--- a/dodaios/ui/web/frontend/src/components/society/verse/engine/realtime/eyeLevelGame.test.tsx
+++ b/dodaios/ui/web/frontend/src/components/society/verse/engine/realtime/eyeLevelGame.test.tsx
@@ -14,7 +14,7 @@ import { StageRuntime, type FrameStats } from "../../runtime";
import { syntheticDeck } from "../../testing/syntheticDeck";
import { worldToPlate } from "../plateMath";
import { plateToScreen } from "../view";
-import { eyeCapable, stageView } from "../stageView";
+import { COMPACT_EYE_MIN, eyeCapable, stageView } from "../stageView";
import { CommanderControl, stationWithin } from "../../life/control";
import type { Station } from "../../content/deck";
import { FloatingLabels, PROMPT_AT } from "../../hud/FloatingLabels";
@@ -151,7 +151,21 @@ describe("which view the stage shows", () => {
expect(stageView({ ...base, mode: "overview" })).toBe("plate");
});
- it("keeps the IDE panel, decks without an export and failed decks on the plate", () => {
+ it("walks a roomy IDE side panel at eye level too, a small or unmeasured one stays on the plate", () => {
+ const min = COMPACT_EYE_MIN;
+ expect(min).toEqual({ width: 480, height: 360 });
+ expect(stageView({ ...base, compact: true, width: min.width, height: min.height, mode: "follow" })).toBe("eye");
+ expect(eyeCapable({ ...base, compact: true, width: 900, height: 700 })).toBe(true);
+ expect(eyeCapable({ ...base, compact: true, width: min.width - 1, height: 700 })).toBe(false);
+ expect(eyeCapable({ ...base, compact: true, width: 900, height: min.height - 1 })).toBe(false);
+ expect(eyeCapable({ ...base, compact: true })).toBe(false);
+ expect(eyeCapable({ ...base, compact: true, width: 900, height: 700, failed: true })).toBe(false);
+ expect(eyeCapable({ ...base, compact: true, width: 900, height: 700, realtime: false })).toBe(false);
+ // The full-size stage never asks for a size.
+ expect(eyeCapable({ ...base, width: 10, height: 10 })).toBe(true);
+ });
+
+ it("keeps a small IDE panel, decks without an export and failed decks on the plate", () => {
expect(stageView({ ...base, compact: true, mode: "follow" })).toBe("plate");
expect(stageView({ ...base, realtime: false, mode: "follow" })).toBe("plate");
expect(stageView({ ...base, failed: true, mode: "follow" })).toBe("plate");
diff --git a/dodaios/ui/web/frontend/src/components/society/verse/engine/realtime/viewMode.ts b/dodaios/ui/web/frontend/src/components/society/verse/engine/realtime/viewMode.ts
index a24beb5778..174d92adb3 100644
--- a/dodaios/ui/web/frontend/src/components/society/verse/engine/realtime/viewMode.ts
+++ b/dodaios/ui/web/frontend/src/components/society/verse/engine/realtime/viewMode.ts
@@ -9,8 +9,9 @@
* V cycles bird's-eye → third → first → bird's-eye; 1, 2 and 3 pick one
* directly. The wheel moves the third-person camera in and out; pushing on
* past the closest distance hands over to first person, and scrolling out of
- * first person comes back to third. Where a deck has no eye-level scene (the
- * compact panel, decks without an export) first person is not offered and
+ * first person comes back to third. Where a deck has no eye-level scene (an
+ * IDE side panel smaller than COMPACT_EYE_MIN, decks without an export)
+ * first person is not offered and
* third person is the plate's follow camera.
*
* Pure: the stage keeps the chosen view and the rig its distance.
diff --git a/dodaios/ui/web/frontend/src/components/society/verse/engine/stageFocus.test.tsx b/dodaios/ui/web/frontend/src/components/society/verse/engine/stageFocus.test.tsx
new file mode 100644
index 0000000000..81cf193592
--- /dev/null
+++ b/dodaios/ui/web/frontend/src/components/society/verse/engine/stageFocus.test.tsx
@@ -0,0 +1,99 @@
+/**
+ * Who gets the keys: a press on the stage takes the focus from the IDE's
+ * terminal beside it, nothing else does, and the hint shows while the keys
+ * go elsewhere. The toolbar says why first person is off in a small panel.
+ */
+import { act, cleanup, fireEvent, render, screen } from "@testing-library/react";
+import { useRef } from "react";
+import { afterEach, describe, expect, it } from "vitest";
+import { Toolbar } from "../hud/DeckBar";
+import { keysReachStage, takeFocusOnPress, typesText, useStageFocus } from "./stageFocus";
+
+afterEach(cleanup);
+
+function Harness() {
+ const host = useRef<HTMLDivElement>(null);
+ const { keysReach, onPointerDownCapture } = useStageFocus(host, true);
+ return (
+ <div>
+ <textarea data-testid="terminal" />
+ <div ref={host} data-testid="stage" tabIndex={-1} data-keys={keysReach ? "stage" : "elsewhere"} onPointerDownCapture={onPointerDownCapture}>
+ <canvas data-testid="surface" />
+ <input data-testid="field" />
+ </div>
+ </div>
+ );
+}
+
+describe("the stage's keyboard focus", () => {
+ it("reads the keys while the focus is inside the stage or nowhere in particular", () => {
+ const host = document.createElement("div");
+ const inner = document.createElement("button");
+ const outside = document.createElement("textarea");
+ host.append(inner);
+ document.body.append(host, outside);
+ expect(keysReachStage(host, null)).toBe(true);
+ expect(keysReachStage(host, document.body)).toBe(true);
+ expect(keysReachStage(host, inner)).toBe(true);
+ expect(keysReachStage(host, outside)).toBe(false);
+ host.remove();
+ outside.remove();
+ });
+
+ it("knows a text field (and a terminal's input) from the rest", () => {
+ expect(typesText(document.createElement("textarea"))).toBe(true);
+ expect(typesText(document.createElement("input"))).toBe(true);
+ expect(typesText(document.createElement("canvas"))).toBe(false);
+ expect(typesText(null)).toBe(false);
+ });
+
+ it("takes the focus from the terminal on a press on the stage, and the hint goes", () => {
+ render(<Harness />);
+ const terminal = screen.getByTestId("terminal");
+ const stage = screen.getByTestId("stage");
+ act(() => terminal.focus());
+ expect(document.activeElement).toBe(terminal);
+ expect(stage.dataset.keys).toBe("elsewhere");
+ fireEvent.pointerDown(screen.getByTestId("surface"));
+ expect(document.activeElement).toBe(stage);
+ expect(stage.dataset.keys).toBe("stage");
+ });
+
+ it("never pulls the focus on its own, and leaves a field inside the stage alone", () => {
+ render(<Harness />);
+ const terminal = screen.getByTestId("terminal");
+ act(() => terminal.focus());
+ // Nothing pressed on the stage: the terminal keeps its keys.
+ expect(document.activeElement).toBe(terminal);
+ const field = screen.getByTestId("field");
+ expect(takeFocusOnPress(screen.getByTestId("stage"), field)).toBe(false);
+ expect(document.activeElement).toBe(terminal);
+ });
+
+ it("does not move the focus within the stage", () => {
+ render(<Harness />);
+ const stage = screen.getByTestId("stage");
+ const field = screen.getByTestId("field");
+ act(() => field.focus());
+ expect(takeFocusOnPress(stage, screen.getByTestId("surface"))).toBe(false);
+ expect(document.activeElement).toBe(field);
+ });
+});
+
+describe("the toolbar in a small side panel", () => {
+ const t = (key: string) => key;
+ const noop = () => undefined;
+
+ it("greys out first person with the panel's own reason", () => {
+ render(<Toolbar t={t} view="third" firstAvailable={false} firstUnavailable="too small" onView={noop} onLift={noop} onCommander={noop} onHelp={noop} />);
+ const first = document.querySelector<HTMLButtonElement>('[data-view="first"]')!;
+ expect(first.disabled).toBe(true);
+ expect(first.title).toBe("too small");
+ });
+
+ it("offers first person where the panel is roomy enough", () => {
+ render(<Toolbar t={t} view="third" firstAvailable onView={noop} onLift={noop} onCommander={noop} onHelp={noop} />);
+ const first = document.querySelector<HTMLButtonElement>('[data-view="first"]')!;
+ expect(first.disabled).toBe(false);
+ });
+});
diff --git a/dodaios/ui/web/frontend/src/components/society/verse/engine/stageFocus.ts b/dodaios/ui/web/frontend/src/components/society/verse/engine/stageFocus.ts
new file mode 100644
index 0000000000..772c91e482
--- /dev/null
+++ b/dodaios/ui/web/frontend/src/components/society/verse/engine/stageFocus.ts
@@ -0,0 +1,58 @@
+/**
+ * Who gets the keys: the stage reads 1/2/3, V, WASD and E only while the
+ * keyboard focus is inside it (or on nothing in particular). In the IDE the
+ * terminal beside the side panel usually holds the focus, so a press on the
+ * stage takes it, and only then: the stage never pulls focus on its own
+ * and never from a field someone is typing in.
+ */
+import { useCallback, useEffect, useState, type PointerEvent as ReactPointerEvent, type RefObject } from "react";
+
+/** The element takes text (a field, a terminal's input): its keys are not the stage's. */
+export function typesText(target: EventTarget | null): boolean {
+ const el = target as HTMLElement | null;
+ return !!el && (el.isContentEditable || ["INPUT", "TEXTAREA", "SELECT"].includes(el.tagName));
+}
+
+/** The stage's keys reach it with `focused` holding the focus: inside the stage, or nowhere in particular. Pure. */
+export function keysReachStage(host: Element | null, focused: Element | null): boolean {
+ if (!focused || focused === document.body || focused === document.documentElement) return true;
+ return !!host && host.contains(focused);
+}
+
+/**
+ * Focus on the stage for a pointer press on it (`onPointerDownCapture` on
+ * the host): the press itself, never a timer or a global listener.
+ */
+export function takeFocusOnPress(host: HTMLElement | null, target: EventTarget | null): boolean {
+ if (!host || typesText(target)) return false;
+ if (host.contains(document.activeElement)) return false;
+ host.focus({ preventScroll: true });
+ return true;
+}
+
+/** Whether the keys reach the stage right now (kept current while `active`), and the press handler for its host. */
+export function useStageFocus(hostRef: RefObject<HTMLElement | null>, active: boolean) {
+ const [keysReach, setKeysReach] = useState(true);
+ useEffect(() => {
+ if (!active) return;
+ const update = () => setKeysReach(keysReachStage(hostRef.current, document.activeElement));
+ // On focusout the next element is not focused yet: read it once the move is done.
+ let pending: ReturnType<typeof setTimeout> | null = null;
+ const later = () => {
+ if (pending) clearTimeout(pending);
+ pending = setTimeout(() => { pending = null; update(); }, 0);
+ };
+ update();
+ document.addEventListener("focusin", update);
+ document.addEventListener("focusout", later);
+ return () => {
+ document.removeEventListener("focusin", update);
+ document.removeEventListener("focusout", later);
+ if (pending) clearTimeout(pending);
+ };
+ }, [hostRef, active]);
+ const onPointerDownCapture = useCallback((e: ReactPointerEvent) => {
+ if (takeFocusOnPress(hostRef.current, e.target)) setKeysReach(true);
+ }, [hostRef]);
+ return { keysReach, onPointerDownCapture };
+}
diff --git a/dodaios/ui/web/frontend/src/components/society/verse/engine/stageView.ts b/dodaios/ui/web/frontend/src/components/society/verse/engine/stageView.ts
index 7f1c480d4c..1924872a6a 100644
--- a/dodaios/ui/web/frontend/src/components/society/verse/engine/stageView.ts
+++ b/dodaios/ui/web/frontend/src/components/society/verse/engine/stageView.ts
@@ -1,16 +1,26 @@
/**
* Which view the stage shows (docs/verse/realtime.md): the eye-level 3D view
* behind the commander's shoulder, or the deck's plate. The plate is the
- * bird's-eye view, the compact IDE panel's view, and the fallback for decks
- * without an eye-level export or whose export failed to load. Pure.
+ * bird's-eye view, the view of an IDE side panel too small to walk in, and
+ * the fallback for decks without an eye-level export or whose export failed
+ * to load. Pure.
*/
import type { ControlMode } from "../life/control";
export type StageView = "eye" | "plate";
+/**
+ * The smallest compact stage (CSS px) that offers third and first person at
+ * eye level; a smaller IDE side panel keeps the overhead follow camera.
+ */
+export const COMPACT_EYE_MIN = { width: 480, height: 360 } as const;
+
export interface ViewInputs {
/** The compact IDE side panel. */
compact: boolean;
+ /** The stage's size in CSS px (only the compact stage reads it; unknown counts as too small). */
+ width?: number;
+ height?: number;
/** The deck has an eye-level export this runtime reads. */
realtime: boolean;
/** Its eye-level scene failed to load on this stage. */
@@ -19,9 +29,14 @@ export interface ViewInputs {
mode: ControlMode;
}
+/** The compact stage is large enough to walk at eye level. */
+export function roomyEnough(width = 0, height = 0): boolean {
+ return width >= COMPACT_EYE_MIN.width && height >= COMPACT_EYE_MIN.height;
+}
+
/** The deck can be walked at eye level on this stage; its scene stays loaded while the bird's-eye view is on. */
export function eyeCapable(v: Omit<ViewInputs, "mode">): boolean {
- return !v.compact && v.realtime && !v.failed;
+ return v.realtime && !v.failed && (!v.compact || roomyEnough(v.width, v.height));
}
export function stageView(v: ViewInputs): StageView {
diff --git a/dodaios/ui/web/frontend/src/components/society/verse/hud/DeckBar.tsx b/dodaios/ui/web/frontend/src/components/society/verse/hud/DeckBar.tsx
index 3c6183da39..58edec2a4d 100644
--- a/dodaios/ui/web/frontend/src/components/society/verse/hud/DeckBar.tsx
+++ b/dodaios/ui/web/frontend/src/components/society/verse/hud/DeckBar.tsx
@@ -55,8 +55,10 @@ interface ToolProps {
t: (key: string) => string;
/** The view on screen: bird's-eye, third or first person. */
view: VerseView;
- /** First person needs the deck's eye-level scene on the full-size stage. */
+ /** First person needs the deck's eye-level scene on the full-size stage or a roomy enough side panel. */
firstAvailable: boolean;
+ /** Why first person is off, when it is not the default reason (a side panel too small). */
+ firstUnavailable?: string;
onView: (view: VerseView) => void;
onLift: () => void;
onCommander: () => void;
@@ -77,7 +79,7 @@ const VIEW_LOOKS: Readonly<Record<VerseView, { label: string; path: string }>> =
first: { label: "verse.tools.first", path: "M1 6.5c1.6-2.6 3.4-3.9 5.5-3.9s3.9 1.3 5.5 3.9c-1.6 2.6-3.4 3.9-5.5 3.9S2.6 9.1 1 6.5zM6.5 5a1.5 1.5 0 1 0 0 3a1.5 1.5 0 1 0 0-3" },
};
-export function Toolbar({ t, view, firstAvailable, onView, onLift, onCommander, onSettings, onDuel, onHelp }: ToolProps) {
+export function Toolbar({ t, view, firstAvailable, firstUnavailable, onView, onLift, onCommander, onSettings, onDuel, onHelp }: ToolProps) {
return (
<nav className="verse-tools" aria-label={t("verse.stage.title")}>
{/* The three views side by side, the one on screen pressed; 1, 2 and 3 pick one, V cycles them. */}
@@ -95,7 +97,7 @@ export function Toolbar({ t, view, firstAvailable, onView, onLift, onCommander,
aria-pressed={view === v}
disabled={off}
onClick={() => onView(v)}
- title={off ? t("verse.tools.first_unavailable") : `${t(look.label)} (${key}, V)`}
+ title={off ? firstUnavailable ?? t("verse.tools.first_unavailable") :`${t(look.label)} (${key}, V)`}
>
{icon(look.path)}
<span className="verse-tool-text">{t(look.label)}</span>
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.de.json b/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.de.json
index ca54fa04f3..6031fbe0b2 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.de.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.de.json
@@ -101,7 +101,9 @@
"duel": "Duell",
"first": "Ego-Perspektive",
"first_unavailable": "Die Ego-Perspektive braucht die 3D-Szene dieses Decks auf der großen Bühne.",
- "click_to_look": "Klicken zum Umsehen"
+ "click_to_look": "Klicken zum Umsehen",
+ "first_too_small": "Für Schulter- und Ego-Perspektive braucht dieses Panel mindestens {width} × {height}.",
+ "click_for_keys": "Hier klicken, damit die Tasten das Schiff steuern"
},
"settings": {
"title": "Ansichtseinstellungen",
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.en.json b/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.en.json
index 85257297bb..5c44515323 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.en.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.en.json
@@ -101,7 +101,9 @@
"duel": "Duel",
"first": "First person",
"first_unavailable": "First person needs this deck's eye-level scene on the full-size stage.",
- "click_to_look": "Click to look around"
+ "click_to_look": "Click to look around",
+ "first_too_small": "Make this panel at least {width} × {height} for third and first person.",
+ "click_for_keys": "Click here so the keys reach the ship"
},
"settings": {
"title": "View settings",
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.es.json b/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.es.json
index 62aa4db227..5ef3618d79 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.es.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.es.json
@@ -101,7 +101,9 @@
"duel": "Duelo",
"first": "Primera persona",
"first_unavailable": "La primera persona necesita la escena 3D de esta cubierta en el escenario completo.",
- "click_to_look": "Haz clic para mirar"
+ "click_to_look": "Haz clic para mirar",
+ "first_too_small": "Amplía este panel a al menos {width} × {height} para la tercera y la primera persona.",
+ "click_for_keys": "Haz clic aquí para que las teclas lleguen a la nave"
},
"settings": {
"title": "Ajustes de vista",
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.pt.json b/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.pt.json
index d11be5553c..8c519e68cf 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.pt.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.pt.json
@@ -101,7 +101,9 @@
"duel": "Duelo",
"first": "Primeira pessoa",
"first_unavailable": "A primeira pessoa precisa da cena 3D deste convés no palco completo.",
- "click_to_look": "Clique para olhar"
+ "click_to_look": "Clique para olhar",
+ "first_too_small": "Aumente este painel para pelo menos {width} × {height} para a terceira e a primeira pessoa.",
+ "click_for_keys": "Clique aqui para que as teclas cheguem à nave"
},
"settings": {
"title": "Ajustes de visualização",
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.zh.json b/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.zh.json
index fac8acc4e7..76ce75d5de 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.zh.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/ship/verse.zh.json
@@ -101,7 +101,9 @@
"duel": "决斗",
"first": "第一人称",
"first_unavailable": "第一人称需要在完整舞台上加载本甲板的 3D 场景。",
- "click_to_look": "点击以环顾"
+ "click_to_look": "点击以环顾",
+ "first_too_small": "将此面板调整到至少 {width} × {height} 才能使用第三人称和第一人称。",
+ "click_for_keys": "点击此处,让按键控制飞船"
},
"settings": {
"title": "视角设置",