@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
@@ -0,0 +1,7 @@
1
+ import{B as e,N as t,P as n,R as r,lt as i,ot as a}from"./src-Dq5mIUf0.js";import{r as o,t as s}from"./charts-CUvev8lV.js";import{c,i as l,l as u,n as d,o as f,r as p,s as m,t as h}from"./ui-CEv2y56s.js";import{_ as g,d as _,f as v,g as y,h as b,l as x,m as S,p as C,u as w}from"./index-BNpacHyi.js";var T=i(a()),E=e(),D=(e,t)=>v[e].info[t]?.name??t;function O(){let e=x.useLoaderData(),r=x.useSearch(),{flow:i}=r,a=n({from:x.fullPath});if(!e)return(0,E.jsx)(N,{});let{totals:T,range:O}=e,M=O.preset===`custom`?`range`:O.preset,F={app:e.app,range:O.preset===`14d`?void 0:O.preset,...O.preset===`custom`?{from:O.from,to:O.to}:{}},I=r.status??`open`,L={status:I,flow:i,category:r.category,owner:r.owner,impact:r.impact},R=y(e.issues,L),z=t=>y(e.issues,{...L,status:t}).length,B=C.filter(e=>L[e]),V=(e,t)=>a({search:n=>({...n,[e]:n[e]===t?void 0:t}),resetScroll:!1}),H=B.length&&!L.owner?[...g(e.issues,L,`owner`)].sort((e,t)=>t[1]-e[1]):[],U=R.length===0&&I!==`all`?z(`all`):0,W=B.length?`Issues: ${B.map(e=>D(e,L[e])).join(` · `)}${i?` in ${i}`:``}`:i?`Issues in ${i}`:`Issues by severity`,G=T.changePct;return(0,E.jsxs)(`main`,{className:`mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsxs)(`p`,{className:`text-xs uppercase tracking-wide text-muted`,children:[`Overview · `,O.label]}),(0,E.jsxs)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:[`What's going wrong in `,e.app]})]}),(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,E.jsx)(w,{value:O,today:e.generatedAt.slice(0,10),onChange:e=>a({search:t=>({...t,...e})})},`${O.preset}${O.from}${O.to}`),e.apps.length>1&&(0,E.jsx)(`select`,{"aria-label":`App`,value:e.app,onChange:e=>a({search:t=>({...t,app:e.target.value,flow:void 0})}),className:`rounded-md border border-line bg-panel px-2 py-1.5 text-sm`,children:e.apps.map(e=>(0,E.jsx)(`option`,{children:e},e))})]})]}),(0,E.jsx)(_,{rangeFrom:O.from,retention:e.retention}),(0,E.jsx)(`section`,{"aria-label":`Summary`,className:`rounded-xl border border-line bg-panel p-4 sm:p-5`,children:(0,E.jsx)(`ul`,{className:`space-y-1.5 text-[15px] leading-relaxed`,children:e.narrative.map((e,t)=>(0,E.jsx)(`li`,{className:t===0?`font-medium`:`text-ink/90`,children:e},t))})}),(0,E.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,E.jsx)(c,{label:`Errors (${M})`,value:T.errorsRange.toLocaleString(),tone:T.criticalIssues?`critical`:void 0,hint:G===null?`not enough earlier data to compare`:G>500?`▲ from ${T.errorsPrev.toLocaleString()} in the previous ${O.span}`:`${G>0?`▲`:G<0?`▼`:`•`} ${Math.abs(G)}% vs previous ${O.span}`}),(0,E.jsx)(c,{label:`Critical issues`,value:T.criticalIssues,tone:T.criticalIssues?`critical`:void 0,hint:`≥ threshold occurrences in 24h`}),(0,E.jsx)(c,{label:`Crash-free users (${M})`,value:k(e.health.crashFreeUsersRate),tone:e.health.crashFreeUsersRate!==null&&e.health.crashFreeUsersRate<.99?`high`:void 0,hint:`${e.health.users.toLocaleString()} users · ${e.health.crashedUsers.toLocaleString()} crashed`}),(0,E.jsx)(c,{label:`Crash-free sessions (${M})`,value:k(e.health.crashFreeRate),tone:e.health.crashFreeRate!==null&&e.health.crashFreeRate<.99?`high`:void 0,hint:`${e.health.sessionsRange.toLocaleString()} sessions · ${T.activeIssues} active issues`})]}),(0,E.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-5`,children:[(0,E.jsx)(`div`,{className:`min-w-0 lg:col-span-3`,children:(0,E.jsxs)(h,{title:`Where the app is failing`,subtitle:`Errors in ${O.label} by flow, coloured by worst severity. Click a bar to filter issues.`,children:[(0,E.jsx)(s,{data:e.flows,onSelect:e=>a({search:t=>({...t,flow:t.flow===e?void 0:e}),resetScroll:!1})}),(0,E.jsx)(d,{columns:[`Flow`,`Severity`,`Errors 24h`,`Errors (${M})`,`Issues`,`Failure rate (${M})`],rows:e.flows.map(e=>[e.critical?`${e.flow} (critical)`:e.flow,e.severity,e.errors24h,e.errorsRange,e.issues,e.failureRate===null?`—`:`${Math.round(e.failureRate*100)}%`])})]})}),(0,E.jsx)(`div`,{className:`min-w-0 lg:col-span-2`,children:(0,E.jsxs)(h,{title:`Error trend`,subtitle:`Errors per ${O.granularity}, ${O.label} (UTC)`,children:[(0,E.jsx)(o,{data:e.trend,markers:e.releases.map(e=>({day:e.firstDay,label:e.release}))}),e.releases.length>0&&(0,E.jsxs)(`p`,{className:`mt-2 text-xs text-muted`,children:[`Dashed lines: a release's first sessions (`,e.releases.map(e=>e.release).join(`, `),`).`]}),(0,E.jsx)(d,{columns:[`Day`,`Errors`,`Events`],rows:e.trend.map(e=>[e.day,e.errors,e.events])})]})})]}),(0,E.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,E.jsx)(h,{title:`Release health`,subtitle:`Share of sessions without a crash or unhandled error, per app version, in ${O.label}. Recorded automatically by the SDK.`,children:e.health.releases.length?(0,E.jsx)(`div`,{className:`-mx-4 overflow-x-auto sm:mx-0`,children:(0,E.jsxs)(`table`,{className:`tabular w-full min-w-[420px] text-left text-sm`,children:[(0,E.jsx)(`thead`,{className:`text-xs text-muted`,children:(0,E.jsxs)(`tr`,{className:`border-b border-line`,children:[(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium sm:px-2`,children:`Version`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Sessions`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Crash-free`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Error-free`})]})}),(0,E.jsx)(`tbody`,{children:e.health.releases.map(e=>(0,E.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,E.jsx)(`td`,{className:`px-4 py-2 font-medium sm:px-2`,children:e.version}),(0,E.jsx)(`td`,{className:`px-2 py-2 text-right text-muted`,children:e.sessions.toLocaleString()}),(0,E.jsx)(`td`,{className:`px-2 py-2 text-right font-semibold ${A(e.crashFreeRate)}`,children:k(e.crashFreeRate)}),(0,E.jsx)(`td`,{className:`px-2 py-2 text-right`,children:k(e.errorFreeRate)})]},e.version))})]})}):(0,E.jsx)(`p`,{className:`text-sm text-muted`,children:`No sessions yet. They're recorded automatically from SDK 0.2.`})}),(0,E.jsx)(h,{title:`Failing endpoints`,subtitle:`Requests that returned 5xx, timed out or failed in ${O.label}. Captured automatically from fetch and XHR.`,children:e.health.endpoints.length?(0,E.jsx)(m,{rows:e.health.endpoints.map(e=>({key:e.endpoint,label:e.label,value:e.failuresRange}))}):(0,E.jsx)(`p`,{className:`text-sm text-muted`,children:`No failed requests.`})})]}),(e.steps.length>0||e.timings.length>0)&&(0,E.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[e.steps.length>0&&(0,E.jsx)(h,{title:`Steps that fail`,subtitle:`track() outcomes per step in ${O.label}, most failures first.${i?` Filtered to ${i}.`:``}`,children:(0,E.jsx)(`div`,{className:`-mx-4 overflow-x-auto sm:mx-0`,children:(0,E.jsxs)(`table`,{className:`tabular w-full min-w-[420px] text-left text-sm`,children:[(0,E.jsx)(`thead`,{className:`text-xs text-muted`,children:(0,E.jsxs)(`tr`,{className:`border-b border-line`,children:[(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium sm:px-2`,children:`Flow · step`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Tries`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Failed`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Failure rate`})]})}),(0,E.jsx)(`tbody`,{children:e.steps.filter(e=>!i||e.flow===i).slice(0,8).map(e=>(0,E.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,E.jsxs)(`td`,{className:`px-4 py-2 font-mono text-xs sm:px-2`,children:[e.flow,` · `,e.step]}),(0,E.jsx)(`td`,{className:`px-2 py-2 text-right text-muted`,children:(e.successes+e.failures).toLocaleString()}),(0,E.jsx)(`td`,{className:`px-2 py-2 text-right`,children:e.failures.toLocaleString()}),(0,E.jsx)(`td`,{className:`px-2 py-2 text-right font-semibold ${e.failureRate!==null&&e.failureRate>=.1?`text-sev-critical`:``}`,children:e.failureRate===null?`—`:`${Math.round(e.failureRate*100)}%`})]},`${e.flow}|${e.step}`))})]})})}),e.timings.length>0&&(0,E.jsxs)(h,{title:`Response times`,subtitle:`Busiest endpoints in ${O.label}. Measured by the SDK on real devices.`,children:[(0,E.jsx)(`div`,{className:`-mx-4 overflow-x-auto sm:mx-0`,children:(0,E.jsxs)(`table`,{className:`tabular w-full min-w-[420px] text-left text-sm`,children:[(0,E.jsx)(`thead`,{className:`text-xs text-muted`,children:(0,E.jsxs)(`tr`,{className:`border-b border-line`,children:[(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium sm:px-2`,children:`Endpoint`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Requests`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`p50`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`p95`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Failed`})]})}),(0,E.jsx)(`tbody`,{children:e.timings.map(e=>(0,E.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,E.jsx)(`td`,{className:`max-w-[220px] truncate px-4 py-2 text-xs sm:px-2 ${e.label?``:`font-mono`}`,title:e.endpoint,children:e.label??e.endpoint}),(0,E.jsx)(`td`,{className:`px-2 py-2 text-right text-muted`,children:e.requests.toLocaleString()}),(0,E.jsx)(`td`,{className:`px-2 py-2 text-right`,children:P(e.p50)}),(0,E.jsx)(`td`,{className:`px-2 py-2 text-right font-semibold ${e.p95!==null&&e.p95>=3e3?`text-sev-high`:``}`,children:P(e.p95)}),(0,E.jsx)(`td`,{className:`px-2 py-2 text-right ${e.errorRate>=.05?`font-semibold text-sev-critical`:`text-muted`}`,children:`${(e.errorRate*100).toFixed(+(e.errorRate<.1))}%`})]},e.endpoint))})]})}),(0,E.jsx)(`p`,{className:`mt-2 text-xs text-muted`,children:`p50/p95: half / 95% of requests finished within this time.`})]})]}),!i&&e.incidents.some(e=>e.active)&&(0,E.jsx)(h,{title:`Incidents`,subtitle:`Issues that failed together for the same reason in ${O.label}, folded into one problem.`,children:(0,E.jsx)(`ul`,{className:`space-y-3`,children:e.incidents.filter(e=>e.active).map(e=>(0,E.jsxs)(`li`,{className:`rounded-lg border border-line p-3`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-2`,children:[(0,E.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,E.jsxs)(`span`,{className:`text-xs text-muted`,children:[j(e.errors,`error`),` · `,j(e.issues.length,`issue`),` · `,e.users?j(e.users,`user`):`users —`,` · happened `,j(e.episodes,`time`)]})]}),(0,E.jsx)(`ul`,{className:`mt-2 space-y-1 text-sm`,children:e.issues.map(e=>(0,E.jsxs)(`li`,{className:`flex items-baseline justify-between gap-3`,children:[(0,E.jsx)(t,{to:`/issues/$fingerprint`,params:{fingerprint:e.fingerprint},search:F,className:`block min-w-0 truncate text-muted hover:text-accent`,children:e.title}),(0,E.jsx)(`span`,{className:`shrink-0 text-xs text-muted`,children:e.errors.toLocaleString()})]},e.fingerprint))})]},e.key))})}),e.breakdowns.impact.length>0&&(0,E.jsxs)(h,{title:`Who it hurts and whose it is`,subtitle:`Errors in ${O.label}, by how badly they hurt users, who likely fixes them, and what kind of problem. Click one to filter issues.`,children:[(0,E.jsx)(`div`,{className:`grid gap-5 md:grid-cols-3`,children:C.map(t=>(0,E.jsxs)(`div`,{className:`min-w-0`,children:[(0,E.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-muted`,children:v[t].title}),(0,E.jsx)(m,{rows:e.breakdowns[t].map(e=>({key:e.key,label:D(t,e.key),value:e.errors})),selected:L[t],onSelect:e=>V(t,e)})]},t))}),(0,E.jsx)(`p`,{className:`mt-3 text-xs text-muted`,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.`})]}),(0,E.jsxs)(h,{title:W,subtitle:`Grouped errors seen in ${O.label}. Severity is set by occurrences in the last 24 hours.`,right:(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 text-xs`,children:[i&&(0,E.jsx)(`button`,{type:`button`,className:`mr-2 text-accent`,onClick:()=>a({search:e=>({...e,flow:void 0}),resetScroll:!1}),children:`Clear flow ×`}),B.length>0&&(0,E.jsx)(`button`,{type:`button`,className:`mr-2 text-accent`,onClick:()=>a({search:e=>({...e,...S}),resetScroll:!1}),children:`Clear labels ×`}),b.map(e=>(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":I===e,onClick:()=>a({search:t=>({...t,status:e===`open`?void 0:e}),resetScroll:!1}),className:`rounded-md border px-2 py-1 capitalize ${I===e?`border-accent bg-accent-soft text-accent`:`border-line text-muted hover:bg-panel-2`}`,children:[e,e!==`all`&&(0,E.jsx)(`span`,{className:`ml-1 opacity-70`,children:z(e)})]},e))]}),children:[(0,E.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-2`,children:C.map(t=>{let n=g(e.issues,L,t);return(0,E.jsxs)(`select`,{"aria-label":`Filter by ${v[t].title.toLowerCase()}`,value:L[t]??``,onChange:e=>a({search:n=>({...n,[t]:e.target.value||void 0}),resetScroll:!1}),className:`rounded-md border bg-panel px-2 py-1 text-xs ${L[t]?`border-accent text-accent`:`border-line`}`,children:[(0,E.jsxs)(`option`,{value:``,children:[`Any `,v[t].title.toLowerCase()]}),Object.entries(v[t].info).filter(([e])=>n.has(e)||L[t]===e).map(([e,t])=>(0,E.jsxs)(`option`,{value:e,children:[t.name,` (`,n.get(e)??0,`)`]},e))]},t)})}),H.length>0&&(0,E.jsxs)(`p`,{className:`mb-3 text-sm`,children:[(0,E.jsx)(`span`,{className:`text-muted`,children:`Whose: `}),H.map(([e,t],n)=>(0,E.jsxs)(`span`,{children:[n>0&&`, `,(0,E.jsx)(`button`,{type:`button`,className:`text-accent hover:underline`,onClick:()=>V(`owner`,e),children:D(`owner`,e)}),` `,t]},e))]}),(0,E.jsx)(`div`,{className:`-mx-4 overflow-x-auto sm:mx-0`,children:(0,E.jsxs)(`table`,{className:`tabular w-full min-w-[640px] text-left text-sm`,children:[(0,E.jsx)(`thead`,{className:`text-xs text-muted`,children:(0,E.jsxs)(`tr`,{className:`border-b border-line`,children:[(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium sm:px-2`,children:`Severity`}),(0,E.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`Issue`}),(0,E.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`Flow`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Users`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`24h`}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:M===`24h`?`Total`:M===`range`?`Range`:M}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Last seen`})]})}),(0,E.jsxs)(`tbody`,{children:[R.map(e=>(0,E.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-panel-2`,children:[(0,E.jsx)(`td`,{className:`px-4 py-2.5 sm:px-2`,children:(0,E.jsx)(f,{severity:e.severity})}),(0,E.jsxs)(`td`,{className:`max-w-[420px] px-2 py-2.5`,children:[(0,E.jsx)(t,{to:`/issues/$fingerprint`,params:{fingerprint:e.fingerprint},search:F,className:`block truncate font-medium hover:text-accent`,children:e.title}),e.culprit&&(0,E.jsx)(`div`,{className:`truncate font-mono text-xs text-muted`,children:e.culprit}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(l,{labels:e.labels}),(0,E.jsx)(p,{issue:e})]})]}),(0,E.jsx)(`td`,{className:`px-2 py-2.5 text-xs`,children:e.flow??(0,E.jsx)(`span`,{className:`text-muted`,children:`untagged`})}),(0,E.jsx)(`td`,{className:`px-2 py-2.5 text-right text-muted`,children:e.users??`—`}),(0,E.jsx)(`td`,{className:`px-2 py-2.5 text-right font-semibold`,children:e.count24h}),(0,E.jsx)(`td`,{className:`px-2 py-2.5 text-right text-muted`,children:M===`24h`?e.countTotal:e.countRange}),(0,E.jsx)(`td`,{className:`px-2 py-2.5 text-right text-xs text-muted`,children:u(e.lastSeen)})]},e.fingerprint)),!R.length&&(0,E.jsx)(`tr`,{children:(0,E.jsx)(`td`,{colSpan:7,className:`px-2 py-6 text-center text-muted`,children:U>0?(0,E.jsxs)(E.Fragment,{children:[`No `,I,` issues match.`,` `,(0,E.jsxs)(`button`,{type:`button`,className:`text-accent hover:underline`,onClick:()=>a({search:e=>({...e,status:`all`}),resetScroll:!1}),children:[`Show `,U,` in other statuses`]})]}):B.length||i?`No issues match these filters.`:`No issues.`})})]})]})})]}),(0,E.jsxs)(`div`,{className:`grid gap-5 md:grid-cols-3`,children:[(0,E.jsx)(h,{title:`By network`,subtitle:`Errors, ${O.label}`,children:(0,E.jsx)(m,{rows:e.breakdowns.network.map(e=>({key:e.key,value:e.errors}))})}),(0,E.jsx)(h,{title:`By country`,subtitle:`Errors, ${O.label}. From the device's timezone, not its IP.`,children:(0,E.jsx)(m,{rows:e.breakdowns.country.map(e=>({key:e.key,value:e.errors}))})}),(0,E.jsx)(h,{title:`By OS`,subtitle:`Errors, ${O.label}`,children:(0,E.jsx)(m,{rows:e.breakdowns.os.map(e=>({key:e.key,value:e.errors}))})}),(0,E.jsx)(h,{title:`By app version`,subtitle:`Errors, ${O.label}`,children:(0,E.jsx)(m,{rows:e.breakdowns.appVersion.map(e=>({key:e.key,value:e.errors}))})}),(0,E.jsx)(h,{title:`By device`,subtitle:`Errors, ${O.label}`,children:(0,E.jsx)(m,{rows:e.breakdowns.deviceModel.map(e=>({key:e.key,value:e.errors}))})})]}),(0,E.jsxs)(`p`,{className:`pb-6 text-xs text-muted`,children:[`Machine-readable: `,(0,E.jsxs)(`code`,{children:[`GET /api/summary?app=`,e.app]}),` returns this page as JSON with field descriptions.`]})]})}function k(e){return e===null?`—`:`${(Math.floor(e*1e3)/10).toFixed(1)}%`}function A(e){return e===null?``:e<.98?`text-sev-critical`:e<.995?`text-sev-high`:``}var j=(e,t)=>`${e.toLocaleString()} ${t}${e===1?``:`s`}`,M=[{title:`A written summary`,when:`after the first error`,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.`},{title:`Incidents`,when:`when several errors share a cause`,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.`},{title:`Issues by severity`,when:`after the first error`,detail:`Errors grouped by cause. Severity comes from how often each happened in the last 24 hours. Open one for the stack trace and the steps that led to it.`},{title:`Release health`,when:`as soon as the app starts`,detail:`Every app launch is a session. You'll see the share of sessions per version that ran without a crash or an unhandled error.`},{title:`Failing endpoints`,when:`after the first failed request`,detail:`Requests that timed out, failed or returned 5xx, captured from fetch and XHR without any code from you.`},{title:`Where the app is failing`,when:`once you tag flows`,detail:`Errors by flow, like auth.login or checkout.payment. Wrap a step in deBug.track() and each flow also gets a failure rate.`},{title:`Breakdowns`,when:`after the first error`,detail:`Errors split by OS, app version and device model, so you can see who is affected.`}];function N(){let e=r();return(0,T.useEffect)(()=>{let t=setInterval(()=>void e.invalidate(),5e3);return()=>clearInterval(t)},[e]),(0,E.jsxs)(`main`,{className:`mx-auto max-w-4xl space-y-6 px-4 py-10 sm:px-6`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-muted`,children:`Connected · waiting for the first event`}),(0,E.jsx)(`h1`,{className:`mt-1 text-2xl font-semibold tracking-tight`,children:`Your dashboard is ready, and empty for now.`}),(0,E.jsxs)(`p`,{className:`mt-2 max-w-2xl text-sm text-muted`,children:[`Nothing has arrived yet. Run your app with the SDK initialised, or send a test event with `,(0,E.jsx)(`code`,{children:`npx debugkit test`}),` (or `,(0,E.jsx)(`code`,{children:`npx @debugkit/cli test`}),`). This page fills in on its own.`]})]}),(0,E.jsxs)(`section`,{"aria-labelledby":`see-h`,className:`rounded-xl border border-line bg-panel p-4 sm:p-5`,children:[(0,E.jsx)(`h2`,{id:`see-h`,className:`text-sm font-semibold`,children:`What you'll see here`}),(0,E.jsx)(`ul`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:M.map(e=>(0,E.jsxs)(`li`,{className:`rounded-lg border border-line p-3`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-2`,children:[(0,E.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,E.jsx)(`span`,{className:`text-[11px] uppercase tracking-wide text-muted`,children:e.when})]}),(0,E.jsx)(`p`,{className:`mt-1 text-sm text-ink/80`,children:e.detail})]},e.title))})]}),(0,E.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,E.jsxs)(`section`,{"aria-labelledby":`auto-h`,className:`rounded-xl border border-line bg-panel p-4 sm:p-5`,children:[(0,E.jsx)(`h2`,{id:`auto-h`,className:`text-sm font-semibold`,children:`Recorded automatically`}),(0,E.jsxs)(`p`,{className:`mt-1 text-xs text-muted`,children:[`Once `,(0,E.jsx)(`code`,{children:`init()`}),` runs, with no other code.`]}),(0,E.jsxs)(`ul`,{className:`mt-3 list-disc space-y-1 pl-5 text-sm`,children:[(0,E.jsx)(`li`,{children:`Crashes and unhandled promise rejections`}),(0,E.jsx)(`li`,{children:`Failed, timed-out and 5xx requests, with the code that made them`}),(0,E.jsx)(`li`,{children:`Sessions, for crash-free rates per release`}),(0,E.jsx)(`li`,{children:`Screens visited, buttons clicked, console warnings, app backgrounded or offline`}),(0,E.jsx)(`li`,{children:`Device, OS, app version and network on every event`})]})]}),(0,E.jsxs)(`section`,{"aria-labelledby":`manual-h`,className:`rounded-xl border border-line bg-panel p-4 sm:p-5`,children:[(0,E.jsx)(`h2`,{id:`manual-h`,className:`text-sm font-semibold`,children:`What you add`}),(0,E.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`Only what the app can't know on its own.`}),(0,E.jsx)(`pre`,{className:`mt-3 overflow-x-auto rounded-md bg-panel-2 p-3 text-xs leading-relaxed`,children:`// in a try/catch you already have
2
+ catch (err) {
3
+ deBug.error(err, { flow: "checkout.payment", step: "charge" });
4
+ }
5
+
6
+ // success or failure of a step, plus the error
7
+ await deBug.track("auth.login", "submit_otp", () => verifyOtp(code));`})]})]})]})}function P(e){return e===null?`—`:Number.isFinite(e)?e>=1e3?`≤ ${(e/1e3).toFixed(e%1e3?1:0)} s`:`≤ ${e} ms`:`> 10 s`}export{O as component};
@@ -0,0 +1 @@
1
+ import{B as e,N as t,R as n,S as r}from"./src-Dq5mIUf0.js";import{b as i,y as a}from"./index-BNpacHyi.js";import{a as o}from"./ui-CEv2y56s.js";var s=e();function c(){let{user:e}=a.useRouteContext(),c=n();return(0,s.jsxs)(`div`,{className:`min-h-screen`,children:[(0,s.jsx)(`header`,{className:`sticky top-0 z-10 border-b border-line bg-bg/90 backdrop-blur`,children:(0,s.jsxs)(`div`,{className:`mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-x-4 gap-y-2 px-4 py-3 sm:px-6`,children:[(0,s.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-5 gap-y-2`,children:[(0,s.jsx)(t,{to:`/`,search:{},className:`shrink-0`,children:(0,s.jsx)(o,{})}),(0,s.jsxs)(`nav`,{className:`flex items-center gap-3 text-sm`,"aria-label":`Main`,children:[(0,s.jsx)(t,{to:`/`,search:{},className:`text-muted hover:text-ink`,activeProps:{className:`font-medium text-ink`},activeOptions:{exact:!0},children:`Overview`}),(0,s.jsx)(t,{to:`/endpoints`,search:{},className:`text-muted hover:text-ink`,activeProps:{className:`font-medium text-ink`},children:`Endpoints`}),(0,s.jsx)(t,{to:`/customers`,search:{},className:`text-muted hover:text-ink`,activeProps:{className:`font-medium text-ink`},children:`Customers`}),(0,s.jsx)(t,{to:`/settings`,search:{},className:`text-muted hover:text-ink`,activeProps:{className:`font-medium text-ink`},children:`Settings`}),(0,s.jsx)(t,{to:`/team`,className:`text-muted hover:text-ink`,activeProps:{className:`font-medium text-ink`},children:`Team`})]})]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,s.jsxs)(`span`,{className:`hidden text-muted sm:inline`,children:[e.email,` · `,e.role]}),(0,s.jsx)(`button`,{className:`rounded-md border border-line px-2.5 py-1 hover:bg-panel-2`,onClick:async()=>{await r(),await c.invalidate(),await c.navigate({to:`/login`})},children:`Sign out`})]})]})}),(0,s.jsx)(i,{})]})}export{c as component};