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.

fix(verse): read an unknown title as private instead of showing its raw key

rubenluetke10-beep713a1d421dfe
diff --git a/jarvis/ui/web/frontend/src/components/society/office/LevelHall.tsx b/jarvis/ui/web/frontend/src/components/society/office/LevelHall.tsx
index d29c68d8d1..19432f58a9 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/LevelHall.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/LevelHall.tsx
@@ -40,7 +40,7 @@ import { FURNITURE_SIZE, type Furniture, type FurnitureKind } from "./officeLayo
import { ToyFigure } from "./ToyFigure";
import { TOY, toyLookFor, type ToyLook } from "./toyFigureModel";
import { equippedFor, levelFraction, rewardRoad } from "../progression/cosmetics";
-import { RANK_INFO, rankAt, slotOf, TITLE_IDS, type RankId, type RewardId } from "../progression/levelCatalog";
+import { RANK_INFO, rankAt, rankOf, slotOf, TITLE_IDS, type RankId, type RewardId } from "../progression/levelCatalog";
import { PERSON_SUBJECT, type XpRuleRow } from "../progression/progressionApi";
import { useProgression } from "../progression/progressionStore";
import { insigniaHeight, RankInsignia3D } from "../progression/regalia/insignia3d";
@@ -260,7 +260,7 @@ function RankWall() {
level: t("society.level.level_n").replace("{0}", String(level)),
xp: person && person.xpForNext > 0
? t("society.level.xp_of").replace("{0}", String(person.xpIntoLevel)).replace("{1}", String(person.xpForNext)) : t("society.level.max"),
- next: next ? t("society.level.next_promotion").replace("{0}", t(`society.level.title.${next.title}`)).replace("{1}", String(next.level))
+ next: next ? t("society.level.next_promotion").replace("{0}", t(`society.level.title.${rankOf(next.title)}`)).replace("{1}", String(next.level))
: t("society.hall.top_title"),
};
const status = useLiveTexture(1024, 220, JSON.stringify([lines, Math.round(fraction * 200)]), (ctx, w, h) => drawStatus(ctx, w, h, lines, fraction));
diff --git a/jarvis/ui/web/frontend/src/components/society/progression/LevelHud.tsx b/jarvis/ui/web/frontend/src/components/society/progression/LevelHud.tsx
index acbbed9f79..73ae42243d 100644
--- a/jarvis/ui/web/frontend/src/components/society/progression/LevelHud.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/progression/LevelHud.tsx
@@ -7,7 +7,7 @@
import { useEffect, useRef, useState } from "react";
import { useT } from "@/i18n";
import { levelFraction } from "./cosmetics";
-import { RANK_INFO, rankAt, type RankId, type SubjectKind } from "./levelCatalog";
+import { RANK_INFO, rankAt, rankOf, type RankId, type SubjectKind } from "./levelCatalog";
import { RankInsignia } from "./insignia/RankInsignia";
import { PERSON_SUBJECT, petSubject } from "./progressionApi";
import { useProgression, type Celebration } from "./progressionStore";
@@ -93,7 +93,7 @@ export function LevelHud({ playerName, petName, compact }: { playerName: string;
<span className="level-hud-body">
<span className="level-hud-name">
<strong>{playerName}</strong>
- <em>{t(`society.level.title.${person?.title || "private"}`)}</em>
+ <em>{t(`society.level.title.${rankOf(person?.title)}`)}</em>
</span>
<XpBar fraction={fraction} kind="person" label={t("society.level.xp_label")} />
{!compact && <span className="level-hud-xp">{xpText}</span>}
@@ -133,7 +133,7 @@ function LevelToast({ toast, name, onClose, label }: { toast: Celebration; name:
<LevelChip kind="agent" level={toast.level} />
<span>
<strong>{label("society.level.agent_up").replace("{0}", name).replace("{1}", String(toast.level))}</strong>
- <em>{toast.away ? label("society.level.while_away") : label(`society.level.title.${toast.title || "private"}`)}</em>
+ <em>{toast.away ? label("society.level.while_away") : label(`society.level.title.${rankOf(toast.title)}`)}</em>
</span>
</button>
);
diff --git a/jarvis/ui/web/frontend/src/components/society/progression/LevelUpBanner.tsx b/jarvis/ui/web/frontend/src/components/society/progression/LevelUpBanner.tsx
index f5faaa9803..869655272e 100644
--- a/jarvis/ui/web/frontend/src/components/society/progression/LevelUpBanner.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/progression/LevelUpBanner.tsx
@@ -16,7 +16,7 @@
*/
import { useEffect } from "react";
import { useT } from "@/i18n";
-import { RANK_INFO, rankAt } from "./levelCatalog";
+import { RANK_INFO, rankAt, rankOf } from "./levelCatalog";
import { RankInsignia } from "./insignia/RankInsignia";
import { useProgression } from "./progressionStore";
import { RewardIcon } from "./RewardIcon";
@@ -73,7 +73,7 @@ export function LevelUpBanner({ playerName, petName }: { playerName: string; pet
</span>
{!promoted && next && (
<span className="promo-next">
- {t("society.level.next_promotion").replace("{0}", t(`society.level.title.${next.title}`)).replace("{1}", String(next.level))}
+ {t("society.level.next_promotion").replace("{0}", t(`society.level.title.${rankOf(next.title)}`)).replace("{1}", String(next.level))}
</span>
)}
{banner.unlocked.length > 0 && (
diff --git a/jarvis/ui/web/frontend/src/components/society/progression/hall/LevelHallScreen.tsx b/jarvis/ui/web/frontend/src/components/society/progression/hall/LevelHallScreen.tsx
index c6719ed371..d775050571 100644
--- a/jarvis/ui/web/frontend/src/components/society/progression/hall/LevelHallScreen.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/progression/hall/LevelHallScreen.tsx
@@ -24,7 +24,7 @@ import { useCompanionPet } from "../../companion/companionPetStore";
import type { SocietyAgent } from "../../data";
import type { ToyLook } from "../../office/toyFigureModel";
import { levelFraction, rewardRoad } from "../cosmetics";
-import { RANK_INFO, rankAt } from "../levelCatalog";
+import { RANK_INFO, rankAt, rankOf } from "../levelCatalog";
import { RankInsignia } from "../insignia/RankInsignia";
import { LevelChip, XpBar } from "../LevelHud";
import { useLevelSound } from "../levelSounds";
@@ -169,7 +169,7 @@ function TeamTab({ agents }: { agents: readonly SocietyAgent[] }) {
<span className="hall-rank">{i + 1}</span>
<LevelChip kind="agent" level={subject?.level ?? 1} />
<span className="hall-rank-body">
- <span><strong>{agent.name}</strong> <em>{t(`society.level.title.${subject?.title || "private"}`)}</em></span>
+ <span><strong>{agent.name}</strong> <em>{t(`society.level.title.${rankOf(subject?.title)}`)}</em></span>
<XpBar fraction={levelFraction(subject)} kind="agent" label={t("society.level.agent_xp_label").replace("{0}", agent.name)} />
</span>
<span className="hall-rank-xp">{t("society.level.total").replace("{0}", String(subject?.xp ?? 0))}</span>
diff --git a/jarvis/ui/web/frontend/src/components/society/progression/hall/hallParts.tsx b/jarvis/ui/web/frontend/src/components/society/progression/hall/hallParts.tsx
index 045e797032..34fca78f1c 100644
--- a/jarvis/ui/web/frontend/src/components/society/progression/hall/hallParts.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/progression/hall/hallParts.tsx
@@ -6,7 +6,7 @@ import type { ReactNode } from "react";
import { useT } from "@/i18n";
import { levelFraction } from "../cosmetics";
import { LevelRing, XpBar } from "../LevelHud";
-import { RANK_INFO, rankAt, type RankId } from "../levelCatalog";
+import { RANK_INFO, rankAt, rankOf, type RankId } from "../levelCatalog";
import { RankInsignia } from "../insignia/RankInsignia";
import type { RewardRow, XpRuleRow } from "../progressionApi";
import { useProgression } from "../progressionStore";
@@ -70,7 +70,7 @@ export function LevelHero({ who, compact = false }: { who: HallWho; compact?: bo
<span className="hall-hero-meta">
<span>{t("society.level.total").replace("{0}", String(subject?.xp ?? 0))}</span>
<span>{upcoming
- ? t("society.hall.next_title").replace("{0}", t(`society.level.title.${upcoming.title}`)).replace("{1}", String(upcoming.level))
+ ? t("society.hall.next_title").replace("{0}", t(`society.level.title.${rankOf(upcoming.title)}`)).replace("{1}", String(upcoming.level))
: t("society.hall.top_title")}</span>
</span>
)}
diff --git a/jarvis/ui/web/frontend/src/components/society/progression/levelCatalog.ts b/jarvis/ui/web/frontend/src/components/society/progression/levelCatalog.ts
index 7b2ab0e4a8..24df459910 100644
--- a/jarvis/ui/web/frontend/src/components/society/progression/levelCatalog.ts
+++ b/jarvis/ui/web/frontend/src/components/society/progression/levelCatalog.ts
@@ -63,6 +63,11 @@ export function isRankId(value: unknown): value is RankId {
return typeof value === "string" && value in RANK_INFO;
}
+/** A title from the server as a rank; an id this build does not know (an older backend's) reads as private. */
+export function rankOf(title: string | undefined): RankId {
+ return isRankId(title) ? title : "private";
+}
+
/** The rank held at `level`, from the server's bands (lowest first); private before the snapshot arrives. */
export function rankAt(bands: readonly { level: number; title: string }[] | undefined, level: number): RankId {
let rank: RankId = "private";