@debugkit/dashboard 0.3.1 → 0.5.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.
- package/dist/client/assets/_authed-DTn7rMla.js +1 -0
- package/dist/client/assets/_authed-Dc7covsB.js +7 -0
- package/dist/client/assets/{charts-C76vsG2N.js → charts-C0zeGTzu.js} +18 -18
- package/dist/client/assets/index-D12jr1bm.js +10 -0
- package/dist/client/assets/issues._fingerprint-C6ryZvIu.js +1 -0
- package/dist/client/assets/login-oLP1Yyz3.js +1 -0
- package/dist/client/assets/preload-helper-CDziuvpw.js +3 -0
- package/dist/client/assets/settings-9oQsCwdV.js +1 -0
- package/dist/client/assets/styles-DBg7wMRg.css +2 -0
- package/dist/client/assets/ui-BiRMJGWB.js +1 -0
- package/dist/server/assets/{_authed-ClbGOSDJ.js → _authed-CuDay0Tl.js} +296 -70
- package/dist/server/assets/{_authed-BaehIntL.js → _authed-DODQ_Iys.js} +28 -8
- package/dist/server/assets/{_tanstack-start-manifest_v-eNUCOzFz.js → _tanstack-start-manifest_v-BBxgjm04.js} +16 -7
- package/dist/server/assets/{charts-CNlV7Pga.js → charts-DzTVqJ8z.js} +21 -4
- package/dist/server/assets/{demo-DTdlXNgj.js → demo-hrRBo9_U.js} +87 -10
- package/dist/server/assets/dynamodb-DyPK9SVV.js +354 -0
- package/dist/server/assets/{firestore-BH-gx9no.js → firestore-B2xzpzYA.js} +89 -5
- package/dist/server/assets/fns-DPsnK0zS.js +79 -0
- package/dist/server/assets/fns-hk_OJe6M.js +250 -0
- package/dist/server/assets/{issues._fingerprint-D78dy5os.js → issues._fingerprint-CZCZDm7t.js} +159 -17
- package/dist/server/assets/{login-h3B5Vdhl.js → login-D-UG6SFw.js} +3 -3
- package/dist/server/assets/{queries-DIVV-5j6.js → memory-Do0CDoAX.js} +205 -505
- package/dist/server/assets/queries-CxHrgTdM.js +955 -0
- package/dist/server/assets/range-picker-0zbSGr3Z.js +106 -0
- package/dist/server/assets/rolldown-runtime-D8jQpDG7.js +12 -0
- package/dist/server/assets/{router-DqTf7XfT.js → router-CIIGBCmL.js} +84 -44
- package/dist/server/assets/settings-BHfngShx.js +371 -0
- package/dist/server/assets/src-D9VHcuh4.js +491 -0
- package/dist/server/assets/src-JXktBs5H.js +4 -0
- package/dist/server/assets/{ui-Lv-KcOoP.js → ui-BJokJdYa.js} +25 -3
- package/dist/server/server.js +32 -8
- package/package.json +4 -4
- package/dist/client/assets/_authed-Bi62GTX3.js +0 -7
- package/dist/client/assets/_authed-mWCAMokt.js +0 -1
- package/dist/client/assets/index-D7uhDdvA.js +0 -12
- package/dist/client/assets/issues._fingerprint-fVGLnT37.js +0 -1
- package/dist/client/assets/login-MqvT094Y.js +0 -1
- package/dist/client/assets/styles-CZZRuG1z.css +0 -2
- package/dist/client/assets/ui-Bj6uJIr8.js +0 -1
- package/dist/server/assets/dynamodb-DejcakaF.js +0 -187
- package/dist/server/assets/fns-CgB12FUN.js +0 -31
- package/dist/server/assets/fns-Yg8sT1Cb.js +0 -87
- package/dist/server/assets/memory-4DwW5cTO.js +0 -59
- package/dist/server/assets/rollups-JXbazRNh.js +0 -22
- package/dist/server/assets/src-D5jyi_C4.js +0 -235
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,_ as t,c as n,w as r}from"./preload-helper-CDziuvpw.js";import{c as i,s as a}from"./index-D12jr1bm.js";import{i as o}from"./ui-BiRMJGWB.js";var s=r();function c(){let{user:r}=a.useRouteContext(),c=e();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 items-center justify-between gap-4 px-4 py-3 sm:px-6`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-5`,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:`/settings`,search:{},className:`text-muted hover:text-ink`,activeProps:{className:`font-medium text-ink`},children:`Settings`})]})]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,s.jsx)(`span`,{className:`hidden text-muted sm:inline`,children:r.email}),(0,s.jsx)(`button`,{className:`rounded-md border border-line px-2.5 py-1 hover:bg-panel-2`,onClick:async()=>{await n(),await c.invalidate(),await c.navigate({to:`/login`})},children:`Sign out`})]})]})}),(0,s.jsx)(i,{})]})}export{c as component};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{S as e,W as t,_ as n,q as r,v as i,w as a}from"./preload-helper-CDziuvpw.js";import{r as o,t as s}from"./charts-C0zeGTzu.js";import{a as c,c as l,n as u,o as d,r as f,s as p,t as m}from"./ui-BiRMJGWB.js";import{a as h,i as g,r as _}from"./index-D12jr1bm.js";var v=r(t()),y=a();function b(){let e=_.useLoaderData(),t=_.useSearch(),{flow:r}=t,a=i({from:_.fullPath});if(!e)return(0,y.jsx)(w,{});let{totals:v,range:b}=e,C=b.preset===`custom`?`range`:b.preset,E=t.status??`open`,D=e.issues.filter(e=>E===`all`?!0:E===`open`?e.status===`open`||e.status===`regressed`:e.status===E),O=r?D.filter(e=>(e.flow??`untagged`)===r):D,k=t=>e.issues.filter(e=>t===`open`?e.status===`open`||e.status===`regressed`:e.status===t).length,A=v.changePct;return(0,y.jsxs)(`main`,{className:`mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`p`,{className:`text-xs uppercase tracking-wide text-muted`,children:[`Overview · `,b.label]}),(0,y.jsxs)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:[`What's going wrong in `,e.app]})]}),(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsx)(g,{value:b,today:e.generatedAt.slice(0,10),onChange:e=>a({search:t=>({...t,...e})})},`${b.preset}${b.from}${b.to}`),e.apps.length>1&&(0,y.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,y.jsx)(`option`,{children:e},e))})]})]}),(0,y.jsx)(h,{rangeFrom:b.from,retention:e.retention}),(0,y.jsx)(`section`,{"aria-label":`Summary`,className:`rounded-xl border border-line bg-panel p-4 sm:p-5`,children:(0,y.jsx)(`ul`,{className:`space-y-1.5 text-[15px] leading-relaxed`,children:e.narrative.map((e,t)=>(0,y.jsx)(`li`,{className:t===0?`font-medium`:`text-ink/90`,children:e},t))})}),(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,y.jsx)(p,{label:`Errors (${C})`,value:v.errorsRange.toLocaleString(),tone:v.criticalIssues?`critical`:void 0,hint:A===null?`not enough earlier data to compare`:A>500?`▲ from ${v.errorsPrev.toLocaleString()} in the previous ${b.span}`:`${A>0?`▲`:A<0?`▼`:`•`} ${Math.abs(A)}% vs previous ${b.span}`}),(0,y.jsx)(p,{label:`Critical issues`,value:v.criticalIssues,tone:v.criticalIssues?`critical`:void 0,hint:`≥ threshold occurrences in 24h`}),(0,y.jsx)(p,{label:`Crash-free users (${C})`,value:x(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,y.jsx)(p,{label:`Crash-free sessions (${C})`,value:x(e.health.crashFreeRate),tone:e.health.crashFreeRate!==null&&e.health.crashFreeRate<.99?`high`:void 0,hint:`${e.health.sessionsRange.toLocaleString()} sessions · ${v.activeIssues} active issues`})]}),(0,y.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-5`,children:[(0,y.jsx)(`div`,{className:`min-w-0 lg:col-span-3`,children:(0,y.jsxs)(m,{title:`Where the app is failing`,subtitle:`Errors in ${b.label} by flow, coloured by worst severity. Click a bar to filter issues.`,children:[(0,y.jsx)(s,{data:e.flows,onSelect:e=>a({search:t=>({...t,flow:t.flow===e?void 0:e})})}),(0,y.jsx)(u,{columns:[`Flow`,`Severity`,`Errors 24h`,`Errors (${C})`,`Issues`,`Failure rate (${C})`],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,y.jsx)(`div`,{className:`min-w-0 lg:col-span-2`,children:(0,y.jsxs)(m,{title:`Error trend`,subtitle:`Errors per ${b.granularity}, ${b.label} (UTC)`,children:[(0,y.jsx)(o,{data:e.trend,markers:e.releases.map(e=>({day:e.firstDay,label:e.release}))}),e.releases.length>0&&(0,y.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,y.jsx)(u,{columns:[`Day`,`Errors`,`Events`],rows:e.trend.map(e=>[e.day,e.errors,e.events])})]})})]}),(0,y.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,y.jsx)(m,{title:`Release health`,subtitle:`Share of sessions without a crash or unhandled error, per app version, in ${b.label}. Recorded automatically by the SDK.`,children:e.health.releases.length?(0,y.jsx)(`div`,{className:`-mx-4 overflow-x-auto sm:mx-0`,children:(0,y.jsxs)(`table`,{className:`tabular w-full min-w-[420px] text-left text-sm`,children:[(0,y.jsx)(`thead`,{className:`text-xs text-muted`,children:(0,y.jsxs)(`tr`,{className:`border-b border-line`,children:[(0,y.jsx)(`th`,{className:`px-4 py-2 font-medium sm:px-2`,children:`Version`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Sessions`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Crash-free`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Error-free`})]})}),(0,y.jsx)(`tbody`,{children:e.health.releases.map(e=>(0,y.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,y.jsx)(`td`,{className:`px-4 py-2 font-medium sm:px-2`,children:e.version}),(0,y.jsx)(`td`,{className:`px-2 py-2 text-right text-muted`,children:e.sessions.toLocaleString()}),(0,y.jsx)(`td`,{className:`px-2 py-2 text-right font-semibold ${S(e.crashFreeRate)}`,children:x(e.crashFreeRate)}),(0,y.jsx)(`td`,{className:`px-2 py-2 text-right`,children:x(e.errorFreeRate)})]},e.version))})]})}):(0,y.jsx)(`p`,{className:`text-sm text-muted`,children:`No sessions yet. They're recorded automatically from SDK 0.2.`})}),(0,y.jsx)(m,{title:`Failing endpoints`,subtitle:`Requests that returned 5xx, timed out or failed in ${b.label}. Captured automatically from fetch and XHR.`,children:e.health.endpoints.length?(0,y.jsx)(d,{rows:e.health.endpoints.map(e=>({key:e.endpoint,value:e.failuresRange}))}):(0,y.jsx)(`p`,{className:`text-sm text-muted`,children:`No failed requests.`})})]}),(e.steps.length>0||e.timings.length>0)&&(0,y.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[e.steps.length>0&&(0,y.jsx)(m,{title:`Steps that fail`,subtitle:`track() outcomes per step in ${b.label}, most failures first.${r?` Filtered to ${r}.`:``}`,children:(0,y.jsx)(`div`,{className:`-mx-4 overflow-x-auto sm:mx-0`,children:(0,y.jsxs)(`table`,{className:`tabular w-full min-w-[420px] text-left text-sm`,children:[(0,y.jsx)(`thead`,{className:`text-xs text-muted`,children:(0,y.jsxs)(`tr`,{className:`border-b border-line`,children:[(0,y.jsx)(`th`,{className:`px-4 py-2 font-medium sm:px-2`,children:`Flow · step`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Tries`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Failed`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Failure rate`})]})}),(0,y.jsx)(`tbody`,{children:e.steps.filter(e=>!r||e.flow===r).slice(0,8).map(e=>(0,y.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,y.jsxs)(`td`,{className:`px-4 py-2 font-mono text-xs sm:px-2`,children:[e.flow,` · `,e.step]}),(0,y.jsx)(`td`,{className:`px-2 py-2 text-right text-muted`,children:(e.successes+e.failures).toLocaleString()}),(0,y.jsx)(`td`,{className:`px-2 py-2 text-right`,children:e.failures.toLocaleString()}),(0,y.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,y.jsxs)(m,{title:`Response times`,subtitle:`Busiest endpoints in ${b.label}. Measured by the SDK on real devices.`,children:[(0,y.jsx)(`div`,{className:`-mx-4 overflow-x-auto sm:mx-0`,children:(0,y.jsxs)(`table`,{className:`tabular w-full min-w-[420px] text-left text-sm`,children:[(0,y.jsx)(`thead`,{className:`text-xs text-muted`,children:(0,y.jsxs)(`tr`,{className:`border-b border-line`,children:[(0,y.jsx)(`th`,{className:`px-4 py-2 font-medium sm:px-2`,children:`Endpoint`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Requests`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`p50`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`p95`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Failed`})]})}),(0,y.jsx)(`tbody`,{children:e.timings.map(e=>(0,y.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,y.jsx)(`td`,{className:`max-w-[220px] truncate px-4 py-2 font-mono text-xs sm:px-2`,title:e.endpoint,children:e.endpoint}),(0,y.jsx)(`td`,{className:`px-2 py-2 text-right text-muted`,children:e.requests.toLocaleString()}),(0,y.jsx)(`td`,{className:`px-2 py-2 text-right`,children:T(e.p50)}),(0,y.jsx)(`td`,{className:`px-2 py-2 text-right font-semibold ${e.p95!==null&&e.p95>=3e3?`text-sev-high`:``}`,children:T(e.p95)}),(0,y.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,y.jsx)(`p`,{className:`mt-2 text-xs text-muted`,children:`p50/p95: half / 95% of requests finished within this time.`})]})]}),(0,y.jsx)(m,{title:r?`Issues in ${r}`:`Issues by severity`,subtitle:`Grouped errors seen in ${b.label}. Severity is set by occurrences in the last 24 hours.`,right:(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 text-xs`,children:[r&&(0,y.jsx)(`button`,{className:`mr-2 text-accent`,onClick:()=>a({search:e=>({...e,flow:void 0})}),children:`Clear flow ×`}),[`open`,`resolved`,`ignored`,`all`].map(e=>(0,y.jsxs)(`button`,{onClick:()=>a({search:t=>({...t,status:e===`open`?void 0:e})}),className:`rounded-md border px-2 py-1 capitalize ${E===e?`border-accent bg-accent-soft text-accent`:`border-line text-muted hover:bg-panel-2`}`,children:[e,e!==`all`&&(0,y.jsx)(`span`,{className:`ml-1 opacity-70`,children:k(e)})]},e))]}),children:(0,y.jsx)(`div`,{className:`-mx-4 overflow-x-auto sm:mx-0`,children:(0,y.jsxs)(`table`,{className:`tabular w-full min-w-[640px] text-left text-sm`,children:[(0,y.jsx)(`thead`,{className:`text-xs text-muted`,children:(0,y.jsxs)(`tr`,{className:`border-b border-line`,children:[(0,y.jsx)(`th`,{className:`px-4 py-2 font-medium sm:px-2`,children:`Severity`}),(0,y.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`Issue`}),(0,y.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`Flow`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Users`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`24h`}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:C===`24h`?`Total`:C===`range`?`Range`:C}),(0,y.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Last seen`})]})}),(0,y.jsxs)(`tbody`,{children:[O.map(t=>(0,y.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-panel-2`,children:[(0,y.jsx)(`td`,{className:`px-4 py-2.5 sm:px-2`,children:(0,y.jsx)(c,{severity:t.severity})}),(0,y.jsxs)(`td`,{className:`max-w-[420px] px-2 py-2.5`,children:[(0,y.jsx)(n,{to:`/issues/$fingerprint`,params:{fingerprint:t.fingerprint},search:{app:e.app,range:b.preset===`14d`?void 0:b.preset,...b.preset===`custom`?{from:b.from,to:b.to}:{}},className:`block truncate font-medium hover:text-accent`,children:t.title}),t.culprit&&(0,y.jsx)(`div`,{className:`truncate font-mono text-xs text-muted`,children:t.culprit}),(0,y.jsx)(f,{issue:t})]}),(0,y.jsx)(`td`,{className:`px-2 py-2.5 text-xs`,children:t.flow??(0,y.jsx)(`span`,{className:`text-muted`,children:`untagged`})}),(0,y.jsx)(`td`,{className:`px-2 py-2.5 text-right text-muted`,children:t.users??`—`}),(0,y.jsx)(`td`,{className:`px-2 py-2.5 text-right font-semibold`,children:t.count24h}),(0,y.jsx)(`td`,{className:`px-2 py-2.5 text-right text-muted`,children:C===`24h`?t.countTotal:t.countRange}),(0,y.jsx)(`td`,{className:`px-2 py-2.5 text-right text-xs text-muted`,children:l(t.lastSeen)})]},t.fingerprint)),!O.length&&(0,y.jsx)(`tr`,{children:(0,y.jsx)(`td`,{colSpan:7,className:`px-2 py-6 text-center text-muted`,children:`No issues.`})})]})]})})}),(0,y.jsxs)(`div`,{className:`grid gap-5 md:grid-cols-3`,children:[(0,y.jsx)(m,{title:`By network`,subtitle:`Errors, ${b.label}`,children:(0,y.jsx)(d,{rows:e.breakdowns.network.map(e=>({key:e.key,value:e.errors}))})}),(0,y.jsx)(m,{title:`By country`,subtitle:`Errors, ${b.label}. From the device's timezone, not its IP.`,children:(0,y.jsx)(d,{rows:e.breakdowns.country.map(e=>({key:e.key,value:e.errors}))})}),(0,y.jsx)(m,{title:`By OS`,subtitle:`Errors, ${b.label}`,children:(0,y.jsx)(d,{rows:e.breakdowns.os.map(e=>({key:e.key,value:e.errors}))})}),(0,y.jsx)(m,{title:`By app version`,subtitle:`Errors, ${b.label}`,children:(0,y.jsx)(d,{rows:e.breakdowns.appVersion.map(e=>({key:e.key,value:e.errors}))})}),(0,y.jsx)(m,{title:`By device`,subtitle:`Errors, ${b.label}`,children:(0,y.jsx)(d,{rows:e.breakdowns.deviceModel.map(e=>({key:e.key,value:e.errors}))})})]}),(0,y.jsxs)(`p`,{className:`pb-6 text-xs text-muted`,children:[`Machine-readable: `,(0,y.jsxs)(`code`,{children:[`GET /api/summary?app=`,e.app]}),` returns this page as JSON with field descriptions.`]})]})}function x(e){return e===null?`—`:`${(Math.floor(e*1e3)/10).toFixed(1)}%`}function S(e){return e===null?``:e<.98?`text-sev-critical`:e<.995?`text-sev-high`:``}var C=[{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:`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 w(){let t=e();return(0,v.useEffect)(()=>{let e=setInterval(()=>void t.invalidate(),5e3);return()=>clearInterval(e)},[t]),(0,y.jsxs)(`main`,{className:`mx-auto max-w-4xl space-y-6 px-4 py-10 sm:px-6`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-muted`,children:`Connected · waiting for the first event`}),(0,y.jsx)(`h1`,{className:`mt-1 text-2xl font-semibold tracking-tight`,children:`Your dashboard is ready, and empty for now.`}),(0,y.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,y.jsx)(`code`,{children:`npx debugkit test`}),` (or `,(0,y.jsx)(`code`,{children:`npx @debugkit/cli test`}),`). This page fills in on its own.`]})]}),(0,y.jsxs)(`section`,{"aria-labelledby":`see-h`,className:`rounded-xl border border-line bg-panel p-4 sm:p-5`,children:[(0,y.jsx)(`h2`,{id:`see-h`,className:`text-sm font-semibold`,children:`What you'll see here`}),(0,y.jsx)(`ul`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:C.map(e=>(0,y.jsxs)(`li`,{className:`rounded-lg border border-line p-3`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,y.jsx)(`span`,{className:`text-[11px] uppercase tracking-wide text-muted`,children:e.when})]}),(0,y.jsx)(`p`,{className:`mt-1 text-sm text-ink/80`,children:e.detail})]},e.title))})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,y.jsxs)(`section`,{"aria-labelledby":`auto-h`,className:`rounded-xl border border-line bg-panel p-4 sm:p-5`,children:[(0,y.jsx)(`h2`,{id:`auto-h`,className:`text-sm font-semibold`,children:`Recorded automatically`}),(0,y.jsxs)(`p`,{className:`mt-1 text-xs text-muted`,children:[`Once `,(0,y.jsx)(`code`,{children:`init()`}),` runs, with no other code.`]}),(0,y.jsxs)(`ul`,{className:`mt-3 list-disc space-y-1 pl-5 text-sm`,children:[(0,y.jsx)(`li`,{children:`Crashes and unhandled promise rejections`}),(0,y.jsx)(`li`,{children:`Failed, timed-out and 5xx requests, with the code that made them`}),(0,y.jsx)(`li`,{children:`Sessions, for crash-free rates per release`}),(0,y.jsx)(`li`,{children:`Screens visited, buttons clicked, console warnings, app backgrounded or offline`}),(0,y.jsx)(`li`,{children:`Device, OS, app version and network on every event`})]})]}),(0,y.jsxs)(`section`,{"aria-labelledby":`manual-h`,className:`rounded-xl border border-line bg-panel p-4 sm:p-5`,children:[(0,y.jsx)(`h2`,{id:`manual-h`,className:`text-sm font-semibold`,children:`What you add`}),(0,y.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`Only what the app can't know on its own.`}),(0,y.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 T(e){return e===null?`—`:Number.isFinite(e)?e>=1e3?`≤ ${(e/1e3).toFixed(e%1e3?1:0)} s`:`≤ ${e} ms`:`> 10 s`}export{b as component};
|