@debugkit/dashboard 0.6.1 → 0.8.0

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.
Files changed (58) hide show
  1. package/dist/client/assets/_authed-CNObwuZh.js +7 -0
  2. package/dist/client/assets/_authed-CuP-He8G.js +1 -0
  3. package/dist/client/assets/{charts-XyOWJI9T.js → charts-CUvev8lV.js} +7 -7
  4. package/dist/client/assets/copy-button-ORgLIh59.js +1 -0
  5. package/dist/client/assets/customers-DTMEprFQ.js +1 -0
  6. package/dist/client/assets/endpoints-lMSO2CdM.js +1 -0
  7. package/dist/client/assets/events._eventId-bWag-i8J.js +3 -0
  8. package/dist/client/assets/index-BNpacHyi.js +10 -0
  9. package/dist/client/assets/invite._token-CxXek2SP.js +1 -0
  10. package/dist/client/assets/issues._fingerprint-BQr85TVY.js +1 -0
  11. package/dist/client/assets/login-Dlk3GyyC.js +1 -0
  12. package/dist/client/assets/sessions._sessionId-3wNImMqM.js +1 -0
  13. package/dist/client/assets/settings-CzbEYB7k.js +1 -0
  14. package/dist/client/assets/src-Dq5mIUf0.js +3 -0
  15. package/dist/client/assets/styles-DPsgRH7g.css +2 -0
  16. package/dist/client/assets/team-Bud2-07A.js +1 -0
  17. package/dist/client/assets/timeline-BSDhQPpY.js +1 -0
  18. package/dist/client/assets/ui-CEv2y56s.js +1 -0
  19. package/dist/server/assets/{_authed-CrjuC0O3.js → _authed-DkkRwdZl.js} +19 -5
  20. package/dist/server/assets/{_authed-C-sIPXSO.js → _authed-DsB8kjZB.js} +318 -126
  21. package/dist/server/assets/_tanstack-start-manifest_v-D1_ErrJK.js +97 -0
  22. package/dist/server/assets/copy-button-D3RddzTw.js +52 -0
  23. package/dist/server/assets/customers-CvSLt_xV.js +163 -0
  24. package/dist/server/assets/{demo-BsMMDk_F.js → demo-BRTkdmQJ.js} +25 -4
  25. package/dist/server/assets/{dynamodb-Zkk1-mgz.js → dynamodb-B0V3ZO20.js} +45 -17
  26. package/dist/server/assets/endpoints-mPQXpH8C.js +371 -0
  27. package/dist/server/assets/{queries-BJxX3Kjp.js → errors-C2KEDL7l.js} +842 -62
  28. package/dist/server/assets/events._eventId-pkQBQ9sL.js +765 -0
  29. package/dist/server/assets/{firestore-C52q_vwM.js → firestore-Jd-LeWZI.js} +15 -6
  30. package/dist/server/assets/fns-B3PHbFwV.js +1295 -0
  31. package/dist/server/assets/{fns-DwGaMi8S.js → fns-Di0vMpkQ.js} +25 -3
  32. package/dist/server/assets/{invite._token-xnpnkdRv.js → invite._token-LwWF5YxP.js} +3 -3
  33. package/dist/server/assets/{issues._fingerprint-e7ubdJf0.js → issues._fingerprint-DAA0QCuA.js} +89 -11
  34. package/dist/server/assets/{login-EopnOJXA.js → login-DqjCU4DJ.js} +3 -3
  35. package/dist/server/assets/{memory-BssaqdZm.js → memory-aqsrtEUn.js} +377 -26
  36. package/dist/server/assets/router-C0Dauj2C.js +510 -0
  37. package/dist/server/assets/sessions._sessionId-D7JPV0M4.js +264 -0
  38. package/dist/server/assets/{settings-CaJN69N6.js → settings-Drjd64d7.js} +165 -5
  39. package/dist/server/assets/{src-D83GYTrp.js → src-C4fNgijW.js} +1 -1
  40. package/dist/server/assets/{team-B1UcM1jA.js → team-D7iXYnSE.js} +3 -3
  41. package/dist/server/assets/timeline-MDRNDhiA.js +132 -0
  42. package/dist/server/assets/{ui-BJokJdYa.js → ui-B_XHlLUQ.js} +53 -13
  43. package/dist/server/server.js +37 -21
  44. package/package.json +4 -4
  45. package/dist/client/assets/_authed-BN39b-7H.js +0 -1
  46. package/dist/client/assets/_authed-CspAf0jN.js +0 -7
  47. package/dist/client/assets/index-Bfb2UOzB.js +0 -10
  48. package/dist/client/assets/invite._token-B4HN51-h.js +0 -1
  49. package/dist/client/assets/issues._fingerprint-BV1QrETY.js +0 -1
  50. package/dist/client/assets/login-COlvJ5Je.js +0 -1
  51. package/dist/client/assets/preload-helper-Dscj_TcA.js +0 -3
  52. package/dist/client/assets/settings-Dl4EWeWC.js +0 -1
  53. package/dist/client/assets/styles-DztngwT9.css +0 -2
  54. package/dist/client/assets/team-7Zekz_Er.js +0 -1
  55. package/dist/client/assets/ui-C0HGOza2.js +0 -1
  56. package/dist/server/assets/_tanstack-start-manifest_v-CqaE4wze.js +0 -61
  57. package/dist/server/assets/fns-mbUIXXep.js +0 -529
  58. package/dist/server/assets/router-G99085_Q.js +0 -315
