Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

feat(ui): chrome-string i18n sweep — Symbol, Flows, Overview, WikiPanel

Martin Vogel675b955f234b
diff --git a/graph-ui/src/components/FlowsTab.tsx b/graph-ui/src/components/FlowsTab.tsx
index 6b9471a54..b7799b0e8 100644
--- a/graph-ui/src/components/FlowsTab.tsx
+++ b/graph-ui/src/components/FlowsTab.tsx
@@ -183,7 +183,7 @@ export function FlowsTab({
mode: traceMode,
max_depth: 0,
reachable: false,
- error: err instanceof Error ? err.message : "trace failed",
+ error: err instanceof Error ? err.message : t.flows.traceFailed,
});
} finally {
setTracing(false);
@@ -251,7 +251,7 @@ export function FlowsTab({
if (!payload) {
return (
<div className="flex items-center justify-center h-full">
- <p className="text-foreground/45 text-sm">Tracing the journeys…</p>
+ <p className="text-foreground/45 text-sm">{t.flows.loading}</p>
</div>
);
}
@@ -262,35 +262,35 @@ export function FlowsTab({
<div className="w-[380px] shrink-0 border-r border-border/40 flex flex-col bg-card/60">
<div className="px-4 py-3 border-b border-border/30 shrink-0">
<p className="text-[12px] uppercase tracking-widest text-foreground/45 mb-2">
- Trace A → B
+ {t.flows.traceHeading}
</p>
<div className="flex items-center gap-1.5 flex-wrap">
<EndpointPicker
project={project}
- placeholder="from symbol…"
+ placeholder={t.flows.fromPlaceholder}
value={traceFrom}
onPick={setTraceFrom}
/>
<span className="text-foreground/30 text-[13px]">→</span>
<EndpointPicker
project={project}
- placeholder="to symbol…"
+ placeholder={t.flows.toPlaceholder}
value={traceTo}
onPick={setTraceTo}
/>
<button
onClick={() => setTraceMode((mode) => (mode === "calls" ? "data" : "calls"))}
className="px-2 py-1 rounded-md bg-popover border border-border/50 text-[12px] text-foreground/60 hover:text-foreground/85 transition-colors"
- title="Follow control flow (CALLS) or data flow (DATA_FLOWS)"
+ title={t.flows.modeTitle}
>
- {traceMode === "calls" ? "control" : "data"}
+ {traceMode === "calls" ? t.flows.modeControl : t.flows.modeData}
</button>
<button
onClick={runTrace}
disabled={!traceFrom || !traceTo || tracing}
className="px-2.5 py-1 rounded-md bg-primary/15 text-primary text-[12px] font-medium hover:bg-primary/25 transition-colors disabled:opacity-40"
>
- {tracing ? "…" : "trace"}
+ {tracing ? "…" : t.flows.traceButton}
</button>
</div>
{trace && (
@@ -300,8 +300,7 @@ export function FlowsTab({
) : trace.reachable ? (
<div>
<p className="text-[12px] text-good/90 mb-1">
- reachable in {trace.hops} hop{trace.hops === 1 ? "" : "s"} via{" "}
- {trace.mode === "data" ? "data flow" : "calls"}
+ {t.flows.reachableIn(trace.hops ?? 0, trace.mode === "data")}
</p>
{allHopsObserved(trace.path ?? []) && (
<p className="text-[11px] text-good/70 mb-1">
@@ -329,7 +328,7 @@ export function FlowsTab({
? "border-warn/50 text-warn/80"
: "border-primary/40 text-primary/80"
}`}
- title="syntactic guard at this hop's call site"
+ title={t.flows.guardTitleHop}
>
{formatGuard(guard)}
</span>
@@ -348,9 +347,7 @@ export function FlowsTab({
</div>
) : (
<p className="text-[12px] text-foreground/45">
- not reachable within {trace.max_depth} hops (
- {trace.mode === "data" ? "data flow" : "calls"};{" "}
- {trace.explored?.toLocaleString("en-US")} nodes explored)
+ {t.flows.notReachable(trace.max_depth, trace.mode === "data", trace.explored)}
</p>
)}
</div>
@@ -358,13 +355,14 @@ export function FlowsTab({
</div>
<div className="px-4 py-3 border-b border-border/30 shrink-0">
<p className="text-[12px] uppercase tracking-widest text-foreground/45">
- Flows — entry → terminal
+ {t.flows.listHeading}
</p>
<p className="text-[12px] text-foreground/45 mt-1">
- {payload.flows.length} journeys from{" "}
- {payload.callable_total.toLocaleString("en-US")} callables
- {payload.candidates_dropped > 0 &&
- ` · ${payload.candidates_dropped.toLocaleString("en-US")} candidates not walked`}
+ {t.flows.summary(
+ payload.flows.length,
+ payload.callable_total,
+ payload.candidates_dropped,
+ )}
</p>
</div>
<ScrollArea className="flex-1 min-h-0">
@@ -375,7 +373,7 @@ export function FlowsTab({
return (
<div key={groupKey}>
<p className="px-4 pt-2 pb-1 text-[12px] uppercase tracking-widest text-foreground/40">
- {groupKey === "cross" ? "across regions" : "within one region"}
+ {groupKey === "cross" ? t.flows.acrossRegions : t.flows.withinOneRegion}
</p>
{groupFlowsByEntry(flows).map((group) => {
const groupKey2 = `${groupKey}:${group.entryName}`;
@@ -398,7 +396,7 @@ export function FlowsTab({
{flow.steps}
</span>
{!flow.sink_terminated && (
- <span className="text-[12px] text-foreground/35 shrink-0" title="walk stopped at the depth cap, not at a sink">
+ <span className="text-[12px] text-foreground/35 shrink-0" title={t.flows.depthCapTitle}>
…
</span>
)}
@@ -417,8 +415,8 @@ export function FlowsTab({
className="w-full text-left px-4 py-[3px] text-[12px] text-foreground/40 hover:text-primary transition-colors"
>
{expanded
- ? "− collapse"
- : `× ${group.flows.length} journeys from ${group.entryName} — show all`}
+ ? t.flows.collapse
+ : t.flows.showAll(group.flows.length, group.entryName)}
</button>
)}
</div>
@@ -429,7 +427,7 @@ export function FlowsTab({
})}
{payload.flows.length === 0 && (
<p className="text-[13px] text-foreground/40 px-4 py-4">
- No flows detected — the project may have no clear entry points.
+ {t.flows.noFlows}
</p>
)}
</div>
@@ -441,7 +439,7 @@ export function FlowsTab({
{flowId === null || !detail ? (
<div className="flex items-center justify-center h-full">
<p className="text-foreground/45 text-sm">
- {flowId === null ? "Pick a journey on the left" : "Loading…"}
+ {flowId === null ? t.flows.pickJourney : t.common.loading}
</p>
</div>
) : (
@@ -467,16 +465,18 @@ export function FlowsTab({
}}
className="px-2.5 py-1 rounded-md bg-surface-3 text-foreground/60 text-[13px] font-medium hover:bg-surface-4 transition-colors"
>
- {copied ? "Copied ✓" : "Copy as mermaid"}
+ {copied ? t.flows.copied : t.flows.copyMermaid}
</button>
</div>
<p className="text-[13px] text-foreground/50 mb-4">
- {detail.steps.length} steps
- {detail.sink_terminated ? " · ends at a sink" : " · stopped at the depth cap"}
- {detail.cross_region ? " · crosses regions" : ""}
- {detail.steps_capped
- ? ` · ${detail.steps_capped} branches beyond the cap not shown`
- : ""}
+ {[
+ t.flows.stepsCount(detail.steps.length),
+ detail.sink_terminated ? t.flows.endsAtSink : t.flows.stoppedAtCap,
+ ...(detail.cross_region ? [t.flows.crossesRegions] : []),
+ ...(detail.steps_capped
+ ? [t.flows.branchesBeyondCap(detail.steps_capped)]
+ : []),
+ ].join(" · ")}
</p>
<div className="space-y-px">
@@ -496,7 +496,7 @@ export function FlowsTab({
{step.confidence !== undefined && step.confidence < 0.75 && (
<span
className="text-[11px] text-warn/80 shrink-0"
- title={`resolver confidence ${Math.round(step.confidence * 100)}% — this hop may be misresolved`}
+ title={t.flows.resolverConfidence(Math.round(step.confidence * 100))}
>
≈{Math.round(step.confidence * 100)}%
</span>
@@ -509,7 +509,7 @@ export function FlowsTab({
? "border-warn/50 text-warn/80"
: "border-primary/40 text-primary/80"
}`}
- title="syntactic guard at this step's call site"
+ title={t.flows.guardTitleStep}
>
{formatGuard(guard)}
</span>
diff --git a/graph-ui/src/components/FlowsTab.zh.test.tsx b/graph-ui/src/components/FlowsTab.zh.test.tsx
new file mode 100644
index 000000000..1d5d32692
--- /dev/null
+++ b/graph-ui/src/components/FlowsTab.zh.test.tsx
@@ -0,0 +1,56 @@
+/* @vitest-environment jsdom */
+/* The zh locale reaches the tab exactly as it does in production: the
+ * /api/ui-config override that detectLanguage honours (see i18n.test.ts).
+ * The i18n module caches the resolved language per module registry, so the
+ * zh render lives in its own file — FlowsTab.observed.test.tsx stays English. */
+import "@testing-library/jest-dom/vitest";
+import { render, screen } from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vitest";
+import { FlowsTab } from "./FlowsTab";
+
+describe("FlowsTab (zh locale)", () => {
+ afterEach(() => {
+ vi.unstubAllGlobals();
+ });
+
+ it("renders the chrome — headings, pickers, counts, empty states — in Chinese", async () => {
+ vi.stubGlobal(
+ "fetch",
+ vi.fn().mockImplementation((url: string) => {
+ if (String(url).includes("/api/ui-config")) {
+ return Promise.resolve({ json: () => Promise.resolve({ lang: "zh" }) });
+ }
+ /* /api/flows — no journeys, so the empty states render too. */
+ return Promise.resolve({
+ ok: true,
+ json: () =>
+ Promise.resolve({ flows: [], callable_total: 1234, candidates_dropped: 5 }),
+ });
+ }),
+ );
+ render(
+ <FlowsTab
+ project="demo"
+ flowId={null}
+ onOpenFlow={() => {}}
+ onOpenSymbol={() => {}}
+ onOpenWiki={() => {}}
+ />,
+ );
+
+ expect(await screen.findByText("追踪 A → B")).toBeInTheDocument();
+ expect(screen.getByText("流程——入口 → 终点")).toBeInTheDocument();
+ /* The counts line keeps en-US number formatting; the dropped tail rides along. */
+ expect(
+ screen.getByText("1,234 个可调用符号中走出 0 条调用链路 · 5 个候选未遍历"),
+ ).toBeInTheDocument();
+ expect(
+ screen.getByText("未检测到流程——项目可能没有明确的入口点。"),
+ ).toBeInTheDocument();
+ expect(screen.getByText("在左侧选择一条调用链路")).toBeInTheDocument();
+ /* Placeholders and the mode toggle come from the zh catalog too. */
+ expect(screen.getByPlaceholderText("起点符号…")).toBeInTheDocument();
+ expect(screen.getByPlaceholderText("终点符号…")).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: "控制流" })).toBeInTheDocument();
+ });
+});
diff --git a/graph-ui/src/components/OverviewTab.tsx b/graph-ui/src/components/OverviewTab.tsx
index f5093bd1f..c32b29773 100644
--- a/graph-ui/src/components/OverviewTab.tsx
+++ b/graph-ui/src/components/OverviewTab.tsx
@@ -27,7 +27,7 @@ import {
type QuestionStatus,
type QuestionTab,
} from "../lib/questions";
-import { messages, useUiLanguage } from "../lib/i18n";
+import { messages, useUiLanguage, useUiMessages } from "../lib/i18n";
import { AddToPromptButton } from "./PromptBasket";
import type { RegionsPayload } from "../lib/types";
@@ -257,6 +257,7 @@ function QuestionIndex({ onOpenTab }: { onOpenTab: (tab: QuestionTab) => void })
* value invites misreading (0.4 can be the tightest region on the map or
* the loosest). This region's dot is emphasized; the tick is the median. */
function CohesionStrip({ values, own }: { values: number[]; own: number }) {
+ const t = useUiMessages();
if (values.length < 2) return null;
const sorted = [...values].sort((a, b) => a - b);
const mid = Math.floor(sorted.length / 2);
@@ -270,7 +271,7 @@ function CohesionStrip({ values, own }: { values: number[]; own: number }) {
viewBox="0 0 120 14"
className="shrink-0"
role="img"
- aria-label={`cohesion ${own.toFixed(2)} among ${values.length} regions, median ${median.toFixed(2)}`}
+ aria-label={t.overview.cohesionAria(own, values.length, median)}
>
<title>{`p50 = ${median.toFixed(2)}`}</title>
<line
@@ -307,6 +308,7 @@ export function OverviewTab({
onOpenDashboard,
onOpenTab,
}: OverviewTabProps) {
+ const t = useUiMessages();
const [arch, setArch] = useState<ArchitectureJson | null>(null);
const [regions, setRegions] = useState<RegionsPayload | null>(null);
const [metrics, setMetrics] = useState<MetricsLite | null>(null);
@@ -437,7 +439,7 @@ export function OverviewTab({
if (!arch && !regions) {
return (
<div className="flex items-center justify-center h-full">
- <p className="text-foreground/45 text-sm">Reading the map…</p>
+ <p className="text-foreground/45 text-sm">{t.overview.loading}</p>
</div>
);
}
@@ -451,9 +453,9 @@ export function OverviewTab({
target="_blank"
rel="noreferrer"
className="text-[12px] text-foreground/45 hover:text-primary transition-colors"
- title="A self-contained, shareable document explaining this codebase — generated from the graph, print-friendly"
+ title={t.overview.handoutTitle}
>
- Handout ↗
+ {t.overview.handout}
</a>
</div>
@@ -463,43 +465,46 @@ export function OverviewTab({
{/* The four slots: is anything wrong? */}
<div className="grid grid-cols-2 lg:grid-cols-4 gap-3 mb-5">
<Slot
- label="Needs attention"
+ label={t.overview.needsAttention}
value={
attention === null
? metrics?.churn_available === false
? "—"
: "…"
- : `${attention} file${attention === 1 ? "" : "s"}`
+ : t.overview.filesCount(attention)
}
sub={
attention === null
- ? "churn unavailable without git history"
- : "concentrate the churn × complexity risk"
+ ? t.overview.churnUnavailable
+ : t.overview.concentrateRisk
}
tone={attention !== null && attention > 0 ? "warn" : undefined}
onClick={onOpenDashboard}
/>
<Slot
- label="Direction"
- value={direction ? direction.text : "first index"}
- sub={direction ? "since the previous index" : "trends appear after the next reindex"}
+ label={t.overview.direction}
+ value={direction ? direction.text : t.overview.firstIndex}
+ sub={direction ? t.overview.sincePrevIndex : t.overview.trendsAfterReindex}
tone={direction?.worsening ? "warn" : "quiet"}
/>
<Slot
- label="Riskiest area"
+ label={t.overview.riskiestArea}
value={riskiest?.file?.split("/").slice(-1)[0] ?? "—"}
sub={
riskiest
- ? `${riskiest.commits ?? "?"} commits this year × high complexity — ${riskiest.file}`
- : "no complex churning files"
+ ? t.overview.riskiestSub(riskiest.commits ?? "?", riskiest.file ?? "")
+ : t.overview.noComplexChurn
}
tone={riskiest ? "crit" : undefined}
onClick={onOpenDashboard}
/>
<Slot
- label="Trust"
- value={`${metrics?.totals.missed_files ?? 0} files missed`}
- sub={`index ${metrics?.generated_from?.slice(0, 10) ?? "…"} · ${regions?.unmapped_nodes ?? 0} unmapped symbols`}
+ label={t.overview.trust}
+ value={t.overview.filesMissed(metrics?.totals.missed_files ?? 0)}
+ sub={t.overview.trustSub(
+ metrics?.generated_from?.slice(0, 10) ?? "…",
+ regions?.unmapped_nodes ?? 0,
+ )}
tone="quiet"
/>
</div>
@@ -509,11 +514,11 @@ export function OverviewTab({
<div className="mb-5">
<div className="flex items-baseline gap-3 mb-2">
<p className="text-[12px] uppercase tracking-widest text-foreground/40">
- Findings
+ {t.overview.findings}
</p>
{dismissedCount > 0 && (
<span className="text-[12px] text-foreground/30">
- {dismissedCount} dismissed
+ {t.overview.dismissed(dismissedCount)}
</span>
)}
</div>
@@ -526,9 +531,9 @@ export function OverviewTab({
<div className="flex-1 min-w-0">
<p className="text-[14px] text-foreground/85">
<span className="font-medium">{coupling.source.name}</span>
- <span className="text-foreground/40"> and </span>
+ <span className="text-foreground/40">{t.overview.couplingAnd}</span>
<span className="font-medium">{coupling.target.name}</span>
- <span className="text-foreground/40"> are unusually coupled</span>
+ <span className="text-foreground/40">{t.overview.couplingSuffix}</span>
</p>
<p className="text-[12px] text-foreground/45 mt-0.5">
{coupling.reasons.join(" · ")}
@@ -538,7 +543,7 @@ export function OverviewTab({
onClick={() => onOpenRegion(coupling.source.id)}
className="text-[12px] text-primary/80 hover:text-primary shrink-0 transition-colors"
>
- inspect
+ {t.overview.inspect}
</button>
<button
onClick={() => {
@@ -546,9 +551,9 @@ export function OverviewTab({
setDismissedTick((tick) => tick + 1);
}}
className="text-[12px] text-foreground/30 hover:text-foreground/60 shrink-0 transition-colors"
- title="Dismiss as intended — re-alerts if the coupling grows an order of magnitude"
+ title={t.overview.intendedTitle}
>
- intended
+ {t.overview.intended}
</button>
</div>
))}
@@ -560,7 +565,7 @@ export function OverviewTab({
{questions.length > 0 && (
<div className="mb-5">
<p className="text-[12px] uppercase tracking-widest text-foreground/40 mb-2">
- Questions this graph can answer — ask your agent
+ {t.overview.questionsHeading}
</p>
<div className="grid grid-cols-1 md:grid-cols-2 gap-2">
{questions.map((question) => (
@@ -590,7 +595,7 @@ export function OverviewTab({
<div className="mb-5">
<div className="flex items-baseline justify-between mb-2">
<p className="text-[12px] uppercase tracking-widest text-foreground/40">
- Regions — the de-facto modules ({regions?.method ?? "…"})
+ {t.overview.regionsHeading(regions?.method ?? "…")}
</p>
{hiddenTestRegions > 0 && (
<button
@@ -598,8 +603,8 @@ export function OverviewTab({
className="text-[12px] text-foreground/40 hover:text-foreground/70 transition-colors"
>
{includeTests
- ? "hide test code"
- : `${hiddenTestRegions} test region${hiddenTestRegions > 1 ? "s" : ""} hidden — show`}
+ ? t.overview.hideTestCode
+ : t.overview.testRegionsHidden(hiddenTestRegions)}
</button>
)}
</div>
@@ -621,8 +626,7 @@ export function OverviewTab({
</div>
<div className="flex items-center gap-2">
<p className="text-[12px] text-foreground/45 truncate tabular-nums flex-1 min-w-0">
- {region.members.toLocaleString("en-US")} symbols · cohesion{" "}
- {region.cohesion.toFixed(2)}
+ {t.overview.regionMeta(region.members, region.cohesion)}
</p>
<CohesionStrip
values={displayRegions.map((r) => r.cohesion)}
@@ -642,7 +646,7 @@ export function OverviewTab({
onClick={onOpenModules}
className="mt-2 text-[13px] text-primary/80 hover:text-primary transition-colors"
>
- all {displayRegions.length} regions in Modules →
+ {t.overview.allRegions(displayRegions.length)}
</button>
)}
</div>
@@ -652,7 +656,7 @@ export function OverviewTab({
{bridges.length > 0 && (
<div className="bg-card border border-border/40 rounded-md p-4 mb-5">
<p className="text-[12px] uppercase tracking-widest text-foreground/40 mb-2">
- Boundary spanners — code that reaches into many regions
+ {t.overview.bridgesHeading}
</p>
{bridges.map((bridge) => (
<div key={bridge.id} className="flex items-center gap-2 py-[3px]">
@@ -664,14 +668,12 @@ export function OverviewTab({
{bridge.name}
</button>
<span className="text-[12px] text-foreground/40 tabular-nums ml-auto shrink-0">
- {bridge.regions} regions · {bridge.cross_calls.toLocaleString("en-US")}{" "}
- cross calls
+ {t.overview.bridgeMeta(bridge.regions, bridge.cross_calls)}
</span>
</div>
))}
<p className="text-[12px] text-foreground/35 mt-1.5">
- Changes here ripple across regions — mention these names when a task spans
- areas.
+ {t.overview.bridgesFootnote}
</p>
</div>
)}
@@ -679,12 +681,12 @@ export function OverviewTab({
{/* Reference — one disclosure away, never shouting. */}
<details className="mb-5">
<summary className="cursor-pointer text-[12px] uppercase tracking-widest text-foreground/40 hover:text-foreground/60 transition-colors select-none">
- Reference — hubs, entry points, boundaries
+ {t.overview.referenceSummary}
</summary>
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 mt-3">
<div className="bg-card border border-border/40 rounded-md p-4">
<p className="text-[12px] uppercase tracking-widest text-foreground/40 mb-2">
- Hubs — highest fan-in
+ {t.overview.hubsHeading}
</p>
{hotspots.slice(0, 8).map((hotspot) => (
<div key={hotspot.qn} className="flex items-center gap-2 py-[3px]">
@@ -701,12 +703,12 @@ export function OverviewTab({
</div>
))}
{hotspots.length === 0 && (
- <p className="text-[13px] text-foreground/40">No hotspot data.</p>
+ <p className="text-[13px] text-foreground/40">{t.overview.noHotspots}</p>
)}
</div>
<div className="bg-card border border-border/40 rounded-md p-4">
<p className="text-[12px] uppercase tracking-widest text-foreground/40 mb-2">
- Entry points
+ {t.overview.entryPoints}
</p>
{entries.slice(0, 8).map((entry) => (
<button
@@ -727,12 +729,12 @@ export function OverviewTab({
onClick={onOpenFlows}
className="mt-2 text-[12px] text-primary/80 hover:text-primary transition-colors"
>
- follow them in Flows →
+ {t.overview.followFlows}
</button>
</div>
<div className="bg-card border border-border/40 rounded-md p-4 md:col-span-2 overflow-x-auto">
<p className="text-[12px] uppercase tracking-widest text-foreground/40 mb-2">
- Boundaries — cross-package calls
+ {t.overview.boundariesHeading}
</p>
<table className="w-full text-[13px]">
<tbody>
@@ -750,7 +752,7 @@ export function OverviewTab({
</tbody>
</table>
{boundaries.length === 0 && (
- <p className="text-[13px] text-foreground/40">No cross-package calls recorded.</p>
+ <p className="text-[13px] text-foreground/40">{t.overview.noBoundaries}</p>
)}
</div>
</div>
@@ -758,9 +760,12 @@ export function OverviewTab({
{/* Inventory footer — facts, untoned. */}
<p className="text-[12px] text-foreground/35 tabular-nums border-t border-border/40 pt-3">
- {totalNodes?.toLocaleString("en-US") ?? "…"} symbols ·{" "}
- {totalEdges?.toLocaleString("en-US") ?? "…"} edges ·{" "}
- {regions?.regions.length ?? "…"} regions ·{" "}
+ {t.overview.inventory(
+ totalNodes?.toLocaleString("en-US") ?? "…",
+ totalEdges?.toLocaleString("en-US") ?? "…",
+ `${regions?.regions.length ?? "…"}`,
+ )}{" "}
+ ·{" "}
{languages
.slice(0, 4)
.map((lang) => lang.language)
diff --git a/graph-ui/src/components/SymbolTab.tsx b/graph-ui/src/components/SymbolTab.tsx
index 77076d21b..325a2dbf6 100644
--- a/graph-ui/src/components/SymbolTab.tsx
+++ b/graph-ui/src/components/SymbolTab.tsx
@@ -59,6 +59,7 @@ function ConnectionList({
onOpenSymbol: (ref: { id?: number; qn?: string }) => void;
onOpenWiki: (slug: string) => void;
}) {
+ const t = useUiMessages();
const shown = page.offset + page.items.length;
/* A utility called from everywhere would carry a dot on every row — the
* signal inverts into noise. Past half, say it once instead. */
@@ -77,9 +78,9 @@ function ConnectionList({
{!dotsUseful && crossCount > 0 && (
<span
className="text-[12px] text-foreground/40"
- title="most of these live in other regions — the cross-seam dot is omitted because it would mark nearly every row"
+ title={t.symbol.crossRegionsTitle}
>
- {crossCount} of {page.items.length} cross regions
+ {t.symbol.crossRegions(crossCount, page.items.length)}
</span>
)}
<span className="text-[12px] text-foreground/40 ml-auto">
@@ -111,7 +112,7 @@ function ConnectionList({
item.region !== homeRegion && (
<span
className="w-[6px] h-[6px] rounded-full bg-primary/70 shrink-0"
- title="in another region — this edge crosses an architectural seam"
+ title={t.symbol.crossSeamDotTitle}
/>
)}
<span className="text-[12px] text-foreground/35 truncate ml-auto shrink-0 max-w-[45%]">
@@ -120,7 +121,7 @@ function ConnectionList({
</button>
))}
{page.items.length === 0 && (
- <p className="text-[13px] text-foreground/40 px-2 py-2">None.</p>
+ <p className="text-[13px] text-foreground/40 px-2 py-2">{t.symbol.none}</p>
)}
</div>
{shown < page.total && (
@@ -129,11 +130,11 @@ function ConnectionList({
onClick={onLoadMore}
className="mt-1.5 px-2 text-[12px] text-primary/70 hover:text-primary transition-colors"
>
- Show more ({(page.total - shown).toLocaleString("en-US")} hidden)
+ {t.symbol.showMore(page.total - shown)}
</button>
{(page.overflow_by_file?.length ?? 0) > 0 && (
<div className="mt-1 px-2">
- <p className="text-[12px] text-foreground/35 mb-0.5">hidden, by file:</p>
+ <p className="text-[12px] text-foreground/35 mb-0.5">{t.symbol.hiddenByFile}</p>
{page.overflow_by_file!.map((row) => (
<p
key={row.file}
@@ -296,7 +297,7 @@ export function SymbolTab({
if (!bundle) {
return (
<div className="flex items-center justify-center h-full">
- <p className="text-foreground/45 text-sm">Loading symbol…</p>
+ <p className="text-foreground/45 text-sm">{t.symbol.loading}</p>
</div>
);
}
@@ -320,16 +321,12 @@ export function SymbolTab({
const impactTiers =
impact && impact.reachable > 0
? [
- `${impactDirect.toLocaleString("en-US")} direct caller${impactDirect === 1 ? "" : "s"}`,
+ t.impact.directCallers(impactDirect),
...(impact.max_distance >= 2
- ? [
- `${(impactDirect + (impact.by_distance[1] ?? 0)).toLocaleString("en-US")} within 2 hops`,
- ]
+ ? [t.impact.withinTwoHops(impactDirect + (impact.by_distance[1] ?? 0))]
: []),
...(impact.max_distance > 2
- ? [
- `${impact.reachable.toLocaleString("en-US")} total within ${impact.max_depth}`,
- ]
+ ? [t.impact.totalWithin(impact.reachable, impact.max_depth)]
: []),
].join(" · ")
: null;
@@ -382,17 +379,17 @@ export function SymbolTab({
</span>
{node.is_entry && (
<span className="px-2 py-0.5 rounded-md text-[12px] bg-emerald-400/10 text-emerald-300/80">
- entry point
+ {t.symbol.entryPoint}
</span>
)}
{node.is_test && (
<span className="px-2 py-0.5 rounded-md text-[12px] bg-surface-3 text-foreground/50">
- test
+ {t.symbol.testFlag}
</span>
)}
{node.is_exported && (
<span className="px-2 py-0.5 rounded-md text-[12px] bg-sky-400/10 text-sky-300/80">
- exported
+ {t.symbol.exported}
</span>
)}
<div className="ml-auto flex gap-2 items-center">
@@ -426,12 +423,12 @@ export function SymbolTab({
onClick={() => onOpenRegion(bundle.region!.id)}
className="text-[13px] text-primary/70 hover:text-primary transition-colors"
>
- region: {bundle.region.name ?? bundle.region.id} →
+ {t.symbol.regionLink(`${bundle.region.name ?? bundle.region.id}`)}
</button>
)}
{editorUrl && (
<a href={editorUrl} className="text-[13px] text-foreground/40 hover:text-foreground/70 transition-colors">
- Open in editor ↗
+ {t.symbol.openInEditor}
</a>
)}
{ghUrl && (
@@ -456,7 +453,7 @@ export function SymbolTab({
disabled={codeLoading || !node.qualified_name}
className="px-2.5 py-1 rounded-md bg-primary/15 text-primary text-[13px] font-medium hover:bg-primary/25 transition-colors disabled:opacity-40"
>
- {codeLoading ? "Loading…" : code ? "Hide code" : "Show code"}
+ {codeLoading ? t.common.loading : code ? t.symbol.hideCode : t.symbol.showCode}
</button>
{code && (
<pre className="mt-2 max-h-[360px] overflow-auto rounded-md bg-black/40 border border-border p-3 text-[13px] leading-relaxed font-mono text-foreground/75 whitespace-pre">
@@ -479,7 +476,7 @@ export function SymbolTab({
{/* Connections */}
<div className="grid grid-cols-1 lg:grid-cols-2 gap-4 mb-4">
<ConnectionList
- title="Called by"
+ title={t.symbol.calledBy}
page={bundle.callers}
homeRegion={bundle.region?.id}
onLoadMore={() => setLimit((value) => value + 100)}
@@ -487,7 +484,7 @@ export function SymbolTab({
onOpenWiki={onOpenWiki}
/>
<ConnectionList
- title="Calls"
+ title={t.symbol.calls}
page={bundle.callees}
homeRegion={bundle.region?.id}
onLoadMore={() => setLimit((value) => value + 100)}
@@ -501,7 +498,7 @@ export function SymbolTab({
* (File nodes, …) have no radius; the section stays hidden. */}
{impactError && impactError !== "symbol is not an indexed callable" && (
<p className="text-[13px] text-foreground/40 mb-4">
- Impact unavailable: {impactError}
+ {t.impact.unavailable(impactError)}
</p>
)}
{impact && (
@@ -567,10 +564,7 @@ export function SymbolTab({
))}
</div>
<p className="text-[12px] text-foreground/40 mt-1">
- {impact.tests.count.toLocaleString("en-US")} test
- {impact.tests.count === 1 ? " reaches" : "s reach"} this symbol
- {impact.tests.nearest.length < impact.tests.count &&
- ` — showing ${impact.tests.nearest.length} of ${impact.tests.count.toLocaleString("en-US")}`}
+ {t.impact.testsReach(impact.tests.count, impact.tests.nearest.length)}
</p>
</div>
) : (
@@ -588,17 +582,17 @@ export function SymbolTab({
<div className="grid grid-cols-1 lg:grid-cols-2 gap-4 mb-4">
<div className="bg-card border border-border/50 rounded-md p-4">
<p className="text-[12px] uppercase tracking-widest text-foreground/40 mb-2">
- Recent changes to this file
+ {t.symbol.recentChanges}
</p>
{bundle.file_history?.available === false && (
<p className="text-[13px] text-foreground/40">
- No git history readable for this project.
+ {t.symbol.noGitHistory}
</p>
)}
{bundle.file_history?.available &&
(bundle.file_history.recent?.length ?? 0) === 0 && (
<p className="text-[13px] text-foreground/40">
- Untouched in the last year.
+ {t.symbol.untouchedYear}
</p>
)}
{(bundle.file_history?.recent ?? []).map((commit) => (
@@ -611,17 +605,20 @@ export function SymbolTab({
{bundle.file_history?.available &&
(bundle.file_history.commits_1y ?? 0) > 0 && (
<p className="text-[12px] text-foreground/40 mt-2">
- {bundle.file_history.commits_1y?.toLocaleString("en-US")} commits in the
- last year
+ {t.symbol.commitsLastYear(bundle.file_history.commits_1y ?? 0)}
{bundle.file_history.top_author &&
- ` · mostly ${bundle.file_history.top_author} (${((bundle.file_history.top_author_share ?? 0) * 100).toFixed(0)}% of ${bundle.file_history.authors} author${(bundle.file_history.authors ?? 0) > 1 ? "s" : ""})`}
+ t.symbol.mostlyBy(
+ bundle.file_history.top_author,
+ bundle.file_history.top_author_share ?? 0,
+ bundle.file_history.authors ?? 0,
+ )}
</p>
)}
</div>
{bundle.project_has_data_flows !== false && (
<div className="bg-card border border-border/50 rounded-md p-4">
<p className="text-[12px] uppercase tracking-widest text-foreground/40 mb-2">
- Data flows
+ {t.symbol.dataFlows}
</p>
{(["data_in", "data_out"] as const).map((direction) => {
const flows: DataFlowRef[] = bundle[direction] ?? [];
@@ -629,7 +626,7 @@ export function SymbolTab({
return (
<div key={direction} className="mb-2">
<p className="text-[12px] text-foreground/35 mb-1">
- {direction === "data_in" ? "receives from" : "feeds into"}
+ {direction === "data_in" ? t.symbol.receivesFrom : t.symbol.feedsInto}
</p>
{flows.map((flow) => (
<button
@@ -656,7 +653,7 @@ export function SymbolTab({
{(bundle.data_in ?? []).length === 0 &&
(bundle.data_out ?? []).length === 0 && (
<p className="text-[13px] text-foreground/40">
- No DATA_FLOWS edges touch this symbol.
+ {t.symbol.noDataFlows}
</p>
)}
</div>
@@ -784,7 +781,7 @@ export function SymbolTab({
<div className="bg-card border border-border/40 rounded-md p-4">
<p className="text-[12px] uppercase tracking-widest text-foreground/45 mb-2">
<MetricChip slug="tested" onOpen={onOpenWiki}>
- Tested by
+ {t.symbol.testedBy}
</MetricChip>
</p>
{(bundle.tests ?? []).map((test: SymbolRef) => (
@@ -797,14 +794,14 @@ export function SymbolTab({
</button>
))}
{(bundle.tests ?? []).length === 0 && (
- <p className="text-[13px] text-amber-300/50">No TESTS edges reach this symbol.</p>
+ <p className="text-[13px] text-amber-300/50">{t.symbol.noTests}</p>
)}
</div>
<div className="bg-card border border-border/40 rounded-md p-4">
<p className="text-[12px] uppercase tracking-widest text-foreground/45 mb-2">
<MetricChip slug="co-change" onOpen={onOpenWiki}>
- Changes together with
+ {t.symbol.changesTogether}
</MetricChip>
</p>
{(bundle.co_change ?? []).map((partner) => (
@@ -816,13 +813,13 @@ export function SymbolTab({
</p>
))}
{(bundle.co_change ?? []).length === 0 && (
- <p className="text-[13px] text-foreground/40">No co-change history.</p>
+ <p className="text-[13px] text-foreground/40">{t.symbol.noCoChange}</p>
)}
</div>
<div className="bg-card border border-border/40 rounded-md p-4">
<p className="text-[12px] uppercase tracking-widest text-foreground/45 mb-2">
- Near-clones
+ {t.symbol.nearClones}
</p>
{(bundle.similar ?? []).map((clone) => (
<button
@@ -837,7 +834,7 @@ export function SymbolTab({
</button>
))}
{(bundle.similar ?? []).length === 0 && (
- <p className="text-[13px] text-foreground/40">No near-clones.</p>
+ <p className="text-[13px] text-foreground/40">{t.symbol.noNearClones}</p>
)}
</div>
</div>
diff --git a/graph-ui/src/components/WikiPanel.tsx b/graph-ui/src/components/WikiPanel.tsx
index 0eeff29ec..18d361176 100644
--- a/graph-ui/src/components/WikiPanel.tsx
+++ b/graph-ui/src/components/WikiPanel.tsx
@@ -102,7 +102,7 @@ export function WikiPanel({ slug, onClose, onNavigate }: WikiPanelProps) {
{!entry || !view ? (
<p className="text-[13px] text-foreground/40 px-4 py-6">
- No wiki entry for “{slug}”.
+ {t.wiki.noEntry(slug)}
</p>
) : (
<ScrollArea className="flex-1 min-h-0">
diff --git a/graph-ui/src/lib/i18n.ts b/graph-ui/src/lib/i18n.ts
index 8872f961f..ee204f950 100644
--- a/graph-ui/src/lib/i18n.ts
+++ b/graph-ui/src/lib/i18n.ts
@@ -79,6 +79,7 @@ export const messages = {
back: "Back",
close: "Close",
clickForMore: "click for more →",
+ noEntry: (slug: string) => `No wiki entry for “${slug}”.`,
},
questions: {
title: "What can Atlas answer?",
@@ -101,6 +102,16 @@ export const messages = {
"⚠ No test reaches this symbol — nothing will catch a regression here automatically.",
basisFootnote:
"Static CALLS edges only — dynamic dispatch and reflection are not counted; treat the count as a floor.",
+ unavailable: (reason: string) => `Impact unavailable: ${reason}`,
+ directCallers: (n: number) =>
+ `${n.toLocaleString("en-US")} direct caller${n === 1 ? "" : "s"}`,
+ withinTwoHops: (n: number) => `${n.toLocaleString("en-US")} within 2 hops`,
+ totalWithin: (n: number, depth: number) =>
+ `${n.toLocaleString("en-US")} total within ${depth}`,
+ testsReach: (count: number, shown: number) =>
+ `${count.toLocaleString("en-US")} test${count === 1 ? " reaches" : "s reach"} this symbol${
+ shown < count ? ` — showing ${shown} of ${count.toLocaleString("en-US")}` : ""
+ }`,
},
history: {
whyHere: "Why is this here?",
@@ -138,6 +149,134 @@ export const messages = {
`Runtime markers from recorded runs (${label}). Unmarked hops are possible, not dead — runs only cover what they exercised.`,
title: (label: string, date: string) => `ran in ${label} · last ${date}`,
},
+ symbol: {
+ loading: "Loading symbol…",
+ calledBy: "Called by",
+ calls: "Calls",
+ none: "None.",
+ showMore: (n: number) => `Show more (${n.toLocaleString("en-US")} hidden)`,
+ hiddenByFile: "hidden, by file:",
+ crossRegions: (cross: number, total: number) => `${cross} of ${total} cross regions`,
+ crossRegionsTitle:
+ "most of these live in other regions — the cross-seam dot is omitted because it would mark nearly every row",
+ crossSeamDotTitle: "in another region — this edge crosses an architectural seam",
+ entryPoint: "entry point",
+ testFlag: "test",
+ exported: "exported",
+ regionLink: (name: string) => `region: ${name} →`,
+ openInEditor: "Open in editor ↗",
+ showCode: "Show code",
+ hideCode: "Hide code",
+ recentChanges: "Recent changes to this file",
+ noGitHistory: "No git history readable for this project.",
+ untouchedYear: "Untouched in the last year.",
+ commitsLastYear: (n: number) =>
+ `${n.toLocaleString("en-US")} commits in the last year`,
+ mostlyBy: (author: string, share: number, authors: number) =>
+ ` · mostly ${author} (${(share * 100).toFixed(0)}% of ${authors} author${authors > 1 ? "s" : ""})`,
+ dataFlows: "Data flows",
+ receivesFrom: "receives from",
+ feedsInto: "feeds into",
+ noDataFlows: "No DATA_FLOWS edges touch this symbol.",
+ testedBy: "Tested by",
+ noTests: "No TESTS edges reach this symbol.",
+ changesTogether: "Changes together with",
+ noCoChange: "No co-change history.",
+ nearClones: "Near-clones",
+ noNearClones: "No near-clones.",
+ },
+ flows: {
+ loading: "Tracing the journeys…",
+ traceHeading: "Trace A → B",
+ fromPlaceholder: "from symbol…",
+ toPlaceholder: "to symbol…",
+ modeControl: "control",
+ modeData: "data",
+ modeTitle: "Follow control flow (CALLS) or data flow (DATA_FLOWS)",
+ traceButton: "trace",
+ traceFailed: "trace failed",
+ reachableIn: (hops: number, viaData: boolean) =>
+ `reachable in ${hops} hop${hops === 1 ? "" : "s"} via ${viaData ? "data flow" : "calls"}`,
+ notReachable: (maxDepth: number, viaData: boolean, explored?: number) =>
+ `not reachable within ${maxDepth} hops (${viaData ? "data flow" : "calls"}; ${explored?.toLocaleString("en-US") ?? ""} nodes explored)`,
+ guardTitleHop: "syntactic guard at this hop's call site",
+ guardTitleStep: "syntactic guard at this step's call site",
+ listHeading: "Flows — entry → terminal",
+ summary: (flows: number, callables: number, dropped: number) =>
+ `${flows} journeys from ${callables.toLocaleString("en-US")} callables${
+ dropped > 0 ? ` · ${dropped.toLocaleString("en-US")} candidates not walked` : ""
+ }`,
+ acrossRegions: "across regions",
+ withinOneRegion: "within one region",
+ depthCapTitle: "walk stopped at the depth cap, not at a sink",
+ collapse: "− collapse",
+ showAll: (n: number, entry: string) => `× ${n} journeys from ${entry} — show all`,
+ noFlows: "No flows detected — the project may have no clear entry points.",
+ pickJourney: "Pick a journey on the left",
+ copied: "Copied ✓",
+ copyMermaid: "Copy as mermaid",
+ stepsCount: (n: number) => `${n} steps`,
+ endsAtSink: "ends at a sink",
+ stoppedAtCap: "stopped at the depth cap",
+ crossesRegions: "crosses regions",
+ branchesBeyondCap: (n: number) => `${n} branches beyond the cap not shown`,
+ resolverConfidence: (pct: number) =>
+ `resolver confidence ${pct}% — this hop may be misresolved`,
+ },
+ overview: {
+ loading: "Reading the map…",
+ handout: "Handout ↗",
+ handoutTitle:
+ "A self-contained, shareable document explaining this codebase — generated from the graph, print-friendly",
+ needsAttention: "Needs attention",
+ filesCount: (n: number) => `${n} file${n === 1 ? "" : "s"}`,
+ churnUnavailable: "churn unavailable without git history",
+ concentrateRisk: "concentrate the churn × complexity risk",
+ direction: "Direction",
+ firstIndex: "first index",
+ sincePrevIndex: "since the previous index",
+ trendsAfterReindex: "trends appear after the next reindex",
+ riskiestArea: "Riskiest area",
+ riskiestSub: (commits: string | number, file: string) =>
+ `${commits} commits this year × high complexity — ${file}`,
+ noComplexChurn: "no complex churning files",
+ trust: "Trust",
+ filesMissed: (n: number) => `${n} files missed`,
+ trustSub: (date: string, unmapped: number) =>
+ `index ${date} · ${unmapped} unmapped symbols`,
+ findings: "Findings",
+ dismissed: (n: number) => `${n} dismissed`,
+ couplingAnd: " and ",
+ couplingSuffix: " are unusually coupled",
+ inspect: "inspect",
+ intended: "intended",
+ intendedTitle:
+ "Dismiss as intended — re-alerts if the coupling grows an order of magnitude",
+ questionsHeading: "Questions this graph can answer — ask your agent",
+ regionsHeading: (method: string) => `Regions — the de-facto modules (${method})`,
+ hideTestCode: "hide test code",
+ testRegionsHidden: (n: number) =>
+ `${n} test region${n > 1 ? "s" : ""} hidden — show`,
+ regionMeta: (members: number, cohesion: number) =>
+ `${members.toLocaleString("en-US")} symbols · cohesion ${cohesion.toFixed(2)}`,
+ cohesionAria: (own: number, count: number, median: number) =>
+ `cohesion ${own.toFixed(2)} among ${count} regions, median ${median.toFixed(2)}`,
+ allRegions: (n: number) => `all ${n} regions in Modules →`,
+ bridgesHeading: "Boundary spanners — code that reaches into many regions",
+ bridgeMeta: (regions: number, calls: number) =>
+ `${regions} regions · ${calls.toLocaleString("en-US")} cross calls`,
+ bridgesFootnote:
+ "Changes here ripple across regions — mention these names when a task spans areas.",
+ referenceSummary: "Reference — hubs, entry points, boundaries",
+ hubsHeading: "Hubs — highest fan-in",
+ noHotspots: "No hotspot data.",
+ entryPoints: "Entry points",
+ followFlows: "follow them in Flows →",
+ boundariesHeading: "Boundaries — cross-package calls",
+ noBoundaries: "No cross-package calls recorded.",
+ inventory: (symbols: string, edges: string, regions: string) =>
+ `${symbols} symbols · ${edges} edges · ${regions} regions`,
+ },
control: {
panel: "Control Panel",
totalCpu: "Total CPU",
@@ -228,6 +367,7 @@ export const messages = {
back: "返回",
close: "关闭",
clickForMore: "点击查看更多 →",
+ noEntry: (slug: string) => `没有 “${slug}” 的 wiki 词条。`,
},
questions: {
title: "Atlas 能回答什么?",
@@ -250,6 +390,15 @@ export const messages = {
"⚠ 没有任何测试到达这个符号——出了回归不会被自动发现。",
basisFootnote:
"仅统计静态 CALLS 边——动态分发与反射不计入;请把数字当作下限。",
+ unavailable: (reason: string) => `影响不可用:${reason}`,
+ directCallers: (n: number) => `${n.toLocaleString("en-US")} 个直接调用者`,
+ withinTwoHops: (n: number) => `2 跳内 ${n.toLocaleString("en-US")} 个`,
+ totalWithin: (n: number, depth: number) =>
+ `${depth} 跳内共 ${n.toLocaleString("en-US")} 个`,
+ testsReach: (count: number, shown: number) =>
+ `${count.toLocaleString("en-US")} 个测试到达这个符号${
+ shown < count ? `——显示其中 ${shown} 个` : ""
+ }`,
},
history: {
whyHere: "为什么会有这段代码?",
@@ -284,6 +433,132 @@ export const messages = {
`运行时标记来自录制的运行(${label})。未标记的跳步只是可能执行,不代表死代码——一次运行只覆盖它实际执行到的部分。`,
title: (label: string, date: string) => `曾在 ${label} 中执行 · 最近 ${date}`,
},
+ symbol: {
+ loading: "正在加载符号…",
+ calledBy: "调用者",
+ calls: "被调用者",
+ none: "无。",
+ showMore: (n: number) => `显示更多(还有 ${n.toLocaleString("en-US")} 条)`,
+ hiddenByFile: "未显示的,按文件:",
+ crossRegions: (cross: number, total: number) => `${cross}/${total} 跨区域`,
+ crossRegionsTitle:
+ "其中大多数位于其他区域——逐行标注跨界点会标记几乎每一行,故省略",
+ crossSeamDotTitle: "位于另一个区域——这条边跨越了架构边界",
+ entryPoint: "入口点",
+ testFlag: "测试",
+ exported: "已导出",
+ regionLink: (name: string) => `区域:${name} →`,
+ openInEditor: "在编辑器中打开 ↗",
+ showCode: "显示代码",
+ hideCode: "隐藏代码",
+ recentChanges: "此文件的近期变更",
+ noGitHistory: "这个项目没有可读的 git 历史。",
+ untouchedYear: "最近一年未改动。",
+ commitsLastYear: (n: number) => `最近一年提交 ${n.toLocaleString("en-US")} 次`,
+ mostlyBy: (author: string, share: number, authors: number) =>
+ ` · 主要来自 ${author}(占 ${authors} 位作者提交的 ${(share * 100).toFixed(0)}%)`,
+ dataFlows: "数据流",
+ receivesFrom: "接收自",
+ feedsInto: "输出到",
+ noDataFlows: "没有 DATA_FLOWS 边触及这个符号。",
+ testedBy: "覆盖它的测试",
+ noTests: "没有 TESTS 边到达这个符号。",
+ changesTogether: "共同变更",
+ noCoChange: "没有共同变更历史。",
+ nearClones: "近似克隆",
+ noNearClones: "没有近似克隆。",
+ },
+ flows: {
+ loading: "正在追踪调用链路…",
+ traceHeading: "追踪 A → B",
+ fromPlaceholder: "起点符号…",
+ toPlaceholder: "终点符号…",
+ modeControl: "控制流",
+ modeData: "数据流",
+ modeTitle: "沿控制流(CALLS)或数据流(DATA_FLOWS)追踪",
+ traceButton: "追踪",
+ traceFailed: "追踪失败",
+ reachableIn: (hops: number, viaData: boolean) =>
+ `经${viaData ? "数据流" : "调用"} ${hops} 跳可达`,
+ notReachable: (maxDepth: number, viaData: boolean, explored?: number) =>
+ `${maxDepth} 跳内不可达(${viaData ? "数据流" : "调用"};已探索 ${explored?.toLocaleString("en-US") ?? ""} 个节点)`,
+ guardTitleHop: "这一跳调用点上的语法守卫",
+ guardTitleStep: "这一步调用点上的语法守卫",
+ listHeading: "流程——入口 → 终点",
+ summary: (flows: number, callables: number, dropped: number) =>
+ `${callables.toLocaleString("en-US")} 个可调用符号中走出 ${flows} 条调用链路${
+ dropped > 0 ? ` · ${dropped.toLocaleString("en-US")} 个候选未遍历` : ""
+ }`,
+ acrossRegions: "跨区域",
+ withinOneRegion: "单一区域内",
+ depthCapTitle: "遍历止步于深度上限,而非汇点",
+ collapse: "− 收起",
+ showAll: (n: number, entry: string) =>
+ `× 来自 ${entry} 的 ${n} 条调用链路——全部显示`,
+ noFlows: "未检测到流程——项目可能没有明确的入口点。",
+ pickJourney: "在左侧选择一条调用链路",
+ copied: "已复制 ✓",
+ copyMermaid: "复制为 mermaid",
+ stepsCount: (n: number) => `${n} 步`,
+ endsAtSink: "终止于汇点",
+ stoppedAtCap: "止步于深度上限",
+ crossesRegions: "跨区域",
+ branchesBeyondCap: (n: number) => `超出上限的 ${n} 个分支未显示`,
+ resolverConfidence: (pct: number) =>
+ `解析置信度 ${pct}%——这一跳可能解析有误`,
+ },
+ overview: {
+ loading: "正在读取地图…",
+ handout: "讲义 ↗",
+ handoutTitle:
+ "一份自包含、可分享的代码库讲解文档——由图谱生成,适合打印",
+ needsAttention: "需要关注",
+ filesCount: (n: number) => `${n} 个文件`,
+ churnUnavailable: "没有 git 历史,无法计算变更频率",
+ concentrateRisk: "集中了变更频率 × 复杂度的风险",
+ direction: "趋势",
+ firstIndex: "首次索引",
+ sincePrevIndex: "相对上一次索引",
+ trendsAfterReindex: "下次重建索引后显示趋势",
+ riskiestArea: "风险最高处",
+ riskiestSub: (commits: string | number, file: string) =>
+ `今年 ${commits} 次提交 × 高复杂度——${file}`,
+ noComplexChurn: "没有高复杂度且频繁变更的文件",
+ trust: "可信度",
+ filesMissed: (n: number) => `漏掉 ${n} 个文件`,
+ trustSub: (date: string, unmapped: number) =>
+ `索引于 ${date} · ${unmapped} 个未映射符号`,
+ findings: "发现",
+ dismissed: (n: number) => `已忽略 ${n} 条`,
+ couplingAnd: " 与 ",
+ couplingSuffix: " 异常耦合",
+ inspect: "查看",
+ intended: "符合预期",
+ intendedTitle: "标记为符合预期并忽略——若耦合增长一个数量级会重新提醒",
+ questionsHeading: "这张图能回答的问题——拿去问你的智能体",
+ regionsHeading: (method: string) => `区域——事实上的模块(${method})`,
+ hideTestCode: "隐藏测试代码",
+ testRegionsHidden: (n: number) => `已隐藏 ${n} 个测试区域——显示`,
+ regionMeta: (members: number, cohesion: number) =>
+ `${members.toLocaleString("en-US")} 个符号 · cohesion ${cohesion.toFixed(2)}`,
+ cohesionAria: (own: number, count: number, median: number) =>
+ `cohesion ${own.toFixed(2)},共 ${count} 个区域,中位数 ${median.toFixed(2)}`,
+ allRegions: (n: number) => `全部 ${n} 个区域,见模块页 →`,
+ bridgesHeading: "跨界符号——伸入多个区域的代码",
+ bridgeMeta: (regions: number, calls: number) =>
+ `${regions} 个区域 · ${calls.toLocaleString("en-US")} 次跨区调用`,
+ bridgesFootnote:
+ "这里的改动会波及多个区域——当任务横跨多个区域时,请提到这些名字。",
+ referenceSummary: "参考——枢纽、入口点、边界",
+ hubsHeading: "枢纽——最高 fan-in",
+ noHotspots: "暂无热点数据。",
+ entryPoints: "入口点",
+ followFlows: "在流程页跟踪它们 →",
+ boundariesHeading: "边界——跨包调用",
+ noBoundaries: "未记录跨包调用。",
+ inventory: (symbols: string, edges: string, regions: string) =>
+ `${symbols} 个符号 · ${edges} 条边 · ${regions} 个区域`,
+ },
control: {
panel: "控制面板",
totalCpu: "总 CPU",
diff --git a/graph-ui/src/lib/questions.ts b/graph-ui/src/lib/questions.ts
index ff4632033..07988f7f0 100644
--- a/graph-ui/src/lib/questions.ts
+++ b/graph-ui/src/lib/questions.ts
@@ -127,7 +127,7 @@ export const QUESTION_FAMILIES: QuestionFamily[] = [
gap: "TESTS-edge reach is shown per symbol; change→test selection is planned",
zh: {
question: "哪些测试覆盖它?",
- hint: "已测符号卡片;每个符号页的 Tested by",
+ hint: "已测符号卡片;每个符号页的“覆盖它的测试”",
gap: "按符号展示 TESTS 边触达;变更→测试选择在计划中",
},
},
diff --git a/graph-ui/tsconfig.tsbuildinfo b/graph-ui/tsconfig.tsbuildinfo
index 468599b00..ec2f4520c 100644
--- a/graph-ui/tsconfig.tsbuildinfo
+++ b/graph-ui/tsconfig.tsbuildinfo
@@ -1 +1 @@
-{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/rpc.ts","./src/components/changestab.tsx","./src/components/commandk.tsx","./src/components/controltab.tsx","./src/components/dashboardtab.tsx","./src/components/displaysettingsmenu.tsx","./src/components/edgelines.tsx","./src/components/errorboundary.tsx","./src/components/filterpanel.tsx","./src/components/flowstab.observed.test.tsx","./src/components/flowstab.tsx","./src/components/graphloader.tsx","./src/components/graphscene.test.ts","./src/components/graphscene.tsx","./src/components/graphtab.deadcode.test.tsx","./src/components/graphtab.filters.test.tsx","./src/components/graphtab.regions.test.tsx","./src/components/graphtab.test.ts","./src/components/graphtab.tsx","./src/components/halolayer.tsx","./src/components/metricchip.tsx","./src/components/minimap.tsx","./src/components/missedcallout.tsx","./src/components/modulestab.tsx","./src/components/nodecloud.tsx","./src/components/nodedetailpanel.showmore.test.tsx","./src/components/nodedetailpanel.test.tsx","./src/components/nodedetailpanel.tsx","./src/components/nodelabels.tsx","./src/components/nodetooltip.tsx","./src/components/overviewtab.tsx","./src/components/projectcard.tsx","./src/components/projectswitcher.tsx","./src/components/promptbasket.tsx","./src/components/regionpanel.tsx","./src/components/regiontooltip.tsx","./src/components/resizehandle.tsx","./src/components/sidebar.tsx","./src/components/statstab.test.tsx","./src/components/statstab.tsx","./src/components/symboltab.tsx","./src/components/tabbar.tsx","./src/components/triggertree.tsx","./src/components/wikihovercard.test.tsx","./src/components/wikihovercard.tsx","./src/components/wikipanel.test.tsx","./src/components/wikipanel.tsx","./src/components/wikipanel.zh.test.tsx","./src/components/wikitier.ts","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/checkbox.tsx","./src/components/ui/input.tsx","./src/components/ui/scroll-area.tsx","./src/components/ui/separator.tsx","./src/hooks/usegraphdata.test.ts","./src/hooks/usegraphdata.ts","./src/hooks/useprojects.ts","./src/lib/atlas.test.ts","./src/lib/atlas.ts","./src/lib/colors.ts","./src/lib/complexity.test.ts","./src/lib/complexity.ts","./src/lib/composer.ts","./src/lib/density.test.ts","./src/lib/density.ts","./src/lib/findings.test.ts","./src/lib/findings.ts","./src/lib/firstread.ts","./src/lib/flowgroup.test.ts","./src/lib/flowgroup.ts","./src/lib/i18n.test.ts","./src/lib/i18n.ts","./src/lib/impact.test.ts","./src/lib/impact.ts","./src/lib/observed.test.ts","./src/lib/observed.ts","./src/lib/questions.test.ts","./src/lib/questions.ts","./src/lib/rationale.test.ts","./src/lib/rationale.ts","./src/lib/regions.test.ts","./src/lib/regions.ts","./src/lib/treemap.ts","./src/lib/types.ts","./src/lib/utils.ts","./src/lib/who.test.ts","./src/lib/who.ts","./src/lib/why.test.ts","./src/lib/why.ts","./src/lib/whyfetch.ts","./src/test/setup.ts","./src/wiki/entries.test.ts","./src/wiki/entries.ts"],"version":"5.9.3"}
\ No newline at end of file
+{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/rpc.ts","./src/components/changestab.tsx","./src/components/commandk.tsx","./src/components/controltab.tsx","./src/components/dashboardtab.tsx","./src/components/displaysettingsmenu.tsx","./src/components/edgelines.tsx","./src/components/errorboundary.tsx","./src/components/filterpanel.tsx","./src/components/flowstab.observed.test.tsx","./src/components/flowstab.tsx","./src/components/flowstab.zh.test.tsx","./src/components/graphloader.tsx","./src/components/graphscene.test.ts","./src/components/graphscene.tsx","./src/components/graphtab.deadcode.test.tsx","./src/components/graphtab.filters.test.tsx","./src/components/graphtab.regions.test.tsx","./src/components/graphtab.test.ts","./src/components/graphtab.tsx","./src/components/halolayer.tsx","./src/components/metricchip.tsx","./src/components/minimap.tsx","./src/components/missedcallout.tsx","./src/components/modulestab.tsx","./src/components/nodecloud.tsx","./src/components/nodedetailpanel.showmore.test.tsx","./src/components/nodedetailpanel.test.tsx","./src/components/nodedetailpanel.tsx","./src/components/nodelabels.tsx","./src/components/nodetooltip.tsx","./src/components/overviewtab.tsx","./src/components/projectcard.tsx","./src/components/projectswitcher.tsx","./src/components/promptbasket.tsx","./src/components/regionpanel.tsx","./src/components/regiontooltip.tsx","./src/components/resizehandle.tsx","./src/components/sidebar.tsx","./src/components/statstab.test.tsx","./src/components/statstab.tsx","./src/components/symboltab.tsx","./src/components/tabbar.tsx","./src/components/triggertree.tsx","./src/components/wikihovercard.test.tsx","./src/components/wikihovercard.tsx","./src/components/wikipanel.test.tsx","./src/components/wikipanel.tsx","./src/components/wikipanel.zh.test.tsx","./src/components/wikitier.ts","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/checkbox.tsx","./src/components/ui/input.tsx","./src/components/ui/scroll-area.tsx","./src/components/ui/separator.tsx","./src/hooks/usegraphdata.test.ts","./src/hooks/usegraphdata.ts","./src/hooks/useprojects.ts","./src/lib/atlas.test.ts","./src/lib/atlas.ts","./src/lib/colors.ts","./src/lib/complexity.test.ts","./src/lib/complexity.ts","./src/lib/composer.ts","./src/lib/density.test.ts","./src/lib/density.ts","./src/lib/findings.test.ts","./src/lib/findings.ts","./src/lib/firstread.ts","./src/lib/flowgroup.test.ts","./src/lib/flowgroup.ts","./src/lib/i18n.test.ts","./src/lib/i18n.ts","./src/lib/impact.test.ts","./src/lib/impact.ts","./src/lib/observed.test.ts","./src/lib/observed.ts","./src/lib/questions.test.ts","./src/lib/questions.ts","./src/lib/rationale.test.ts","./src/lib/rationale.ts","./src/lib/regions.test.ts","./src/lib/regions.ts","./src/lib/treemap.ts","./src/lib/types.ts","./src/lib/utils.ts","./src/lib/who.test.ts","./src/lib/who.ts","./src/lib/why.test.ts","./src/lib/why.ts","./src/lib/whyfetch.ts","./src/test/setup.ts","./src/wiki/entries.test.ts","./src/wiki/entries.ts"],"version":"5.9.3"}
\ No newline at end of file