Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

feat(web): translate the activity and run panels and work items

Kilyn1ab16c028695
diff --git a/apps/web/src/features/rooms/members/agent-live-activities.messages.ts b/apps/web/src/features/rooms/members/agent-live-activities.messages.ts
new file mode 100644
index 00000000..e1d2a72a
--- /dev/null
+++ b/apps/web/src/features/rooms/members/agent-live-activities.messages.ts
@@ -0,0 +1,12 @@
+import { defineMessages } from "@/i18n/messages";
+
+/**
+ * The live activities an Agent's avatar card lists. What each activity says
+ * comes from the Agent's Run and is shown as it arrives.
+ */
+export const agentLiveActivitiesMessages = defineMessages(
+ "agentLiveActivities",
+ {
+ title: "Live activities",
+ },
+);
diff --git a/apps/web/src/features/rooms/members/agent-live-activities.tsx b/apps/web/src/features/rooms/members/agent-live-activities.tsx
index 1a66e68d..51c1ee41 100644
--- a/apps/web/src/features/rooms/members/agent-live-activities.tsx
+++ b/apps/web/src/features/rooms/members/agent-live-activities.tsx
@@ -1,5 +1,9 @@
import type { ReactNode } from "react";
+import { useT } from "@/i18n/use-translation";
+
+import { agentLiveActivitiesMessages as m } from "./agent-live-activities.messages";
+
export interface AgentLiveActivity {
id: string;
label: string;
@@ -28,9 +32,10 @@ export function AgentLiveActivities({
}: {
activities: readonly AgentLiveActivity[];
}) {
+ const t = useT();
if (!activities.length) return null;
return (
- <AgentInfoSection title="Live activities">
+ <AgentInfoSection title={t(m.title)}>
<ul className="space-y-2">
{activities.map((activity) => (
<li
diff --git a/apps/web/src/features/rooms/task-sidebar/adapters/activity-panel-language.test.tsx b/apps/web/src/features/rooms/task-sidebar/adapters/activity-panel-language.test.tsx
new file mode 100644
index 00000000..5d8d911a
--- /dev/null
+++ b/apps/web/src/features/rooms/task-sidebar/adapters/activity-panel-language.test.tsx
@@ -0,0 +1,260 @@
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import {
+ fireEvent,
+ render,
+ screen,
+ waitFor,
+ within,
+} from "@testing-library/react";
+import { MemoryRouter } from "react-router";
+import { afterEach, describe, expect, it, vi } from "vitest";
+
+import { AgentLiveActivities } from "@/features/rooms/members/agent-live-activities";
+import type { RunStatusSubscription } from "@/features/teamhub/run-status-transport";
+import { TeamHubRuntimeProvider } from "@/features/teamhub/teamhub-runtime";
+import type {
+ TeamHubMessageActivityRecord,
+ TeamHubRunStatus,
+ TeamHubTaskExecution,
+} from "@/features/teamhub/teamhub-types";
+import { resetLanguageForTest, setLanguage } from "@/i18n/language";
+import zhCN from "@/i18n/locales/zh-CN.json";
+import { createTestTeamHubRuntime } from "@/test/teamhub-test-runtime";
+
+import { RuntimeTrajectoryView } from "./runtime-trajectory-view";
+import { TaskActivitiesPanelTab } from "./task-activities-panel-tab";
+
+const panel = zhCN.activityPanel;
+const run = zhCN.runPanel;
+const stamp = "2026-10-09T09:00:00Z";
+
+function zhTime(value: string) {
+ return new Intl.DateTimeFormat("zh-CN", {
+ day: "numeric",
+ hour: "2-digit",
+ minute: "2-digit",
+ month: "short",
+ }).format(new Date(value));
+}
+
+function renderTaskPanel() {
+ const runtime = createTestTeamHubRuntime();
+ const actor = {
+ display_name: "Jenny",
+ id: "actor-jenny",
+ kind: "human" as const,
+ tenant_id: "tenant-northstar",
+ };
+ runtime.server.on("GET", "/v0/work-items/{workItemId}", ({ params }) => ({
+ assignees: [],
+ created_at: stamp,
+ created_by: actor,
+ description: "Inspect the workspace",
+ explicit_access_grants: [],
+ id: params.workItemId,
+ kind: "task",
+ number: 17,
+ priority: "medium",
+ referenced_actors: [],
+ state: "in_progress",
+ tenant_id: "tenant-northstar",
+ title: "Check the workspace",
+ updated_at: stamp,
+ updated_by: actor,
+ version: 1,
+ work_room_id: "room-all",
+ }));
+ const execution: TeamHubTaskExecution = {
+ control_revision: 0,
+ control_settled_revision: 0,
+ current_attempt: { attempt_number: 2 } as never,
+ desired_control: "run",
+ execution_revision: 1,
+ execution_updated_at: stamp,
+ generation: 1,
+ run_spec: {
+ attempt_policy: {
+ max_retries: 0,
+ policy_version: 1,
+ retry_on_agent_failure: false,
+ retry_on_timeout: false,
+ timeout_seconds: 60,
+ },
+ result_agent_actor_id: "agent-codex",
+ schema_version: 1,
+ },
+ status: "running",
+ task_id: "task-a",
+ };
+ runtime.server.on("GET", "/v0/tasks/{taskId}/execution", () => execution);
+ const active: TeamHubRunStatus = {
+ agent: { display_name: "Codex", id: "agent-codex", kind: "agent" },
+ created_at: stamp,
+ id: "run-1",
+ replied: false,
+ revision: 1,
+ room_id: "room-all",
+ run_id: "run-1",
+ status: "active",
+ updated_at: stamp,
+ };
+ vi.spyOn(runtime.client.workItems, "listActivities").mockResolvedValue({
+ active_items: [active],
+ history_items: [],
+ work_room_id: "room-all",
+ });
+ runtime.server.on(
+ "GET",
+ "/v0/rooms/{roomId}/runs/{runId}/runtime-presentation-events",
+ () => ({ has_more: false, items: [], published_through_ordinal: "0" }),
+ );
+ const testRuntime = {
+ ...runtime,
+ runStatuses: {
+ subscribe: (_input: RunStatusSubscription) => vi.fn(),
+ },
+ };
+ render(
+ <QueryClientProvider
+ client={
+ new QueryClient({ defaultOptions: { queries: { retry: false } } })
+ }
+ >
+ <TeamHubRuntimeProvider runtime={testRuntime}>
+ <MemoryRouter>
+ <TaskActivitiesPanelTab
+ hidden={false}
+ taskId="task-a"
+ tenantId="tenant-northstar"
+ />
+ </MemoryRouter>
+ </TeamHubRuntimeProvider>
+ </QueryClientProvider>,
+ );
+}
+
+describe("activity panels in the language on screen", () => {
+ afterEach(() => {
+ resetLanguageForTest();
+ });
+
+ it("words a Task's activity panel in Chinese and dates it the Chinese way", async () => {
+ await setLanguage("zh-CN");
+ renderTaskPanel();
+
+ const section = screen.getByRole("region", { name: panel.taskActivities });
+ expect(
+ await within(section).findByText(
+ panel.taskNumber.replace("{number}", "17"),
+ ),
+ ).toBeVisible();
+ expect(
+ within(section).getByRole("heading", { name: "Check the workspace" }),
+ ).toBeVisible();
+ // Refreshing only reloads; it risks nothing, so it carries no marker.
+ expect(
+ within(section).getByRole("button", { name: panel.refreshTask }),
+ ).not.toHaveAttribute("data-voice-risk");
+ expect(
+ await within(section).findByText(zhCN.runtimeStatus.taskStatusRunning),
+ ).toBeVisible();
+ expect(
+ within(section).getByText(panel.attempt.replace("{number}", "2")),
+ ).toBeVisible();
+ expect(
+ within(section).getByText(panel.updated.replace("{time}", zhTime(stamp))),
+ ).toBeVisible();
+
+ const tabs = within(section).getByRole("navigation", {
+ name: panel.taskSections,
+ });
+ expect(
+ within(tabs).getByRole("button", { name: panel.tabActivity }),
+ ).toHaveAttribute("aria-current", "page");
+
+ const runRow = await within(section).findByRole("button", {
+ name: (name) =>
+ name.includes("Codex") &&
+ name.includes(
+ panel.runStarted
+ .replace("{time}", zhTime(stamp))
+ .replace("{state}", panel.runWorking),
+ ),
+ });
+ expect(
+ within(runRow).getByRole("img", { name: panel.agentWorking }),
+ ).toBeVisible();
+
+ fireEvent.click(
+ within(tabs).getByRole("button", { name: panel.tabDetails }),
+ );
+ await waitFor(() => expect(section).toHaveTextContent(panel.assignees));
+ expect(section).toHaveTextContent(panel.unassigned);
+ expect(section).toHaveTextContent(panel.priority);
+ expect(section).toHaveTextContent(panel.execution);
+ expect(
+ within(section).getByRole("heading", { name: panel.description }),
+ ).toBeVisible();
+ });
+
+ it("words a Run's steps in Chinese and keeps the commands as written", async () => {
+ await setLanguage("zh-CN");
+ const records = [
+ codex(1, "tool_call", "response_item.function_call", {
+ arguments: JSON.stringify({ cmd: "pnpm test" }),
+ call_id: "c1",
+ name: "exec_command",
+ type: "function_call",
+ }),
+ codex(2, "tool_result", "response_item.function_call_output", {
+ call_id: "c1",
+ output: "12 passed",
+ type: "function_call_output",
+ }),
+ ];
+ render(<RuntimeTrajectoryView live={false} records={records} />);
+
+ expect(
+ screen.getByRole("list", { name: zhCN.runtimeStatus.activityLog }),
+ ).toBeInTheDocument();
+ const ran = screen.getByTitle(
+ run.ran.replace("<detail>{detail}</detail>", "pnpm test"),
+ );
+ fireEvent.click(ran);
+ expect(screen.getByRole("region", { name: run.output })).toHaveTextContent(
+ "12 passed",
+ );
+ });
+
+ it("titles an Agent's live activities in Chinese", async () => {
+ await setLanguage("zh-CN");
+ render(
+ <AgentLiveActivities
+ activities={[{ detail: "2m", id: "a1", label: "Reviewing notes" }]}
+ />,
+ );
+
+ expect(
+ screen.getByRole("heading", { name: zhCN.agentLiveActivities.title }),
+ ).toBeVisible();
+ expect(screen.getByText("Reviewing notes")).toBeVisible();
+ });
+});
+
+function codex(
+ ordinal: number,
+ category: TeamHubMessageActivityRecord["category"],
+ nativeType: string,
+ payload: Record<string, unknown>,
+): TeamHubMessageActivityRecord {
+ return {
+ category,
+ native_record: { payload, type: nativeType.split(".")[0] },
+ native_type: nativeType,
+ ordinal,
+ redacted_fields: [],
+ tool_call_id: payload.call_id as string,
+ ...(typeof payload.name === "string" ? { tool_name: payload.name } : {}),
+ turn_id: "turn-codex",
+ };
+}
diff --git a/apps/web/src/features/rooms/task-sidebar/adapters/activity-panel.messages.ts b/apps/web/src/features/rooms/task-sidebar/adapters/activity-panel.messages.ts
new file mode 100644
index 00000000..0169080c
--- /dev/null
+++ b/apps/web/src/features/rooms/task-sidebar/adapters/activity-panel.messages.ts
@@ -0,0 +1,82 @@
+import { defineMessages } from "@/i18n/messages";
+
+/**
+ * The Activity panels of the Room side panel: a Task's activity and details,
+ * a Message's activity log, an Agent's live activity, and the dialog that
+ * reads a delegated Task like a conversation. Names, titles, priorities and
+ * reasons TeamHub sends are data and are shown as they arrive.
+ */
+export const activityPanelMessages = defineMessages("activityPanel", {
+ backToAgentInfo: "Back to Agent info",
+ // An Agent's live activity.
+ agentActivity: "{name} activity",
+ activity: "Activity",
+ waitingForActivity: "Waiting for activity",
+ activityLoadFailedTitle: "Activity could not be loaded",
+ activityLoadFailedDetail:
+ "Published Runtime events could not be read from TeamHub.",
+ noActivityTitle: "No activity yet",
+ noActivityDetail: "This run has not published any activity events yet.",
+ // A Message's activity log.
+ messageActivities: "{name} activities",
+ refreshMessageActivities: "Refresh message activities",
+ refresh: "Refresh",
+ activitiesLoadFailedTitle: "Activities could not be loaded",
+ activitiesLoadFailedDetail: "The Message activity log could not be read.",
+ loadingActivities: "Loading activities",
+ activityLogUnavailable: "Message activity log unavailable",
+ onlyLinkedToolRecords:
+ "Only linked tool records are available for this execution.",
+ // {limit} is the number of records kept, such as 10,000.
+ turnTruncated:
+ "This unusually large turn was limited to the latest {limit} records.",
+ onlyLinkedRuntimeRecords:
+ "Only Runtime records connected by Activity identity are shown.",
+ noExactActivityLog: "No exact activity log for this Message",
+ // A Task's activity panel.
+ taskActivities: "Task activities",
+ task: "Task",
+ // {number} is the Task's number, such as 17.
+ taskNumber: "Task #{number}",
+ refreshTask: "Refresh task",
+ taskActivity: "Task activity",
+ attempt: "Attempt {number}",
+ updated: "Updated {time}",
+ taskSections: "Task sections",
+ tabActivity: "Activity",
+ tabDetails: "Details",
+ taskLoadFailed: "Task could not be loaded.",
+ loadingTask: "Loading task…",
+ executionLoadFailed: "Execution status could not be loaded.",
+ noActivityAccess: "You do not have access to this task’s work room activity.",
+ activityLoadFailedRefresh: "Activity could not be loaded. Try refreshing.",
+ loadingActivityEllipsis: "Loading activity…",
+ reconnecting: "Reconnecting to live activity…",
+ noPublishedActivity:
+ "No published activity yet. Earlier runs may not have an activity history.",
+ taskMessages: "Task messages",
+ messagesLoadFailed: "Messages could not be loaded.",
+ noTaskMessages: "No task messages yet.",
+ loadEarlierMessages: "Load earlier messages",
+ assignees: "Assignees",
+ unassigned: "Unassigned",
+ priority: "Priority",
+ execution: "Execution",
+ executionNotEnabled: "Execution is not enabled",
+ reason: "Reason",
+ description: "Description",
+ activityLoadFailed: "Activity could not be loaded.",
+ // The state of a Task's execution.
+ stageWaitingForApproval: "Waiting for approval",
+ stageIdle: "Idle",
+ // The state of one Agent's run inside a Task.
+ runWorking: "Working",
+ runPaused: "Paused",
+ runInterrupted: "Interrupted",
+ runEnded: "Ended",
+ // {time} is when the run started; {state} is one of the states above.
+ runStarted: "{time} · {state}",
+ agentWorking: "Agent working",
+ // The dialog that reads a delegated Task like a conversation.
+ taskConversation: "Task conversation",
+});
diff --git a/apps/web/src/features/rooms/task-sidebar/adapters/agent-live-activity-panel-tab.tsx b/apps/web/src/features/rooms/task-sidebar/adapters/agent-live-activity-panel-tab.tsx
index 87387643..35cee91a 100644
--- a/apps/web/src/features/rooms/task-sidebar/adapters/agent-live-activity-panel-tab.tsx
+++ b/apps/web/src/features/rooms/task-sidebar/adapters/agent-live-activity-panel-tab.tsx
@@ -3,6 +3,7 @@ import { useInfiniteQuery } from "@tanstack/react-query";
import { ActorAvatar } from "../../members/actor-avatar";
import { Icon } from "@/components/ui/icon";
+import { useT } from "@/i18n/use-translation";
import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";
import type { TeamHubMessage } from "@/features/teamhub/teamhub-types";
@@ -10,6 +11,8 @@ import { roomMessagesInfiniteQueryOptions } from "../../room-queries";
import { RuntimeActivityPath } from "../../runtime-status/runtime-activity-path-view";
import { useRuntimePresentationEventRecords } from "../../runtime-status/use-runtime-presentation-event-records";
import { PanelLoading } from "../panel-loading";
+import { sidePanelMessages } from "../side-panel.messages";
+import { activityPanelMessages as m } from "./activity-panel.messages";
import { TaskConversationProvider } from "./task-conversation-dialog";
const EMPTY_MESSAGES: readonly TeamHubMessage[] = [];
@@ -24,7 +27,7 @@ export function AgentLiveActivityPanelTab({
messages = EMPTY_MESSAGES,
messagesRoomId,
onBack,
- backLabel = "Back to Agent info",
+ backLabel,
roomId,
tenantId,
}: {
@@ -41,6 +44,8 @@ export function AgentLiveActivityPanelTab({
roomId: string;
tenantId: string;
}) {
+ const t = useT();
+ const back = backLabel ?? t(m.backToAgentInfo);
const { client } = useTeamHubRuntime();
// The sidebar supplies its parent Room's messages. A Thread Activity shares
// the Thread conversation's existing query instead of reading that parent.
@@ -76,10 +81,10 @@ export function AgentLiveActivityPanelTab({
<header className="flex min-h-14 shrink-0 items-center gap-2.5 border-b border-border bg-card px-4 py-2">
{onBack ? (
<button
- aria-label={backLabel}
+ aria-label={back}
className="flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-app-focus"
onClick={onBack}
- title={backLabel}
+ title={back}
type="button"
>
<Icon icon={ArrowLeft01Icon} size={16} />
@@ -93,20 +98,20 @@ export function AgentLiveActivityPanelTab({
/>
<div className="min-w-0 flex-1">
<h2 className="truncate text-sm font-semibold text-foreground">
- {`${actorName} activity`}
+ {t(m.agentActivity, { name: actorName })}
</h2>
<p className="truncate text-xs font-normal leading-4 text-app-muted">
- {pending || hasEvents ? "Activity" : "Waiting for activity"}
+ {t(pending || hasEvents ? m.activity : m.waitingForActivity)}
</p>
</div>
</header>
{events.error ? (
<LiveActivityState
- detail="Published Runtime events could not be read from TeamHub."
- title="Activity could not be loaded"
+ detail={t(m.activityLoadFailedDetail)}
+ title={t(m.activityLoadFailedTitle)}
/>
) : pending ? (
- <PanelLoading label="Loading activity" />
+ <PanelLoading label={t(sidePanelMessages.loadingActivity)} />
) : hasEvents ? (
<RuntimeActivityPath
key={`${activationKey}:${hidden}:${runId ?? runStatusId}`}
@@ -115,8 +120,8 @@ export function AgentLiveActivityPanelTab({
/>
) : (
<LiveActivityState
- detail="This run has not published any activity events yet."
- title="No activity yet"
+ detail={t(m.noActivityDetail)}
+ title={t(m.noActivityTitle)}
/>
)}
</div>
diff --git a/apps/web/src/features/rooms/task-sidebar/adapters/message-activities-panel-tab.tsx b/apps/web/src/features/rooms/task-sidebar/adapters/message-activities-panel-tab.tsx
index 59a793d6..1296a385 100644
--- a/apps/web/src/features/rooms/task-sidebar/adapters/message-activities-panel-tab.tsx
+++ b/apps/web/src/features/rooms/task-sidebar/adapters/message-activities-panel-tab.tsx
@@ -8,6 +8,7 @@ import {
} from "@hugeicons/core-free-icons";
import { Icon } from "@/components/ui/icon";
+import { useT } from "@/i18n/use-translation";
import { RuntimeHistoryView } from "./runtime-history-view";
import { teamHubData } from "@/features/teamhub/teamhub-api";
import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";
@@ -15,6 +16,7 @@ import type { TeamHubMessage } from "@/features/teamhub/teamhub-types";
import { ActorAvatar } from "../../members/actor-avatar";
import { PanelLoading } from "../panel-loading";
+import { activityPanelMessages as m } from "./activity-panel.messages";
import { TaskConversationProvider } from "./task-conversation-dialog";
export function MessageActivitiesPanelTab({
@@ -22,7 +24,7 @@ export function MessageActivitiesPanelTab({
hidden,
message,
onBack,
- backLabel = "Back to Agent info",
+ backLabel,
roomId,
tenantId,
}: {
@@ -34,6 +36,8 @@ export function MessageActivitiesPanelTab({
roomId: string;
tenantId: string;
}) {
+ const t = useT();
+ const back = backLabel ?? t(m.backToAgentInfo);
const { client } = useTeamHubRuntime();
const activities = useQuery({
enabled: !hidden,
@@ -87,10 +91,10 @@ export function MessageActivitiesPanelTab({
<header className="flex min-h-14 shrink-0 items-center gap-2.5 border-b border-app-border px-4 py-2">
{onBack ? (
<button
- aria-label={backLabel}
+ aria-label={back}
className="flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-app-focus"
onClick={onBack}
- title={backLabel}
+ title={back}
type="button"
>
<Icon icon={ArrowLeft01Icon} size={16} />
@@ -104,19 +108,19 @@ export function MessageActivitiesPanelTab({
/>
<div className="min-w-0 flex-1">
<h2 className="truncate text-sm font-semibold text-foreground">
- {message.author.display_name} activities
+ {t(m.messageActivities, { name: message.author.display_name })}
</h2>
- <p className="truncate text-xs text-app-muted">Activity</p>
+ <p className="truncate text-xs text-app-muted">{t(m.activity)}</p>
</div>
<button
- aria-label="Refresh message activities"
+ aria-label={t(m.refreshMessageActivities)}
className="flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-60"
disabled={loading}
onClick={() => {
setRefreshing(true);
void activities.refetch().finally(() => setRefreshing(false));
}}
- title="Refresh"
+ title={t(m.refresh)}
type="button"
>
{refreshing ? (
@@ -143,38 +147,34 @@ export function MessageActivitiesPanelTab({
>
{activities.isError ? (
<ActivityLogState
- detail="The Message activity log could not be read."
- title="Activities could not be loaded"
+ detail={t(m.activitiesLoadFailedDetail)}
+ title={t(m.activitiesLoadFailedTitle)}
/>
) : loading ? (
- <PanelLoading label="Loading activities" />
+ <PanelLoading label={t(m.loadingActivities)} />
) : activities.data?.status !== "available" ? (
<ActivityLogState
detail={activities.data?.reason}
- title="Message activity log unavailable"
+ title={t(m.activityLogUnavailable)}
/>
) : activities.data.records.length > 0 ? (
<section className="bg-card">
{!activities.data.has_native_turn ? (
<p className="border-b border-app-border px-4 py-2 text-xs text-app-muted">
- Only linked tool records are available for this execution.
+ {t(m.onlyLinkedToolRecords)}
</p>
) : null}
{activities.data.truncated ? (
<p className="border-b border-app-border px-4 py-2 text-xs text-app-muted">
- This unusually large turn was limited to the latest 10,000
- records.
+ {t(m.turnTruncated, { limit: 10_000 })}
</p>
) : null}
<RuntimeHistoryView records={activities.data.records} />
</section>
) : (
<ActivityLogState
- detail={
- activities.data.reason ??
- "Only Runtime records connected by Activity identity are shown."
- }
- title="No exact activity log for this Message"
+ detail={activities.data.reason ?? t(m.onlyLinkedRuntimeRecords)}
+ title={t(m.noExactActivityLog)}
/>
)}
</div>
diff --git a/apps/web/src/features/rooms/task-sidebar/adapters/native-activity-records.ts b/apps/web/src/features/rooms/task-sidebar/adapters/native-activity-records.ts
index 180c517c..d7731a66 100644
--- a/apps/web/src/features/rooms/task-sidebar/adapters/native-activity-records.ts
+++ b/apps/web/src/features/rooms/task-sidebar/adapters/native-activity-records.ts
@@ -1,4 +1,7 @@
import type { TeamHubMessageActivityRecord } from "@/features/teamhub/teamhub-types";
+import type { Translate } from "@/i18n/language";
+
+import { runPanelMessages as m } from "./run-panel.messages";
// Reads native Runtime history records of every Runtime's shape: Codex
// response items, Claude Code transcript lines and Pi session messages.
@@ -44,13 +47,16 @@ function isString(value: unknown): value is string {
return typeof value === "string";
}
-export function activityMessageText(record: TeamHubMessageActivityRecord) {
+export function activityMessageText(
+ t: Translate,
+ record: TeamHubMessageActivityRecord,
+) {
const payload = nativePayload(record);
return (
stringValue(payload?.message) ??
stringValue(payload?.text) ??
textContent(payload?.content) ??
- "No message text recorded"
+ t(m.noMessageText)
);
}
@@ -104,14 +110,13 @@ export function contentBlockRecords(
}
export function reasoningText(
+ t: Translate,
record: TeamHubMessageActivityRecord,
): string | undefined {
const payload = nativePayload(record);
const block = nativeContentBlock(record, payload);
if (block?.type === "thinking" || block?.type === "redacted_thinking") {
- return (
- thinkingSummary(block) ?? "Thinking recorded · private content hidden"
- );
+ return thinkingSummary(block) ?? t(m.thinkingHidden);
}
return stringValue(payload?.text) ?? textContent(payload?.summary);
}
diff --git a/apps/web/src/features/rooms/task-sidebar/adapters/run-panel.messages.ts b/apps/web/src/features/rooms/task-sidebar/adapters/run-panel.messages.ts
new file mode 100644
index 00000000..9bcbcf33
--- /dev/null
+++ b/apps/web/src/features/rooms/task-sidebar/adapters/run-panel.messages.ts
@@ -0,0 +1,30 @@
+import { defineMessages } from "@/i18n/messages";
+
+/**
+ * A Runtime's own record of a Run, step by step: what it thought, the
+ * commands and tools it called and what it replied. Commands, paths, queries,
+ * tool names and output are data and are shown as the Runtime wrote them.
+ */
+export const runPanelMessages = defineMessages("runPanel", {
+ input: "Input",
+ output: "Output",
+ changes: "Changes",
+ toolCall: "Tool call",
+ noMessageText: "No message text recorded",
+ thinkingHidden: "Thinking recorded · private content hidden",
+ // One step of a Run: <detail> wraps what it acted on (a command, a path,
+ // a search, a URL or a tool name), which keeps its own text.
+ ran: "Ran <detail>{detail}</detail>",
+ read: "Read <detail>{detail}</detail>",
+ edited: "Edited <detail>{detail}</detail>",
+ wrote: "Wrote <detail>{detail}</detail>",
+ searched: "Searched <detail>{detail}</detail>",
+ listed: "Listed <detail>{detail}</detail>",
+ fetched: "Fetched <detail>{detail}</detail>",
+ delegated: "Delegated <detail>{detail}</detail>",
+ called: "Called <detail>{detail}</detail>",
+ // What an edit acted on when its patch names no file.
+ files: "files",
+ // A search and the folder it looked in.
+ searchIn: "{query} in {scope}",
+});
diff --git a/apps/web/src/features/rooms/task-sidebar/adapters/runtime-history-view.tsx b/apps/web/src/features/rooms/task-sidebar/adapters/runtime-history-view.tsx
index b75904d3..a3a634a9 100644
--- a/apps/web/src/features/rooms/task-sidebar/adapters/runtime-history-view.tsx
+++ b/apps/web/src/features/rooms/task-sidebar/adapters/runtime-history-view.tsx
@@ -15,7 +15,9 @@ import {
type TaskCommand,
} from "@/features/rooms/runtime-status/task-command";
import type { TeamHubMessageActivityRecord } from "@/features/teamhub/teamhub-types";
+import type { Translate } from "@/i18n/language";
import { useT } from "@/i18n/use-translation";
+import { runtimeStatusMessages } from "@/features/rooms/runtime-status/runtime-status.messages";
import {
activityMessageText,
@@ -32,12 +34,14 @@ import {
stringValue,
type ToolCallPair,
} from "./native-activity-records";
+import { runPanelMessages as m } from "./run-panel.messages";
export function RuntimeHistoryView({
records,
}: {
records: TeamHubMessageActivityRecord[];
}) {
+ const t = useT();
const orderedRecords = useMemo(
() => [...records].sort((left, right) => left.ordinal - right.ordinal),
[records],
@@ -47,12 +51,12 @@ export function RuntimeHistoryView({
[orderedRecords],
);
const items = useMemo(
- () => activityTimelineItems(orderedRecords, callPairs),
- [callPairs, orderedRecords],
+ () => activityTimelineItems(t, orderedRecords, callPairs),
+ [t, callPairs, orderedRecords],
);
return (
<ol
- aria-label="Activity log"
+ aria-label={t(runtimeStatusMessages.activityLog)}
className="space-y-1 bg-white px-4 py-3 text-xs font-normal leading-5 text-app-body"
>
{items.map((item) =>
@@ -87,6 +91,7 @@ type ActivityTimelineItem =
};
function activityTimelineItems(
+ t: Translate,
records: TeamHubMessageActivityRecord[],
callPairs: ReadonlyMap<string, ToolCallPair>,
): ActivityTimelineItem[] {
@@ -101,7 +106,9 @@ function activityTimelineItems(
record = {
...record,
category: "tool_call",
- tool_name: toolNameLabel(stringValue(invocation?.tool) ?? "Tool call"),
+ tool_name: toolNameLabel(
+ stringValue(invocation?.tool) ?? t(m.toolCall),
+ ),
};
} else if (record.category === "tool_call") {
if (
@@ -110,7 +117,7 @@ function activityTimelineItems(
)
continue;
} else if (record.category === "reasoning") {
- const summary = reasoningText(record);
+ const summary = reasoningText(t, record);
if (!summary?.trim()) continue;
if (thinkingTitles.has(summary)) continue;
thinkingTitles.add(summary);
@@ -118,7 +125,7 @@ function activityTimelineItems(
if (
isEventRecord(record) ||
(!isAssistantMessage(record) && !isUserMessage(record)) ||
- (isUserMessage(record) && activityMessageText(record).length > 240)
+ (isUserMessage(record) && activityMessageText(t, record).length > 240)
)
continue;
} else {
@@ -172,7 +179,7 @@ function activityTimelineItems(
function RuntimeToolCallsActivity({ calls }: { calls: ActivityToolCall[] }) {
const t = useT();
const presentedCalls = calls.map(({ pair, record }) => {
- const name = record.tool_name ?? pair?.call?.tool_name ?? "Tool call";
+ const name = record.tool_name ?? pair?.call?.tool_name ?? t(m.toolCall);
const invocation = asObject(nativePayload(record)?.invocation);
// Native history carries tool names, not activity kinds: show the name.
const shownName = stringValue(invocation?.tool) ?? name;
@@ -231,8 +238,12 @@ function RuntimeActivityRecord({
}: {
record: TeamHubMessageActivityRecord;
}) {
+ const t = useT();
if (record.category === "reasoning") {
- const title = reasoningText(record)?.replace(/^\*\*([\s\S]+)\*\*$/, "$1");
+ const title = reasoningText(t, record)?.replace(
+ /^\*\*([\s\S]+)\*\*$/,
+ "$1",
+ );
return (
<li className="flex min-h-8 items-start gap-2 py-1.5 text-app-muted">
<Sparkles aria-hidden="true" className="mt-0.5 shrink-0" size={15} />
@@ -246,7 +257,7 @@ function RuntimeActivityRecord({
<li className="py-2">
<MessageMarkdown
authorKind={isAssistantMessage(record) ? "agent" : "human"}
- body={activityMessageText(record)}
+ body={activityMessageText(t, record)}
/>
</li>
);
diff --git a/apps/web/src/features/rooms/task-sidebar/adapters/runtime-trajectory-view.tsx b/apps/web/src/features/rooms/task-sidebar/adapters/runtime-trajectory-view.tsx
index 1a5f4ae9..cbbab545 100644
--- a/apps/web/src/features/rooms/task-sidebar/adapters/runtime-trajectory-view.tsx
+++ b/apps/web/src/features/rooms/task-sidebar/adapters/runtime-trajectory-view.tsx
@@ -2,6 +2,9 @@ import { ArrowRight01Icon, SparklesIcon } from "@hugeicons/core-free-icons";
import { useMemo } from "react";
import { Icon } from "@/components/ui/icon";
+import type { Translate } from "@/i18n/language";
+import { formatMessageParts } from "@/i18n/messages";
+import { RichMessage, useTranslation } from "@/i18n/use-translation";
import { cn } from "@/lib/cn";
import {
toolAppearance,
@@ -10,6 +13,7 @@ import {
import type { TeamHubMessageActivityRecord } from "@/features/teamhub/teamhub-types";
import { MessageMarkdown } from "../../chat/message-markdown";
+import { runtimeStatusMessages } from "../../runtime-status/runtime-status.messages";
import {
activityMessageText,
asObject,
@@ -27,6 +31,19 @@ import {
thinkingSummary,
type ToolCallPair,
} from "./native-activity-records";
+import { runPanelMessages as m } from "./run-panel.messages";
+
+/** What a call did, worded around what it acted on. */
+type CallVerb = (typeof m)[
+ | "ran"
+ | "read"
+ | "edited"
+ | "wrote"
+ | "searched"
+ | "listed"
+ | "fetched"
+ | "delegated"
+ | "called"];
type TrajectoryItem =
| { key: string; kind: "reasoning"; text: string }
@@ -44,7 +61,7 @@ interface TrajectoryCall {
kind: string;
output?: string;
pending: boolean;
- verb: string;
+ verb: CallVerb;
}
/**
@@ -60,10 +77,14 @@ export function RuntimeTrajectoryView({
live: boolean;
records: TeamHubMessageActivityRecord[];
}) {
- const items = useMemo(() => trajectoryItems(records, live), [records, live]);
+ const { t } = useTranslation();
+ const items = useMemo(
+ () => trajectoryItems(t, records, live),
+ [t, records, live],
+ );
return (
<ol
- aria-label="Activity log"
+ aria-label={t(runtimeStatusMessages.activityLog)}
className="space-y-1 text-xs leading-5 font-normal text-app-body"
>
{items.map((item) =>
@@ -88,17 +109,27 @@ export function RuntimeTrajectoryView({
}
function TrajectoryCallRow({ call }: { call: TrajectoryCall }) {
+ const { catalog, language, t } = useTranslation();
const { glyph } = toolAppearance(call.kind);
const output = call.diff ?? call.output;
+ const values = { detail: call.detail };
const label = (
<span
className={cn(
"min-w-0 flex-1 truncate",
call.pending && "town-shimmer-text",
)}
- title={`${call.verb} ${call.detail}`}
+ title={formatMessageParts(call.verb, language, catalog, values)
+ .map((part) => part.text)
+ .join("")}
>
- {call.verb} <span className="text-app-body">{call.detail}</span>
+ <RichMessage
+ message={call.verb}
+ tags={{
+ detail: (text) => <span className="text-app-body">{text}</span>,
+ }}
+ values={values}
+ />
</span>
);
if (!output && !call.input)
@@ -124,12 +155,12 @@ function TrajectoryCallRow({ call }: { call: TrajectoryCall }) {
</summary>
<div className="space-y-2 pb-2 pl-[1.4rem]">
{call.input ? (
- <TrajectoryText label="Input" text={call.input} />
+ <TrajectoryText label={t(m.input)} text={call.input} />
) : null}
{output ? (
<TrajectoryText
diff={Boolean(call.diff)}
- label={call.diff ? "Changes" : "Output"}
+ label={t(call.diff ? m.changes : m.output)}
text={output}
/>
) : null}
@@ -172,6 +203,7 @@ function diffTone(line: string) {
}
function trajectoryItems(
+ t: Translate,
records: TeamHubMessageActivityRecord[],
live: boolean,
): TrajectoryItem[] {
@@ -184,7 +216,7 @@ function trajectoryItems(
for (const record of ordered) {
const key = `${record.ordinal}:${items.length}`;
if (record.category === "reasoning") {
- const text = reasoningSummary(record);
+ const text = reasoningSummary(t, record);
if (!text || seenReasoning.has(text)) continue;
seenReasoning.add(text);
items.push({ key, kind: "reasoning", text });
@@ -193,13 +225,13 @@ function trajectoryItems(
isAssistantMessage(record) &&
!isEventRecord(record)
) {
- items.push({ key, kind: "reply", text: activityMessageText(record) });
+ items.push({ key, kind: "reply", text: activityMessageText(t, record) });
} else if (record.category === "tool_call") {
const pair = record.tool_call_id
? pairs.get(record.tool_call_id)
: undefined;
items.push({
- call: trajectoryCall(record, pair, live),
+ call: trajectoryCall(t, record, pair, live),
key,
kind: "call",
});
@@ -212,9 +244,9 @@ function trajectoryItems(
* The readable summary of a reasoning step. Private thinking without a
* summary says nothing to show, so it is left out.
*/
-function reasoningSummary(record: TeamHubMessageActivityRecord) {
+function reasoningSummary(t: Translate, record: TeamHubMessageActivityRecord) {
const block = nativeContentBlock(record, nativePayload(record));
- const text = block ? thinkingSummary(block) : reasoningText(record);
+ const text = block ? thinkingSummary(block) : reasoningText(t, record);
return text?.replace(/^\*\*([\s\S]+)\*\*$/, "$1").trim();
}
@@ -224,6 +256,7 @@ function reasoningSummary(record: TeamHubMessageActivityRecord) {
* `Edit`, Pi `bash`, `read` and `edit`; MCP tools keep their own names.
*/
function trajectoryCall(
+ t: Translate,
record: TeamHubMessageActivityRecord,
pair: ToolCallPair | undefined,
live: boolean,
@@ -261,18 +294,18 @@ function trajectoryCall(
"bash",
].includes(tool)
)
- return { ...base, detail: command, kind: "command", verb: "Ran" };
+ return { ...base, detail: command, kind: "command", verb: m.ran };
const path = stringValue(args?.path ?? args?.file_path ?? args?.filePath);
if (["read", "read_file", "view"].includes(tool) && path)
- return { ...base, detail: path, kind: "read", verb: "Read" };
+ return { ...base, detail: path, kind: "read", verb: m.read };
if (tool === "apply_patch") {
const patch = stringValue(args?.input) ?? rawInput ?? "";
return {
...base,
- detail: patchFiles(patch) || "files",
+ detail: patchFiles(patch) || t(m.files),
diff: patchLines(patch),
kind: "file_change",
- verb: "Edited",
+ verb: m.edited,
};
}
if (
@@ -286,7 +319,7 @@ function trajectoryCall(
detail: path,
diff: editLines(args) || undefined,
kind: "file_change",
- verb: tool === "write" ? "Wrote" : "Edited",
+ verb: tool === "write" ? m.wrote : m.edited,
};
const query = stringValue(args?.query ?? args?.pattern);
if (
@@ -303,26 +336,26 @@ function trajectoryCall(
const scope = stringValue(args?.path);
return {
...base,
- detail: scope ? `${query} in ${scope}` : query,
+ detail: scope ? t(m.searchIn, { query, scope }) : query,
kind: "search",
- verb: "Searched",
+ verb: m.searched,
};
}
if (tool === "ls")
- return { ...base, detail: path ?? ".", kind: "read", verb: "Listed" };
+ return { ...base, detail: path ?? ".", kind: "read", verb: m.listed };
const url = stringValue(args?.url);
if (["web_fetch", "webfetch"].includes(tool) && url)
- return { ...base, detail: url, kind: "browse", verb: "Fetched" };
+ return { ...base, detail: url, kind: "browse", verb: m.fetched };
const task = stringValue(args?.description);
if (["task", "agent"].includes(tool) && task)
- return { ...base, detail: task, kind: "delegation", verb: "Delegated" };
+ return { ...base, detail: task, kind: "delegation", verb: m.delegated };
const input = args ? JSON.stringify(args, null, 2) : rawInput;
return {
...base,
detail: toolNameLabel(name),
...(input ? { input } : {}),
kind: "tool",
- verb: "Called",
+ verb: m.called,
};
}
diff --git a/apps/web/src/features/rooms/task-sidebar/adapters/task-activities-panel-tab.tsx b/apps/web/src/features/rooms/task-sidebar/adapters/task-activities-panel-tab.tsx
index 15b650d9..886b356b 100644
--- a/apps/web/src/features/rooms/task-sidebar/adapters/task-activities-panel-tab.tsx
+++ b/apps/web/src/features/rooms/task-sidebar/adapters/task-activities-panel-tab.tsx
@@ -1,5 +1,8 @@
import { dateTimeFormat } from "@/lib/date-format";
import { useState } from "react";
+import { formatLocale } from "@/i18n/language";
+import type { Message } from "@/i18n/messages";
+import { useTranslation } from "@/i18n/use-translation";
import { useInfiniteQuery } from "@tanstack/react-query";
import {
Activity01Icon,
@@ -26,15 +29,22 @@ import { RuntimeActivityPath } from "../../runtime-status/runtime-activity-path-
import { useTaskActivityEvents } from "../../runtime-status/use-task-activity-events";
import { RunningDots } from "../running-dots";
import { PanelLoading } from "../panel-loading";
+import { runtimeStatusMessages } from "../../runtime-status/runtime-status.messages";
+import { sidePanelMessages } from "../side-panel.messages";
+import { activityPanelMessages as m } from "./activity-panel.messages";
-const stageLabels: Record<TeamHubTaskExecution["status"], string> = {
- running: "Running",
- waiting_for_approval: "Waiting for approval",
- idle: "Idle",
- failed: "Failed",
- canceled: "Stopped",
+const stageLabels: Record<TeamHubTaskExecution["status"], Message<string>> = {
+ running: runtimeStatusMessages.taskStatusRunning,
+ waiting_for_approval: m.stageWaitingForApproval,
+ idle: m.stageIdle,
+ failed: runtimeStatusMessages.taskStatusFailed,
+ canceled: runtimeStatusMessages.taskStatusStopped,
};
const tabs = ["Activity", "Details"] as const;
+const tabLabels: Record<(typeof tabs)[number], Message<string>> = {
+ Activity: m.tabActivity,
+ Details: m.tabDetails,
+};
export function TaskActivitiesPanelTab({
hidden,
@@ -45,6 +55,8 @@ export function TaskActivitiesPanelTab({
taskId: string;
tenantId: string;
}) {
+ const { language, t } = useTranslation();
+ const locale = formatLocale(language);
const [tab, setTab] = useState<(typeof tabs)[number]>("Activity");
const data = useTaskActivities({ tenantId, taskId, enabled: !hidden });
const { client } = useTeamHubRuntime();
@@ -62,7 +74,7 @@ export function TaskActivitiesPanelTab({
const item = data.item.data;
const stopped = taskExecutionStopped(execution);
const status = execution
- ? stageLabels[execution.status]
+ ? t(stageLabels[execution.status])
: (item?.state.replaceAll("_", " ") ?? "");
const refresh = () => {
void data.item.refetch();
@@ -76,15 +88,19 @@ export function TaskActivitiesPanelTab({
hidden={hidden || undefined}
inert={hidden || undefined}
data-testid="task-activities-panel"
- aria-label="Task activities"
+ aria-label={t(m.taskActivities)}
>
<header className="shrink-0 border-b border-app-border px-4 pb-3 pt-4">
<div className="flex items-center gap-2 text-xs text-app-muted">
<Icon icon={Activity01Icon} size={14} />
- <span>Task {item ? `#${item.number}` : ""}</span>
+ <span>
+ {item
+ ? t(m.taskNumber, { number: String(item.number) })
+ : t(m.task)}
+ </span>
<button
type="button"
- aria-label="Refresh task"
+ aria-label={t(m.refreshTask)}
onClick={refresh}
className="ml-auto rounded-lg p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
>
@@ -92,7 +108,7 @@ export function TaskActivitiesPanelTab({
</button>
</div>
<h2 className="mt-2 break-words text-sm font-semibold text-app-ink">
- {item?.title ?? "Task activity"}
+ {item?.title ?? t(m.taskActivity)}
</h2>
<div className="mt-3 flex flex-wrap items-center gap-2 text-xs">
<span className="rounded-full bg-muted px-2 py-0.5 capitalize text-muted-foreground">
@@ -100,18 +116,22 @@ export function TaskActivitiesPanelTab({
</span>
{execution?.current_attempt ? (
<span className="text-app-muted">
- Attempt {execution.current_attempt.attempt_number}
+ {t(m.attempt, {
+ number: String(execution.current_attempt.attempt_number),
+ })}
</span>
) : null}
</div>
{execution ? (
<p className="mt-2 text-2xs text-app-muted">
- Updated {formatTime(execution.execution_updated_at)}
+ {t(m.updated, {
+ time: formatTime(execution.execution_updated_at, locale),
+ })}
</p>
) : null}
</header>
<nav
- aria-label="Task sections"
+ aria-label={t(m.taskSections)}
className="flex shrink-0 gap-1 border-b border-border px-3 py-2"
>
{tabs.map((value) => (
@@ -122,40 +142,37 @@ export function TaskActivitiesPanelTab({
onClick={() => setTab(value)}
className={`rounded-full px-3 py-1 text-sm font-medium transition-colors duration-150 ${tab === value ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`}
>
- {value}
+ {t(tabLabels[value])}
</button>
))}
</nav>
<div className="workspace-scrollbar min-h-0 flex-1 overflow-y-auto">
{data.item.error ? (
- <State>Task could not be loaded.</State>
+ <State>{t(m.taskLoadFailed)}</State>
) : data.item.isPending ? (
- <State busy>Loading task…</State>
+ <State busy>{t(m.loadingTask)}</State>
) : (
<>
{data.execution.error ? (
- <State>Execution status could not be loaded.</State>
+ <State>{t(m.executionLoadFailed)}</State>
) : null}
{tab === "Activity" ? (
<>
{data.activities.error ? (
<State>
{isTaskActivityNotFound(data.activities.error)
- ? "You do not have access to this task’s work room activity."
- : "Activity could not be loaded. Try refreshing."}
+ ? t(m.noActivityAccess)
+ : t(m.activityLoadFailedRefresh)}
</State>
) : data.activities.isPending ? (
- <State busy>Loading activity…</State>
+ <State busy>{t(m.loadingActivityEllipsis)}</State>
) : (
<>
{data.roomId && !data.connected ? (
- <State>Reconnecting to live activity…</State>
+ <State>{t(m.reconnecting)}</State>
) : null}
{!data.runStatuses.length ? (
- <State>
- No published activity yet. Earlier runs may not have an
- activity history.
- </State>
+ <State>{t(m.noPublishedActivity)}</State>
) : null}
{data.roomId
? data.runStatuses.map((runStatus) => (
@@ -181,7 +198,7 @@ export function TaskActivitiesPanelTab({
disabled={data.activities.isFetchingNextPage}
onClick={() => void data.activities.fetchNextPage()}
>
- Load earlier activity
+ {t(sidePanelMessages.loadEarlierActivity)}
</Button>
</div>
) : null}
@@ -190,15 +207,15 @@ export function TaskActivitiesPanelTab({
{data.roomId ? (
<div className="border-t border-app-border px-4 py-4">
<h3 className="mb-3 text-xs font-medium text-app-body">
- Task messages
+ {t(m.taskMessages)}
</h3>
{messages.error ? (
<p className="text-xs text-app-muted">
- Messages could not be loaded.
+ {t(m.messagesLoadFailed)}
</p>
) : !publicMessages.length ? (
<p className="text-xs text-app-muted">
- No task messages yet.
+ {t(m.noTaskMessages)}
</p>
) : (
[...publicMessages].reverse().map((message) => (
@@ -206,7 +223,7 @@ export function TaskActivitiesPanelTab({
<div className="mb-1 flex gap-2 text-2xs text-app-muted">
<span>{message.author.display_name}</span>
<time dateTime={message.created_at}>
- {formatTime(message.created_at)}
+ {formatTime(message.created_at, locale)}
</time>
</div>
<MessageMarkdown
@@ -223,7 +240,7 @@ export function TaskActivitiesPanelTab({
disabled={messages.isFetchingNextPage}
onClick={() => void messages.fetchNextPage()}
>
- Load earlier messages
+ {t(m.loadEarlierMessages)}
</Button>
) : null}
</div>
@@ -234,29 +251,29 @@ export function TaskActivitiesPanelTab({
<div className="space-y-5 p-4 text-xs text-app-body">
<dl className="space-y-3">
<Field
- label="Assignees"
+ label={t(m.assignees)}
value={
item.assignees
.map((assignment) => assignment.actor.display_name)
- .join(", ") || "Unassigned"
+ .join(", ") || t(m.unassigned)
}
/>
- <Field label="Priority" value={item.priority} />
+ <Field label={t(m.priority)} value={item.priority} />
<Field
- label="Execution"
+ label={t(m.execution)}
value={
execution
- ? stageLabels[execution.status]
- : "Execution is not enabled"
+ ? t(stageLabels[execution.status])
+ : t(m.executionNotEnabled)
}
/>
{execution?.reason_code ? (
- <Field label="Reason" value={execution.reason_code} />
+ <Field label={t(m.reason)} value={execution.reason_code} />
) : null}
</dl>
{item.description ? (
<div>
- <h3 className="mb-2 font-medium">Description</h3>
+ <h3 className="mb-2 font-medium">{t(m.description)}</h3>
<MessageMarkdown
body={item.description}
authorKind="human"
@@ -289,6 +306,7 @@ function TaskActivityGroup({
paused: boolean;
messages: TeamHubMessage[];
}) {
+ const { language, t } = useTranslation();
const active = runStatus.status === "active" && !stopped;
const paused = runStatus.status === "active" && taskPaused;
const [opened, setOpened] = useState<boolean>();
@@ -330,19 +348,23 @@ function TaskActivityGroup({
{runStatus.agent.display_name}
</span>
<span className="text-2xs text-app-muted">
- {formatTime(runStatus.created_at)} ·{" "}
- {active
- ? "Working"
- : paused
- ? "Paused"
- : interrupted
- ? "Interrupted"
- : "Ended"}
+ {t(m.runStarted, {
+ time: formatTime(runStatus.created_at, formatLocale(language)),
+ state: t(
+ active
+ ? m.runWorking
+ : paused
+ ? m.runPaused
+ : interrupted
+ ? m.runInterrupted
+ : m.runEnded,
+ ),
+ })}
</span>
</span>
{active ? (
<span
- aria-label="Agent working"
+ aria-label={t(m.agentWorking)}
className="flex h-3.5 items-center text-app-info"
role="img"
>
@@ -358,9 +380,9 @@ function TaskActivityGroup({
</button>
{expanded ? (
events.error ? (
- <State>Activity could not be loaded.</State>
+ <State>{t(m.activityLoadFailed)}</State>
) : !events.data ? (
- <State busy>Loading activity…</State>
+ <State busy>{t(m.loadingActivityEllipsis)}</State>
) : (
<RuntimeActivityPath
records={events.data.items}
@@ -395,11 +417,14 @@ function Field({ label, value }: { label: string; value: string }) {
</div>
);
}
-function formatTime(value: string) {
- return dateTimeFormat({
- month: "short",
- day: "numeric",
- hour: "2-digit",
- minute: "2-digit",
- }).format(new Date(value));
+function formatTime(value: string, locale: string) {
+ return dateTimeFormat(
+ {
+ month: "short",
+ day: "numeric",
+ hour: "2-digit",
+ minute: "2-digit",
+ },
+ locale,
+ ).format(new Date(value));
}
diff --git a/apps/web/src/features/rooms/task-sidebar/adapters/task-conversation-dialog.tsx b/apps/web/src/features/rooms/task-sidebar/adapters/task-conversation-dialog.tsx
index 72110b1f..9eb67f77 100644
--- a/apps/web/src/features/rooms/task-sidebar/adapters/task-conversation-dialog.tsx
+++ b/apps/web/src/features/rooms/task-sidebar/adapters/task-conversation-dialog.tsx
@@ -10,6 +10,7 @@ import { teamHubData } from "@/features/teamhub/teamhub-api";
import { useTaskActivities } from "@/features/work-items/use-task-activities";
import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";
import type { TeamHubRunStatus } from "@/features/teamhub/teamhub-types";
+import { useT } from "@/i18n/use-translation";
import { CancelTaskButton } from "../../chat/cancel-task-button";
import { useCancelRoomBackgroundTask } from "../../chat/use-room-background-tasks";
@@ -28,6 +29,8 @@ import {
import { useTaskActivityEvents } from "../../runtime-status/use-task-activity-events";
import { PanelLoading } from "../panel-loading";
import { RunningDots } from "../running-dots";
+import { sidePanelMessages } from "../side-panel.messages";
+import { activityPanelMessages as m } from "./activity-panel.messages";
import { RuntimeTrajectoryView } from "./runtime-trajectory-view";
import { TaskInputBubble } from "./task-input-bubble";
@@ -82,6 +85,7 @@ export function TaskConversationDialog({
tenantId: string;
title: string;
}) {
+ const t = useT();
const { client } = useTeamHubRuntime();
const cancel = useCancelRoomBackgroundTask({
client,
@@ -154,12 +158,12 @@ export function TaskConversationDialog({
}
>
<div
- aria-label="Task conversation"
+ aria-label={t(m.taskConversation)}
className="flex min-h-64 flex-col gap-3 px-5 py-4 text-[15px] leading-[22px]"
role="log"
>
{conversation.isPending || data.activities.isPending ? (
- <PanelLoading label="Loading task" />
+ <PanelLoading label={t(sidePanelMessages.loadingTask)} />
) : (
entries.map((entry) =>
entry.kind === "input" ? (
@@ -216,6 +220,7 @@ function TaskConversationRun({
stopped: boolean;
tenantId: string;
}) {
+ const t = useT();
const { client } = useTeamHubRuntime();
const active = runStatus.status === "active" && !stopped;
// Native history is read from the Runtime's session file on the Computer,
@@ -273,9 +278,9 @@ function TaskConversationRun({
{runStatus.agent.display_name}
{active && !paused ? (
<span className="flex items-center gap-1.5 text-xs text-app-muted">
- Working
+ {t(m.runWorking)}
<span
- aria-label="Agent working"
+ aria-label={t(m.agentWorking)}
className="flex h-3.5 items-center text-app-info"
role="img"
>
@@ -304,7 +309,7 @@ function TaskConversationRun({
/>
</div>
) : (
- <PanelLoading label="Loading activity" />
+ <PanelLoading label={t(sidePanelMessages.loadingActivity)} />
)}
</div>
</div>
diff --git a/apps/web/src/features/rooms/task-sidebar/adapters/task-input-bubble.tsx b/apps/web/src/features/rooms/task-sidebar/adapters/task-input-bubble.tsx
index b29ea13c..6b19832f 100644
--- a/apps/web/src/features/rooms/task-sidebar/adapters/task-input-bubble.tsx
+++ b/apps/web/src/features/rooms/task-sidebar/adapters/task-input-bubble.tsx
@@ -3,9 +3,11 @@ import { HeadlessMantineProvider, Spoiler } from "@mantine/core";
import { useState } from "react";
import { Icon } from "@/components/ui/icon";
+import { useT } from "@/i18n/use-translation";
import { cn } from "@/lib/cn";
import { MessageMarkdown } from "../../chat/message-markdown";
+import { runtimeStatusMessages as m } from "../../runtime-status/runtime-status.messages";
/** About four lines of message text. */
const FOLDED_HEIGHT = 110;
@@ -21,6 +23,7 @@ export function TaskInputBubble({
authorKind: "agent" | "human";
body: string;
}) {
+ const t = useT();
const [expanded, setExpanded] = useState(false);
return (
<div className="flex justify-end">
@@ -43,7 +46,7 @@ export function TaskInputBubble({
expanded={expanded}
hideLabel={
<>
- Show less
+ {t(m.showLess)}
<Icon
className="rotate-180"
icon={ArrowDown01Icon}
@@ -55,7 +58,7 @@ export function TaskInputBubble({
onExpandedChange={setExpanded}
showLabel={
<>
- Show more
+ {t(m.showMore)}
<Icon icon={ArrowDown01Icon} size={14} />
</>
}
diff --git a/apps/web/src/features/work-items/work-item-queries.ts b/apps/web/src/features/work-items/work-item-queries.ts
index fb10e458..0d558f68 100644
--- a/apps/web/src/features/work-items/work-item-queries.ts
+++ b/apps/web/src/features/work-items/work-item-queries.ts
@@ -4,6 +4,9 @@ import { collectTeamHubCursorPages } from "@/features/teamhub/teamhub-cursor-pag
import { TeamHubError } from "@/features/teamhub/teamhub-error";
import { teamHubData } from "@/features/teamhub/teamhub-api";
import type { TeamHubClient } from "@/features/teamhub/teamhub-client";
+import { translate } from "@/i18n/language";
+
+import { workItemsMessages as m } from "./work-items.messages";
export function tenantWorkItemTargetQueryKey(
tenantId: string,
@@ -31,7 +34,8 @@ export function tenantWorkItemTargetQueryOptions(
if (item.id !== workItemId || item.tenant_id !== tenantId) {
throw new TeamHubError({
code: "WORK_ITEM_NOT_FOUND",
- message: "Work Item is unavailable in this Tenant.",
+ // Shown on the Dashboard, worded when the check fails.
+ message: translate(m.workItemUnavailable),
status: 404,
});
}
@@ -72,9 +76,7 @@ export function tenantAgentWorkItemsQueryOptions(
),
);
if (page.items.some((item) => item.tenant_id !== tenantId)) {
- throw new Error(
- "Agent Work Item list does not match the active Tenant.",
- );
+ throw new Error(translate(m.agentListTenantMismatch));
}
return {
...page,
@@ -108,9 +110,7 @@ export function tenantWorkItemsDashboardQueryOptions(
),
);
if (page.items.some((item) => item.tenant_id !== tenantId)) {
- throw new Error(
- "Work Item Dashboard does not match the active Tenant.",
- );
+ throw new Error(translate(m.dashboardTenantMismatch));
}
return page;
},
diff --git a/apps/web/src/features/work-items/work-item-room-filter.ts b/apps/web/src/features/work-items/work-item-room-filter.ts
index ec71a596..e6c4557a 100644
--- a/apps/web/src/features/work-items/work-item-room-filter.ts
+++ b/apps/web/src/features/work-items/work-item-room-filter.ts
@@ -1,11 +1,16 @@
import type { TeamHubWorkItem } from "@/features/teamhub/teamhub-types";
+import { type Translate, translate } from "@/i18n/language";
+
+import { workItemsMessages as m } from "./work-items.messages";
export const NO_SOURCE_ROOM_FILTER = "!no-source";
export function createWorkItemRoomFilterModel(
visibleRooms: Array<{ id: string; name: string }>,
items: TeamHubWorkItem[],
+ t: Translate = translate,
) {
+ const unknownRoomLabel = (id: string) => t(m.unknownRoom, { id });
const roomNames = new Map(visibleRooms.map((room) => [room.id, room.name]));
const originRoomIds = [
...new Set(
@@ -36,11 +41,11 @@ export function createWorkItemRoomFilterModel(
...knownOptions,
...unknownOptions,
...(items.some((item) => !item.origin_room_id)
- ? [{ id: NO_SOURCE_ROOM_FILTER, label: "No source room" }]
+ ? [{ id: NO_SOURCE_ROOM_FILTER, label: t(m.noSourceRoom) }]
: []),
],
originLabel(item: TeamHubWorkItem) {
- if (!item.origin_room_id) return "No source room";
+ if (!item.origin_room_id) return t(m.noSourceRoom);
const name = roomNames.get(item.origin_room_id);
return name ? `#${name}` : unknownRoomLabel(item.origin_room_id);
},
@@ -55,7 +60,3 @@ function compareFilterOptions(
left.label.localeCompare(right.label) || left.id.localeCompare(right.id)
);
}
-
-function unknownRoomLabel(roomId: string) {
- return `Unknown room (${roomId})`;
-}
diff --git a/apps/web/src/features/work-items/work-items-language.test.tsx b/apps/web/src/features/work-items/work-items-language.test.tsx
new file mode 100644
index 00000000..68210a29
--- /dev/null
+++ b/apps/web/src/features/work-items/work-items-language.test.tsx
@@ -0,0 +1,191 @@
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { fireEvent, render, screen, within } from "@testing-library/react";
+import { Suspense } from "react";
+import { MemoryRouter, Route, Routes } from "react-router";
+import { afterEach, describe, expect, it } from "vitest";
+
+import { TeamHubRuntimeProvider } from "@/features/teamhub/teamhub-runtime";
+import type { TeamHubWorkItem } from "@/features/teamhub/teamhub-types";
+import { resetLanguageForTest, setLanguage } from "@/i18n/language";
+import zhCN from "@/i18n/locales/zh-CN.json";
+import {
+ createTestTeamHubRuntime,
+ type TestTeamHubRuntime,
+} from "@/test/teamhub-test-runtime";
+
+import { WorkItemsPage } from "./work-items-page";
+
+const words = zhCN.workItems;
+
+function renderPage(runtime: TestTeamHubRuntime, entry: string) {
+ render(
+ <QueryClientProvider
+ client={
+ new QueryClient({ defaultOptions: { queries: { retry: false } } })
+ }
+ >
+ <TeamHubRuntimeProvider runtime={runtime}>
+ <MemoryRouter initialEntries={[entry]}>
+ <Suspense fallback={null}>
+ <Routes>
+ <Route
+ element={<WorkItemsPage />}
+ path="/t/:tenantId/dashboard"
+ />
+ </Routes>
+ </Suspense>
+ </MemoryRouter>
+ </TeamHubRuntimeProvider>
+ </QueryClientProvider>,
+ );
+}
+
+describe("the Dashboard in the language on screen", () => {
+ afterEach(() => {
+ resetLanguageForTest();
+ });
+
+ it("words the board in Chinese and keeps the Work Items as written", async () => {
+ await setLanguage("zh-CN");
+ const runtime = createTestTeamHubRuntime();
+ const human = runtime.seed.identity.actors[0]!;
+ const agent = runtime.seed.actors.find(
+ (actor) => actor.id === "actor-codex",
+ )!;
+ runtime.seed.workItems = [
+ workItem(human, {
+ assignees: [
+ {
+ actor: agent,
+ assigned_at: "2026-07-30T00:00:00Z",
+ assigned_by: human,
+ },
+ ],
+ origin_room_id: "room-all",
+ title: "Ship release",
+ }),
+ workItem(human, {
+ id: "workitem-task",
+ kind: "task",
+ number: 7,
+ resolution: "not_planned",
+ state: "resolved",
+ title: "Retire old release",
+ }),
+ ];
+
+ renderPage(runtime, "/t/tenant-northstar/dashboard");
+
+ expect(
+ await screen.findByRole("heading", { name: words.dashboard }),
+ ).toBeVisible();
+ expect(
+ screen.getByText(words.itemCount.other.replace("{count}", "2")),
+ ).toBeVisible();
+ expect(screen.getByRole("group", { name: words.filters })).toBeVisible();
+ expect(screen.getByLabelText(words.room)).toBeVisible();
+ for (const column of [
+ words.columnTodo,
+ words.columnInProgress,
+ words.columnDone,
+ words.columnClosed,
+ ]) {
+ expect(screen.getByRole("region", { name: column })).toBeVisible();
+ }
+
+ const card = await screen.findByRole("link", { name: /Ship release/ });
+ // Priorities and people come from TeamHub as they are.
+ expect(within(card).getByText("High")).toBeVisible();
+ expect(
+ within(card).getByRole("group", {
+ name: words.assignedTo.replace("{names}", "Codex"),
+ }),
+ ).toBeVisible();
+ expect(
+ within(card).getByText(words.issueNumber.replace("{number}", "42")),
+ ).toBeVisible();
+ expect(
+ within(card).getByText(
+ new Intl.DateTimeFormat("zh-CN", {
+ day: "numeric",
+ month: "short",
+ timeZone: "UTC",
+ year: "numeric",
+ }).format(new Date("2026-07-30T00:00:00Z")),
+ ),
+ ).toBeVisible();
+ const task = screen.getByRole("link", { name: /Retire old release/ });
+ expect(
+ within(task).getByText(words.taskNumber.replace("{number}", "7")),
+ ).toBeVisible();
+
+ // Folding a column only changes the view, so it carries no marker.
+ const collapse = screen.getByRole("button", { name: words.collapseClosed });
+ expect(collapse).not.toHaveAttribute("data-voice-risk");
+ fireEvent.click(collapse);
+ expect(
+ screen.getByRole("button", { name: words.expandClosed }),
+ ).toBeVisible();
+ });
+
+ it("counts the Work Items the Room filter shows in Chinese", async () => {
+ await setLanguage("zh-CN");
+ const runtime = createTestTeamHubRuntime();
+ const human = runtime.seed.identity.actors[0]!;
+ runtime.seed.workItems = [
+ workItem(human, { origin_room_id: "room-all", title: "Here" }),
+ workItem(human, {
+ id: "workitem-elsewhere",
+ origin_room_id: "room-gtm-launch",
+ title: "Elsewhere",
+ }),
+ ];
+
+ renderPage(runtime, "/t/tenant-northstar/dashboard?room=room-all");
+
+ expect(await screen.findByText("Here")).toBeVisible();
+ expect(
+ screen.getByText(
+ words.filteredCount.replace("{shown}", "1").replace("{count}", "2"),
+ ),
+ ).toBeVisible();
+ });
+
+ it("shows an empty board in Chinese", async () => {
+ await setLanguage("zh-CN");
+ const runtime = createTestTeamHubRuntime();
+ runtime.seed.workItems = [];
+
+ renderPage(runtime, "/t/tenant-northstar/dashboard");
+
+ expect(await screen.findByText(words.noWorkItems)).toBeVisible();
+ expect(
+ screen.getByText(words.itemCount.other.replace("{count}", "0")),
+ ).toBeVisible();
+ });
+});
+
+function workItem(
+ actor: TeamHubWorkItem["created_by"],
+ override: Partial<TeamHubWorkItem> = {},
+): TeamHubWorkItem {
+ return {
+ assignees: [],
+ created_at: "2026-07-30T00:00:00Z",
+ created_by: actor,
+ description: "Email login returns 500.",
+ explicit_access_grants: [],
+ id: "workitem-login",
+ kind: "issue",
+ number: 42,
+ priority: "high",
+ referenced_actors: [],
+ state: "open",
+ tenant_id: "tenant-northstar",
+ title: "Fix login failure",
+ updated_at: "2026-07-30T00:00:00Z",
+ updated_by: actor,
+ version: 1,
+ ...override,
+ };
+}
diff --git a/apps/web/src/features/work-items/work-items-page.tsx b/apps/web/src/features/work-items/work-items-page.tsx
index 494e1b2a..a4d9ac5f 100644
--- a/apps/web/src/features/work-items/work-items-page.tsx
+++ b/apps/web/src/features/work-items/work-items-page.tsx
@@ -6,6 +6,10 @@ import {
CheckListIcon,
} from "@hugeicons/core-free-icons";
import { Icon } from "@/components/ui/icon";
+import { commonMessages } from "@/i18n/common.messages";
+import { formatLocale } from "@/i18n/language";
+import type { Message } from "@/i18n/messages";
+import { useT, useTranslation } from "@/i18n/use-translation";
import { useCallback, useState, type RefCallback } from "react";
import { Link, useParams, useSearchParams } from "react-router";
@@ -25,27 +29,22 @@ import {
} from "./work-item-queries";
import { dashboardWorkItemPath } from "./work-item-routes";
import { createWorkItemRoomFilterModel } from "./work-item-room-filter";
+import { workItemsMessages as m } from "./work-items.messages";
interface DashboardColumn {
id: "todo" | "in-progress" | "done" | "closed";
- label: "Todo" | "In progress" | "Done" | "Closed";
+ label: Message<string>;
}
const dashboardColumns: readonly DashboardColumn[] = [
- { id: "todo", label: "Todo" },
- { id: "in-progress", label: "In progress" },
- { id: "done", label: "Done" },
- { id: "closed", label: "Closed" },
+ { id: "todo", label: m.columnTodo },
+ { id: "in-progress", label: m.columnInProgress },
+ { id: "done", label: m.columnDone },
+ { id: "closed", label: m.columnClosed },
];
-const dashboardDateFormatter = dateTimeFormat({
- day: "numeric",
- month: "short",
- timeZone: "UTC",
- year: "numeric",
-});
-
export function WorkItemsPage() {
+ const t = useT();
const { client } = useTeamHubRuntime();
const params = useParams();
const tenantId = requireRoomRouteParam(params.tenantId, "Tenant");
@@ -101,7 +100,7 @@ export function WorkItemsPage() {
const rooms = roomsQuery.data;
if (!data || !rooms) return <WorkItemsLoading />;
const items = mergeFocusedWorkItem(data.items, focusedWorkItemQuery.data);
- const roomFilter = createWorkItemRoomFilterModel(rooms.items, items);
+ const roomFilter = createWorkItemRoomFilterModel(rooms.items, items, t);
const roomId = searchParams.get("room")?.trim() ?? "";
const dashboardSearch = roomId
? new URLSearchParams({ room: roomId }).toString()
@@ -122,16 +121,19 @@ export function WorkItemsPage() {
<header className="work-items-header shrink-0 border-b border-app-border px-5 py-3 sm:px-8">
<div className="flex flex-wrap items-end justify-between gap-3">
<div>
- <h1 className="text-2xl text-foreground">Dashboard</h1>
+ <h1 className="text-2xl text-foreground">{t(m.dashboard)}</h1>
<p className="mt-0.5 text-sm text-muted-foreground">
{filteredItems.length === items.length
- ? itemCount(items.length)
- : `${filteredItems.length} of ${items.length} items`}
+ ? t(m.itemCount, { count: items.length })
+ : t(m.filteredCount, {
+ count: items.length,
+ shown: filteredItems.length,
+ })}
</p>
</div>
{items.length ? (
<div
- aria-label="Work Item filters"
+ aria-label={t(m.filters)}
className="w-[240px] max-w-full"
role="group"
>
@@ -171,7 +173,7 @@ export function WorkItemsPage() {
<Icon icon={CheckListIcon} size={16} />
</span>
<h2 className="mt-3 text-sm font-semibold text-app-ink">
- No Work Items yet
+ {t(m.noWorkItems)}
</h2>
</div>
</section>
@@ -193,10 +195,6 @@ function mergeFocusedWorkItem(
);
}
-function itemCount(count: number) {
- return `${count} ${count === 1 ? "item" : "items"}`;
-}
-
function WorkItemsLoading() {
return <AuthenticatedRouteLoading pathname="/dashboard" rooms={[]} />;
}
@@ -210,22 +208,23 @@ function WorkItemsError({
isRetrying: boolean;
onRetry: () => void;
}) {
+ const t = useT();
const forbidden = error instanceof TeamHubError && error.status === 403;
return (
<main
- aria-label="Dashboard error"
+ aria-label={t(m.dashboardError)}
className="work-items-surface flex min-h-0 flex-1 items-center justify-center bg-app-surface px-6 py-12 text-center"
role="alert"
>
<div className="max-w-md">
<h1 className="text-lg text-app-ink">
- {forbidden ? "Access denied" : "Dashboard unavailable"}
+ {t(forbidden ? m.accessDenied : m.dashboardUnavailable)}
</h1>
<p className="mt-2 text-sm leading-6 text-app-muted">
- {error.message || "TeamHub could not load Work Items."}
+ {error.message || t(m.loadFailed)}
</p>
<Button className="mt-5" disabled={isRetrying} onClick={onRetry}>
- {isRetrying ? "Trying again…" : "Try again"}
+ {isRetrying ? t(m.tryingAgain) : t(commonMessages.tryAgain)}
</Button>
</div>
</main>
@@ -241,16 +240,17 @@ function RoomFilter({
options: Array<{ id: string; label: string }>;
value: string;
}) {
+ const t = useT();
return (
<label className="grid min-w-0 gap-1 text-xs font-medium text-muted-foreground">
- Room
+ {t(m.room)}
<Select
- aria-label="Room"
+ aria-label={t(m.room)}
className="h-8 w-full min-w-0 rounded-md border border-border bg-card px-2 text-sm text-foreground outline-none transition-colors hover:border-border-hover focus-visible:border-foreground focus-visible:ring-2 focus-visible:ring-ring"
onValueChange={onChange}
value={value}
>
- <SelectItem value="">All rooms</SelectItem>
+ <SelectItem value="">{t(m.allRooms)}</SelectItem>
{options.map((option) => (
<SelectItem key={option.id} value={option.id}>
{option.label}
@@ -278,12 +278,14 @@ function WorkItemColumn({
search: string;
tenantId: string;
}) {
+ const { language, t } = useTranslation();
+ const locale = formatLocale(language);
const [closedExpanded, setClosedExpanded] = useState(true);
const isClosed = column.id === "closed";
return (
<section
- aria-label={column.label}
+ aria-label={t(column.label)}
className="work-item-column flex min-h-0 min-w-0 flex-col"
>
<header className="flex h-11 shrink-0 items-center justify-between px-2">
@@ -299,10 +301,10 @@ function WorkItemColumn({
<Button
aria-controls="work-item-column-closed-items"
aria-expanded={closedExpanded}
- aria-label={closedExpanded ? "Collapse closed" : "Expand closed"}
+ aria-label={t(closedExpanded ? m.collapseClosed : m.expandClosed)}
onClick={() => setClosedExpanded((expanded) => !expanded)}
size="compactIcon"
- title={closedExpanded ? "Collapse closed" : "Expand closed"}
+ title={t(closedExpanded ? m.collapseClosed : m.expandClosed)}
tone="ghost"
>
{closedExpanded ? (
@@ -356,7 +358,11 @@ function WorkItemColumn({
</span>
{item.assignees.length ? (
<span
- aria-label={`Assigned to ${item.assignees.map(({ actor }) => actor.display_name).join(", ")}`}
+ aria-label={t(m.assignedTo, {
+ names: item.assignees
+ .map(({ actor }) => actor.display_name)
+ .join(", "),
+ })}
className="flex shrink-0 -space-x-1"
role="group"
>
@@ -383,13 +389,15 @@ function WorkItemColumn({
</span>
<span aria-hidden="true">·</span>
<span className="shrink-0">
- {item.kind === "issue" ? "Issue" : "Task"} #{item.number}
+ {t(item.kind === "issue" ? m.issueNumber : m.taskNumber, {
+ number: String(item.number),
+ })}
</span>
</span>
<span className="flex shrink-0 items-center gap-2">
<WorkItemStatus compact status={column.id} />
<time dateTime={item.updated_at}>
- {formatDashboardDate(item.updated_at)}
+ {formatDashboardDate(item.updated_at, locale)}
</time>
</span>
</span>
@@ -409,6 +417,7 @@ function WorkItemStatus({
compact?: boolean;
status: DashboardColumn["id"];
}) {
+ const t = useT();
const column = dashboardColumns.find((candidate) => candidate.id === status)!;
return (
@@ -417,7 +426,7 @@ function WorkItemStatus({
data-compact={compact ? "true" : "false"}
data-status={status}
>
- <span>{column.label}</span>
+ <span>{t(column.label)}</span>
</span>
);
}
@@ -432,6 +441,9 @@ function capitalize(value: string) {
return value.charAt(0).toUpperCase() + value.slice(1);
}
-function formatDashboardDate(value: string) {
- return dashboardDateFormatter.format(new Date(value));
+function formatDashboardDate(value: string, locale: string) {
+ return dateTimeFormat(
+ { day: "numeric", month: "short", timeZone: "UTC", year: "numeric" },
+ locale,
+ ).format(new Date(value));
}
diff --git a/apps/web/src/features/work-items/work-items.messages.ts b/apps/web/src/features/work-items/work-items.messages.ts
new file mode 100644
index 00000000..4e4d641e
--- /dev/null
+++ b/apps/web/src/features/work-items/work-items.messages.ts
@@ -0,0 +1,44 @@
+import { defineMessages } from "@/i18n/messages";
+
+/**
+ * The Work Item Dashboard. Titles, people, Room names and priorities come
+ * from TeamHub and are shown as they arrive; a server error message is shown
+ * as TeamHub wrote it.
+ */
+export const workItemsMessages = defineMessages("workItems", {
+ dashboard: "Dashboard",
+ itemCount: { one: "{count} item", other: "{count} items" },
+ // {shown} of {count} Work Items match the Room filter.
+ filteredCount: "{shown} of {count} items",
+ filters: "Work Item filters",
+ noWorkItems: "No Work Items yet",
+ // The columns of the board.
+ columnTodo: "Todo",
+ columnInProgress: "In progress",
+ columnDone: "Done",
+ columnClosed: "Closed",
+ collapseClosed: "Collapse closed",
+ expandClosed: "Expand closed",
+ // {names} lists the people and Agents a Work Item is assigned to.
+ assignedTo: "Assigned to {names}",
+ // The kind and number of a Work Item, such as "Task #17".
+ issueNumber: "Issue #{number}",
+ taskNumber: "Task #{number}",
+ // The Room filter.
+ room: "Room",
+ allRooms: "All rooms",
+ noSourceRoom: "No source room",
+ // {id} is the id of a Room the Human cannot see.
+ unknownRoom: "Unknown room ({id})",
+ // The page when the Work Items cannot be loaded.
+ dashboardError: "Dashboard error",
+ accessDenied: "Access denied",
+ dashboardUnavailable: "Dashboard unavailable",
+ loadFailed: "TeamHub could not load Work Items.",
+ tryingAgain: "Trying again…",
+ workItemUnavailable: "Work Item is unavailable in this Tenant.",
+ dashboardTenantMismatch:
+ "Work Item Dashboard does not match the active Tenant.",
+ agentListTenantMismatch:
+ "Agent Work Item list does not match the active Tenant.",
+});
diff --git a/apps/web/src/i18n/locales/zh-CN.json b/apps/web/src/i18n/locales/zh-CN.json
index 5d8da967..58a1da0c 100644
--- a/apps/web/src/i18n/locales/zh-CN.json
+++ b/apps/web/src/i18n/locales/zh-CN.json
@@ -2850,6 +2850,69 @@
"notCompleted": "服务器无法完成此请求({status}),请重试。",
"unreachable": "无法连接到服务器。请检查网络后重试。"
},
+ "activityPanel": {
+ "backToAgentInfo": "返回 Agent 信息",
+ "agentActivity": "{name} 的活动",
+ "activity": "活动",
+ "waitingForActivity": "等待活动",
+ "activityLoadFailedTitle": "无法加载活动",
+ "activityLoadFailedDetail": "无法从 TeamHub 读取已发布的 Runtime 事件。",
+ "noActivityTitle": "暂无活动",
+ "noActivityDetail": "这次运行还没有发布任何活动事件。",
+ "messageActivities": "{name} 的活动",
+ "refreshMessageActivities": "刷新消息活动",
+ "refresh": "刷新",
+ "activitiesLoadFailedTitle": "无法加载活动",
+ "activitiesLoadFailedDetail": "无法读取这条消息的活动记录。",
+ "loadingActivities": "正在加载活动",
+ "activityLogUnavailable": "消息活动记录不可用",
+ "onlyLinkedToolRecords": "这次执行只有关联的工具记录可用。",
+ "turnTruncated": "这一轮的记录异常多,只保留了最近的 {limit} 条。",
+ "onlyLinkedRuntimeRecords": "只显示按活动标识关联的 Runtime 记录。",
+ "noExactActivityLog": "这条消息没有对应的活动记录",
+ "taskActivities": "任务活动",
+ "task": "任务",
+ "taskNumber": "任务 #{number}",
+ "refreshTask": "刷新任务",
+ "taskActivity": "任务活动",
+ "attempt": "第 {number} 次尝试",
+ "updated": "更新于 {time}",
+ "taskSections": "任务分区",
+ "tabActivity": "活动",
+ "tabDetails": "详情",
+ "taskLoadFailed": "无法加载任务。",
+ "loadingTask": "正在加载任务…",
+ "executionLoadFailed": "无法加载执行状态。",
+ "noActivityAccess": "你无权查看这个任务工作 Room 中的活动。",
+ "activityLoadFailedRefresh": "无法加载活动,请尝试刷新。",
+ "loadingActivityEllipsis": "正在加载活动…",
+ "reconnecting": "正在重新连接实时活动…",
+ "noPublishedActivity": "还没有已发布的活动。较早的运行可能没有活动历史。",
+ "taskMessages": "任务消息",
+ "messagesLoadFailed": "无法加载消息。",
+ "noTaskMessages": "还没有任务消息。",
+ "loadEarlierMessages": "加载更早的消息",
+ "assignees": "负责人",
+ "unassigned": "未分配",
+ "priority": "优先级",
+ "execution": "执行",
+ "executionNotEnabled": "未启用执行",
+ "reason": "原因",
+ "description": "描述",
+ "activityLoadFailed": "无法加载活动。",
+ "stageWaitingForApproval": "等待批准",
+ "stageIdle": "空闲",
+ "runWorking": "工作中",
+ "runPaused": "已暂停",
+ "runInterrupted": "已中断",
+ "runEnded": "已结束",
+ "runStarted": "{time} · {state}",
+ "agentWorking": "Agent 工作中",
+ "taskConversation": "任务对话"
+ },
+ "agentLiveActivities": {
+ "title": "实时活动"
+ },
"canvas": {
"canvasLabel": "{target} 画布",
"agentEditing": "Agent 正在编辑…",
@@ -3357,6 +3420,25 @@
"stopBeforeSwitching": "请先停止当前录音,再切换对象",
"startInDirectChat": "请在 Agent 私聊中开始录音"
},
+ "runPanel": {
+ "input": "输入",
+ "output": "输出",
+ "changes": "改动",
+ "toolCall": "工具调用",
+ "noMessageText": "没有记录消息内容",
+ "thinkingHidden": "已记录思考过程 · 内容不公开",
+ "ran": "运行了 <detail>{detail}</detail>",
+ "read": "读取了 <detail>{detail}</detail>",
+ "edited": "编辑了 <detail>{detail}</detail>",
+ "wrote": "写入了 <detail>{detail}</detail>",
+ "searched": "搜索了 <detail>{detail}</detail>",
+ "listed": "列出了 <detail>{detail}</detail>",
+ "fetched": "获取了 <detail>{detail}</detail>",
+ "delegated": "委派了 <detail>{detail}</detail>",
+ "called": "调用了 <detail>{detail}</detail>",
+ "files": "文件",
+ "searchIn": "{scope} 中的 {query}"
+ },
"voiceChat": {
"addToVoice": "添加到语音",
"addedToVoice": "已添加到语音",
@@ -3432,5 +3514,35 @@
},
"resizeHint": "拖动以调整大小,或使用方向键",
"meetingTitle": "会议"
+ },
+ "workItems": {
+ "dashboard": "仪表盘",
+ "itemCount": {
+ "other": "{count} 项"
+ },
+ "filteredCount": "{shown} / {count} 项",
+ "filters": "工作项筛选",
+ "noWorkItems": "还没有工作项",
+ "columnTodo": "待办",
+ "columnInProgress": "进行中",
+ "columnDone": "已完成",
+ "columnClosed": "已关闭",
+ "collapseClosed": "收起已关闭",
+ "expandClosed": "展开已关闭",
+ "assignedTo": "已分配给 {names}",
+ "issueNumber": "Issue #{number}",
+ "taskNumber": "任务 #{number}",
+ "room": "Room",
+ "allRooms": "全部 Room",
+ "noSourceRoom": "无来源 Room",
+ "unknownRoom": "未知 Room({id})",
+ "dashboardError": "仪表盘错误",
+ "accessDenied": "无权访问",
+ "dashboardUnavailable": "仪表盘不可用",
+ "loadFailed": "TeamHub 无法加载工作项。",
+ "tryingAgain": "正在重试…",
+ "workItemUnavailable": "这个工作区中没有这个工作项。",
+ "dashboardTenantMismatch": "工作项仪表盘与当前工作区不匹配。",
+ "agentListTenantMismatch": "Agent 的工作项列表与当前工作区不匹配。"
}
}