@burdenoff/microfe-semanticfed 2026.1031.2 → 2026.1031.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,441 @@
1
+ import { translateWithFallback as e } from "../utils/i18n.js";
2
+ import { lineageErrorMessage as t, lineageRootFor as n, useSemRecordLineage as r, useSemWorkspaceLineage as i } from "../hooks/useLineage.js";
3
+ import { cn as a } from "../utils/cn.js";
4
+ import { useMemo as o, useState as s } from "react";
5
+ import { AlertTriangle as c, ArrowDownRight as l, ArrowUpLeft as ee, Boxes as u, Columns3 as d, Database as f, FileCode2 as p, GitBranch as m, Hash as h, Layers as g, Loader2 as _, Plug as v, Ruler as y, Table2 as b, X as x } from "lucide-react";
6
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
7
+ import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell";
8
+ import { Badge as T, Button as E, Card as D, CardContent as O, CardHeader as k, CardTitle as A, Input as j } from "@burdenoff/fe-libs/ui";
9
+ //#region src/semanticfed/pages/LineagePage.tsx
10
+ var M = {
11
+ CONNECTOR: v,
12
+ DATA_SOURCE: f,
13
+ TABLE: b,
14
+ ENTITY: u,
15
+ DIMENSION: y,
16
+ METRIC: h,
17
+ COLUMN: d,
18
+ MODEL: g,
19
+ QUERY: p
20
+ }, N = {
21
+ CONNECTOR: "Connector",
22
+ DATA_SOURCE: "Data source",
23
+ TABLE: "Table",
24
+ ENTITY: "Entity",
25
+ DIMENSION: "Dimension",
26
+ METRIC: "Metric",
27
+ COLUMN: "Column",
28
+ MODEL: "Model",
29
+ QUERY: "Query"
30
+ }, P = [
31
+ {
32
+ id: "sources",
33
+ label: "Sources",
34
+ kinds: ["CONNECTOR", "DATA_SOURCE"]
35
+ },
36
+ {
37
+ id: "tables",
38
+ label: "Tables",
39
+ kinds: ["TABLE"]
40
+ },
41
+ {
42
+ id: "entities",
43
+ label: "Entities",
44
+ kinds: ["ENTITY"]
45
+ },
46
+ {
47
+ id: "fields",
48
+ label: "Fields",
49
+ kinds: [
50
+ "DIMENSION",
51
+ "METRIC",
52
+ "COLUMN"
53
+ ]
54
+ },
55
+ {
56
+ id: "models",
57
+ label: "Models",
58
+ kinds: ["MODEL"]
59
+ },
60
+ {
61
+ id: "queries",
62
+ label: "Queries",
63
+ kinds: ["QUERY"]
64
+ }
65
+ ], F = {
66
+ PROVIDES: "provides",
67
+ HOSTS: "hosts",
68
+ MAPS_TO: "maps to",
69
+ DEFINES: "defines",
70
+ MEMBER_OF: "member of",
71
+ JOINS: "joins",
72
+ SERVES: "serves",
73
+ READ_BY: "read by",
74
+ EXECUTED_ON: "executed on"
75
+ }, I = [
76
+ "UPSTREAM",
77
+ "BOTH",
78
+ "DOWNSTREAM"
79
+ ], L = [
80
+ 1,
81
+ 2,
82
+ 3,
83
+ 5,
84
+ 10
85
+ ];
86
+ function R(e, t, n, r) {
87
+ let i = new Set([t]), a = (n) => {
88
+ let a = [t], o = 0;
89
+ for (; a.length > 0 && (r === null || o < r);) {
90
+ let t = [];
91
+ for (let r of e.edges) {
92
+ if (r.kind === "JOINS") continue;
93
+ let [e, o] = n ? [r.from, r.to] : [r.to, r.from];
94
+ a.includes(e) && !i.has(o) && (i.add(o), t.push(o));
95
+ }
96
+ a = t, o += 1;
97
+ }
98
+ };
99
+ return n !== "DOWNSTREAM" && a(!1), n !== "UPSTREAM" && a(!0), i;
100
+ }
101
+ function z(e) {
102
+ if (!e) return null;
103
+ let t = new Date(e);
104
+ return Number.isNaN(t.getTime()) ? null : t.toLocaleString();
105
+ }
106
+ function B() {
107
+ let { t: u } = te(), d = (t, n, r) => e(u, t, n, r), f = i(), [p, h] = s(null), [g, v] = s("BOTH"), [y, b] = s(null), [F, z] = s(""), B = f.data, H = o(() => new Map((B?.nodes ?? []).map((e) => [e.id, e])), [B]), U = p ? H.get(p) ?? null : null, W = U ? n(U) : null, G = r(W, g, y), K = o(() => !B || !U ? null : W ? G.data ? new Set(G.data.nodes.map((e) => e.id)) : null : R(B, U.id, g, y), [
108
+ B,
109
+ U,
110
+ W,
111
+ G.data,
112
+ g,
113
+ y
114
+ ]), q = o(() => U ? W ? G.data?.edges ?? [] : !B || !K ? [] : B.edges.filter((e) => K.has(e.from) && K.has(e.to)) : [], [
115
+ U,
116
+ W,
117
+ G.data,
118
+ B,
119
+ K
120
+ ]), J = F.trim().toLowerCase(), ne = (e) => J === "" || e.label.toLowerCase().includes(J) || (e.detail ?? "").toLowerCase().includes(J), Y = o(() => {
121
+ let e = {};
122
+ for (let t of B?.nodes ?? []) e[t.kind] = (e[t.kind] ?? 0) + 1;
123
+ return e;
124
+ }, [B]), re = U ? q.filter((e) => e.to === U.id) : [], ie = U ? q.filter((e) => e.from === U.id) : [], X = (e) => H.get(e)?.label ?? e, Z = (e) => {
125
+ let t = H.get(e);
126
+ return t ? d(`semanticfed.lineage.kinds.${t.kind}`, N[t.kind]) : "";
127
+ }, ae = f.isSuccess && (B?.nodes.length ?? 0) === 0, Q = [...B?.warnings ?? []], $ = !!(B?.truncated || G.data?.truncated);
128
+ return /* @__PURE__ */ w("div", {
129
+ className: "space-y-6 p-4 sm:p-6",
130
+ "data-testid": "semanticfed-lineage-page",
131
+ children: [
132
+ /* @__PURE__ */ w("div", {
133
+ className: "flex flex-wrap items-center justify-between gap-3",
134
+ "data-tour": "semanticfed-lineage-header",
135
+ children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h1", {
136
+ className: "text-2xl font-semibold",
137
+ children: d("semanticfed.lineage.title", "Lineage")
138
+ }), /* @__PURE__ */ C("p", {
139
+ className: "text-sm text-muted-foreground",
140
+ children: d("semanticfed.lineage.description", "End-to-end lineage from connectors and data sources through tables, entities and fields to the models and saved queries that use them. Select anything to trace where its data comes from and what depends on it.")
141
+ })] }), /* @__PURE__ */ C("div", {
142
+ className: "flex flex-wrap gap-2",
143
+ "data-testid": "lineage-counts",
144
+ children: Object.keys(N).filter((e) => Y[e]).map((e) => {
145
+ let t = M[e];
146
+ return /* @__PURE__ */ w(T, {
147
+ variant: "outline",
148
+ className: "gap-1",
149
+ children: [
150
+ /* @__PURE__ */ C(t, { className: "h-3 w-3" }),
151
+ Y[e],
152
+ " ",
153
+ d(`semanticfed.lineage.kinds.${e}`, N[e])
154
+ ]
155
+ }, e);
156
+ })
157
+ })]
158
+ }),
159
+ f.isPending && /* @__PURE__ */ C(D, { children: /* @__PURE__ */ w(O, {
160
+ className: "flex items-center gap-3 p-6 text-sm text-muted-foreground",
161
+ children: [/* @__PURE__ */ C(_, { className: "h-5 w-5 animate-spin" }), d("semanticfed.lineage.loading", "Computing lineage…")]
162
+ }) }),
163
+ f.isError && /* @__PURE__ */ C(D, { children: /* @__PURE__ */ w(O, {
164
+ className: "flex items-center gap-3 p-6 text-sm text-destructive",
165
+ "data-testid": "lineage-error",
166
+ children: [/* @__PURE__ */ C(c, { className: "h-5 w-5" }), t(f.error)]
167
+ }) }),
168
+ ae && /* @__PURE__ */ C(D, { children: /* @__PURE__ */ w(O, {
169
+ className: "flex items-center gap-3 p-6 text-sm text-muted-foreground",
170
+ "data-testid": "lineage-empty",
171
+ children: [/* @__PURE__ */ C(m, { className: "h-5 w-5" }), d("semanticfed.lineage.empty", "No lineage yet. Connect a data source and model an entity on it; lineage appears here as soon as records exist.")]
172
+ }) }),
173
+ (Q.length > 0 || $) && /* @__PURE__ */ w(D, {
174
+ "data-testid": "lineage-warnings",
175
+ children: [/* @__PURE__ */ C(k, {
176
+ className: "pb-2",
177
+ children: /* @__PURE__ */ w(A, {
178
+ className: "flex items-center gap-2 text-base",
179
+ children: [/* @__PURE__ */ C(c, { className: "h-4 w-4 text-destructive" }), d("semanticfed.lineage.warnings.title", "Lineage warnings")]
180
+ })
181
+ }), /* @__PURE__ */ w(O, {
182
+ className: "space-y-1 text-sm",
183
+ children: [$ && /* @__PURE__ */ C("p", {
184
+ className: "text-muted-foreground",
185
+ children: d("semanticfed.lineage.warnings.truncated", "This workspace is larger than one lineage pass reads, so the graph is partial.")
186
+ }), Q.slice(0, 20).map((e, t) => /* @__PURE__ */ w("button", {
187
+ type: "button",
188
+ className: "block text-left text-muted-foreground hover:text-foreground",
189
+ onClick: () => e.nodeId && h(e.nodeId),
190
+ children: [e.nodeId ? /* @__PURE__ */ w("span", {
191
+ className: "font-medium",
192
+ children: [X(e.nodeId), ": "]
193
+ }) : null, e.message]
194
+ }, `${e.nodeId ?? "graph"}-${t}`))]
195
+ })]
196
+ }),
197
+ B && B.nodes.length > 0 && /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ w("div", {
198
+ className: "flex flex-wrap items-center gap-2",
199
+ children: [
200
+ /* @__PURE__ */ C(j, {
201
+ "aria-label": d("semanticfed.lineage.search", "Filter nodes"),
202
+ placeholder: d("semanticfed.lineage.search", "Filter nodes"),
203
+ value: F,
204
+ onChange: (e) => z(e.target.value),
205
+ className: "w-full sm:w-64",
206
+ "data-testid": "lineage-search"
207
+ }),
208
+ /* @__PURE__ */ C("div", {
209
+ className: "flex rounded-md border",
210
+ role: "group",
211
+ "aria-label": d("semanticfed.lineage.direction", "Direction"),
212
+ children: I.map((e) => /* @__PURE__ */ C(E, {
213
+ type: "button",
214
+ size: "sm",
215
+ variant: g === e ? "default" : "ghost",
216
+ onClick: () => v(e),
217
+ "aria-pressed": g === e,
218
+ "data-testid": `lineage-direction-${e}`,
219
+ children: e === "UPSTREAM" ? d("semanticfed.lineage.upstream", "Upstream") : e === "DOWNSTREAM" ? d("semanticfed.lineage.downstream", "Downstream") : d("semanticfed.lineage.both", "Both")
220
+ }, e))
221
+ }),
222
+ /* @__PURE__ */ w("label", {
223
+ className: "flex items-center gap-2 text-sm text-muted-foreground",
224
+ children: [d("semanticfed.lineage.depth", "Depth"), /* @__PURE__ */ w("select", {
225
+ className: "rounded border bg-background p-1.5 text-sm text-foreground",
226
+ value: y ?? "",
227
+ onChange: (e) => b(e.target.value ? Number(e.target.value) : null),
228
+ "data-testid": "lineage-depth",
229
+ children: [/* @__PURE__ */ C("option", {
230
+ value: "",
231
+ children: d("semanticfed.lineage.depthAll", "All")
232
+ }), L.map((e) => /* @__PURE__ */ C("option", {
233
+ value: e,
234
+ children: e
235
+ }, e))]
236
+ })]
237
+ }),
238
+ U && /* @__PURE__ */ w(E, {
239
+ type: "button",
240
+ size: "sm",
241
+ variant: "outline",
242
+ onClick: () => h(null),
243
+ className: "gap-1",
244
+ "data-testid": "lineage-clear",
245
+ children: [/* @__PURE__ */ C(x, { className: "h-3 w-3" }), d("semanticfed.lineage.clear", "Clear selection")]
246
+ })
247
+ ]
248
+ }), /* @__PURE__ */ w("div", {
249
+ className: "grid gap-4 xl:grid-cols-[minmax(0,1fr)_22rem]",
250
+ children: [/* @__PURE__ */ C("div", {
251
+ className: "min-w-0 overflow-x-auto",
252
+ children: /* @__PURE__ */ C("div", {
253
+ className: "grid min-w-0 grid-cols-1 gap-3 md:min-w-[60rem] md:grid-cols-6",
254
+ "data-testid": "lineage-lanes",
255
+ children: P.map((e) => {
256
+ let t = B.nodes.filter((t) => e.kinds.includes(t.kind) && ne(t));
257
+ return /* @__PURE__ */ w("section", {
258
+ className: "min-w-0 space-y-2",
259
+ "data-testid": `lineage-lane-${e.id}`,
260
+ children: [
261
+ /* @__PURE__ */ w("h2", {
262
+ className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground",
263
+ children: [
264
+ d(`semanticfed.lineage.lanes.${e.id}`, e.label),
265
+ " ",
266
+ /* @__PURE__ */ w("span", {
267
+ className: "font-normal",
268
+ children: [
269
+ "(",
270
+ t.length,
271
+ ")"
272
+ ]
273
+ })
274
+ ]
275
+ }),
276
+ t.length === 0 && /* @__PURE__ */ C("p", {
277
+ className: "text-xs text-muted-foreground",
278
+ children: "—"
279
+ }),
280
+ t.map((e) => {
281
+ let t = M[e.kind], n = e.id === p, r = K?.has(e.id) ?? !1, i = K !== null && !r;
282
+ return /* @__PURE__ */ w("button", {
283
+ type: "button",
284
+ onClick: () => h(n ? null : e.id),
285
+ "aria-pressed": n,
286
+ title: e.detail ?? e.label,
287
+ "data-testid": "lineage-node",
288
+ "data-node-id": e.id,
289
+ "data-node-kind": e.kind,
290
+ "data-in-lineage": r ? "true" : "false",
291
+ className: a("w-full rounded-md border bg-card p-2 text-left text-sm transition-colors hover:bg-accent", n && "border-primary ring-2 ring-primary", r && !n && "border-primary bg-accent", i && "opacity-40"),
292
+ children: [/* @__PURE__ */ w("span", {
293
+ className: "flex items-center gap-1.5 font-medium",
294
+ children: [/* @__PURE__ */ C(t, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }), /* @__PURE__ */ C("span", {
295
+ className: "truncate",
296
+ children: e.label
297
+ })]
298
+ }), (e.detail || e.status) && /* @__PURE__ */ C("span", {
299
+ className: "mt-0.5 block truncate text-xs text-muted-foreground",
300
+ children: [e.status, e.detail].filter(Boolean).join(" · ")
301
+ })]
302
+ }, e.id);
303
+ })
304
+ ]
305
+ }, e.id);
306
+ })
307
+ })
308
+ }), /* @__PURE__ */ w(D, {
309
+ className: "min-w-0 self-start",
310
+ "data-testid": "lineage-details",
311
+ children: [/* @__PURE__ */ C(k, {
312
+ className: "pb-3",
313
+ children: /* @__PURE__ */ w(A, {
314
+ className: "flex items-center gap-2 text-base",
315
+ children: [/* @__PURE__ */ C(m, { className: "h-4 w-4" }), U ? U.label : d("semanticfed.lineage.details.title", "Lineage details")]
316
+ })
317
+ }), /* @__PURE__ */ w(O, {
318
+ className: "space-y-4 text-sm",
319
+ children: [!U && /* @__PURE__ */ C("p", {
320
+ className: "text-muted-foreground",
321
+ children: d("semanticfed.lineage.details.hint", "Select a source, table, entity, field, model or query to trace its lineage.")
322
+ }), U && /* @__PURE__ */ w(S, { children: [
323
+ /* @__PURE__ */ w("div", {
324
+ className: "space-y-1",
325
+ children: [
326
+ /* @__PURE__ */ C(T, {
327
+ variant: "outline",
328
+ children: d(`semanticfed.lineage.kinds.${U.kind}`, N[U.kind])
329
+ }),
330
+ U.detail && /* @__PURE__ */ C("p", {
331
+ className: "break-words font-mono text-xs text-muted-foreground",
332
+ children: U.detail
333
+ }),
334
+ U.status && /* @__PURE__ */ C("p", {
335
+ className: "text-xs text-muted-foreground",
336
+ children: U.status
337
+ })
338
+ ]
339
+ }),
340
+ W && G.isPending && /* @__PURE__ */ w("p", {
341
+ className: "flex items-center gap-2 text-muted-foreground",
342
+ children: [/* @__PURE__ */ C(_, { className: "h-4 w-4 animate-spin" }), d("semanticfed.lineage.tracing", "Tracing lineage…")]
343
+ }),
344
+ W && G.isError && /* @__PURE__ */ C("p", {
345
+ className: "text-destructive",
346
+ "data-testid": "lineage-record-error",
347
+ children: t(G.error)
348
+ }),
349
+ K && /* @__PURE__ */ C("p", {
350
+ className: "text-muted-foreground",
351
+ "data-testid": "lineage-reach",
352
+ children: d("semanticfed.lineage.details.reach", "{{count}} nodes in this lineage", { count: Math.max(K.size - 1, 0) })
353
+ }),
354
+ /* @__PURE__ */ C(V, {
355
+ title: d("semanticfed.lineage.details.upstream", "Comes from"),
356
+ icon: ee,
357
+ edges: re,
358
+ otherEnd: (e) => e.from,
359
+ nodeLabel: X,
360
+ nodeKindLabel: Z,
361
+ onSelect: h,
362
+ emptyText: d("semanticfed.lineage.details.noUpstream", "Nothing upstream"),
363
+ testId: "lineage-upstream"
364
+ }),
365
+ /* @__PURE__ */ C(V, {
366
+ title: d("semanticfed.lineage.details.downstream", "Feeds into"),
367
+ icon: l,
368
+ edges: ie,
369
+ otherEnd: (e) => e.to,
370
+ nodeLabel: X,
371
+ nodeKindLabel: Z,
372
+ onSelect: h,
373
+ emptyText: d("semanticfed.lineage.details.noDownstream", "Nothing downstream"),
374
+ testId: "lineage-downstream"
375
+ })
376
+ ] })]
377
+ })]
378
+ })]
379
+ })] })
380
+ ]
381
+ });
382
+ }
383
+ function V({ title: e, icon: t, edges: n, otherEnd: r, nodeLabel: i, nodeKindLabel: a, onSelect: o, emptyText: s, testId: c }) {
384
+ return /* @__PURE__ */ w("div", {
385
+ className: "space-y-2",
386
+ "data-testid": c,
387
+ children: [
388
+ /* @__PURE__ */ w("h3", {
389
+ className: "flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground",
390
+ children: [
391
+ /* @__PURE__ */ C(t, { className: "h-3.5 w-3.5" }),
392
+ e,
393
+ " (",
394
+ n.length,
395
+ ")"
396
+ ]
397
+ }),
398
+ n.length === 0 && /* @__PURE__ */ C("p", {
399
+ className: "text-xs text-muted-foreground",
400
+ children: s
401
+ }),
402
+ /* @__PURE__ */ C("ul", {
403
+ className: "space-y-1.5",
404
+ children: n.map((e) => {
405
+ let t = r(e), n = z(e.observedAt);
406
+ return /* @__PURE__ */ w("li", {
407
+ className: "rounded border p-2",
408
+ children: [
409
+ /* @__PURE__ */ C("button", {
410
+ type: "button",
411
+ className: "font-medium hover:underline",
412
+ onClick: () => o(t),
413
+ children: i(t)
414
+ }),
415
+ /* @__PURE__ */ w("span", {
416
+ className: "ml-1 text-xs text-muted-foreground",
417
+ children: [
418
+ a(t),
419
+ " · ",
420
+ F[e.kind]
421
+ ]
422
+ }),
423
+ e.detail && /* @__PURE__ */ C("p", {
424
+ className: "mt-0.5 break-words font-mono text-xs text-muted-foreground",
425
+ children: e.detail
426
+ }),
427
+ n && /* @__PURE__ */ C("p", {
428
+ className: "mt-0.5 text-xs text-muted-foreground",
429
+ children: n
430
+ })
431
+ ]
432
+ }, e.id);
433
+ })
434
+ })
435
+ ]
436
+ });
437
+ }
438
+ //#endregion
439
+ export { B as LineagePage };
440
+
441
+ //# sourceMappingURL=LineagePage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LineagePage.js","names":[],"sources":["../../../src/semanticfed/pages/LineagePage.tsx"],"sourcesContent":["/**\n * Lineage page (BOFF-4279) — end-to-end lineage of the workspace's semantic\n * layer, read from the `semLineage` API.\n *\n * The workspace graph is laid out in lanes in the direction data flows\n * (sources → tables → entities → fields → models → queries). Selecting a node\n * asks the API for that record's upstream / downstream lineage and highlights\n * it; tables and unregistered columns (which have no SemanticFed record to\n * start a traversal from) are traced over the workspace graph instead.\n */\nimport { useMemo, useState } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Badge,\n Button,\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n Input,\n} from '@burdenoff/fe-libs/ui';\nimport {\n AlertTriangle,\n ArrowDownRight,\n ArrowUpLeft,\n Boxes,\n Columns3,\n Database,\n FileCode2,\n GitBranch,\n Hash,\n Layers,\n Loader2,\n Plug,\n Ruler,\n Table2,\n X,\n} from 'lucide-react';\nimport type { LucideIcon } from 'lucide-react';\n\nimport {\n type SemLineageDirection,\n type SemLineageEdge,\n type SemLineageGraph,\n type SemLineageNode,\n type SemLineageNodeKind,\n lineageErrorMessage,\n lineageRootFor,\n useSemRecordLineage,\n useSemWorkspaceLineage,\n} from '../hooks/useLineage';\nimport { cn } from '../utils/cn';\nimport { translateWithFallback } from '../utils/i18n';\n\nconst KIND_ICON: Record<SemLineageNodeKind, LucideIcon> = {\n CONNECTOR: Plug,\n DATA_SOURCE: Database,\n TABLE: Table2,\n ENTITY: Boxes,\n DIMENSION: Ruler,\n METRIC: Hash,\n COLUMN: Columns3,\n MODEL: Layers,\n QUERY: FileCode2,\n};\n\nconst KIND_LABEL: Record<SemLineageNodeKind, string> = {\n CONNECTOR: 'Connector',\n DATA_SOURCE: 'Data source',\n TABLE: 'Table',\n ENTITY: 'Entity',\n DIMENSION: 'Dimension',\n METRIC: 'Metric',\n COLUMN: 'Column',\n MODEL: 'Model',\n QUERY: 'Query',\n};\n\ninterface Lane {\n id: string;\n label: string;\n kinds: SemLineageNodeKind[];\n}\n\n/** Lanes in the direction data flows. */\nconst LANES: Lane[] = [\n { id: 'sources', label: 'Sources', kinds: ['CONNECTOR', 'DATA_SOURCE'] },\n { id: 'tables', label: 'Tables', kinds: ['TABLE'] },\n { id: 'entities', label: 'Entities', kinds: ['ENTITY'] },\n { id: 'fields', label: 'Fields', kinds: ['DIMENSION', 'METRIC', 'COLUMN'] },\n { id: 'models', label: 'Models', kinds: ['MODEL'] },\n { id: 'queries', label: 'Queries', kinds: ['QUERY'] },\n];\n\nconst EDGE_LABEL: Record<SemLineageEdge['kind'], string> = {\n PROVIDES: 'provides',\n HOSTS: 'hosts',\n MAPS_TO: 'maps to',\n DEFINES: 'defines',\n MEMBER_OF: 'member of',\n JOINS: 'joins',\n SERVES: 'serves',\n READ_BY: 'read by',\n EXECUTED_ON: 'executed on',\n};\n\nconst DIRECTIONS: SemLineageDirection[] = ['UPSTREAM', 'BOTH', 'DOWNSTREAM'];\nconst DEPTH_OPTIONS = [1, 2, 3, 5, 10] as const;\n\n/**\n * Upstream / downstream reach of a node over a graph that is already loaded,\n * for node kinds the API cannot start from. JOINS edges are context, not data\n * flow, so they are shown but not followed (matching the service).\n */\nfunction traceLocally(\n graph: SemLineageGraph,\n rootId: string,\n direction: SemLineageDirection,\n depth: number | null\n): Set<string> {\n const reached = new Set<string>([rootId]);\n const walk = (forward: boolean) => {\n let frontier = [rootId];\n let hops = 0;\n while (frontier.length > 0 && (depth === null || hops < depth)) {\n const next: string[] = [];\n for (const edge of graph.edges) {\n if (edge.kind === 'JOINS') continue;\n const [from, to] = forward ? [edge.from, edge.to] : [edge.to, edge.from];\n if (frontier.includes(from) && !reached.has(to)) {\n reached.add(to);\n next.push(to);\n }\n }\n frontier = next;\n hops += 1;\n }\n };\n if (direction !== 'DOWNSTREAM') walk(false);\n if (direction !== 'UPSTREAM') walk(true);\n return reached;\n}\n\nfunction formatObservedAt(value: string | null): string | null {\n if (!value) return null;\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? null : date.toLocaleString();\n}\n\nexport function LineagePage() {\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) =>\n translateWithFallback(t, key, fallback, params);\n\n const workspace = useSemWorkspaceLineage();\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const [direction, setDirection] = useState<SemLineageDirection>('BOTH');\n const [depth, setDepth] = useState<number | null>(null);\n const [search, setSearch] = useState('');\n\n const graph = workspace.data;\n const nodesById = useMemo(\n () => new Map((graph?.nodes ?? []).map((node) => [node.id, node] as const)),\n [graph]\n );\n const selected = selectedId ? (nodesById.get(selectedId) ?? null) : null;\n const root = selected ? lineageRootFor(selected) : null;\n const record = useSemRecordLineage(root, direction, depth);\n\n // The node ids in the selected node's lineage: from the API for records,\n // traced over the workspace graph for tables and columns.\n const highlighted = useMemo<Set<string> | null>(() => {\n if (!graph || !selected) return null;\n if (root) return record.data ? new Set(record.data.nodes.map((n) => n.id)) : null;\n return traceLocally(graph, selected.id, direction, depth);\n }, [graph, selected, root, record.data, direction, depth]);\n\n const lineageEdges = useMemo<SemLineageEdge[]>(() => {\n if (!selected) return [];\n if (root) return record.data?.edges ?? [];\n if (!graph || !highlighted) return [];\n return graph.edges.filter((e) => highlighted.has(e.from) && highlighted.has(e.to));\n }, [selected, root, record.data, graph, highlighted]);\n\n const query = search.trim().toLowerCase();\n const matches = (node: SemLineageNode) =>\n query === '' ||\n node.label.toLowerCase().includes(query) ||\n (node.detail ?? '').toLowerCase().includes(query);\n\n const counts = useMemo(() => {\n const byKind: Partial<Record<SemLineageNodeKind, number>> = {};\n for (const node of graph?.nodes ?? []) byKind[node.kind] = (byKind[node.kind] ?? 0) + 1;\n return byKind;\n }, [graph]);\n\n const upstreamEdges = selected ? lineageEdges.filter((e) => e.to === selected.id) : [];\n const downstreamEdges = selected ? lineageEdges.filter((e) => e.from === selected.id) : [];\n const nodeLabel = (id: string) => nodesById.get(id)?.label ?? id;\n const nodeKindLabel = (id: string) => {\n const node = nodesById.get(id);\n return node ? tx(`semanticfed.lineage.kinds.${node.kind}`, KIND_LABEL[node.kind]) : '';\n };\n\n const isEmpty = workspace.isSuccess && (graph?.nodes.length ?? 0) === 0;\n const warnings = [...(graph?.warnings ?? [])];\n const truncated = Boolean(graph?.truncated || record.data?.truncated);\n\n return (\n <div className=\"space-y-6 p-4 sm:p-6\" data-testid=\"semanticfed-lineage-page\">\n <div\n className=\"flex flex-wrap items-center justify-between gap-3\"\n data-tour=\"semanticfed-lineage-header\"\n >\n <div>\n <h1 className=\"text-2xl font-semibold\">{tx('semanticfed.lineage.title', 'Lineage')}</h1>\n <p className=\"text-sm text-muted-foreground\">\n {tx(\n 'semanticfed.lineage.description',\n 'End-to-end lineage from connectors and data sources through tables, entities and fields to the models and saved queries that use them. Select anything to trace where its data comes from and what depends on it.'\n )}\n </p>\n </div>\n <div className=\"flex flex-wrap gap-2\" data-testid=\"lineage-counts\">\n {(Object.keys(KIND_LABEL) as SemLineageNodeKind[])\n .filter((kind) => counts[kind])\n .map((kind) => {\n const Icon = KIND_ICON[kind];\n return (\n <Badge key={kind} variant=\"outline\" className=\"gap-1\">\n <Icon className=\"h-3 w-3\" />\n {counts[kind]} {tx(`semanticfed.lineage.kinds.${kind}`, KIND_LABEL[kind])}\n </Badge>\n );\n })}\n </div>\n </div>\n\n {workspace.isPending && (\n <Card>\n <CardContent className=\"flex items-center gap-3 p-6 text-sm text-muted-foreground\">\n <Loader2 className=\"h-5 w-5 animate-spin\" />\n {tx('semanticfed.lineage.loading', 'Computing lineage…')}\n </CardContent>\n </Card>\n )}\n\n {workspace.isError && (\n <Card>\n <CardContent\n className=\"flex items-center gap-3 p-6 text-sm text-destructive\"\n data-testid=\"lineage-error\"\n >\n <AlertTriangle className=\"h-5 w-5\" />\n {lineageErrorMessage(workspace.error)}\n </CardContent>\n </Card>\n )}\n\n {isEmpty && (\n <Card>\n <CardContent\n className=\"flex items-center gap-3 p-6 text-sm text-muted-foreground\"\n data-testid=\"lineage-empty\"\n >\n <GitBranch className=\"h-5 w-5\" />\n {tx(\n 'semanticfed.lineage.empty',\n 'No lineage yet. Connect a data source and model an entity on it; lineage appears here as soon as records exist.'\n )}\n </CardContent>\n </Card>\n )}\n\n {(warnings.length > 0 || truncated) && (\n <Card data-testid=\"lineage-warnings\">\n <CardHeader className=\"pb-2\">\n <CardTitle className=\"flex items-center gap-2 text-base\">\n <AlertTriangle className=\"h-4 w-4 text-destructive\" />\n {tx('semanticfed.lineage.warnings.title', 'Lineage warnings')}\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-1 text-sm\">\n {truncated && (\n <p className=\"text-muted-foreground\">\n {tx(\n 'semanticfed.lineage.warnings.truncated',\n 'This workspace is larger than one lineage pass reads, so the graph is partial.'\n )}\n </p>\n )}\n {warnings.slice(0, 20).map((warning, index) => (\n <button\n key={`${warning.nodeId ?? 'graph'}-${index}`}\n type=\"button\"\n className=\"block text-left text-muted-foreground hover:text-foreground\"\n onClick={() => warning.nodeId && setSelectedId(warning.nodeId)}\n >\n {warning.nodeId ? (\n <span className=\"font-medium\">{nodeLabel(warning.nodeId)}: </span>\n ) : null}\n {warning.message}\n </button>\n ))}\n </CardContent>\n </Card>\n )}\n\n {graph && graph.nodes.length > 0 && (\n <>\n <div className=\"flex flex-wrap items-center gap-2\">\n <Input\n aria-label={tx('semanticfed.lineage.search', 'Filter nodes')}\n placeholder={tx('semanticfed.lineage.search', 'Filter nodes')}\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n className=\"w-full sm:w-64\"\n data-testid=\"lineage-search\"\n />\n <div\n className=\"flex rounded-md border\"\n role=\"group\"\n aria-label={tx('semanticfed.lineage.direction', 'Direction')}\n >\n {DIRECTIONS.map((d) => (\n <Button\n key={d}\n type=\"button\"\n size=\"sm\"\n variant={direction === d ? 'default' : 'ghost'}\n onClick={() => setDirection(d)}\n aria-pressed={direction === d}\n data-testid={`lineage-direction-${d}`}\n >\n {d === 'UPSTREAM'\n ? tx('semanticfed.lineage.upstream', 'Upstream')\n : d === 'DOWNSTREAM'\n ? tx('semanticfed.lineage.downstream', 'Downstream')\n : tx('semanticfed.lineage.both', 'Both')}\n </Button>\n ))}\n </div>\n <label className=\"flex items-center gap-2 text-sm text-muted-foreground\">\n {tx('semanticfed.lineage.depth', 'Depth')}\n <select\n className=\"rounded border bg-background p-1.5 text-sm text-foreground\"\n value={depth ?? ''}\n onChange={(e) => setDepth(e.target.value ? Number(e.target.value) : null)}\n data-testid=\"lineage-depth\"\n >\n <option value=\"\">{tx('semanticfed.lineage.depthAll', 'All')}</option>\n {DEPTH_OPTIONS.map((d) => (\n <option key={d} value={d}>\n {d}\n </option>\n ))}\n </select>\n </label>\n {selected && (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n onClick={() => setSelectedId(null)}\n className=\"gap-1\"\n data-testid=\"lineage-clear\"\n >\n <X className=\"h-3 w-3\" />\n {tx('semanticfed.lineage.clear', 'Clear selection')}\n </Button>\n )}\n </div>\n\n <div className=\"grid gap-4 xl:grid-cols-[minmax(0,1fr)_22rem]\">\n <div className=\"min-w-0 overflow-x-auto\">\n <div\n className=\"grid min-w-0 grid-cols-1 gap-3 md:min-w-[60rem] md:grid-cols-6\"\n data-testid=\"lineage-lanes\"\n >\n {LANES.map((lane) => {\n const laneNodes = graph.nodes.filter(\n (node) => lane.kinds.includes(node.kind) && matches(node)\n );\n return (\n <section\n key={lane.id}\n className=\"min-w-0 space-y-2\"\n data-testid={`lineage-lane-${lane.id}`}\n >\n <h2 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n {tx(`semanticfed.lineage.lanes.${lane.id}`, lane.label)}{' '}\n <span className=\"font-normal\">({laneNodes.length})</span>\n </h2>\n {laneNodes.length === 0 && <p className=\"text-xs text-muted-foreground\">—</p>}\n {laneNodes.map((node) => {\n const Icon = KIND_ICON[node.kind];\n const isSelected = node.id === selectedId;\n const inLineage = highlighted?.has(node.id) ?? false;\n const dimmed = highlighted !== null && !inLineage;\n return (\n <button\n key={node.id}\n type=\"button\"\n onClick={() => setSelectedId(isSelected ? null : node.id)}\n aria-pressed={isSelected}\n title={node.detail ?? node.label}\n data-testid=\"lineage-node\"\n data-node-id={node.id}\n data-node-kind={node.kind}\n data-in-lineage={inLineage ? 'true' : 'false'}\n className={cn(\n 'w-full rounded-md border bg-card p-2 text-left text-sm transition-colors hover:bg-accent',\n isSelected && 'border-primary ring-2 ring-primary',\n inLineage && !isSelected && 'border-primary bg-accent',\n dimmed && 'opacity-40'\n )}\n >\n <span className=\"flex items-center gap-1.5 font-medium\">\n <Icon className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate\">{node.label}</span>\n </span>\n {(node.detail || node.status) && (\n <span className=\"mt-0.5 block truncate text-xs text-muted-foreground\">\n {[node.status, node.detail].filter(Boolean).join(' · ')}\n </span>\n )}\n </button>\n );\n })}\n </section>\n );\n })}\n </div>\n </div>\n\n <Card className=\"min-w-0 self-start\" data-testid=\"lineage-details\">\n <CardHeader className=\"pb-3\">\n <CardTitle className=\"flex items-center gap-2 text-base\">\n <GitBranch className=\"h-4 w-4\" />\n {selected\n ? selected.label\n : tx('semanticfed.lineage.details.title', 'Lineage details')}\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4 text-sm\">\n {!selected && (\n <p className=\"text-muted-foreground\">\n {tx(\n 'semanticfed.lineage.details.hint',\n 'Select a source, table, entity, field, model or query to trace its lineage.'\n )}\n </p>\n )}\n {selected && (\n <>\n <div className=\"space-y-1\">\n <Badge variant=\"outline\">\n {tx(\n `semanticfed.lineage.kinds.${selected.kind}`,\n KIND_LABEL[selected.kind]\n )}\n </Badge>\n {selected.detail && (\n <p className=\"break-words font-mono text-xs text-muted-foreground\">\n {selected.detail}\n </p>\n )}\n {selected.status && (\n <p className=\"text-xs text-muted-foreground\">{selected.status}</p>\n )}\n </div>\n {root && record.isPending && (\n <p className=\"flex items-center gap-2 text-muted-foreground\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n {tx('semanticfed.lineage.tracing', 'Tracing lineage…')}\n </p>\n )}\n {root && record.isError && (\n <p className=\"text-destructive\" data-testid=\"lineage-record-error\">\n {lineageErrorMessage(record.error)}\n </p>\n )}\n {highlighted && (\n <p className=\"text-muted-foreground\" data-testid=\"lineage-reach\">\n {tx(\n 'semanticfed.lineage.details.reach',\n '{{count}} nodes in this lineage',\n { count: Math.max(highlighted.size - 1, 0) }\n )}\n </p>\n )}\n <EdgeList\n title={tx('semanticfed.lineage.details.upstream', 'Comes from')}\n icon={ArrowUpLeft}\n edges={upstreamEdges}\n otherEnd={(e) => e.from}\n nodeLabel={nodeLabel}\n nodeKindLabel={nodeKindLabel}\n onSelect={setSelectedId}\n emptyText={tx('semanticfed.lineage.details.noUpstream', 'Nothing upstream')}\n testId=\"lineage-upstream\"\n />\n <EdgeList\n title={tx('semanticfed.lineage.details.downstream', 'Feeds into')}\n icon={ArrowDownRight}\n edges={downstreamEdges}\n otherEnd={(e) => e.to}\n nodeLabel={nodeLabel}\n nodeKindLabel={nodeKindLabel}\n onSelect={setSelectedId}\n emptyText={tx(\n 'semanticfed.lineage.details.noDownstream',\n 'Nothing downstream'\n )}\n testId=\"lineage-downstream\"\n />\n </>\n )}\n </CardContent>\n </Card>\n </div>\n </>\n )}\n </div>\n );\n}\n\ninterface EdgeListProps {\n title: string;\n icon: LucideIcon;\n edges: SemLineageEdge[];\n otherEnd: (edge: SemLineageEdge) => string;\n nodeLabel: (id: string) => string;\n nodeKindLabel: (id: string) => string;\n onSelect: (id: string) => void;\n emptyText: string;\n testId: string;\n}\n\nfunction EdgeList({\n title,\n icon: Icon,\n edges,\n otherEnd,\n nodeLabel,\n nodeKindLabel,\n onSelect,\n emptyText,\n testId,\n}: EdgeListProps) {\n return (\n <div className=\"space-y-2\" data-testid={testId}>\n <h3 className=\"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n <Icon className=\"h-3.5 w-3.5\" />\n {title} ({edges.length})\n </h3>\n {edges.length === 0 && <p className=\"text-xs text-muted-foreground\">{emptyText}</p>}\n <ul className=\"space-y-1.5\">\n {edges.map((edge) => {\n const other = otherEnd(edge);\n const observed = formatObservedAt(edge.observedAt);\n return (\n <li key={edge.id} className=\"rounded border p-2\">\n <button\n type=\"button\"\n className=\"font-medium hover:underline\"\n onClick={() => onSelect(other)}\n >\n {nodeLabel(other)}\n </button>\n <span className=\"ml-1 text-xs text-muted-foreground\">\n {nodeKindLabel(other)} · {EDGE_LABEL[edge.kind]}\n </span>\n {edge.detail && (\n <p className=\"mt-0.5 break-words font-mono text-xs text-muted-foreground\">\n {edge.detail}\n </p>\n )}\n {observed && <p className=\"mt-0.5 text-xs text-muted-foreground\">{observed}</p>}\n </li>\n );\n })}\n </ul>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAsDA,IAAM,IAAoD;CACxD,WAAW;CACX,aAAa;CACb,OAAO;CACP,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,OAAO;CACR,EAEK,IAAiD;CACrD,WAAW;CACX,aAAa;CACb,OAAO;CACP,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,OAAO;CACR,EASK,IAAgB;CACpB;EAAE,IAAI;EAAW,OAAO;EAAW,OAAO,CAAC,aAAa,cAAc;EAAE;CACxE;EAAE,IAAI;EAAU,OAAO;EAAU,OAAO,CAAC,QAAQ;EAAE;CACnD;EAAE,IAAI;EAAY,OAAO;EAAY,OAAO,CAAC,SAAS;EAAE;CACxD;EAAE,IAAI;EAAU,OAAO;EAAU,OAAO;GAAC;GAAa;GAAU;GAAS;EAAE;CAC3E;EAAE,IAAI;EAAU,OAAO;EAAU,OAAO,CAAC,QAAQ;EAAE;CACnD;EAAE,IAAI;EAAW,OAAO;EAAW,OAAO,CAAC,QAAQ;EAAE;CACtD,EAEK,IAAqD;CACzD,UAAU;CACV,OAAO;CACP,SAAS;CACT,SAAS;CACT,WAAW;CACX,OAAO;CACP,QAAQ;CACR,SAAS;CACT,aAAa;CACd,EAEK,IAAoC;CAAC;CAAY;CAAQ;CAAa,EACtE,IAAgB;CAAC;CAAG;CAAG;CAAG;CAAG;CAAG;AAOtC,SAAS,EACP,GACA,GACA,GACA,GACa;CACb,IAAM,IAAU,IAAI,IAAY,CAAC,EAAO,CAAC,EACnC,KAAQ,MAAqB;EACjC,IAAI,IAAW,CA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