@@ -1,11 +1,12 @@
1
1
  import { r as TrendChart, t as FlowChart } from "./charts-DzTVqJ8z.js";
2
- import { a as SeverityBadge, c as timeAgo, n as DataTable, o as ShareBars, r as IssueLabels, s as Stat, t as Card } from "./ui-BJokJdYa.js";
2
+ import { c as Stat, i as LabelBadges, l as timeAgo, n as DataTable, o as SeverityBadge, r as IssueLabels, s as ShareBars, t as Card } from "./ui-B_XHlLUQ.js";
3
+ import { d as LABEL_FILTERS, f as LABEL_FILTER_KEYS, g as labelCounts, h as filterIssues, m as STATUS_FILTERS, p as NO_LABEL_FILTERS, u as Route } from "./router-C0Dauj2C.js";
3
4
  import { n as RetentionNote, t as RangePicker } from "./range-picker-0zbSGr3Z.js";
4
- import { o as Route } from "./router-G99085_Q.js";
5
5
  import { useEffect } from "react";
6
6
  import { Link, useNavigate, useRouter } from "@tanstack/react-router";
7
- import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  // src/routes/_authed/index.tsx?tsr-split=component
9
+ var labelName = (k, id) => LABEL_FILTERS[k].info[id]?.name ?? id;
9
10
  function Overview() {
10
11
  const summary = Route.useLoaderData();
11
12
  const search = Route.useSearch();
@@ -14,10 +15,41 @@ function Overview() {
14
15
  if (!summary) return /* @__PURE__ */ jsx(EmptyState, {});
15
16
  const { totals, range } = summary;
16
17
  const span = range.preset === "custom" ? "range" : range.preset;
18
+ /** Keep the app and range when opening an issue. */
19
+ const issueSearch = {
20
+ app: summary.app,
21
+ range: range.preset === "14d" ? void 0 : range.preset,
22
+ ...range.preset === "custom" ? {
23
+ from: range.from,
24
+ to: range.to
25
+ } : {}
26
+ };
17
27
  const statusFilter = search.status ?? "open";
18
- const byStatus = summary.issues.filter((i) => statusFilter === "all" ? true : statusFilter === "open" ? i.status === "open" || i.status === "regressed" : i.status === statusFilter);
19
- const issues = flow ? byStatus.filter((i) => (i.flow ?? "untagged") === flow) : byStatus;
20
- const countFor = (st) => summary.issues.filter((i) => st === "open" ? i.status === "open" || i.status === "regressed" : i.status === st).length;
28
+ const filter = {
29
+ status: statusFilter,
30
+ flow,
31
+ category: search.category,
32
+ owner: search.owner,
33
+ impact: search.impact
34
+ };
35
+ const issues = filterIssues(summary.issues, filter);
36
+ const countFor = (st) => filterIssues(summary.issues, {
37
+ ...filter,
38
+ status: st
39
+ }).length;
40
+ const labelFiltered = LABEL_FILTER_KEYS.filter((k) => filter[k]);
41
+ const toggleLabel = (k, v) => navigate({
42
+ search: (s) => ({
43
+ ...s,
44
+ [k]: s[k] === v ? void 0 : v
45
+ }),
46
+ resetScroll: false
47
+ });
48
+ /** "Whose is it" for a label-filtered list: its issues by owner, worst first. */
49
+ const owners = labelFiltered.length && !filter.owner ? [...labelCounts(summary.issues, filter, "owner")].sort((a, b) => b[1] - a[1]) : [];
50
+ /** Issues hidden only by the status filter: a bar's errors can all belong to resolved issues. */
51
+ const otherStatuses = issues.length === 0 && statusFilter !== "all" ? countFor("all") : 0;
52
+ const issuesTitle = labelFiltered.length ? `Issues: ${labelFiltered.map((k) => labelName(k, filter[k])).join(" · ")}${flow ? ` in ${flow}` : ""}` : flow ? `Issues in ${flow}` : "Issues by severity";
21
53
  const change = totals.changePct;
22
54
  return /* @__PURE__ */ jsxs("main", {
23
55
  className: "mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6",
@@ -105,10 +137,13 @@ function Overview() {
105
137
  subtitle: `Errors in ${range.label} by flow, coloured by worst severity. Click a bar to filter issues.`,
106
138
  children: [/* @__PURE__ */ jsx(FlowChart, {
107
139
  data: summary.flows,
108
- onSelect: (f) => navigate({ search: (s) => ({
109
- ...s,
110
- flow: s.flow === f ? void 0 : f
111
- }) })
140
+ onSelect: (f) => navigate({
141
+ search: (s) => ({
142
+ ...s,
143
+ flow: s.flow === f ? void 0 : f
144
+ }),
145
+ resetScroll: false
146
+ })
112
147
  }), /* @__PURE__ */ jsx(DataTable, {
113
148
  columns: [
114
149
  "Flow",
@@ -228,6 +263,7 @@ function Overview() {
228
263
  subtitle: `Requests that returned 5xx, timed out or failed in ${range.label}. Captured automatically from fetch and XHR.`,
229
264
  children: summary.health.endpoints.length ? /* @__PURE__ */ jsx(ShareBars, { rows: summary.health.endpoints.map((e) => ({
230
265
  key: e.endpoint,
266
+ label: e.label,
231
267
  value: e.failuresRange
232
268
  })) }) : /* @__PURE__ */ jsx("p", {
233
269
  className: "text-sm text-muted",
@@ -332,9 +368,9 @@ function Overview() {
332
368
  className: "border-b border-line last:border-0",
333
369
  children: [
334
370
  /* @__PURE__ */ jsx("td", {
335
- className: "max-w-[220px] truncate px-4 py-2 font-mono text-xs sm:px-2",
371
+ className: `max-w-[220px] truncate px-4 py-2 text-xs sm:px-2 ${t.label ? "" : "font-mono"}`,
336
372
  title: t.endpoint,
337
- children: t.endpoint
373
+ children: t.label ?? t.endpoint
338
374
  }),
339
375
  /* @__PURE__ */ jsx("td", {
340
376
  className: "px-2 py-2 text-right text-muted",
@@ -361,136 +397,286 @@ function Overview() {
361
397
  })]
362
398
  })]
363
399
  }),
364
- /* @__PURE__ */ jsx(Card, {
365
- title: flow ? `Issues in ${flow}` : "Issues by severity",
400
+ !flow && summary.incidents.some((inc) => inc.active) && /* @__PURE__ */ jsx(Card, {
401
+ title: "Incidents",
402
+ subtitle: `Issues that failed together for the same reason in ${range.label}, folded into one problem.`,
403
+ children: /* @__PURE__ */ jsx("ul", {
404
+ className: "space-y-3",
405
+ children: summary.incidents.filter((inc) => inc.active).map((inc) => /* @__PURE__ */ jsxs("li", {
406
+ className: "rounded-lg border border-line p-3",
407
+ children: [/* @__PURE__ */ jsxs("div", {
408
+ className: "flex flex-wrap items-baseline justify-between gap-2",
409
+ children: [/* @__PURE__ */ jsx("span", {
410
+ className: "font-medium",
411
+ children: inc.title
412
+ }), /* @__PURE__ */ jsxs("span", {
413
+ className: "text-xs text-muted",
414
+ children: [
415
+ plural(inc.errors, "error"),
416
+ " · ",
417
+ plural(inc.issues.length, "issue"),
418
+ " · ",
419
+ inc.users ? plural(inc.users, "user") : "users —",
420
+ " · happened ",
421
+ plural(inc.episodes, "time")
422
+ ]
423
+ })]
424
+ }), /* @__PURE__ */ jsx("ul", {
425
+ className: "mt-2 space-y-1 text-sm",
426
+ children: inc.issues.map((i) => /* @__PURE__ */ jsxs("li", {
427
+ className: "flex items-baseline justify-between gap-3",
428
+ children: [/* @__PURE__ */ jsx(Link, {
429
+ to: "/issues/$fingerprint",
430
+ params: { fingerprint: i.fingerprint },
431
+ search: issueSearch,
432
+ className: "block min-w-0 truncate text-muted hover:text-accent",
433
+ children: i.title
434
+ }), /* @__PURE__ */ jsx("span", {
435
+ className: "shrink-0 text-xs text-muted",
436
+ children: i.errors.toLocaleString()
437
+ })]
438
+ }, i.fingerprint))
439
+ })]
440
+ }, inc.key))
441
+ })
442
+ }),
443
+ summary.breakdowns.impact.length > 0 && /* @__PURE__ */ jsxs(Card, {
444
+ title: "Who it hurts and whose it is",
445
+ subtitle: `Errors in ${range.label}, by how badly they hurt users, who likely fixes them, and what kind of problem. Click one to filter issues.`,
446
+ children: [/* @__PURE__ */ jsx("div", {
447
+ className: "grid gap-5 md:grid-cols-3",
448
+ children: LABEL_FILTER_KEYS.map((k) => /* @__PURE__ */ jsxs("div", {
449
+ className: "min-w-0",
450
+ children: [/* @__PURE__ */ jsx("h3", {
451
+ className: "mb-2 text-xs font-medium text-muted",
452
+ children: LABEL_FILTERS[k].title
453
+ }), /* @__PURE__ */ jsx(ShareBars, {
454
+ rows: summary.breakdowns[k].map((r) => ({
455
+ key: r.key,
456
+ label: labelName(k, r.key),
457
+ value: r.errors
458
+ })),
459
+ selected: filter[k],
460
+ onSelect: (v) => toggleLabel(k, v)
461
+ })]
462
+ }, k))
463
+ }), /* @__PURE__ */ jsx("p", {
464
+ className: "mt-3 text-xs text-muted",
465
+ children: "Bars count every error in the range, as labelled when it arrived, whatever its issue's status. The list below shows each issue's labels now, including host owners set in Settings since."
466
+ })]
467
+ }),
468
+ /* @__PURE__ */ jsxs(Card, {
469
+ title: issuesTitle,
366
470
  subtitle: `Grouped errors seen in ${range.label}. Severity is set by occurrences in the last 24 hours.`,
367
471
  right: /* @__PURE__ */ jsxs("div", {
368
472
  className: "flex flex-wrap items-center justify-end gap-1 text-xs",
369
- children: [flow && /* @__PURE__ */ jsx("button", {
370
- className: "mr-2 text-accent",
371
- onClick: () => navigate({ search: (s) => ({
372
- ...s,
373
- flow: void 0
374
- }) }),
375
- children: "Clear flow ×"
376
- }), [
377
- "open",
378
- "resolved",
379
- "ignored",
380
- "all"
381
- ].map((st) => /* @__PURE__ */ jsxs("button", {
382
- onClick: () => navigate({ search: (s) => ({
383
- ...s,
384
- status: st === "open" ? void 0 : st
385
- }) }),
386
- className: `rounded-md border px-2 py-1 capitalize ${statusFilter === st ? "border-accent bg-accent-soft text-accent" : "border-line text-muted hover:bg-panel-2"}`,
387
- children: [st, st !== "all" && /* @__PURE__ */ jsx("span", {
388
- className: "ml-1 opacity-70",
389
- children: countFor(st)
390
- })]
391
- }, st))]
473
+ children: [
474
+ flow && /* @__PURE__ */ jsx("button", {
475
+ type: "button",
476
+ className: "mr-2 text-accent",
477
+ onClick: () => navigate({
478
+ search: (s) => ({
479
+ ...s,
480
+ flow: void 0
481
+ }),
482
+ resetScroll: false
483
+ }),
484
+ children: "Clear flow ×"
485
+ }),
486
+ labelFiltered.length > 0 && /* @__PURE__ */ jsx("button", {
487
+ type: "button",
488
+ className: "mr-2 text-accent",
489
+ onClick: () => navigate({
490
+ search: (s) => ({
491
+ ...s,
492
+ ...NO_LABEL_FILTERS
493
+ }),
494
+ resetScroll: false
495
+ }),
496
+ children: "Clear labels ×"
497
+ }),
498
+ STATUS_FILTERS.map((st) => /* @__PURE__ */ jsxs("button", {
499
+ type: "button",
500
+ "aria-pressed": statusFilter === st,
501
+ onClick: () => navigate({
502
+ search: (s) => ({
503
+ ...s,
504
+ status: st === "open" ? void 0 : st
505
+ }),
506
+ resetScroll: false
507
+ }),
508
+ className: `rounded-md border px-2 py-1 capitalize ${statusFilter === st ? "border-accent bg-accent-soft text-accent" : "border-line text-muted hover:bg-panel-2"}`,
509
+ children: [st, st !== "all" && /* @__PURE__ */ jsx("span", {
510
+ className: "ml-1 opacity-70",
511
+ children: countFor(st)
512
+ })]
513
+ }, st))
514
+ ]
392
515
  }),
393
- children: /* @__PURE__ */ jsx("div", {
394
- className: "-mx-4 overflow-x-auto sm:mx-0",
395
- children: /* @__PURE__ */ jsxs("table", {
396
- className: "tabular w-full min-w-[640px] text-left text-sm",
397
- children: [/* @__PURE__ */ jsx("thead", {
398
- className: "text-xs text-muted",
399
- children: /* @__PURE__ */ jsxs("tr", {
400
- className: "border-b border-line",
516
+ children: [
517
+ /* @__PURE__ */ jsx("div", {
518
+ className: "mb-3 flex flex-wrap gap-2",
519
+ children: LABEL_FILTER_KEYS.map((k) => {
520
+ const counts = labelCounts(summary.issues, filter, k);
521
+ return /* @__PURE__ */ jsxs("select", {
522
+ "aria-label": `Filter by ${LABEL_FILTERS[k].title.toLowerCase()}`,
523
+ value: filter[k] ?? "",
524
+ onChange: (e) => navigate({
525
+ search: (s) => ({
526
+ ...s,
527
+ [k]: e.target.value || void 0
528
+ }),
529
+ resetScroll: false
530
+ }),
531
+ className: `rounded-md border bg-panel px-2 py-1 text-xs ${filter[k] ? "border-accent text-accent" : "border-line"}`,
532
+ children: [/* @__PURE__ */ jsxs("option", {
533
+ value: "",
534
+ children: ["Any ", LABEL_FILTERS[k].title.toLowerCase()]
535
+ }), Object.entries(LABEL_FILTERS[k].info).filter(([id]) => counts.has(id) || filter[k] === id).map(([id, info]) => /* @__PURE__ */ jsxs("option", {
536
+ value: id,
537
+ children: [
538
+ info.name,
539
+ " (",
540
+ counts.get(id) ?? 0,
541
+ ")"
542
+ ]
543
+ }, id))]
544
+ }, k);
545
+ })
546
+ }),
547
+ owners.length > 0 && /* @__PURE__ */ jsxs("p", {
548
+ className: "mb-3 text-sm",
549
+ children: [/* @__PURE__ */ jsx("span", {
550
+ className: "text-muted",
551
+ children: "Whose: "
552
+ }), owners.map(([o, n], idx) => /* @__PURE__ */ jsxs("span", { children: [
553
+ idx > 0 && ", ",
554
+ /* @__PURE__ */ jsx("button", {
555
+ type: "button",
556
+ className: "text-accent hover:underline",
557
+ onClick: () => toggleLabel("owner", o),
558
+ children: labelName("owner", o)
559
+ }),
560
+ " ",
561
+ n
562
+ ] }, o))]
563
+ }),
564
+ /* @__PURE__ */ jsx("div", {
565
+ className: "-mx-4 overflow-x-auto sm:mx-0",
566
+ children: /* @__PURE__ */ jsxs("table", {
567
+ className: "tabular w-full min-w-[640px] text-left text-sm",
568
+ children: [/* @__PURE__ */ jsx("thead", {
569
+ className: "text-xs text-muted",
570
+ children: /* @__PURE__ */ jsxs("tr", {
571
+ className: "border-b border-line",
572
+ children: [
573
+ /* @__PURE__ */ jsx("th", {
574
+ className: "px-4 py-2 font-medium sm:px-2",
575
+ children: "Severity"
576
+ }),
577
+ /* @__PURE__ */ jsx("th", {
578
+ className: "px-2 py-2 font-medium",
579
+ children: "Issue"
580
+ }),
581
+ /* @__PURE__ */ jsx("th", {
582
+ className: "px-2 py-2 font-medium",
583
+ children: "Flow"
584
+ }),
585
+ /* @__PURE__ */ jsx("th", {
586
+ className: "px-2 py-2 text-right font-medium",
587
+ children: "Users"
588
+ }),
589
+ /* @__PURE__ */ jsx("th", {
590
+ className: "px-2 py-2 text-right font-medium",
591
+ children: "24h"
592
+ }),
593
+ /* @__PURE__ */ jsx("th", {
594
+ className: "px-2 py-2 text-right font-medium",
595
+ children: span === "24h" ? "Total" : span === "range" ? "Range" : span
596
+ }),
597
+ /* @__PURE__ */ jsx("th", {
598
+ className: "px-2 py-2 text-right font-medium",
599
+ children: "Last seen"
600
+ })
601
+ ]
602
+ })
603
+ }), /* @__PURE__ */ jsxs("tbody", { children: [issues.map((i) => /* @__PURE__ */ jsxs("tr", {
604
+ className: "border-b border-line last:border-0 hover:bg-panel-2",
401
605
  children: [
402
- /* @__PURE__ */ jsx("th", {
403
- className: "px-4 py-2 font-medium sm:px-2",
404
- children: "Severity"
606
+ /* @__PURE__ */ jsx("td", {
607
+ className: "px-4 py-2.5 sm:px-2",
608
+ children: /* @__PURE__ */ jsx(SeverityBadge, { severity: i.severity })
405
609
  }),
406
- /* @__PURE__ */ jsx("th", {
407
- className: "px-2 py-2 font-medium",
408
- children: "Issue"
610
+ /* @__PURE__ */ jsxs("td", {
611
+ className: "max-w-[420px] px-2 py-2.5",
612
+ children: [
613
+ /* @__PURE__ */ jsx(Link, {
614
+ to: "/issues/$fingerprint",
615
+ params: { fingerprint: i.fingerprint },
616
+ search: issueSearch,
617
+ className: "block truncate font-medium hover:text-accent",
618
+ children: i.title
619
+ }),
620
+ i.culprit && /* @__PURE__ */ jsx("div", {
621
+ className: "truncate font-mono text-xs text-muted",
622
+ children: i.culprit
623
+ }),
624
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(LabelBadges, { labels: i.labels }), /* @__PURE__ */ jsx(IssueLabels, { issue: i })] })
625
+ ]
409
626
  }),
410
- /* @__PURE__ */ jsx("th", {
411
- className: "px-2 py-2 font-medium",
412
- children: "Flow"
627
+ /* @__PURE__ */ jsx("td", {
628
+ className: "px-2 py-2.5 text-xs",
629
+ children: i.flow ?? /* @__PURE__ */ jsx("span", {
630
+ className: "text-muted",
631
+ children: "untagged"
632
+ })
413
633
  }),
414
- /* @__PURE__ */ jsx("th", {
415
- className: "px-2 py-2 text-right font-medium",
416
- children: "Users"
634
+ /* @__PURE__ */ jsx("td", {
635
+ className: "px-2 py-2.5 text-right text-muted",
636
+ children: i.users ?? "—"
417
637
  }),
418
- /* @__PURE__ */ jsx("th", {
419
- className: "px-2 py-2 text-right font-medium",
420
- children: "24h"
638
+ /* @__PURE__ */ jsx("td", {
639
+ className: "px-2 py-2.5 text-right font-semibold",
640
+ children: i.count24h
421
641
  }),
422
- /* @__PURE__ */ jsx("th", {
423
- className: "px-2 py-2 text-right font-medium",
424
- children: span === "24h" ? "Total" : span === "range" ? "Range" : span
642
+ /* @__PURE__ */ jsx("td", {
643
+ className: "px-2 py-2.5 text-right text-muted",
644
+ children: span === "24h" ? i.countTotal : i.countRange
425
645
  }),
426
- /* @__PURE__ */ jsx("th", {
427
- className: "px-2 py-2 text-right font-medium",
428
- children: "Last seen"
646
+ /* @__PURE__ */ jsx("td", {
647
+ className: "px-2 py-2.5 text-right text-xs text-muted",
648
+ children: timeAgo(i.lastSeen)
429
649
  })
430
650
  ]
431
- })
432
- }), /* @__PURE__ */ jsxs("tbody", { children: [issues.map((i) => /* @__PURE__ */ jsxs("tr", {
433
- className: "border-b border-line last:border-0 hover:bg-panel-2",
434
- children: [
435
- /* @__PURE__ */ jsx("td", {
436
- className: "px-4 py-2.5 sm:px-2",
437
- children: /* @__PURE__ */ jsx(SeverityBadge, { severity: i.severity })
438
- }),
439
- /* @__PURE__ */ jsxs("td", {
440
- className: "max-w-[420px] px-2 py-2.5",
441
- children: [
442
- /* @__PURE__ */ jsx(Link, {
443
- to: "/issues/$fingerprint",
444
- params: { fingerprint: i.fingerprint },
445
- search: {
446
- app: summary.app,
447
- range: range.preset === "14d" ? void 0 : range.preset,
448
- ...range.preset === "custom" ? {
449
- from: range.from,
450
- to: range.to
451
- } : {}
452
- },
453
- className: "block truncate font-medium hover:text-accent",
454
- children: i.title
651
+ }, i.fingerprint)), !issues.length && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
652
+ colSpan: 7,
653
+ className: "px-2 py-6 text-center text-muted",
654
+ children: otherStatuses > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
655
+ "No ",
656
+ statusFilter,
657
+ " issues match.",
658
+ " ",
659
+ /* @__PURE__ */ jsxs("button", {
660
+ type: "button",
661
+ className: "text-accent hover:underline",
662
+ onClick: () => navigate({
663
+ search: (s) => ({
664
+ ...s,
665
+ status: "all"
666
+ }),
667
+ resetScroll: false
455
668
  }),
456
- i.culprit && /* @__PURE__ */ jsx("div", {
457
- className: "truncate font-mono text-xs text-muted",
458
- children: i.culprit
459
- }),
460
- /* @__PURE__ */ jsx(IssueLabels, { issue: i })
461
- ]
462
- }),
463
- /* @__PURE__ */ jsx("td", {
464
- className: "px-2 py-2.5 text-xs",
465
- children: i.flow ?? /* @__PURE__ */ jsx("span", {
466
- className: "text-muted",
467
- children: "untagged"
669
+ children: [
670
+ "Show ",
671
+ otherStatuses,
672
+ " in other statuses"
673
+ ]
468
674
  })
469
- }),
470
- /* @__PURE__ */ jsx("td", {
471
- className: "px-2 py-2.5 text-right text-muted",
472
- children: i.users ?? "—"
473
- }),
474
- /* @__PURE__ */ jsx("td", {
475
- className: "px-2 py-2.5 text-right font-semibold",
476
- children: i.count24h
477
- }),
478
- /* @__PURE__ */ jsx("td", {
479
- className: "px-2 py-2.5 text-right text-muted",
480
- children: span === "24h" ? i.countTotal : i.countRange
481
- }),
482
- /* @__PURE__ */ jsx("td", {
483
- className: "px-2 py-2.5 text-right text-xs text-muted",
484
- children: timeAgo(i.lastSeen)
485
- })
486
- ]
487
- }, i.fingerprint)), !issues.length && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
488
- colSpan: 7,
489
- className: "px-2 py-6 text-center text-muted",
490
- children: "No issues."
491
- }) })] })]
675
+ ] }) : labelFiltered.length || flow ? "No issues match these filters." : "No issues."
676
+ }) })] })]
677
+ })
492
678
  })
493
- })
679
+ ]
494
680
  }),
495
681
  /* @__PURE__ */ jsxs("div", {
496
682
  className: "grid gap-5 md:grid-cols-3",
@@ -555,12 +741,18 @@ function healthTone(rate) {
555
741
  if (rate === null) return "";
556
742
  return rate < .98 ? "text-sev-critical" : rate < .995 ? "text-sev-high" : "";
557
743
  }
744
+ var plural = (n, word) => `${n.toLocaleString()} ${word}${n === 1 ? "" : "s"}`;
558
745
  var WHAT_YOU_WILL_SEE = [
559
746
  {
560
747
  title: "A written summary",
561
748
  when: "after the first error",
562
749
  detail: "How many errors in the last 24 hours, the worst part of the app, the top issue and the release that's struggling, in plain sentences."
563
750
  },
751
+ {
752
+ title: "Incidents",
753
+ when: "when several errors share a cause",
754
+ detail: "Issues that failed together for the same reason, like every request failing right after the app reopens, shown as one problem with the issues inside it."
755
+ },
564
756
  {
565
757
  title: "Issues by severity",
566
758
  when: "after the first error",
@@ -0,0 +1,97 @@
1
+ // \0tanstack-start-manifest:v
2
+ var tsrStartManifest = () => ({ routes: {
3
+ __root__: {
4
+ filePath: "/Users/sivemwanda/Work/Tanstack/deBug/.claude/worktrees/aba-118-sdk/apps/dashboard/src/routes/__root.tsx",
5
+ children: [
6
+ "/_authed",
7
+ "/login",
8
+ "/api/ingest",
9
+ "/api/summary",
10
+ "/invite/$token",
11
+ "/api/issues/$fingerprint"
12
+ ],
13
+ preloads: ["/assets/index-BNpacHyi.js", "/assets/src-Dq5mIUf0.js"],
14
+ scripts: [{ attrs: {
15
+ type: "module",
16
+ async: !0,
17
+ src: "/assets/index-BNpacHyi.js"
18
+ } }]
19
+ },
20
+ "/_authed": {
21
+ filePath: "/Users/sivemwanda/Work/Tanstack/deBug/.claude/worktrees/aba-118-sdk/apps/dashboard/src/routes/_authed.tsx",
22
+ children: [
23
+ "/_authed/customers",
24
+ "/_authed/endpoints",
25
+ "/_authed/settings",
26
+ "/_authed/team",
27
+ "/_authed/",
28
+ "/_authed/events/$eventId",
29
+ "/_authed/issues/$fingerprint",
30
+ "/_authed/sessions/$sessionId"
31
+ ],
32
+ preloads: ["/assets/_authed-CuP-He8G.js", "/assets/ui-CEv2y56s.js"]
33
+ },
34
+ "/login": {
35
+ filePath: "/Users/sivemwanda/Work/Tanstack/deBug/.claude/worktrees/aba-118-sdk/apps/dashboard/src/routes/login.tsx",
36
+ children: void 0,
37
+ preloads: ["/assets/login-Dlk3GyyC.js", "/assets/ui-CEv2y56s.js"]
38
+ },
39
+ "/_authed/customers": {
40
+ filePath: "/Users/sivemwanda/Work/Tanstack/deBug/.claude/worktrees/aba-118-sdk/apps/dashboard/src/routes/_authed/customers.tsx",
41
+ children: void 0,
42
+ preloads: ["/assets/customers-DTMEprFQ.js", "/assets/timeline-BSDhQPpY.js"]
43
+ },
44
+ "/_authed/endpoints": {
45
+ filePath: "/Users/sivemwanda/Work/Tanstack/deBug/.claude/worktrees/aba-118-sdk/apps/dashboard/src/routes/_authed/endpoints.tsx",
46
+ children: void 0,
47
+ preloads: ["/assets/endpoints-lMSO2CdM.js", "/assets/timeline-BSDhQPpY.js"]
48
+ },
49
+ "/_authed/settings": {
50
+ filePath: "/Users/sivemwanda/Work/Tanstack/deBug/.claude/worktrees/aba-118-sdk/apps/dashboard/src/routes/_authed/settings.tsx",
51
+ children: void 0,
52
+ preloads: ["/assets/settings-CzbEYB7k.js"]
53
+ },
54
+ "/_authed/team": {
55
+ filePath: "/Users/sivemwanda/Work/Tanstack/deBug/.claude/worktrees/aba-118-sdk/apps/dashboard/src/routes/_authed/team.tsx",
56
+ children: void 0,
57
+ preloads: ["/assets/team-Bud2-07A.js"]
58
+ },
59
+ "/invite/$token": {
60
+ filePath: "/Users/sivemwanda/Work/Tanstack/deBug/.claude/worktrees/aba-118-sdk/apps/dashboard/src/routes/invite.$token.tsx",
61
+ children: void 0,
62
+ preloads: ["/assets/invite._token-CxXek2SP.js", "/assets/ui-CEv2y56s.js"]
63
+ },
64
+ "/_authed/": {
65
+ filePath: "/Users/sivemwanda/Work/Tanstack/deBug/.claude/worktrees/aba-118-sdk/apps/dashboard/src/routes/_authed/index.tsx",
66
+ children: void 0,
67
+ preloads: ["/assets/_authed-CNObwuZh.js", "/assets/charts-CUvev8lV.js"]
68
+ },
69
+ "/_authed/events/$eventId": {
70
+ filePath: "/Users/sivemwanda/Work/Tanstack/deBug/.claude/worktrees/aba-118-sdk/apps/dashboard/src/routes/_authed/events.$eventId.tsx",
71
+ children: void 0,
72
+ preloads: [
73
+ "/assets/events._eventId-bWag-i8J.js",
74
+ "/assets/copy-button-ORgLIh59.js",
75
+ "/assets/timeline-BSDhQPpY.js"
76
+ ]
77
+ },
78
+ "/_authed/issues/$fingerprint": {
79
+ filePath: "/Users/sivemwanda/Work/Tanstack/deBug/.claude/worktrees/aba-118-sdk/apps/dashboard/src/routes/_authed/issues.$fingerprint.tsx",
80
+ children: void 0,
81
+ preloads: [
82
+ "/assets/issues._fingerprint-BQr85TVY.js",
83
+ "/assets/charts-CUvev8lV.js",
84
+ "/assets/copy-button-ORgLIh59.js"
85
+ ]
86
+ },
87
+ "/_authed/sessions/$sessionId": {
88
+ filePath: "/Users/sivemwanda/Work/Tanstack/deBug/.claude/worktrees/aba-118-sdk/apps/dashboard/src/routes/_authed/sessions.$sessionId.tsx",
89
+ children: void 0,
90
+ preloads: [
91
+ "/assets/sessions._sessionId-3wNImMqM.js",
92
+ "/assets/copy-button-ORgLIh59.js",
93
+ "/assets/timeline-BSDhQPpY.js"
94
+ ]
95
+ }
96
+ } });
97
+ export { tsrStartManifest };
@@ -0,0 +1,52 @@
1
+ import { useEffect, useRef, useState } from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ // src/lib/copy.ts
4
+ /** Copy text: the Clipboard API, or a hidden textarea where that's blocked (embedded browsers, plain http). */
5
+ async function copyText(text, doc = document, nav = navigator) {
6
+ try {
7
+ await nav.clipboard.writeText(text);
8
+ return true;
9
+ } catch {
10
+ const area = doc.createElement("textarea");
11
+ area.value = text;
12
+ area.setAttribute("readonly", "");
13
+ area.style.position = "fixed";
14
+ area.style.opacity = "0";
15
+ doc.body.appendChild(area);
16
+ area.select();
17
+ try {
18
+ return doc.execCommand("copy");
19
+ } catch {
20
+ return false;
21
+ } finally {
22
+ area.remove();
23
+ }
24
+ }
25
+ }
26
+ // src/components/copy-button.tsx
27
+ /**
28
+ * Copies `text`, then says whether it worked for a few seconds. `ariaLabel` names what's copied
29
+ * ("Copy trace id"); the result is announced to screen readers too.
30
+ */
31
+ function CopyButton({ text, label, ariaLabel }) {
32
+ const [state, setState] = useState("idle");
33
+ const timer = useRef(void 0);
34
+ useEffect(() => () => clearTimeout(timer.current), []);
35
+ return /* @__PURE__ */ jsx("button", {
36
+ type: "button",
37
+ "aria-label": state === "idle" ? ariaLabel : void 0,
38
+ className: "rounded-md border border-line px-2 py-1 text-xs text-muted hover:bg-panel-2",
39
+ onClick: () => {
40
+ copyText(text).then((ok) => {
41
+ setState(ok ? "copied" : "failed");
42
+ clearTimeout(timer.current);
43
+ timer.current = setTimeout(() => setState("idle"), 2500);
44
+ });
45
+ },
46
+ children: /* @__PURE__ */ jsx("span", {
47
+ "aria-live": "polite",
48
+ children: state === "copied" ? "Copied" : state === "failed" ? "Couldn't copy" : label
49
+ })
50
+ });
51
+ }
52
+ export { CopyButton as t };