@nivaro/react 0.3.0 → 0.3.1
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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +341 -0
- package/dist/index.js +764 -723
- package/dist/shared/components/ClientChaosToolbar.js +410 -0
- package/dist/shared/components/LoadErrorNote.js +49 -0
- package/dist/shared/components/PretendDown.js +258 -0
- package/dist/shared/components/ProfileView.js +54 -49
- package/dist/shared/components/QueryErrorState.js +16 -0
- package/dist/shared/components/ReportView.js +1351 -1338
- package/dist/shared/components/WidgetSlot.js +438 -418
- package/dist/shared/components/chaos/DeclareIncidentButton.js +72 -0
- package/dist/shared/components/chaos/DrillBanner.js +119 -0
- package/dist/shared/components/chaos/DrillTag.js +62 -0
- package/dist/shared/components/chaos/GameDayStrip.js +61 -0
- package/dist/shared/components/client-chaos-gate.js +51 -0
- package/dist/shared/components/integrations/console/SignalCard.js +172 -167
- package/dist/shared/components/layout-editor/EditorTopBar.js +108 -105
- package/dist/shared/components/layout-editor/LayoutEditor.js +514 -508
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +18 -10
- package/dist/shared/components/pipeline/PipelineEditorView.js +495 -479
- package/dist/shared/components/pipeline/TeamsView.js +184 -169
- package/dist/shared/lib/client-chaos.js +359 -0
- package/dist/shared/lib/load-error.js +26 -0
- package/dist/shared/lib/socket-realtime.js +31 -30
- package/dist/shared/lib/worker-socket.js +108 -89
- package/package.json +1 -1
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { jsxs as a, jsx as
|
|
2
|
-
import { AlertOctagon as j, AlertTriangle as F, ChevronRight as B, Loader2 as K, ChevronDown as O, ExternalLink as
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsxs as a, jsx as o, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { AlertOctagon as j, AlertTriangle as F, ChevronRight as B, Loader2 as K, ChevronDown as O, ExternalLink as W } from "lucide-react";
|
|
3
|
+
import { useState as L, useMemo as G, useId as V, useRef as X } from "react";
|
|
4
4
|
import { useItemEditAuth as q } from "../../../context.js";
|
|
5
5
|
import { cn as x, titleCase as H } from "../../../lib/utils.js";
|
|
6
6
|
import { ExplainButton as J } from "../../ai/ExplainButton.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import { useDrillWindows as Q, DrillTag as Y } from "../../chaos/DrillTag.js";
|
|
8
|
+
import { useSignalAction as Z, useDismissRows as ee, useSnooze as te } from "./api.js";
|
|
9
|
+
import { canDrill as ne, RowDrill as oe } from "./drill/index.js";
|
|
10
|
+
import { SnoozeMenu as P, DismissButton as re } from "./SnoozeMenu.js";
|
|
11
|
+
import { TONE_FILL as ie, TONE_TEXT as T, agoText as se, exactTime as R, TONE_SOFT as ae, ageOf as le } from "./tone.js";
|
|
12
|
+
const de = ["retry_submission", "extension"], ce = (t) => t.kind === "extension" ? U(t) : t.kind, U = (t) => `${t.kind}:${t.id ?? ""}`;
|
|
13
|
+
function ue(t) {
|
|
13
14
|
let e = null;
|
|
14
15
|
for (const m of t.rows) (!e || m.first_seen < e) && (e = m.first_seen);
|
|
15
16
|
return e;
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function $e({
|
|
18
19
|
signal: t,
|
|
19
20
|
expanded: e,
|
|
20
21
|
onToggle: m,
|
|
21
|
-
onOpenRecord:
|
|
22
|
+
onOpenRecord: g,
|
|
22
23
|
onExplain: p,
|
|
23
24
|
canExplain: l
|
|
24
25
|
}) {
|
|
25
|
-
const
|
|
26
|
+
const h = t.severity === "critical", v = h ? "negative" : "warning", S = h ? j : F, y = ue(t), z = Q(), $ = t.rows.reduce(
|
|
27
|
+
(N, D) => !N || D.first_seen > N ? D.first_seen : N,
|
|
28
|
+
null
|
|
29
|
+
), k = t.rows[0], [b, C] = L(!1), _ = `ic-signal-body-${t.id.replace(/[^a-z0-9]/gi, "-")}`;
|
|
26
30
|
return /* @__PURE__ */ a(
|
|
27
31
|
"section",
|
|
28
32
|
{
|
|
@@ -36,30 +40,31 @@ function we({
|
|
|
36
40
|
type: "button",
|
|
37
41
|
onClick: m,
|
|
38
42
|
"aria-expanded": e,
|
|
39
|
-
"aria-controls":
|
|
43
|
+
"aria-controls": _,
|
|
40
44
|
className: "flex w-full items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
|
|
41
45
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ o(
|
|
43
47
|
"span",
|
|
44
48
|
{
|
|
45
49
|
className: x(
|
|
46
50
|
"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md",
|
|
47
|
-
|
|
51
|
+
ae[v]
|
|
48
52
|
),
|
|
49
|
-
"data-tip":
|
|
50
|
-
children: /* @__PURE__ */
|
|
53
|
+
"data-tip": h ? "Critical — something is failing now" : "Worth a look",
|
|
54
|
+
children: /* @__PURE__ */ o(S, { className: x("h-3.5 w-3.5", T[v]), "aria-hidden": !0 })
|
|
51
55
|
}
|
|
52
56
|
),
|
|
53
57
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
54
58
|
/* @__PURE__ */ a("span", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
/* @__PURE__ */ o("span", { className: "text-[13.5px] font-semibold text-foreground", children: t.label }),
|
|
60
|
+
$ && /* @__PURE__ */ o(Y, { windows: z, at: $, className: "self-center" }),
|
|
61
|
+
t.error ? /* @__PURE__ */ o("span", { className: x("text-[12px] font-medium", T.negative), children: "Couldn't evaluate" }) : /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: [
|
|
62
|
+
/* @__PURE__ */ o("span", { className: x("font-semibold", T[v]), children: t.count }),
|
|
58
63
|
" open",
|
|
59
64
|
y && /* @__PURE__ */ a("span", { "data-tip": `Oldest first seen ${R(y)}`, children: [
|
|
60
65
|
" ",
|
|
61
66
|
"· oldest ",
|
|
62
|
-
|
|
67
|
+
le(y)
|
|
63
68
|
] }),
|
|
64
69
|
t.snoozed.length > 0 && /* @__PURE__ */ a(A, { children: [
|
|
65
70
|
" · ",
|
|
@@ -68,9 +73,9 @@ function we({
|
|
|
68
73
|
] })
|
|
69
74
|
] })
|
|
70
75
|
] }),
|
|
71
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ o("span", { className: "mt-0.5 block truncate text-[12px] text-muted-foreground", children: t.error ? t.error : k ? `${k.title}${k.detail ? ` — ${k.detail}` : ""}` : t.description })
|
|
72
77
|
] }),
|
|
73
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ o(
|
|
74
79
|
B,
|
|
75
80
|
{
|
|
76
81
|
className: x(
|
|
@@ -83,18 +88,18 @@ function we({
|
|
|
83
88
|
]
|
|
84
89
|
}
|
|
85
90
|
),
|
|
86
|
-
e && /* @__PURE__ */ a("div", { id:
|
|
87
|
-
t.error ? /* @__PURE__ */ a("p", { className: x("px-4 py-3 text-[12.5px]",
|
|
91
|
+
e && /* @__PURE__ */ a("div", { id: _, className: "border-t border-border", children: [
|
|
92
|
+
t.error ? /* @__PURE__ */ a("p", { className: x("px-4 py-3 text-[12.5px]", T.negative), children: [
|
|
88
93
|
"Couldn't evaluate · ",
|
|
89
94
|
t.error
|
|
90
95
|
] }) : /* @__PURE__ */ a(A, { children: [
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
|
|
96
|
+
/* @__PURE__ */ o("p", { className: "max-w-[80ch] px-4 pb-1 pt-3 text-[12px] leading-relaxed text-muted-foreground", children: t.description }),
|
|
97
|
+
/* @__PURE__ */ o(
|
|
98
|
+
me,
|
|
94
99
|
{
|
|
95
100
|
signal: t,
|
|
96
101
|
rows: t.rows,
|
|
97
|
-
onOpenRecord:
|
|
102
|
+
onOpenRecord: g,
|
|
98
103
|
onExplain: p,
|
|
99
104
|
canExplain: l
|
|
100
105
|
}
|
|
@@ -112,15 +117,15 @@ function we({
|
|
|
112
117
|
"button",
|
|
113
118
|
{
|
|
114
119
|
type: "button",
|
|
115
|
-
onClick: () =>
|
|
116
|
-
"aria-expanded":
|
|
120
|
+
onClick: () => C((N) => !N),
|
|
121
|
+
"aria-expanded": b,
|
|
117
122
|
"data-ic-snoozed-fold": t.snoozed.length,
|
|
118
123
|
className: "flex w-full items-center gap-1.5 px-4 py-2 text-left text-[12px] font-medium text-muted-foreground hover:text-foreground",
|
|
119
124
|
children: [
|
|
120
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ o(
|
|
121
126
|
B,
|
|
122
127
|
{
|
|
123
|
-
className: x("h-3.5 w-3.5 transition-transform",
|
|
128
|
+
className: x("h-3.5 w-3.5 transition-transform", b && "rotate-90")
|
|
124
129
|
}
|
|
125
130
|
),
|
|
126
131
|
"Snoozed (",
|
|
@@ -129,109 +134,109 @@ function we({
|
|
|
129
134
|
]
|
|
130
135
|
}
|
|
131
136
|
),
|
|
132
|
-
|
|
137
|
+
b && /* @__PURE__ */ o(fe, { signal: t })
|
|
133
138
|
] })
|
|
134
139
|
] })
|
|
135
140
|
]
|
|
136
141
|
}
|
|
137
142
|
);
|
|
138
143
|
}
|
|
139
|
-
function
|
|
144
|
+
function me({
|
|
140
145
|
signal: t,
|
|
141
146
|
rows: e,
|
|
142
147
|
onOpenRecord: m,
|
|
143
|
-
onExplain:
|
|
148
|
+
onExplain: g,
|
|
144
149
|
canExplain: p
|
|
145
150
|
}) {
|
|
146
|
-
const l =
|
|
151
|
+
const l = Z(), h = ee(), [v, S] = L({}), [y, z] = L(/* @__PURE__ */ new Set()), [$, k] = L(/* @__PURE__ */ new Set()), b = G(() => {
|
|
147
152
|
if (!e.some((s) => s.group)) return null;
|
|
148
|
-
const
|
|
153
|
+
const r = /* @__PURE__ */ new Map();
|
|
149
154
|
for (const s of e) {
|
|
150
|
-
const i = s.group ?? "—", d =
|
|
151
|
-
d.rows.push(s),
|
|
155
|
+
const i = s.group ?? "—", d = r.get(i) ?? { key: i, label: s.group_label ?? s.group ?? "Other", rows: [] };
|
|
156
|
+
d.rows.push(s), r.set(i, d);
|
|
152
157
|
}
|
|
153
|
-
return [...
|
|
154
|
-
}, [e]),
|
|
158
|
+
return [...r.values()].sort((s, i) => i.rows.length - s.rows.length);
|
|
159
|
+
}, [e]), C = async (r, s) => {
|
|
155
160
|
var d;
|
|
156
161
|
const i = s.map((c) => c.key);
|
|
157
|
-
|
|
162
|
+
z((c) => /* @__PURE__ */ new Set([...c, ...i]));
|
|
158
163
|
try {
|
|
159
|
-
const c = await l.mutateAsync({ signal: t.id, row_keys: i, action:
|
|
164
|
+
const c = await l.mutateAsync({ signal: t.id, row_keys: i, action: r });
|
|
160
165
|
S((n) => {
|
|
161
166
|
const u = { ...n };
|
|
162
|
-
for (const
|
|
167
|
+
for (const f of c) u[f.key] = f;
|
|
163
168
|
return u;
|
|
164
|
-
}),
|
|
169
|
+
}), k((n) => new Set([...n].filter((u) => !i.includes(u))));
|
|
165
170
|
} catch (c) {
|
|
166
171
|
const n = ((d = c == null ? void 0 : c.response) == null ? void 0 : d.error) ?? (c instanceof Error ? c.message : "The action failed");
|
|
167
172
|
S((u) => {
|
|
168
|
-
const
|
|
169
|
-
for (const w of i)
|
|
170
|
-
return
|
|
173
|
+
const f = { ...u };
|
|
174
|
+
for (const w of i) f[w] = { key: w, ok: !1, message: n };
|
|
175
|
+
return f;
|
|
171
176
|
});
|
|
172
177
|
} finally {
|
|
173
|
-
|
|
178
|
+
z((c) => new Set([...c].filter((n) => !i.includes(n))));
|
|
174
179
|
}
|
|
175
|
-
},
|
|
180
|
+
}, _ = async (r) => {
|
|
176
181
|
var i;
|
|
177
|
-
const s =
|
|
178
|
-
|
|
182
|
+
const s = r.map((d) => d.key);
|
|
183
|
+
z((d) => /* @__PURE__ */ new Set([...d, ...s]));
|
|
179
184
|
try {
|
|
180
|
-
await
|
|
185
|
+
await h.mutateAsync({ signal: t.id, row_keys: s }), k((d) => new Set([...d].filter((c) => !s.includes(c))));
|
|
181
186
|
} catch (d) {
|
|
182
187
|
const c = ((i = d == null ? void 0 : d.response) == null ? void 0 : i.error) ?? (d instanceof Error ? d.message : "Could not dismiss");
|
|
183
188
|
S((n) => {
|
|
184
189
|
const u = { ...n };
|
|
185
|
-
for (const
|
|
190
|
+
for (const f of s) u[f] = { key: f, ok: !1, message: c };
|
|
186
191
|
return u;
|
|
187
192
|
});
|
|
188
193
|
} finally {
|
|
189
|
-
|
|
194
|
+
z((d) => new Set([...d].filter((c) => !s.includes(c))));
|
|
190
195
|
}
|
|
191
|
-
},
|
|
196
|
+
}, N = (r, s) => {
|
|
192
197
|
var i, d, c, n;
|
|
193
|
-
if (
|
|
194
|
-
const u = ((i =
|
|
195
|
-
u &&
|
|
198
|
+
if (r.kind === "open") {
|
|
199
|
+
const u = ((i = r.payload) == null ? void 0 : i.collection) ?? ((d = s.record) == null ? void 0 : d.collection), f = ((c = r.payload) == null ? void 0 : c.id) ?? ((n = s.record) == null ? void 0 : n.id);
|
|
200
|
+
u && f && (m == null || m(u, String(f)));
|
|
196
201
|
return;
|
|
197
202
|
}
|
|
198
|
-
if (
|
|
199
|
-
|
|
203
|
+
if (r.kind === "explain") {
|
|
204
|
+
g == null || g(r, s);
|
|
200
205
|
return;
|
|
201
206
|
}
|
|
202
|
-
|
|
203
|
-
},
|
|
204
|
-
|
|
207
|
+
C(r, [s]);
|
|
208
|
+
}, D = (r, s) => /* @__PURE__ */ o(
|
|
209
|
+
pe,
|
|
205
210
|
{
|
|
206
211
|
signal: t,
|
|
207
|
-
row:
|
|
208
|
-
result: v[
|
|
209
|
-
busy: y.has(
|
|
212
|
+
row: r,
|
|
213
|
+
result: v[r.key],
|
|
214
|
+
busy: y.has(r.key),
|
|
210
215
|
selectable: s,
|
|
211
|
-
selected:
|
|
212
|
-
onSelect: (i) =>
|
|
216
|
+
selected: $.has(r.key),
|
|
217
|
+
onSelect: (i) => k((d) => {
|
|
213
218
|
const c = new Set(d);
|
|
214
|
-
return i ? c.add(
|
|
219
|
+
return i ? c.add(r.key) : c.delete(r.key), c;
|
|
215
220
|
}),
|
|
216
|
-
onAction: (i) =>
|
|
221
|
+
onAction: (i) => N(i, r),
|
|
217
222
|
onOpenRecord: m,
|
|
218
223
|
canExplain: p
|
|
219
224
|
},
|
|
220
|
-
|
|
225
|
+
r.key
|
|
221
226
|
);
|
|
222
|
-
if (!
|
|
223
|
-
const
|
|
227
|
+
if (!b) {
|
|
228
|
+
const r = e.length > 0 && e.every((i) => $.has(i.key)), s = e.filter((i) => $.has(i.key));
|
|
224
229
|
return /* @__PURE__ */ a("div", { children: [
|
|
225
230
|
e.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-h-9 items-center gap-2.5 bg-muted/60 px-4 py-1.5", children: [
|
|
226
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ o(
|
|
227
232
|
"input",
|
|
228
233
|
{
|
|
229
234
|
type: "checkbox",
|
|
230
|
-
checked:
|
|
235
|
+
checked: r,
|
|
231
236
|
ref: (i) => {
|
|
232
|
-
i && (i.indeterminate = s.length > 0 && !
|
|
237
|
+
i && (i.indeterminate = s.length > 0 && !r);
|
|
233
238
|
},
|
|
234
|
-
onChange: (i) =>
|
|
239
|
+
onChange: (i) => k(new Set(i.target.checked ? e.map((d) => d.key) : [])),
|
|
235
240
|
"aria-label": "Select every problem",
|
|
236
241
|
"data-ic-select-all": !0,
|
|
237
242
|
className: "h-3.5 w-3.5 accent-[rgb(var(--nvr-cyan-rgb))]"
|
|
@@ -243,36 +248,36 @@ function ce({
|
|
|
243
248
|
type: "button",
|
|
244
249
|
"data-ic-bulk-action": "dismiss",
|
|
245
250
|
disabled: s.some((i) => y.has(i.key)),
|
|
246
|
-
onClick: () => void
|
|
251
|
+
onClick: () => void _(s),
|
|
247
252
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground hover:bg-muted disabled:opacity-60",
|
|
248
253
|
children: [
|
|
249
|
-
s.some((i) => y.has(i.key)) && /* @__PURE__ */
|
|
254
|
+
s.some((i) => y.has(i.key)) && /* @__PURE__ */ o(K, { className: "h-3 w-3 animate-spin" }),
|
|
250
255
|
"Dismiss selected ",
|
|
251
256
|
s.length
|
|
252
257
|
]
|
|
253
258
|
}
|
|
254
|
-
) : /* @__PURE__ */
|
|
259
|
+
) : /* @__PURE__ */ o("span", { className: "text-[12px] text-muted-foreground", children: "Select problems to dismiss several at once" })
|
|
255
260
|
] }),
|
|
256
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ o("ul", { className: "divide-y divide-border", children: e.map((i) => D(i, !0)) })
|
|
257
262
|
] });
|
|
258
263
|
}
|
|
259
|
-
return /* @__PURE__ */
|
|
260
|
-
const s =
|
|
264
|
+
return /* @__PURE__ */ o("div", { className: "pb-1", children: b.map((r) => {
|
|
265
|
+
const s = r.rows.filter((n) => $.has(n.key)), i = r.rows.length > 0 && s.length === r.rows.length, d = /* @__PURE__ */ new Map();
|
|
261
266
|
for (const n of s) {
|
|
262
267
|
const u = /* @__PURE__ */ new Set();
|
|
263
|
-
for (const
|
|
264
|
-
if (!
|
|
265
|
-
const w =
|
|
268
|
+
for (const f of n.actions) {
|
|
269
|
+
if (!de.includes(f.kind)) continue;
|
|
270
|
+
const w = ce(f);
|
|
266
271
|
if (u.has(w)) continue;
|
|
267
272
|
u.add(w);
|
|
268
|
-
const M = d.get(w) ?? { action:
|
|
273
|
+
const M = d.get(w) ?? { action: f, rows: [] };
|
|
269
274
|
M.rows.push(n), d.set(w, M);
|
|
270
275
|
}
|
|
271
276
|
}
|
|
272
277
|
const c = s.some((n) => y.has(n.key));
|
|
273
|
-
return /* @__PURE__ */ a("div", { "data-ic-group":
|
|
278
|
+
return /* @__PURE__ */ a("div", { "data-ic-group": r.key, className: "mt-2 first:mt-1", children: [
|
|
274
279
|
/* @__PURE__ */ a("div", { className: "flex min-h-9 items-center gap-2.5 bg-muted/60 px-4 py-1.5", children: [
|
|
275
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ o(
|
|
276
281
|
"input",
|
|
277
282
|
{
|
|
278
283
|
type: "checkbox",
|
|
@@ -280,19 +285,19 @@ function ce({
|
|
|
280
285
|
ref: (n) => {
|
|
281
286
|
n && (n.indeterminate = s.length > 0 && !i);
|
|
282
287
|
},
|
|
283
|
-
onChange: (n) =>
|
|
284
|
-
const
|
|
285
|
-
for (const w of
|
|
286
|
-
n.target.checked ?
|
|
287
|
-
return
|
|
288
|
+
onChange: (n) => k((u) => {
|
|
289
|
+
const f = new Set(u);
|
|
290
|
+
for (const w of r.rows)
|
|
291
|
+
n.target.checked ? f.add(w.key) : f.delete(w.key);
|
|
292
|
+
return f;
|
|
288
293
|
}),
|
|
289
|
-
"aria-label": `Select every problem in ${
|
|
290
|
-
"data-ic-group-select":
|
|
294
|
+
"aria-label": `Select every problem in ${r.label}`,
|
|
295
|
+
"data-ic-group-select": r.key,
|
|
291
296
|
className: "h-3.5 w-3.5 accent-[rgb(var(--nvr-cyan-rgb))]"
|
|
292
297
|
}
|
|
293
298
|
),
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ o("span", { className: "text-[12.5px] font-semibold text-foreground", children: r.label }),
|
|
300
|
+
/* @__PURE__ */ o("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: r.rows.length }),
|
|
296
301
|
/* @__PURE__ */ a("span", { className: "ml-auto flex items-center gap-1", children: [
|
|
297
302
|
[...d.entries()].map(([n, u]) => /* @__PURE__ */ a(
|
|
298
303
|
"button",
|
|
@@ -300,7 +305,7 @@ function ce({
|
|
|
300
305
|
type: "button",
|
|
301
306
|
"data-ic-bulk-action": u.action.kind,
|
|
302
307
|
onClick: () => {
|
|
303
|
-
|
|
308
|
+
C(u.action, u.rows);
|
|
304
309
|
},
|
|
305
310
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground hover:bg-muted",
|
|
306
311
|
children: [
|
|
@@ -317,77 +322,77 @@ function ce({
|
|
|
317
322
|
type: "button",
|
|
318
323
|
"data-ic-bulk-action": "dismiss",
|
|
319
324
|
disabled: c,
|
|
320
|
-
onClick: () => void
|
|
325
|
+
onClick: () => void _(s),
|
|
321
326
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground hover:bg-muted disabled:opacity-60",
|
|
322
327
|
children: [
|
|
323
|
-
c && /* @__PURE__ */
|
|
328
|
+
c && /* @__PURE__ */ o(K, { className: "h-3 w-3 animate-spin" }),
|
|
324
329
|
"Dismiss selected ",
|
|
325
330
|
s.length
|
|
326
331
|
]
|
|
327
332
|
}
|
|
328
333
|
),
|
|
329
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ o(
|
|
330
335
|
P,
|
|
331
336
|
{
|
|
332
337
|
signal: t.id,
|
|
333
338
|
signalLabel: t.label,
|
|
334
|
-
group: { key:
|
|
339
|
+
group: { key: r.key, label: r.label },
|
|
335
340
|
defaultScope: "group"
|
|
336
341
|
}
|
|
337
342
|
)
|
|
338
343
|
] })
|
|
339
344
|
] }),
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
] },
|
|
345
|
+
/* @__PURE__ */ o("ul", { className: "divide-y divide-border", children: r.rows.map((n) => D(n, !0)) })
|
|
346
|
+
] }, r.key);
|
|
342
347
|
}) });
|
|
343
348
|
}
|
|
344
349
|
function E(t) {
|
|
345
350
|
return t.label ? t.label : `${H(t.collection).replace(/s$/, "")} ${t.id}`;
|
|
346
351
|
}
|
|
347
|
-
function
|
|
352
|
+
function pe({
|
|
348
353
|
signal: t,
|
|
349
354
|
row: e,
|
|
350
355
|
result: m,
|
|
351
|
-
busy:
|
|
356
|
+
busy: g,
|
|
352
357
|
selectable: p,
|
|
353
358
|
selected: l,
|
|
354
|
-
onSelect:
|
|
359
|
+
onSelect: h,
|
|
355
360
|
onAction: v,
|
|
356
361
|
onOpenRecord: S,
|
|
357
362
|
canExplain: y
|
|
358
363
|
}) {
|
|
359
364
|
var i, d, c;
|
|
360
|
-
const
|
|
365
|
+
const z = e.since ?? e.first_seen, $ = e.actions.filter(
|
|
361
366
|
(n) => !(n.kind === "open" && e.record) && !(n.kind === "explain" && (y == null ? void 0 : y(n)) === !1)
|
|
362
|
-
), { isAdmin:
|
|
367
|
+
), { isAdmin: k } = q(), [b, C] = L(!1), _ = V(), N = X(null), D = ne(e.drill), r = ((i = e.drill) == null ? void 0 : i.kind) === "submission" ? e.actions.find((n) => {
|
|
363
368
|
var u;
|
|
364
369
|
return n.kind === "retry_submission" && n.id === ((u = e.drill) == null ? void 0 : u.id);
|
|
365
370
|
}) : void 0, s = () => {
|
|
366
371
|
var n;
|
|
367
|
-
|
|
372
|
+
C(!1), (n = N.current) == null || n.focus();
|
|
368
373
|
};
|
|
369
374
|
return /* @__PURE__ */ a(
|
|
370
375
|
"li",
|
|
371
376
|
{
|
|
372
377
|
"data-ic-row": e.key,
|
|
373
|
-
"data-ic-row-open":
|
|
374
|
-
className: x(
|
|
378
|
+
"data-ic-row-open": b ? "" : void 0,
|
|
379
|
+
className: x(b && "bg-muted/30"),
|
|
375
380
|
children: [
|
|
376
381
|
/* @__PURE__ */ a("div", { className: "flex gap-3 px-4 py-2.5", children: [
|
|
377
|
-
p && /* @__PURE__ */
|
|
382
|
+
p && /* @__PURE__ */ o(
|
|
378
383
|
"input",
|
|
379
384
|
{
|
|
380
385
|
type: "checkbox",
|
|
381
386
|
checked: l,
|
|
382
|
-
onChange: (n) =>
|
|
387
|
+
onChange: (n) => h(n.target.checked),
|
|
383
388
|
"aria-label": `Select ${e.title}`,
|
|
384
389
|
"data-ic-select-row": e.key,
|
|
385
390
|
className: "mt-1 h-3.5 w-3.5 shrink-0 accent-[rgb(var(--nvr-cyan-rgb))]"
|
|
386
391
|
}
|
|
387
392
|
),
|
|
388
393
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
e.detail && /* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ o("p", { className: "text-[12.5px] font-medium text-foreground", children: e.title }),
|
|
395
|
+
e.detail && /* @__PURE__ */ o(
|
|
391
396
|
"p",
|
|
392
397
|
{
|
|
393
398
|
className: "mt-0.5 line-clamp-2 break-words text-[12px] leading-snug text-muted-foreground",
|
|
@@ -395,10 +400,10 @@ function ue({
|
|
|
395
400
|
children: e.detail
|
|
396
401
|
}
|
|
397
402
|
),
|
|
398
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ o(
|
|
399
404
|
I,
|
|
400
405
|
{
|
|
401
|
-
since:
|
|
406
|
+
since: z,
|
|
402
407
|
record: e.record,
|
|
403
408
|
onOpenRecord: S,
|
|
404
409
|
className: "mt-1 flex-wrap gap-x-2 xl:hidden"
|
|
@@ -411,15 +416,15 @@ function ue({
|
|
|
411
416
|
"data-ic-result": m.ok ? "ok" : "failed",
|
|
412
417
|
className: x(
|
|
413
418
|
"mt-1 flex items-start gap-1.5 text-[12px] font-medium",
|
|
414
|
-
|
|
419
|
+
T[m.ok ? "positive" : "negative"]
|
|
415
420
|
),
|
|
416
421
|
children: [
|
|
417
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ o(
|
|
418
423
|
"span",
|
|
419
424
|
{
|
|
420
425
|
className: x(
|
|
421
426
|
"mt-[5px] h-1.5 w-1.5 shrink-0 rounded-full",
|
|
422
|
-
|
|
427
|
+
ie[m.ok ? "positive" : "negative"]
|
|
423
428
|
)
|
|
424
429
|
}
|
|
425
430
|
),
|
|
@@ -428,10 +433,10 @@ function ue({
|
|
|
428
433
|
}
|
|
429
434
|
)
|
|
430
435
|
] }),
|
|
431
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ o(
|
|
432
437
|
I,
|
|
433
438
|
{
|
|
434
|
-
since:
|
|
439
|
+
since: z,
|
|
435
440
|
record: e.record,
|
|
436
441
|
onOpenRecord: S,
|
|
437
442
|
className: "hidden w-[210px] shrink-0 flex-col items-start gap-0.5 pt-0.5 xl:flex",
|
|
@@ -439,30 +444,30 @@ function ue({
|
|
|
439
444
|
}
|
|
440
445
|
),
|
|
441
446
|
/* @__PURE__ */ a("div", { className: "flex shrink-0 items-start gap-1", children: [
|
|
442
|
-
|
|
447
|
+
D && /* @__PURE__ */ a(
|
|
443
448
|
"button",
|
|
444
449
|
{
|
|
445
|
-
ref:
|
|
450
|
+
ref: N,
|
|
446
451
|
type: "button",
|
|
447
452
|
"data-ic-drill-toggle": `${(d = e.drill) == null ? void 0 : d.kind}:${(c = e.drill) == null ? void 0 : c.id}`,
|
|
448
|
-
"aria-expanded":
|
|
449
|
-
"aria-controls":
|
|
450
|
-
onClick: () =>
|
|
453
|
+
"aria-expanded": b,
|
|
454
|
+
"aria-controls": b ? _ : void 0,
|
|
455
|
+
onClick: () => C((n) => !n),
|
|
451
456
|
onKeyDown: (n) => {
|
|
452
|
-
n.key === "Escape" &&
|
|
457
|
+
n.key === "Escape" && b && (n.preventDefault(), n.stopPropagation(), C(!1));
|
|
453
458
|
},
|
|
454
459
|
className: x(
|
|
455
460
|
"inline-flex h-7 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
456
|
-
|
|
461
|
+
b ? "border-[color:rgb(var(--nvr-cyan-rgb)/0.45)] bg-[color:rgb(var(--nvr-cyan-rgb)/0.10)] text-foreground dark:bg-[color:rgb(var(--nvr-cyan-rgb)/0.16)]" : "border-border bg-card text-foreground hover:bg-muted"
|
|
457
462
|
),
|
|
458
463
|
children: [
|
|
459
464
|
"Details",
|
|
460
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ o(
|
|
461
466
|
O,
|
|
462
467
|
{
|
|
463
468
|
className: x(
|
|
464
469
|
"h-3 w-3 transition-transform duration-200",
|
|
465
|
-
|
|
470
|
+
b && "rotate-180"
|
|
466
471
|
),
|
|
467
472
|
"aria-hidden": !0
|
|
468
473
|
}
|
|
@@ -470,23 +475,23 @@ function ue({
|
|
|
470
475
|
]
|
|
471
476
|
}
|
|
472
477
|
),
|
|
473
|
-
|
|
478
|
+
$.map((n) => /* @__PURE__ */ a(
|
|
474
479
|
"button",
|
|
475
480
|
{
|
|
476
481
|
type: "button",
|
|
477
482
|
"data-ic-action": n.kind,
|
|
478
|
-
disabled:
|
|
483
|
+
disabled: g,
|
|
479
484
|
onClick: () => v(n),
|
|
480
485
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
481
486
|
children: [
|
|
482
|
-
|
|
487
|
+
g && n.kind !== "explain" && /* @__PURE__ */ o(K, { className: "h-3 w-3 animate-spin" }),
|
|
483
488
|
n.label
|
|
484
489
|
]
|
|
485
490
|
},
|
|
486
491
|
U(n)
|
|
487
492
|
)),
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ o(re, { signal: t.id, rowKey: e.key }),
|
|
494
|
+
/* @__PURE__ */ o(
|
|
490
495
|
P,
|
|
491
496
|
{
|
|
492
497
|
signal: t.id,
|
|
@@ -498,7 +503,7 @@ function ue({
|
|
|
498
503
|
)
|
|
499
504
|
] })
|
|
500
505
|
] }),
|
|
501
|
-
|
|
506
|
+
k && /* @__PURE__ */ o("div", { className: "pb-3 pl-11 pr-4", "data-ic-explain": e.key, children: /* @__PURE__ */ o(
|
|
502
507
|
J,
|
|
503
508
|
{
|
|
504
509
|
kind: "signal-row",
|
|
@@ -506,23 +511,23 @@ function ue({
|
|
|
506
511
|
label: "Explain this failure"
|
|
507
512
|
}
|
|
508
513
|
) }),
|
|
509
|
-
|
|
510
|
-
/* @__PURE__ */
|
|
514
|
+
b && D && e.drill && // Esc anywhere inside the open drill collapses it.
|
|
515
|
+
/* @__PURE__ */ o(
|
|
511
516
|
"section",
|
|
512
517
|
{
|
|
513
|
-
id:
|
|
518
|
+
id: _,
|
|
514
519
|
"aria-label": `Details: ${e.title}`,
|
|
515
520
|
onKeyDown: (n) => {
|
|
516
521
|
n.key === "Escape" && !n.defaultPrevented && (n.stopPropagation(), s());
|
|
517
522
|
},
|
|
518
523
|
className: "border-t border-border pb-4 pl-11 pr-4 pt-3",
|
|
519
|
-
children: /* @__PURE__ */
|
|
520
|
-
|
|
524
|
+
children: /* @__PURE__ */ o(
|
|
525
|
+
oe,
|
|
521
526
|
{
|
|
522
527
|
drill: e.drill,
|
|
523
528
|
onOpenRecord: S,
|
|
524
|
-
onRetry:
|
|
525
|
-
retryBusy:
|
|
529
|
+
onRetry: r ? () => v(r) : void 0,
|
|
530
|
+
retryBusy: g
|
|
526
531
|
}
|
|
527
532
|
)
|
|
528
533
|
}
|
|
@@ -535,16 +540,16 @@ function I({
|
|
|
535
540
|
since: t,
|
|
536
541
|
record: e,
|
|
537
542
|
onOpenRecord: m,
|
|
538
|
-
className:
|
|
543
|
+
className: g,
|
|
539
544
|
stacked: p
|
|
540
545
|
}) {
|
|
541
|
-
return /* @__PURE__ */ a("div", { className: x("flex items-center text-[11.5px] text-muted-foreground",
|
|
546
|
+
return /* @__PURE__ */ a("div", { className: x("flex items-center text-[11.5px] text-muted-foreground", g), children: [
|
|
542
547
|
/* @__PURE__ */ a("span", { "data-tip": R(t), className: "tabular-nums", children: [
|
|
543
548
|
"Since ",
|
|
544
|
-
|
|
549
|
+
se(t)
|
|
545
550
|
] }),
|
|
546
551
|
e && /* @__PURE__ */ a(A, { children: [
|
|
547
|
-
!p && /* @__PURE__ */
|
|
552
|
+
!p && /* @__PURE__ */ o("span", { "aria-hidden": !0, children: "·" }),
|
|
548
553
|
m ? /* @__PURE__ */ a(
|
|
549
554
|
"button",
|
|
550
555
|
{
|
|
@@ -554,23 +559,23 @@ function I({
|
|
|
554
559
|
className: "inline-flex max-w-full items-center gap-1 truncate font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground",
|
|
555
560
|
children: [
|
|
556
561
|
E(e),
|
|
557
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ o(W, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": !0 })
|
|
558
563
|
]
|
|
559
564
|
}
|
|
560
|
-
) : /* @__PURE__ */
|
|
565
|
+
) : /* @__PURE__ */ o("span", { className: "font-medium text-foreground", children: E(e) })
|
|
561
566
|
] })
|
|
562
567
|
] });
|
|
563
568
|
}
|
|
564
|
-
function
|
|
565
|
-
const { remove: e } =
|
|
569
|
+
function fe({ signal: t }) {
|
|
570
|
+
const { remove: e } = te(), m = /* @__PURE__ */ new Map();
|
|
566
571
|
for (const p of t.snoozed) {
|
|
567
572
|
if (!p.snooze) continue;
|
|
568
573
|
const l = m.get(p.snooze.id) ?? [];
|
|
569
574
|
l.push(p), m.set(p.snooze.id, l);
|
|
570
575
|
}
|
|
571
|
-
const
|
|
572
|
-
return /* @__PURE__ */
|
|
573
|
-
const l = p.snooze,
|
|
576
|
+
const g = (p) => new Set(p.map((h) => h.group ?? "")).size === 1 && p[0].group ? `everything in ${p[0].group_label ?? p[0].group}` : `all of “${t.label}”`;
|
|
577
|
+
return /* @__PURE__ */ o("ul", { className: "divide-y divide-border border-t border-border bg-muted/30", children: t.snoozed.map((p) => {
|
|
578
|
+
const l = p.snooze, h = l ? m.get(l.id) ?? [] : [], v = l != null && l.until_occurrence ? "Dismissed — shows again if it happens again" : `Snoozed ${l != null && l.until_change ? "until it changes" : l != null && l.until ? `until ${new Date(l.until).toLocaleString(void 0, {
|
|
574
579
|
month: "short",
|
|
575
580
|
day: "numeric",
|
|
576
581
|
hour: "numeric",
|
|
@@ -578,30 +583,30 @@ function me({ signal: t }) {
|
|
|
578
583
|
})}` : ""}`;
|
|
579
584
|
return /* @__PURE__ */ a("li", { "data-ic-row": p.key, "data-ic-snoozed": !0, className: "flex gap-3 px-4 py-2", children: [
|
|
580
585
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
581
|
-
/* @__PURE__ */
|
|
586
|
+
/* @__PURE__ */ o("p", { className: "truncate text-[12.5px] text-foreground", children: p.title }),
|
|
582
587
|
/* @__PURE__ */ a("p", { className: "text-[11.5px] text-muted-foreground", children: [
|
|
583
588
|
v,
|
|
584
|
-
|
|
589
|
+
h.length > 1 ? ` with ${g(h)}` : "",
|
|
585
590
|
l != null && l.note ? ` — “${l.note}”` : ""
|
|
586
591
|
] })
|
|
587
592
|
] }),
|
|
588
|
-
l && /* @__PURE__ */
|
|
593
|
+
l && /* @__PURE__ */ o(
|
|
589
594
|
"button",
|
|
590
595
|
{
|
|
591
596
|
type: "button",
|
|
592
597
|
"data-ic-unsnooze": l.id,
|
|
593
|
-
"data-ic-unsnooze-count":
|
|
594
|
-
"data-tip":
|
|
598
|
+
"data-ic-unsnooze-count": h.length,
|
|
599
|
+
"data-tip": h.length > 1 ? `This snooze covers ${h.length} problems (${g(h)}) — they all come back` : void 0,
|
|
595
600
|
disabled: e.isPending && e.variables === l.id,
|
|
596
601
|
onClick: () => e.mutate(l.id),
|
|
597
602
|
className: "h-7 shrink-0 rounded-md px-2.5 text-[12px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-60",
|
|
598
|
-
children:
|
|
603
|
+
children: h.length > 1 ? `Unsnooze all ${h.length}` : l != null && l.until_occurrence ? "Undo" : "Unsnooze"
|
|
599
604
|
}
|
|
600
605
|
)
|
|
601
606
|
] }, p.key);
|
|
602
607
|
}) });
|
|
603
608
|
}
|
|
604
609
|
export {
|
|
605
|
-
|
|
606
|
-
|
|
610
|
+
$e as SignalCard,
|
|
611
|
+
ue as oldestSeen
|
|
607
612
|
};
|