@capagents/forgeqe 3.4.3 → 3.4.5
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/forgeqe.js +1993 -1985
- package/dist/web/assets/{3d-force-graph-ChNz5Yhx.js → 3d-force-graph-Bv0L0GYY.js} +1 -1
- package/dist/web/assets/{Agent-CTRFDu9M.js → Agent-CxEcSdpb.js} +1 -1
- package/dist/web/assets/{AgentWork-D1c_w9rM.js → AgentWork-pz5zDHe7.js} +1 -1
- package/dist/web/assets/{ApiTests-CHKwMgxN.js → ApiTests-Cvuu_jpF.js} +1 -1
- package/dist/web/assets/{Browse-CcKh43L5.js → Browse-CugNbc8C.js} +1 -1
- package/dist/web/assets/{Chat-CooI13qi.js → Chat-Tqqg4JUL.js} +1 -1
- package/dist/web/assets/{CommandPalette-D8AtIocY.js → CommandPalette-DvSYdMC_.js} +1 -1
- package/dist/web/assets/{Compare-DPX2G5oF.js → Compare-CVdloZNm.js} +1 -1
- package/dist/web/assets/{Cost-CBGk_xKN.js → Cost-Bm4Dqpwr.js} +1 -1
- package/dist/web/assets/{Data-CW95KX9u.js → Data-CGjaHLjI.js} +1 -1
- package/dist/web/assets/{Desktop-C6-h0ExO.js → Desktop-BbTWto2U.js} +1 -1
- package/dist/web/assets/{DesktopReview-C02n70Wx.js → DesktopReview-Cw2ODskw.js} +1 -1
- package/dist/web/assets/{Evidence-DqTx1TS1.js → Evidence-DjY7OEs8.js} +1 -1
- package/dist/web/assets/{Explore-DgaugrDO.js → Explore-BB-c2iyf.js} +1 -1
- package/dist/web/assets/{Features-DYr-izEt.js → Features-DLJ0o5mQ.js} +1 -1
- package/dist/web/assets/{Flags-DL-G7YWK.js → Flags-BF4LF0Sn.js} +1 -1
- package/dist/web/assets/{Flaky-DOxneo4i.js → Flaky-DKEWWH_N.js} +1 -1
- package/dist/web/assets/{Impact-BuHHY2_3.js → Impact-BYfBT4ng.js} +1 -1
- package/dist/web/assets/{Jobs-DEc49gwq.js → Jobs-DwPYSmQp.js} +1 -1
- package/dist/web/assets/{KindPage-DuLav-l5.js → KindPage-CNSIw8EU.js} +1 -1
- package/dist/web/assets/{LiveDevice-PsN5gnXw.js → LiveDevice-Bzz5k4my.js} +1 -1
- package/dist/web/assets/{Migration-BcxL5Okw.js → Migration-B8FRhxpQ.js} +1 -1
- package/dist/web/assets/{Mobile-CBDmyoL5.js → Mobile-DDg3lrvO.js} +1 -1
- package/dist/web/assets/{Observability-Cqjko62E.js → Observability-S_GxyR80.js} +1 -1
- package/dist/web/assets/{OwnItems-DXS-CMiC.js → OwnItems-CGD8lZsA.js} +1 -1
- package/dist/web/assets/{PageAgent-BzDuRR-t.js → PageAgent-CUicHm1M.js} +1 -1
- package/dist/web/assets/{Product-BKIKhNp3.js → Product-D0HVqFU9.js} +2 -2
- package/dist/web/assets/{Production-DKKynWrp.js → Production-D4qoP1EY.js} +1 -1
- package/dist/web/assets/{Quality-Dsh07yXp.js → Quality-BeNUMygb.js} +1 -1
- package/dist/web/assets/{Readiness-BbjzvgVB.js → Readiness-BKh3XR-d.js} +1 -1
- package/dist/web/assets/Record-CEY5wJ5f.js +1 -0
- package/dist/web/assets/{Regression-DeQnXoZ4.js → Regression-DVQujWFy.js} +1 -1
- package/dist/web/assets/{RelationGraph-C7M_Zcx-.js → RelationGraph-5GEqITmu.js} +1 -1
- package/dist/web/assets/{Reports-DsWA9Q7H.js → Reports-C7R9gb02.js} +1 -1
- package/dist/web/assets/{Requirements-B-8D5JFY.js → Requirements-FCu-HkXc.js} +1 -1
- package/dist/web/assets/{Responsive-Dl4CLUoF.js → Responsive-DwXdPKww.js} +1 -1
- package/dist/web/assets/{RunDiff-C2knd045.js → RunDiff-UU3jCTyW.js} +1 -1
- package/dist/web/assets/{Settings-Cmac0LZa.js → Settings-BkjUlPMQ.js} +3 -3
- package/dist/web/assets/{SiteScan-D2WMUVcw.js → SiteScan-CNCGcPQX.js} +1 -1
- package/dist/web/assets/{Steps-DeZhIdc1.js → Steps-CYDb_3OH.js} +1 -1
- package/dist/web/assets/{TestData-CDOvUmVT.js → TestData-CE5vC330.js} +1 -1
- package/dist/web/assets/{TestManagement-9CTQonHe.js → TestManagement-CxcJI04K.js} +1 -1
- package/dist/web/assets/{WhatsNew-BotUU9UF.js → WhatsNew-CIg0ienp.js} +1 -1
- package/dist/web/assets/{agentSettingsSheet-BEVtvrGk.js → agentSettingsSheet-CLWVrbZy.js} +1 -1
- package/dist/web/assets/api-D1PU4zye.js +1 -0
- package/dist/web/assets/{dataParts-C5w2uvJZ.js → dataParts-uqmYw8V2.js} +1 -1
- package/dist/web/assets/{desktopAppPath-BN4vYVi4.js → desktopAppPath-DUEjQMmN.js} +1 -1
- package/dist/web/assets/{flowTheme-dXvSLQHO.js → flowTheme-ZJk8bNiH.js} +1 -1
- package/dist/web/assets/{frame-BANehQdX.js → frame-D0MS2ZMz.js} +3 -3
- package/dist/web/assets/{index-Db_tsLSf.js → index-F8zkXd19.js} +4 -4
- package/dist/web/assets/{nav-f8SqayfG.js → nav-CkrE6JFU.js} +1 -1
- package/dist/web/assets/{pageBack-DU3mApVL.js → pageBack-DfGBh1Hs.js} +1 -1
- package/dist/web/assets/{palette-D8aKJo_q.js → palette-dAh9kV3S.js} +1 -1
- package/dist/web/assets/{parts-B0PK7ewd.js → parts-DqfD-6Qb.js} +1 -1
- package/dist/web/assets/{productParts-bcAIT4Ca.js → productParts-CCceBbIo.js} +1 -1
- package/dist/web/assets/{qualityParts-C2Y38oFp.js → qualityParts-DcRvGy-_.js} +1 -1
- package/dist/web/assets/{recordTest-Cn4qoyRB.js → recordTest-DN3Kl6PB.js} +1 -1
- package/dist/web/assets/{stepper-CEFz82T4.js → stepper-DiPQQ2l6.js} +1 -1
- package/dist/web/assets/{wizardParts-CGHmp8or.js → wizardParts-CnCYTsR0.js} +1 -1
- package/dist/web/index.html +6 -6
- package/package.json +1 -1
- package/py/forgeqe_engine/capture.py +36 -8
- package/py/forgeqe_engine/d365.py +263 -3
- package/py/forgeqe_engine/recordsession.py +2 -1
- package/py/forgeqe_engine/webrecord.py +3 -0
- package/py/forgeqe_engine/webrecord_page.py +34 -5
- package/skills/dynamics-365-automation/SKILL.md +12 -0
- package/dist/web/assets/Record-BIa-SPuU.js +0 -1
- package/dist/web/assets/api-DS8XP38R.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{r as n}from"./route-9BkoTWUE.js";import{I as r,c as i}from"./surface-c1kG1KPS.js";import{n as a,t as o}from"./utils-DJRAScIl.js";import{t as s}from"./jsx-runtime-LKYXHABd.js";import{G as c,I as l,W as u}from"./palette-D8aKJo_q.js";import{Q as d}from"./api-DS8XP38R.js";import{A as f,F as p,I as m,L as h,M as g,O as _,T as v,_ as y,g as b,j as x,k as S,m as C,n as ee,w}from"./pageBack-DU3mApVL.js";import{Bt as T,C as E,Er as D,Tn as O,Un as te,ft as k,rr as ne,vn as re,y as ie,z as A}from"./line-icons-Cwj9OmCz.js";import{At as j,B as ae,G as oe,Ht as se,K as ce,L as le,Vt as ue,W as M,Z as N,ct as P,ft as de,it as fe,lt as F,ot as I,rt as L,s as R,t as z,ut as B}from"./frame-BANehQdX.js";import{J as pe,R as me,V as he}from"./index-Db_tsLSf.js";var V=e(t(),1),H=s(),U={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`Mobile run`,page:`Report page`},W=e=>{if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString([],{month:`short`,day:`numeric`,...t.getFullYear()===new Date().getFullYear()?{}:{year:`numeric`},hour:`numeric`,minute:`2-digit`})},ge=e=>{if(!e)return``;let t=Math.round(e/1e3);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${t%60}s`:`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`};function G(e){return e.scope===`page`?{tone:`neutral`,label:`Report`}:e.counts.total?e.counts.failed?{tone:`fail`,label:`${e.counts.failed} failed`}:e.stopped||e.counts.other?{tone:`warn`,label:e.stopped?`Stopped`:`${e.counts.other} not run`}:{tone:`pass`,label:`Passed`}:{tone:`neutral`,label:`No results`}}var _e={fail:0,warn:1,pass:2,neutral:3},K=e=>Date.parse(e.startedAt||``)||0,q=e=>e.toSorted((e,t)=>K(t)-K(e)),ve=async(e,t)=>t(await x(e.report||e.folder));function J({r:e,onNote:t}){let[n,r]=(0,V.useState)(!1),i=e=>()=>{r(!1),e()};return(0,H.jsxs)(`span`,{className:`relative inline-block`,onClick:e=>e.stopPropagation(),children:[(0,H.jsx)(p,{variant:`icon`,size:`icon-sm`,"aria-label":`More for ${e.title}`,"data-tip":`More`,"aria-haspopup":`menu`,"aria-expanded":n,onClick:()=>r(!n),children:(0,H.jsx)(O,{"aria-hidden":`true`})}),(0,H.jsxs)(u,{open:n,onClose:()=>r(!1),label:`More for ${e.title}`,align:`end`,className:`min-w-[220px] text-left`,children:[e.report&&(0,H.jsx)(c,{onClick:i(async()=>t(await x(e.report))),children:`Open the report in a new tab`}),(0,H.jsx)(c,{onClick:i(async()=>t(await x(e.folder))),children:`Open its folder`}),(0,H.jsx)(c,{onClick:i(()=>navigator.clipboard?.writeText(e.folder).then(()=>t(``),()=>t(`Could not copy the folder's path.`))),children:`Copy the folder's path`})]})]})}function Y({rows:e,resetKey:t,tools:n,empty:r,onNote:i}){return(0,H.jsx)(L,{label:`Execution reports`,search:!1,resetKey:t,tools:n,height:fe,empty:r,head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{scope:`col`,className:F,children:`Report`}),(0,H.jsx)(`th`,{scope:`col`,className:o(F,`w-[136px]`),children:`Result`}),(0,H.jsx)(`th`,{scope:`col`,className:o(B,`hidden w-[104px] @3xl:table-cell`),children:`Passed`}),(0,H.jsx)(`th`,{scope:`col`,className:o(B,`hidden w-[96px] @3xl:table-cell`),children:`Took`}),(0,H.jsx)(`th`,{scope:`col`,className:o(F,`hidden w-[136px] @2xl:table-cell`),children:`Kind`}),(0,H.jsx)(`th`,{scope:`col`,className:o(B,`hidden w-[128px] @xl:table-cell`),children:`When`}),(0,H.jsx)(`th`,{scope:`col`,className:o(F,`w-12`),children:(0,H.jsx)(`span`,{className:`sr-only`,children:`More`})})]}),children:e.map(e=>{let t=G(e),n=()=>void ve(e,i);return(0,H.jsxs)(`tr`,{className:de,onClick:n,children:[(0,H.jsx)(`td`,{className:o(I,`max-w-0`),children:(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col items-start`,children:[(0,H.jsx)(p,{variant:`link`,size:`inline`,className:`max-w-full min-w-0 justify-start font-medium text-ink no-underline hover:underline`,"data-tip":e.title,"aria-label":`${e.title}: open ${e.report?`the report`:`its folder`} in a new tab`,onClick:e=>{e.stopPropagation(),n()},children:(0,H.jsx)(`span`,{className:`truncate`,children:e.title})}),(0,H.jsx)(`span`,{className:`max-w-full truncate text-muted @xl:hidden`,children:[U[e.scope],N(e.startedAt)].filter(Boolean).join(` · `)})]})}),(0,H.jsx)(`td`,{className:o(I,`whitespace-nowrap`),"data-sort":_e[t.tone],children:(0,H.jsx)(S,{tone:t.tone,children:t.label})}),(0,H.jsx)(`td`,{className:o(P,`hidden text-ink-2 @3xl:table-cell`),"data-sort":e.counts.total?e.counts.passed/e.counts.total:-1,children:e.scope===`page`||!e.counts.total?(0,H.jsx)(`span`,{className:`text-muted`,children:`—`}):`${e.counts.passed}/${e.counts.total}`}),(0,H.jsx)(`td`,{className:o(P,`hidden text-ink-2 @3xl:table-cell`),"data-sort":e.ms||0,children:ge(e.ms)||(0,H.jsx)(`span`,{className:`text-muted`,children:`—`})}),(0,H.jsx)(`td`,{className:o(I,`hidden max-w-0 @2xl:table-cell`),children:(0,H.jsx)(`span`,{className:`block truncate text-ink-2`,children:U[e.scope]||e.scope})}),(0,H.jsx)(`td`,{className:o(P,`hidden text-ink-2 @xl:table-cell`),"data-sort":K(e),"data-tip":W(e.startedAt),children:N(e.startedAt)}),(0,H.jsx)(`td`,{className:o(I,`text-right`),children:(0,H.jsx)(J,{r:e,onNote:i})})]},e.key)})})}var X=e=>{let t=new Date(`${e}T12:00:00`);return Number.isNaN(t.getTime())?e:t.toLocaleDateString([],{day:`numeric`,month:`short`})},Z=e=>{let t=e.reduce((e,t)=>e+t.cases,0);return t?Math.round(e.reduce((e,t)=>e+t.passed,0)/t*100):null};function Q({title:e,icon:t,note:n,children:r,className:a}){return(0,H.jsx)(pe,{level:3,icon:t,title:e,description:n,className:o(i,a),children:(0,H.jsx)(`div`,{className:`flex min-w-0 flex-col`,children:r})})}function $({part:e,whole:t,tone:n,label:r}){return(0,H.jsxs)(`span`,{className:`flex flex-none items-center gap-2`,children:[(0,H.jsx)(w,{share:t?e/t:0,lead:n===`accent`,tone:n===`accent`?void 0:n,text:t?`${Math.round(e/t*100)}%`:``,className:`w-24 flex-none`}),(0,H.jsx)(`span`,{className:`text-body-sm whitespace-nowrap text-ink-2 tabular-nums`,children:r})]})}function ye({days:e}){let[t,n]=(0,V.useState)(null),r=e.slice(-30);if(!r.length)return(0,H.jsx)(`p`,{className:`m-0 py-6 text-body-sm text-muted`,children:`No runs with results yet.`});let i=Math.max(1,...r.map(e=>e.cases)),s=i<=4?1:Math.ceil(i/4/5)*5||1,c=Math.ceil(i/s)*s,l=[c,Math.round(c/2),0],u=Math.ceil(r.length/8),d=t===null?null:r[t];return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{"aria-hidden":`true`,className:`flex gap-4 text-body-sm text-ink-2`,children:[(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`size-2.5 rounded-sm bg-pass`}),` Passed`]}),(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`size-2.5 rounded-sm bg-fail`}),` Failed`]})]}),(0,H.jsxs)(`div`,{className:`relative grid grid-cols-[32px_minmax(0,1fr)] gap-x-2`,children:[(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-[180px] flex-col justify-between text-right text-body-sm text-muted tabular-nums`,children:l.map(e=>(0,H.jsx)(`span`,{className:`-translate-y-1/2 first:translate-y-0 last:translate-y-0`,children:e},e))}),(0,H.jsxs)(`div`,{className:`relative h-[180px]`,onMouseLeave:()=>n(null),children:[l.map((e,t)=>(0,H.jsx)(`span`,{"aria-hidden":`true`,className:o(`absolute inset-x-0 border-t`,t===l.length-1?`border-line`:`border-line-soft`),style:{top:`${(1-e/c)*100}%`}},e)),(0,H.jsx)(`div`,{className:`absolute inset-0`,children:(0,H.jsx)(y,{series:[{values:r.map(e=>e.passed),tone:`pass`},{values:r.map(e=>e.cases-e.passed),tone:`fail`}],label:`Cases by day over ${a(r.length,`day`)}: ${r.reduce((e,t)=>e+t.passed,0)} passed and ${r.reduce((e,t)=>e+t.cases-t.passed,0)} failed.`,max:c,padded:!1,hover:t??-1,onHover:e=>n(e<0?null:e),className:`h-[180px]`})}),d&&(0,H.jsxs)(`div`,{role:`status`,className:o(`rounded-md border border-overlay-line bg-overlay p-2 text-ink shadow-menu backdrop-blur-[16px]`,`pointer-events-none absolute z-[2] w-max max-w-[220px] -translate-x-1/2 -translate-y-[calc(100%+8px)] text-body-sm`),style:{left:`${Math.min(88,Math.max(12,t/Math.max(1,r.length-1)*100))}%`,top:`${(1-d.passed/c)*100}%`},children:[(0,H.jsx)(`b`,{className:`block text-ink`,children:X(d.day)}),(0,H.jsxs)(`span`,{className:`block text-ink-2 tabular-nums`,children:[d.passed,` passed, `,d.cases-d.passed,` failed · `,Z([d]),`%`]}),(0,H.jsx)(`span`,{className:`block text-muted`,children:a(d.runs,`run`)})]})]}),(0,H.jsx)(`span`,{}),(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`mt-1 flex gap-1 text-body-sm text-muted`,children:r.map((e,t)=>(0,H.jsx)(`span`,{className:`min-w-0 flex-1 text-center whitespace-nowrap`,children:t%u===0&&(0,H.jsx)(`span`,{className:o(t/u%2==1&&`hidden @2xl:inline`),children:X(e.day)})},e.day))})]}),(0,H.jsxs)(`table`,{className:`sr-only`,children:[(0,H.jsx)(`caption`,{children:`Cases by day`}),(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{scope:`col`,children:`Day`}),(0,H.jsx)(`th`,{scope:`col`,children:`Runs`}),(0,H.jsx)(`th`,{scope:`col`,children:`Passed`}),(0,H.jsx)(`th`,{scope:`col`,children:`Failed`})]})}),(0,H.jsx)(`tbody`,{children:r.map(e=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{children:e.day}),(0,H.jsx)(`td`,{children:e.runs}),(0,H.jsx)(`td`,{children:e.passed}),(0,H.jsx)(`td`,{children:e.cases-e.passed})]},e.day))})]})]})}function be({project:e,build:t,onBuilt:r}){let[i,s]=(0,V.useState)(t),[c,l]=(0,V.useState)(``),u=!!i?.running;(0,V.useEffect)(()=>{if(!u)return;let e=se(async()=>{try{let e=await d.buildStatus();s(e),e&&!e.running&&r()}catch{}},1200);return()=>ue(e)},[u,r]);let _=e.cases?Math.round(e.passed/e.cases*100):null,v=Z(e.days.slice(-7)),y=Z(e.days.slice(-14,-7)),b=v!==null&&y!==null?v-y:null,S=[{label:`Runs`,value:String(e.runs),sub:e.runs?`${X(String(e.from).slice(0,10))} – ${X(String(e.to).slice(0,10))}`:void 0},{label:`Cases run`,value:String(e.cases),sub:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`span`,{className:`text-pass`,children:[e.passed,` passed`]}),` · `,(0,H.jsxs)(`span`,{className:o(e.failed&&`text-fail`),children:[e.failed,` failed`]})]})},{label:`Tokens`,value:ae(e.tokens),sub:e.cost?le(e.cost.amount,e.cost.currency):void 0}];return(0,H.jsxs)(`section`,{"aria-labelledby":`project-h`,className:`flex min-w-0 flex-col gap-4`,children:[(0,H.jsx)(`h2`,{id:`project-h`,className:`sr-only`,children:`Project report`}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-[1_1_240px] text-body-sm text-muted`,children:e.page?`The HTML report was built ${W(e.page.builtAt)}.`:`Every run, taken together. The HTML report has not been built yet.`}),e.page&&(0,H.jsxs)(p,{size:`sm`,"data-tip":`Open the HTML report`,onClick:async()=>l(await x(e.page.file)),children:[(0,H.jsx)(k,{"aria-hidden":`true`}),`Report`]}),(0,H.jsx)(p,{size:`sm`,variant:`outline`,disabled:u,"data-tip":e.page?`Build the HTML report again`:`Build the HTML report`,onClick:async()=>{l(``);try{s(await d.build())}catch(e){l(e.message)}},children:u?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(g,{state:`working`,px:14}),`Building…`]}):e.page?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(te,{"aria-hidden":`true`}),`Rebuild`]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(T,{"aria-hidden":`true`}),`Build`]})})]}),c&&(0,H.jsx)(`p`,{role:`alert`,className:o(h.fail,`m-0`),children:c}),i&&(i.running||i.ok===!1)&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[!i.running&&(0,H.jsx)(`p`,{className:o(h.fail,`m-0`),children:`forgeqe bi build stopped with a problem; its output is below.`}),(0,H.jsx)(`pre`,{"aria-label":`forgeqe bi build output`,"aria-live":`polite`,className:o(`overflow-auto rounded-base bg-surface-muted p-4 font-mono text-body-sm leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,`m-0 max-h-[200px]`),children:(0,H.jsx)(C,{text:i.lines.length?i.lines.join(`
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{r as n}from"./route-9BkoTWUE.js";import{I as r,c as i}from"./surface-c1kG1KPS.js";import{n as a,t as o}from"./utils-DJRAScIl.js";import{t as s}from"./jsx-runtime-LKYXHABd.js";import{G as c,I as l,W as u}from"./palette-dAh9kV3S.js";import{Q as d}from"./api-D1PU4zye.js";import{A as f,F as p,I as m,L as h,M as g,O as _,T as v,_ as y,g as b,j as x,k as S,m as C,n as ee,w}from"./pageBack-DfGBh1Hs.js";import{Bt as T,C as E,Er as D,Tn as O,Un as te,ft as k,rr as ne,vn as re,y as ie,z as A}from"./line-icons-Cwj9OmCz.js";import{At as j,B as ae,G as oe,Ht as se,K as ce,L as le,Vt as ue,W as M,Z as N,ct as P,ft as de,it as fe,lt as F,ot as I,rt as L,s as R,t as z,ut as B}from"./frame-D0MS2ZMz.js";import{J as pe,R as me,V as he}from"./index-F8zkXd19.js";var V=e(t(),1),H=s(),U={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`Mobile run`,page:`Report page`},W=e=>{if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString([],{month:`short`,day:`numeric`,...t.getFullYear()===new Date().getFullYear()?{}:{year:`numeric`},hour:`numeric`,minute:`2-digit`})},ge=e=>{if(!e)return``;let t=Math.round(e/1e3);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${t%60}s`:`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`};function G(e){return e.scope===`page`?{tone:`neutral`,label:`Report`}:e.counts.total?e.counts.failed?{tone:`fail`,label:`${e.counts.failed} failed`}:e.stopped||e.counts.other?{tone:`warn`,label:e.stopped?`Stopped`:`${e.counts.other} not run`}:{tone:`pass`,label:`Passed`}:{tone:`neutral`,label:`No results`}}var _e={fail:0,warn:1,pass:2,neutral:3},K=e=>Date.parse(e.startedAt||``)||0,q=e=>e.toSorted((e,t)=>K(t)-K(e)),ve=async(e,t)=>t(await x(e.report||e.folder));function J({r:e,onNote:t}){let[n,r]=(0,V.useState)(!1),i=e=>()=>{r(!1),e()};return(0,H.jsxs)(`span`,{className:`relative inline-block`,onClick:e=>e.stopPropagation(),children:[(0,H.jsx)(p,{variant:`icon`,size:`icon-sm`,"aria-label":`More for ${e.title}`,"data-tip":`More`,"aria-haspopup":`menu`,"aria-expanded":n,onClick:()=>r(!n),children:(0,H.jsx)(O,{"aria-hidden":`true`})}),(0,H.jsxs)(u,{open:n,onClose:()=>r(!1),label:`More for ${e.title}`,align:`end`,className:`min-w-[220px] text-left`,children:[e.report&&(0,H.jsx)(c,{onClick:i(async()=>t(await x(e.report))),children:`Open the report in a new tab`}),(0,H.jsx)(c,{onClick:i(async()=>t(await x(e.folder))),children:`Open its folder`}),(0,H.jsx)(c,{onClick:i(()=>navigator.clipboard?.writeText(e.folder).then(()=>t(``),()=>t(`Could not copy the folder's path.`))),children:`Copy the folder's path`})]})]})}function Y({rows:e,resetKey:t,tools:n,empty:r,onNote:i}){return(0,H.jsx)(L,{label:`Execution reports`,search:!1,resetKey:t,tools:n,height:fe,empty:r,head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{scope:`col`,className:F,children:`Report`}),(0,H.jsx)(`th`,{scope:`col`,className:o(F,`w-[136px]`),children:`Result`}),(0,H.jsx)(`th`,{scope:`col`,className:o(B,`hidden w-[104px] @3xl:table-cell`),children:`Passed`}),(0,H.jsx)(`th`,{scope:`col`,className:o(B,`hidden w-[96px] @3xl:table-cell`),children:`Took`}),(0,H.jsx)(`th`,{scope:`col`,className:o(F,`hidden w-[136px] @2xl:table-cell`),children:`Kind`}),(0,H.jsx)(`th`,{scope:`col`,className:o(B,`hidden w-[128px] @xl:table-cell`),children:`When`}),(0,H.jsx)(`th`,{scope:`col`,className:o(F,`w-12`),children:(0,H.jsx)(`span`,{className:`sr-only`,children:`More`})})]}),children:e.map(e=>{let t=G(e),n=()=>void ve(e,i);return(0,H.jsxs)(`tr`,{className:de,onClick:n,children:[(0,H.jsx)(`td`,{className:o(I,`max-w-0`),children:(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col items-start`,children:[(0,H.jsx)(p,{variant:`link`,size:`inline`,className:`max-w-full min-w-0 justify-start font-medium text-ink no-underline hover:underline`,"data-tip":e.title,"aria-label":`${e.title}: open ${e.report?`the report`:`its folder`} in a new tab`,onClick:e=>{e.stopPropagation(),n()},children:(0,H.jsx)(`span`,{className:`truncate`,children:e.title})}),(0,H.jsx)(`span`,{className:`max-w-full truncate text-muted @xl:hidden`,children:[U[e.scope],N(e.startedAt)].filter(Boolean).join(` · `)})]})}),(0,H.jsx)(`td`,{className:o(I,`whitespace-nowrap`),"data-sort":_e[t.tone],children:(0,H.jsx)(S,{tone:t.tone,children:t.label})}),(0,H.jsx)(`td`,{className:o(P,`hidden text-ink-2 @3xl:table-cell`),"data-sort":e.counts.total?e.counts.passed/e.counts.total:-1,children:e.scope===`page`||!e.counts.total?(0,H.jsx)(`span`,{className:`text-muted`,children:`—`}):`${e.counts.passed}/${e.counts.total}`}),(0,H.jsx)(`td`,{className:o(P,`hidden text-ink-2 @3xl:table-cell`),"data-sort":e.ms||0,children:ge(e.ms)||(0,H.jsx)(`span`,{className:`text-muted`,children:`—`})}),(0,H.jsx)(`td`,{className:o(I,`hidden max-w-0 @2xl:table-cell`),children:(0,H.jsx)(`span`,{className:`block truncate text-ink-2`,children:U[e.scope]||e.scope})}),(0,H.jsx)(`td`,{className:o(P,`hidden text-ink-2 @xl:table-cell`),"data-sort":K(e),"data-tip":W(e.startedAt),children:N(e.startedAt)}),(0,H.jsx)(`td`,{className:o(I,`text-right`),children:(0,H.jsx)(J,{r:e,onNote:i})})]},e.key)})})}var X=e=>{let t=new Date(`${e}T12:00:00`);return Number.isNaN(t.getTime())?e:t.toLocaleDateString([],{day:`numeric`,month:`short`})},Z=e=>{let t=e.reduce((e,t)=>e+t.cases,0);return t?Math.round(e.reduce((e,t)=>e+t.passed,0)/t*100):null};function Q({title:e,icon:t,note:n,children:r,className:a}){return(0,H.jsx)(pe,{level:3,icon:t,title:e,description:n,className:o(i,a),children:(0,H.jsx)(`div`,{className:`flex min-w-0 flex-col`,children:r})})}function $({part:e,whole:t,tone:n,label:r}){return(0,H.jsxs)(`span`,{className:`flex flex-none items-center gap-2`,children:[(0,H.jsx)(w,{share:t?e/t:0,lead:n===`accent`,tone:n===`accent`?void 0:n,text:t?`${Math.round(e/t*100)}%`:``,className:`w-24 flex-none`}),(0,H.jsx)(`span`,{className:`text-body-sm whitespace-nowrap text-ink-2 tabular-nums`,children:r})]})}function ye({days:e}){let[t,n]=(0,V.useState)(null),r=e.slice(-30);if(!r.length)return(0,H.jsx)(`p`,{className:`m-0 py-6 text-body-sm text-muted`,children:`No runs with results yet.`});let i=Math.max(1,...r.map(e=>e.cases)),s=i<=4?1:Math.ceil(i/4/5)*5||1,c=Math.ceil(i/s)*s,l=[c,Math.round(c/2),0],u=Math.ceil(r.length/8),d=t===null?null:r[t];return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{"aria-hidden":`true`,className:`flex gap-4 text-body-sm text-ink-2`,children:[(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`size-2.5 rounded-sm bg-pass`}),` Passed`]}),(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`size-2.5 rounded-sm bg-fail`}),` Failed`]})]}),(0,H.jsxs)(`div`,{className:`relative grid grid-cols-[32px_minmax(0,1fr)] gap-x-2`,children:[(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-[180px] flex-col justify-between text-right text-body-sm text-muted tabular-nums`,children:l.map(e=>(0,H.jsx)(`span`,{className:`-translate-y-1/2 first:translate-y-0 last:translate-y-0`,children:e},e))}),(0,H.jsxs)(`div`,{className:`relative h-[180px]`,onMouseLeave:()=>n(null),children:[l.map((e,t)=>(0,H.jsx)(`span`,{"aria-hidden":`true`,className:o(`absolute inset-x-0 border-t`,t===l.length-1?`border-line`:`border-line-soft`),style:{top:`${(1-e/c)*100}%`}},e)),(0,H.jsx)(`div`,{className:`absolute inset-0`,children:(0,H.jsx)(y,{series:[{values:r.map(e=>e.passed),tone:`pass`},{values:r.map(e=>e.cases-e.passed),tone:`fail`}],label:`Cases by day over ${a(r.length,`day`)}: ${r.reduce((e,t)=>e+t.passed,0)} passed and ${r.reduce((e,t)=>e+t.cases-t.passed,0)} failed.`,max:c,padded:!1,hover:t??-1,onHover:e=>n(e<0?null:e),className:`h-[180px]`})}),d&&(0,H.jsxs)(`div`,{role:`status`,className:o(`rounded-md border border-overlay-line bg-overlay p-2 text-ink shadow-menu backdrop-blur-[16px]`,`pointer-events-none absolute z-[2] w-max max-w-[220px] -translate-x-1/2 -translate-y-[calc(100%+8px)] text-body-sm`),style:{left:`${Math.min(88,Math.max(12,t/Math.max(1,r.length-1)*100))}%`,top:`${(1-d.passed/c)*100}%`},children:[(0,H.jsx)(`b`,{className:`block text-ink`,children:X(d.day)}),(0,H.jsxs)(`span`,{className:`block text-ink-2 tabular-nums`,children:[d.passed,` passed, `,d.cases-d.passed,` failed · `,Z([d]),`%`]}),(0,H.jsx)(`span`,{className:`block text-muted`,children:a(d.runs,`run`)})]})]}),(0,H.jsx)(`span`,{}),(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`mt-1 flex gap-1 text-body-sm text-muted`,children:r.map((e,t)=>(0,H.jsx)(`span`,{className:`min-w-0 flex-1 text-center whitespace-nowrap`,children:t%u===0&&(0,H.jsx)(`span`,{className:o(t/u%2==1&&`hidden @2xl:inline`),children:X(e.day)})},e.day))})]}),(0,H.jsxs)(`table`,{className:`sr-only`,children:[(0,H.jsx)(`caption`,{children:`Cases by day`}),(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{scope:`col`,children:`Day`}),(0,H.jsx)(`th`,{scope:`col`,children:`Runs`}),(0,H.jsx)(`th`,{scope:`col`,children:`Passed`}),(0,H.jsx)(`th`,{scope:`col`,children:`Failed`})]})}),(0,H.jsx)(`tbody`,{children:r.map(e=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{children:e.day}),(0,H.jsx)(`td`,{children:e.runs}),(0,H.jsx)(`td`,{children:e.passed}),(0,H.jsx)(`td`,{children:e.cases-e.passed})]},e.day))})]})]})}function be({project:e,build:t,onBuilt:r}){let[i,s]=(0,V.useState)(t),[c,l]=(0,V.useState)(``),u=!!i?.running;(0,V.useEffect)(()=>{if(!u)return;let e=se(async()=>{try{let e=await d.buildStatus();s(e),e&&!e.running&&r()}catch{}},1200);return()=>ue(e)},[u,r]);let _=e.cases?Math.round(e.passed/e.cases*100):null,v=Z(e.days.slice(-7)),y=Z(e.days.slice(-14,-7)),b=v!==null&&y!==null?v-y:null,S=[{label:`Runs`,value:String(e.runs),sub:e.runs?`${X(String(e.from).slice(0,10))} – ${X(String(e.to).slice(0,10))}`:void 0},{label:`Cases run`,value:String(e.cases),sub:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`span`,{className:`text-pass`,children:[e.passed,` passed`]}),` · `,(0,H.jsxs)(`span`,{className:o(e.failed&&`text-fail`),children:[e.failed,` failed`]})]})},{label:`Tokens`,value:ae(e.tokens),sub:e.cost?le(e.cost.amount,e.cost.currency):void 0}];return(0,H.jsxs)(`section`,{"aria-labelledby":`project-h`,className:`flex min-w-0 flex-col gap-4`,children:[(0,H.jsx)(`h2`,{id:`project-h`,className:`sr-only`,children:`Project report`}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-[1_1_240px] text-body-sm text-muted`,children:e.page?`The HTML report was built ${W(e.page.builtAt)}.`:`Every run, taken together. The HTML report has not been built yet.`}),e.page&&(0,H.jsxs)(p,{size:`sm`,"data-tip":`Open the HTML report`,onClick:async()=>l(await x(e.page.file)),children:[(0,H.jsx)(k,{"aria-hidden":`true`}),`Report`]}),(0,H.jsx)(p,{size:`sm`,variant:`outline`,disabled:u,"data-tip":e.page?`Build the HTML report again`:`Build the HTML report`,onClick:async()=>{l(``);try{s(await d.build())}catch(e){l(e.message)}},children:u?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(g,{state:`working`,px:14}),`Building…`]}):e.page?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(te,{"aria-hidden":`true`}),`Rebuild`]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(T,{"aria-hidden":`true`}),`Build`]})})]}),c&&(0,H.jsx)(`p`,{role:`alert`,className:o(h.fail,`m-0`),children:c}),i&&(i.running||i.ok===!1)&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[!i.running&&(0,H.jsx)(`p`,{className:o(h.fail,`m-0`),children:`forgeqe bi build stopped with a problem; its output is below.`}),(0,H.jsx)(`pre`,{"aria-label":`forgeqe bi build output`,"aria-live":`polite`,className:o(`overflow-auto rounded-base bg-surface-muted p-4 font-mono text-body-sm leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,`m-0 max-h-[200px]`),children:(0,H.jsx)(C,{text:i.lines.length?i.lines.join(`
|
|
2
2
|
`):`Starting…`})})]}),e.runs?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(oe,{label:`Project numbers`,children:[(0,H.jsx)(M,{label:`Pass rate`,big:!0,value:_===null?`–`:`${_}%`,tone:_!==null&&_<80?`text-fail`:void 0,change:b===null?void 0:{text:b===0?`Same`:`${b>0?`+`:`−`}${Math.abs(b)} ${Math.abs(b)===1?`point`:`points`}`,dir:b>0?`up`:b<0?`down`:`same`,good:b>0,against:b===0?`as the week before`:`on the week before`}}),S.map(e=>(0,H.jsx)(M,{label:e.label,value:e.value,note:e.sub},e.label))]}),(0,H.jsx)(Q,{title:`Cases by day`,icon:E,note:`The last ${a(Math.min(30,e.days.length),`day`)} with runs. Hover a day for its pass rate.`,children:(0,H.jsx)(ye,{days:e.days})}),(0,H.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-2`,children:[(0,H.jsx)(Q,{title:`Fails most`,icon:A,note:`Cases that failed in the most runs.`,children:e.failing.length===0?(0,H.jsx)(`p`,{className:`m-0 py-2 text-body-sm text-muted`,children:`No case has failed.`}):(0,H.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.failing.slice(0,8).map(e=>(0,H.jsxs)(`li`,{className:`flex flex-col gap-1 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(A,{size:14,"aria-hidden":`true`,className:`flex-none text-fail`}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm`,"data-tip":e.title,children:[e.id&&(0,H.jsx)(`span`,{className:`font-mono text-body-sm text-ink-2`,children:e.id}),` `,e.title]}),(0,H.jsx)(`span`,{className:`flex-none text-body-sm text-muted`,children:N(e.lastFailed)})]}),(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-4 pl-6`,children:[(0,H.jsx)($,{part:e.failed,whole:e.runs,tone:`fail`,label:`failed ${e.failed} of ${e.runs}`}),e.summary&&(0,H.jsx)(`span`,{className:`min-w-0 truncate text-body-sm text-muted`,children:e.summary.replace(/[*_`#>[\]]/g,``)})]})]},e.id||e.title))})}),(0,H.jsx)(Q,{title:`Defects`,icon:D,note:`Failures grouped by their cause.`,children:e.defects.length===0?(0,H.jsx)(`p`,{className:`m-0 py-2 text-body-sm text-muted`,children:`None found.`}):(0,H.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.defects.slice(0,8).map(e=>(0,H.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate text-body-sm`,"data-tip":e.title,children:e.title}),(0,H.jsxs)(`span`,{className:`text-body-sm whitespace-nowrap text-muted tabular-nums`,children:[a(e.cases,`case`),` · `,a(e.runs,`run`),e.lastSeen?` · ${N(e.lastSeen)}`:``]})]},e.title))})}),(0,H.jsx)(Q,{title:`Flaky`,icon:ie,note:`Cases that both passed and failed.`,children:e.flaky.length===0?(0,H.jsx)(`p`,{className:`m-0 py-2 text-body-sm text-muted`,children:`None.`}):(0,H.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.flaky.slice(0,8).map(e=>(0,H.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,H.jsxs)(`span`,{className:`min-w-0 truncate text-body-sm`,"data-tip":e.title,children:[e.id&&(0,H.jsx)(`span`,{className:`font-mono text-body-sm text-ink-2`,children:e.id}),` `,e.title]}),(0,H.jsx)($,{part:e.failed,whole:e.runs,tone:`fail`,label:`${e.failed}/${e.runs} failed`})]},e.id||e.title))})}),(0,H.jsx)(Q,{title:`By kind`,icon:ne,note:`Each kind of run and how often its cases passed.`,children:e.kinds.length===0?(0,H.jsx)(`p`,{className:`m-0 py-2 text-body-sm text-muted`,children:`No runs with results yet.`}):(0,H.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.kinds.map(e=>(0,H.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-x-4 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate text-body-sm`,children:U[e.scope]||e.scope}),(0,H.jsx)(`span`,{className:`text-body-sm text-muted tabular-nums`,children:a(e.runs,`run`)}),(0,H.jsx)($,{part:e.passed,whole:e.cases,tone:`pass`,label:e.cases?`${Math.round(e.passed/e.cases*100)}% passed`:`no cases`})]},e.scope))})})]})]}):(0,H.jsx)(f,{icon:k,title:`No runs yet`,action:(0,H.jsxs)(`a`,{className:m({size:`sm`}),href:n(),"data-tip":`Start a chat`,children:[(0,H.jsx)(re,{"aria-hidden":`true`}),`Chat`]}),children:`Runs, suites and monitor rounds are taken together here once there are some: pass rate by day, the cases that fail most, flaky cases and defects.`})]})}function xe({sub:e}){let[t,n]=(0,V.useState)(null),[i,a]=(0,V.useState)(``),[s,c]=(0,V.useState)(``),[u,f]=(0,V.useState)(``),[p,m]=(0,V.useState)(`all`),[g,y]=(0,V.useState)(``),x=(0,V.useCallback)(()=>{d.list().then(n,e=>a(e.message))},[]);(0,V.useEffect)(x,[x]);let S=e===`project`?`project`:`execution`,C=t?.rows??null,w=u.toLowerCase().split(/\s+/).filter(Boolean),T=(0,V.useMemo)(()=>(C||[]).filter(e=>(!s||e.scope===s)&&w.every(t=>`${e.title} ${e.id} ${U[e.scope]}`.toLowerCase().includes(t))),[C,s,u]),E=T.filter(e=>G(e).tone===`fail`).length,D=(0,V.useMemo)(()=>q(p===`failed`?T.filter(e=>G(e).tone===`fail`):T),[T,p]),O=[...new Set((C||[]).map(e=>e.scope))];return(0,H.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,H.jsx)(R,{}),(0,H.jsxs)(`main`,{className:o(z,`@container flex-auto gap-4`),children:[(0,H.jsx)(ee,{}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-6 gap-y-2`,children:[(0,H.jsx)(j,{pixel:l.reports,size:`lg`,head:!0}),(0,H.jsx)(`h1`,{className:`m-0 text-headline-md`,children:`Runs and reports`}),(0,H.jsx)(ce,{label:`Runs and reports`,links:me,current:S===`project`?`reports-project`:`reports`})]}),i&&(0,H.jsx)(`p`,{role:`alert`,className:o(h.fail,`m-0`),children:i}),!t&&!i&&(0,H.jsx)(b,{shape:`rows`}),t&&S===`project`&&(0,H.jsx)(be,{project:t.project,build:t.build,onBuilt:x}),t&&S===`execution`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(he,{children:`Every report ForgeQE made, newest first. Open one to see it in full in a new tab.`}),g&&(0,H.jsx)(`p`,{role:`alert`,className:o(h.fail,`m-0`),children:g}),t.total>t.rows.length&&(0,H.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`The newest `,t.rows.length,` of `,t.total,` reports are listed.`]}),(0,H.jsx)(`div`,{children:(0,H.jsx)(Y,{rows:D,resetKey:`${s}-${p}-${u}`,empty:t.rows.length?`No report matches.`:`No reports yet. Runs, suites and monitor rounds show here once they have run.`,onNote:y,tools:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(_,{id:`report-search`,label:`Find a report`,value:u,onChange:f}),(0,H.jsx)(v,{items:[{id:`all`,label:`All`,n:T.length},{id:`failed`,label:`Failed`,n:E,alert:!0}],value:p,onChange:m}),O.length>1&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`label`,{htmlFor:`report-kind`,className:`sr-only`,children:`Kind`}),(0,H.jsxs)(r,{size:`sm`,id:`report-kind`,value:s,onChange:e=>c(e.target.value),className:`w-auto pr-8 pl-4`,children:[(0,H.jsx)(`option`,{value:``,children:`Every kind`}),O.map(e=>(0,H.jsx)(`option`,{value:e,children:U[e]},e))]})]})]})})})]})]})]})}export{xe as Reports,Y as ReportsTable,q as newestReports};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{r as n}from"./route-9BkoTWUE.js";import{L as r,P as i,V as a,c as o,s,z as c}from"./surface-c1kG1KPS.js";import{n as l,t as u}from"./utils-DJRAScIl.js";import{t as d}from"./jsx-runtime-LKYXHABd.js";import{d as f}from"./sectionList-B6NF3ZMb.js";import{v as p}from"./api-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{r as n}from"./route-9BkoTWUE.js";import{L as r,P as i,V as a,c as o,s,z as c}from"./surface-c1kG1KPS.js";import{n as l,t as u}from"./utils-DJRAScIl.js";import{t as d}from"./jsx-runtime-LKYXHABd.js";import{d as f}from"./sectionList-B6NF3ZMb.js";import{v as p}from"./api-D1PU4zye.js";import{A as m,F as h,L as g,a as _,g as v,j as y,k as b,n as ee,u as x,x as S}from"./pageBack-DfGBh1Hs.js";import{Gr as C,Or as te,Rn as w,Un as T,V as E,Vn as D,cn as O,cr as ne,it as re,o as ie,ur as ae,w as k,xt as A,yn as j}from"./line-icons-Cwj9OmCz.js";import{Ht as oe,Vt as se,Y as M,Z as ce,ft as N,it as P,lt as F,ot as I,rt as L}from"./frame-D0MS2ZMz.js";import{u as R}from"./nav-CkrE6JFU.js";import{B as z,K as B,Y as V,l as le,n as ue,t as H,z as de}from"./index-F8zkXd19.js";import{t as fe}from"./step-mark-Bu6fNKW8.js";import{t as pe}from"./stepper-DiPQQ2l6.js";import{n as me,r as he}from"./wizardParts-CnCYTsR0.js";import{i as ge,t as _e}from"./parts-DqfD-6Qb.js";var U=e(t(),1),ve=/^[a-z0-9][a-z0-9-]{0,79}$/,W={overview:()=>p(`GET`,`/api/requirements`),review:e=>p(`GET`,`/api/requirements/review?id=${encodeURIComponent(e)}`),job:()=>p(`GET`,`/api/requirements/job`),report:(e,t)=>p(`GET`,`/api/requirements/report?id=${encodeURIComponent(e)}&doc=${t}`),start:e=>p(`POST`,`/api/requirements/start`,e),stop:()=>p(`POST`,`/api/requirements/stop`,{}),open:(e,t)=>p(`POST`,`/api/requirements/open`,{id:e,file:t})},G=d(),ye=300,be=2e5,xe=`As an operations user I can refund a card payment within 30 days of capture, in part or in full, so that customers get their money back without a support ticket.`;function Se({info:e,onStarted:t}){let[n,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(``),[l,d]=(0,U.useState)([]),[f,p]=(0,U.useState)(!0),[m,_]=(0,U.useState)(!1),[v,y]=(0,U.useState)(``),b=n.trim().length>0&&s.trim().length>=10&&!m&&!e.job?.running,ee=async()=>{_(!0),y(``);try{let e=await W.start({op:`review`,title:n.trim(),design:s,personas:l,consolidate:f});e.target&&t(e.target)}catch(e){y(e.message),_(!1)}};return(0,G.jsxs)(`section`,{"aria-labelledby":`rq-new`,className:`flex min-w-0 flex-col gap-6`,children:[(0,G.jsx)(V,{id:`rq-new`,icon:A,title:`Which requirement should be reviewed?`}),v&&(0,G.jsx)(`p`,{role:`alert`,className:u(g.fail,`m-0`),children:v}),e.job?.running&&(0,G.jsx)(`p`,{role:`status`,className:u(g.info,`m-0`),children:`A review is being written. Start this one when it ends.`}),(0,G.jsx)(me,{id:`rq-title`,label:`Title`,help:`What the requirement is called, as in your backlog.`,children:(0,G.jsx)(i,{id:`rq-title`,value:n,maxLength:ye,placeholder:`Card refunds`,onChange:e=>o(e.target.value.replace(/[\r\n]+/g,` `))})}),(0,G.jsx)(me,{id:`rq-design`,label:`The requirement`,help:`Paste the story, its acceptance criteria and any notes. ${s.length}/${be}`,children:(0,G.jsx)(r,{id:`rq-design`,value:s,rows:10,maxLength:be,placeholder:xe,onChange:e=>c(e.target.value)})}),(0,G.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,G.jsxs)(`legend`,{className:`mb-2 p-0 text-body-sm font-medium`,children:[`Business personas who review it (`,l.length,`/`,6,`)`]}),e.personas.map(e=>{let t=l.includes(e.id);return(0,G.jsxs)(`label`,{className:u(a,`items-start gap-2`),children:[(0,G.jsx)(B,{className:`mt-1`,checked:t,disabled:!t&&l.length>=6,onCheckedChange:t=>d(t?[...l,e.id]:l.filter(t=>t!==e.id))}),(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,G.jsx)(`span`,{className:`text-body-sm`,children:e.name}),(0,G.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[e.role,e.builtIn?``:` · this project's`]})]})]},e.id)}),e.notLoaded.length>0&&(0,G.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`Not loaded: `,e.notLoaded.join(`; `)]})]}),(0,G.jsxs)(`label`,{className:u(a,`items-start gap-2`),children:[(0,G.jsx)(B,{className:`mt-1`,checked:f,onCheckedChange:e=>p(!!e)}),(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,G.jsx)(`span`,{className:`text-body-sm`,children:`Write the requirements report too`}),(0,G.jsx)(`span`,{className:`text-body-sm text-muted`,children:`The reviews folded into one report with ids (FR-001, NFR-001) that test cases trace to. Takes longer.`})]})]}),(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-4`,children:(0,G.jsxs)(h,{variant:`primary`,disabled:!b,onClick:()=>void ee(),children:[(0,G.jsx)(w,{"aria-hidden":`true`}),m?`Starting…`:`Review`]})})]})}function Ce(e,t){return t?.running&&t.target===e.id?{label:`Working`,tone:`running`}:e.status===`complete`?e.open?{label:`${e.open} open`,tone:`neutral`}:{label:`Ready`,tone:`pass`}:{label:`Not finished`,tone:`warn`}}var we=(e,t)=>t?.running&&t.target===e.id?`working`:e.open||e.status!==`complete`?`open`:`ready`;function Te({rows:e,job:t}){let[r,i]=(0,U.useState)(`all`),a=n=>n===`all`?e.length:e.filter(e=>we(e,t)===n).length,o=e.filter(e=>r===`all`||we(e,t)===r),s=e=>location.hash=n(`requirements`,e);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(de,{label:`Reviews by status`,children:[(0,G.jsx)(z,{dot:`neutral`,value:a(`all`),label:`reviews`,onClick:()=>i(`all`),on:r===`all`}),(0,G.jsx)(z,{dot:`running`,value:a(`working`),label:`working`,onClick:()=>i(`working`),on:r===`working`}),(0,G.jsx)(z,{dot:`warn`,value:a(`open`),label:`with open items`,onClick:()=>i(`open`),on:r===`open`}),(0,G.jsx)(z,{dot:`pass`,value:a(`ready`),label:`ready`,onClick:()=>i(`ready`),on:r===`ready`})]}),(0,G.jsx)(L,{label:`Reviews`,placeholder:`Find a review`,empty:r===`all`?`No reviews.`:`None here.`,resetKey:r,height:P,head:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`th`,{scope:`col`,className:F,children:`Requirement`}),(0,G.jsx)(`th`,{scope:`col`,className:F,children:`Score`}),(0,G.jsx)(`th`,{scope:`col`,className:F,children:`Status`}),(0,G.jsx)(`th`,{scope:`col`,className:u(F,`hidden @xl:table-cell`),children:`When`})]}),children:o.map(e=>{let r=Ce(e,t);return(0,G.jsxs)(`tr`,{onClick:()=>s(e.id),className:N,children:[(0,G.jsxs)(`td`,{className:I,children:[(0,G.jsx)(`a`,{href:n(`requirements`,e.id),onClick:e=>e.stopPropagation(),className:`font-medium text-ink no-underline [overflow-wrap:anywhere] hover:underline`,children:e.title}),(0,G.jsx)(`span`,{className:`block text-body-sm text-muted`,children:e.id})]}),(0,G.jsx)(`td`,{className:u(I,`text-body-sm whitespace-nowrap tabular-nums`),"data-sort":e.score??-1,children:e.score===null?(0,G.jsx)(`span`,{className:`text-muted`,children:`Not scored`}):`${e.score}/100`}),(0,G.jsx)(`td`,{className:u(I,`whitespace-nowrap`),children:(0,G.jsx)(b,{tone:r.tone,children:r.label})}),(0,G.jsx)(`td`,{className:u(I,`hidden text-body-sm whitespace-nowrap text-muted @xl:table-cell`),"data-sort":new Date(e.created).getTime()||0,children:e.created?ce(e.created):``})]},e.id)})})]})}var Ee=[`Overview`,`Business Analyst`,`Product Manager`,`Product Owner`,`Solution Architect`,`Developer`,`QA`,`Scrum Master`];function De(e){return[`@@ -1,${e.filter(e=>e.op!==`+`).length} +1,${e.filter(e=>e.op!==`-`).length} @@`,...e.map(e=>`${e.op}${e.text.replace(/[\r\n]+/g,` `)}`)].join(`
|
|
2
2
|
`)}var K=e=>(e?.lines??[]).filter(e=>!e.startsWith(`{`)&&!e.startsWith(`[`));function Oe(e,t,n){let r=n?K(t):[],i=new Set([...e.reviewers.map(e=>e.heading),...r.flatMap(e=>e.startsWith(`Done: `)?[e.slice(6)]:[])]),a=n?[...r].reverse().map(e=>/^Running (.+?) \(\d+\/\d+\)$/.exec(e)?.[1]).find(Boolean):void 0,o=[...Ee.map(e=>({heading:e,persona:!1})),...e.personas.map(e=>({heading:`Persona review: ${e.name}`,persona:!0}))];for(let t of e.reviewers)o.some(e=>e.heading===t.heading)||o.push({heading:t.heading,persona:t.persona});return o.map(e=>({...e,state:i.has(e.heading)?`done`:a===e.heading?`running`:`pending`}))}var ke=104,Ae=280;function q({className:e,children:t}){let n=(0,U.useRef)(null),[r,i]=(0,U.useState)();return(0,U.useLayoutEffect)(()=>{let e=()=>{let e=n.current?.getBoundingClientRect().top;e!==void 0&&i(Math.max(Ae,Math.round(window.innerHeight-e-ke)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,G.jsx)(`div`,{ref:n,className:u(`grid auto-rows-[minmax(0,1fr)] gap-6`,e),style:r?{height:r}:void 0,children:t})}function J({label:e,className:t,children:n}){return(0,G.jsx)(`section`,{...e?{"aria-label":e}:{},className:u(`flex h-full min-h-0 min-w-0 flex-col gap-4 overflow-y-auto`,t),children:n})}function je({review:e}){let t=e.quality,n=t.overall!==null&&e.scoreBefore!==null?t.overall-e.scoreBefore:0;return(0,G.jsxs)(`div`,{className:u(o,`flex flex-wrap items-center gap-x-8 gap-y-4`),children:[(0,G.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,G.jsx)(S,{value:t.overall,label:`Quality`,size:`lg`}),n!==0&&(0,G.jsx)(`span`,{className:u(`text-body-sm`,n>0?`text-pass`:`text-fail`),children:`${n>0?`+`:``}${n} since the review`})]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-4`,children:[(0,G.jsx)(`div`,{className:`grid grid-cols-3 gap-4 @3xl:grid-cols-6`,children:t.dimensions.map(e=>(0,G.jsx)(S,{value:e.score,label:e.label},e.key))}),t.rationale&&(0,G.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2`,children:t.rationale})]})]})}function Me({review:e,job:t,live:n}){let r=Oe(e,t,n),i=r.filter(e=>e.state===`done`).length,c=r.find(e=>e.state===`running`),l=[{heading:`Score`,done:e.quality.overall!==null},{heading:`Gaps and questions`,done:e.status===`complete`||e.items.length>0},{heading:`Requirements report`,done:e.document===`02-requirements-report.md`}],d=K(t).slice(-40),f=Object.entries(e.context.byProvider),p=Math.round(i/Math.max(1,r.length)*100);return(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,G.jsxs)(`div`,{className:u(o,`flex flex-col gap-4`),children:[(0,G.jsx)(ge,{label:n?`Reviewer ${Math.min(i+1,r.length)} of ${r.length}`:`${i} of ${r.length} reviewers`,value:`${p}%`,sub:n?c?.heading??`Starting`:i===r.length?`Every reviewer has written their section`:`The review stopped before every reviewer wrote`}),(0,G.jsx)(_e,{value:p,label:`Reviewers done`})]}),(0,G.jsxs)(q,{className:`grid-cols-[minmax(0,1fr)] @4xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`,children:[(0,G.jsxs)(J,{label:`Reviewers`,children:[(0,G.jsx)(V,{icon:O,title:`Reviewers`,level:3,n:`${i} of ${r.length}`}),(0,G.jsxs)(`ol`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:[r.map((e,t)=>(0,G.jsxs)(`li`,{className:u(a,`items-center gap-4`),...e.state===`running`?{"aria-current":`step`}:{},children:[(0,G.jsx)(fe,{state:e.state,n:t+1}),(0,G.jsx)(`span`,{className:u(`min-w-0 flex-1 text-body-sm`,e.state===`pending`&&`text-muted`),children:e.heading}),e.persona&&(0,G.jsx)(b,{tone:`neutral`,icon:!1,children:`Persona`}),(0,G.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.state===`done`?`Done`:e.state===`running`?`Reviewing`:`Waiting`})]},e.heading)),l.map((e,t)=>(0,G.jsxs)(`li`,{className:u(a,`items-center gap-4`),children:[(0,G.jsx)(fe,{state:e.done?`done`:`pending`,n:r.length+t+1}),(0,G.jsx)(`span`,{className:u(`min-w-0 flex-1 text-body-sm`,!e.done&&`text-muted`),children:e.heading}),(0,G.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.done?`Done`:`Then`})]},e.heading))]})]}),(0,G.jsx)(J,{label:n?`Live activity`:`What the reviewers read`,className:s,children:n?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(V,{icon:j,title:`Live activity`,level:3}),(0,G.jsx)(`ol`,{"aria-live":`polite`,className:`m-0 flex list-none flex-col gap-2 p-0`,children:d.length?d.map((e,t)=>(0,G.jsx)(`li`,{className:u(`text-body-sm`,t===d.length-1?`text-ink`:`text-muted`),children:e},`${t}-${e}`)):(0,G.jsx)(`li`,{className:`text-body-sm text-muted`,children:`Starting…`})})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(V,{icon:A,title:`What the reviewers read`,level:3}),(0,G.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0 text-body-sm`,children:[(0,G.jsx)(`li`,{children:`The requirement as you wrote it`}),f.map(([e,t])=>(0,G.jsxs)(`li`,{children:[t,` from `,e.replace(` (from ForgeQE)`,``)]},e)),!f.length&&(0,G.jsx)(`li`,{className:`text-muted`,children:`No knowledge, search or earlier decisions matched it`})]}),e.personas.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(V,{icon:O,title:`Personas`,level:3,n:e.personas.length}),(0,G.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0 text-body-sm`,children:e.personas.map(e=>(0,G.jsxs)(`li`,{children:[e.name,` `,(0,G.jsxs)(`span`,{className:`text-muted`,children:[`· `,e.role]})]},e.id))})]})]})})]})]})}function Y(e,t,n){let[r,i]=(0,U.useState)(null),[a,o]=(0,U.useState)(``);return(0,U.useEffect)(()=>{let n=!0;return W.report(e,t).then(e=>n&&(i(e.markdown),o(``)),e=>n&&(i(null),o(e.message))),()=>{n=!1}},[e,t,n]),{text:r,error:a}}var Ne=e=>[...e.matchAll(/^##\s+(.+?)\s*$/gm)].map(e=>e[1].replace(/[*_`]/g,``)).slice(0,40);function Pe({raw:e,label:t}){let n=(0,U.useRef)(null),r=e.replace(/^\s*#\s+[^\n]*\n/,``),i=Ne(r),[s,l]=(0,U.useState)(0),d=e=>{l(e),n.current?.querySelectorAll(`h2`)[e]?.scrollIntoView({behavior:c(),block:`start`})};return(0,G.jsxs)(q,{className:`grid-cols-[minmax(0,1fr)] @4xl:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,G.jsx)(J,{className:`hidden @4xl:flex`,children:(0,G.jsx)(`nav`,{"aria-label":`Sections of the ${t}`,children:(0,G.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:i.map((e,t)=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"aria-current":s===t?`true`:void 0,onClick:()=>d(t),className:u(a,`items-start gap-2`),children:[(0,G.jsxs)(`span`,{className:`w-6 flex-none text-muted tabular-nums`,children:[t+1,`.`]}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:e})]})},`${t}-${e}`))})})}),(0,G.jsx)(J,{label:t,className:o,children:(0,G.jsx)(`div`,{ref:n,className:`min-w-0`,children:(0,G.jsx)(_,{text:r,className:`text-body-md`,fill:!0})})})]})}function X({text:e,error:t,label:n}){return t?(0,G.jsx)(`p`,{role:`alert`,className:u(g.fail,`m-0`),children:t}):e===null?(0,G.jsx)(v,{shape:`lines`,count:8}):(0,G.jsx)(Pe,{raw:e,label:n})}function Fe({review:e,version:t}){let{text:n,error:r}=Y(e.id,`spec`,t);return(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,G.jsx)(je,{review:e}),(0,G.jsx)(X,{text:n,error:r,label:`Spec Circuit report`})]})}var Z=e=>e.kind===`gap`?`Gaps`:e.category||`Questions`;function Ie({review:e,locked:t,act:n,open:r,setOpen:i}){let o=[...new Set(e.items.map(Z))],c=e.items.find(e=>e.index===r)??e.items.find(e=>e.status===`open`)??e.items[0],[l,d]=(0,U.useState)(c?Z(c):o[0]??``);(0,U.useEffect)(()=>{c&&Z(c)!==l&&d(Z(c))},[c?.index]);let f=e.items.filter(e=>Z(e)===l),p=e.items.filter(e=>e.status!==`open`).length,h=t=>i(e.items.find(e=>e.status===`open`&&e.index>t)?.index??e.items.find(e=>e.status===`open`&&e.index!==t)?.index??null);return e.items.length?(0,G.jsxs)(q,{className:`grid-cols-[minmax(0,1fr)] @5xl:grid-cols-[220px_280px_minmax(0,1fr)]`,children:[(0,G.jsxs)(J,{className:s,children:[(0,G.jsx)(S,{value:e.quality.overall,label:`Quality`,size:`lg`}),(0,G.jsx)(`span`,{className:`text-center text-body-sm text-muted`,children:`${p} of ${e.items.length} resolved`}),(0,G.jsx)(`nav`,{"aria-label":`Kinds of issue`,children:(0,G.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:o.map(t=>{let n=e.items.filter(e=>Z(e)===t).filter(e=>e.status===`open`).length;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"aria-current":t===l?`true`:void 0,onClick:()=>d(t),className:u(a,`gap-2`),children:[(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:t}),(0,G.jsx)(b,{tone:n?`warn`:`pass`,icon:!1,children:n?`${n} open`:`Done`})]})},t)})})})]}),(0,G.jsxs)(J,{label:`${l}: issues`,children:[(0,G.jsx)(V,{icon:O,title:l,level:3,n:f.length}),(0,G.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:f.map(t=>{let n=t.status===`accepted`?`pass`:t.status===`skipped`?`neutral`:e.proposal?.index===t.index?`warn`:void 0;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"aria-current":c?.index===t.index?`true`:void 0,onClick:()=>i(t.index),className:u(a,`flex-col items-start gap-1`),children:[(0,G.jsxs)(`span`,{className:u(t.status!==`open`&&`text-muted`),children:[t.index,`. `,t.text]}),n&&(0,G.jsx)(b,{tone:n,icon:!1,children:t.status===`accepted`?`Kept`:t.status===`skipped`?`Skipped`:`Change proposed`})]})},t.index)})})]}),c?(0,G.jsx)(Le,{item:c,review:e,locked:t,act:n,onAccepted:()=>h(c.index)},c.index):(0,G.jsx)(J,{label:`Issue`,children:` `})]}):(0,G.jsx)(m,{icon:j,title:`No gaps or questions`,children:`The review listed none: go on to the requirements report.`})}function Le({item:e,review:t,locked:n,act:i,onAccepted:a}){let[s,c]=(0,U.useState)(``),l=`rq-answer-${e.index}`,d=t.proposal?.index===e.index?t.proposal:null,f=t.suggestions[String(e.index)],p=e.status===`open`;return(0,G.jsxs)(J,{label:`Issue ${e.index}`,className:o,children:[(0,G.jsx)(V,{icon:j,level:3,title:e.text,description:`${e.kind===`gap`?`Gap`:`Question · ${e.category}`} · ${e.index} of ${t.items.length}`}),!p&&(0,G.jsx)(`p`,{role:`status`,className:u(e.status===`accepted`?g.pass:g.info,`m-0`),children:e.status===`accepted`?`Kept: the change is in the report and remembered for later reviews.`:`Skipped: left as it is.`}),p&&(0,G.jsxs)(`div`,{className:u(`panel rounded-md bg-(--page-surface-strong) p-6`,`flex flex-col gap-2`),children:[(0,G.jsx)(V,{icon:ne,level:3,title:`Suggested answer`,actions:(0,G.jsxs)(h,{size:`sm`,disabled:n,onClick:()=>void i({op:`suggest`,id:t.id,index:e.index}),"data-tip":`The agent suggests an answer from the report, the product's knowledge and earlier decisions`,children:[(0,G.jsx)(T,{"aria-hidden":`true`}),f?`Suggest again`:`Suggest`]})}),f?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`text-body-sm whitespace-pre-wrap`,children:f.text}),f.rationale&&(0,G.jsx)(`span`,{className:`text-body-sm text-muted`,children:f.rationale}),(0,G.jsx)(`span`,{children:(0,G.jsxs)(h,{size:`sm`,onClick:()=>c(f.text.slice(0,1200)),"data-tip":`Put this answer in the box below, to edit it`,children:[(0,G.jsx)(k,{"aria-hidden":`true`}),`Use it`]})})]}):(0,G.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Ask for one, or write your own answer below.`})]}),p&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`label`,{htmlFor:l,className:`text-body-sm font-medium`,children:`Your answer`}),(0,G.jsx)(r,{id:l,rows:3,value:s,maxLength:1200,placeholder:e.kind===`question`?`Answer the question, or leave it empty to let the agent decide`:`What the report should say, if you know`,onChange:e=>c(e.target.value.replace(/[\r\n]+/g,` `))}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(h,{size:`sm`,disabled:n,onClick:()=>void i({op:`fix`,id:t.id,index:e.index,...s.trim()?{answer:s.trim()}:{}}),"data-tip":`The Requirements Agent proposes a change to the section this is about`,children:d?`Propose again`:`Propose a change`}),!d&&(0,G.jsxs)(h,{size:`sm`,disabled:n,onClick:()=>void i({op:`skip`,id:t.id,index:e.index}),"data-tip":`Leave this item as it is; it no longer holds the requirements report back`,children:[(0,G.jsx)(C,{"aria-hidden":`true`}),`Skip`]})]})]}),d&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsxs)(`span`,{className:`text-body-sm text-ink-2`,children:[`Proposed change to `,(0,G.jsx)(`span`,{className:`font-medium text-ink`,children:d.section}),d.answer?`, from your answer`:``]}),(0,G.jsx)(x,{diff:De(d.diff)}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsxs)(h,{variant:`primary`,size:`sm`,disabled:n,onClick:async()=>{await i({op:`accept`,id:t.id,rescore:!0})&&a()},"data-tip":`Keep the change, score the report again, and remember the decision for later reviews`,children:[(0,G.jsx)(k,{"aria-hidden":`true`}),`Accept`]}),(0,G.jsxs)(h,{size:`sm`,disabled:n,onClick:()=>void i({op:`skip`,id:t.id,index:e.index}),"data-tip":`Leave this item as it is`,children:[(0,G.jsx)(C,{"aria-hidden":`true`}),`Skip`]}),(0,G.jsxs)(h,{size:`sm`,disabled:n,onClick:()=>document.getElementById(l)?.focus(),"data-tip":`Say what you would change, then propose again`,children:[(0,G.jsx)(j,{"aria-hidden":`true`}),`Discuss`]})]})]})]})}function Re({review:e,version:t,locked:n,act:r}){let[i,a]=(0,U.useState)(`brd`),o=e.document===`02-requirements-report.md`,s=Y(e.id,`brd`,o?t:`none`),c=Y(e.id,`spec`,i===`spec`?t:`idle`),d=e.items.filter(e=>e.status===`accepted`).length,f=()=>void r({op:`consolidate`,id:e.id});return(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,G.jsxs)(de,{label:`Gaps and questions`,children:[(0,G.jsx)(z,{dot:`warn`,value:e.items.filter(e=>e.status===`open`).length,label:`open`}),(0,G.jsx)(z,{dot:`pass`,value:d,label:`kept`}),(0,G.jsx)(z,{dot:`neutral`,value:e.items.filter(e=>e.status===`skipped`).length,label:`skipped`}),(0,G.jsx)(z,{dot:`neutral`,value:e.quality.overall===null?`–`:`${e.quality.overall}/100`,label:`quality`})]}),(0,G.jsxs)(`div`,{className:u(g.pass,`flex flex-wrap items-center gap-4`),children:[(0,G.jsx)(`span`,{role:`status`,className:`min-w-0 flex-1`,children:`Every gap and question is kept or skipped. The report is ready for test cases (requirements.json).`}),(0,G.jsxs)(h,{size:`sm`,disabled:n,onClick:f,"data-tip":`Write the report again from the Spec Circuit report and every decision kept; the current one can be put back with Undo`,children:[(0,G.jsx)(T,{"aria-hidden":`true`}),o?`Write again`:`Write it`]})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(M,{prefix:`rqtab`,className:`mb-4`,label:`Report`,current:i,onPick:a,tabs:[{id:`brd`,label:`Requirements report`},{id:`decisions`,label:`Decisions`,n:e.decisions.length},{id:`spec`,label:`Spec Circuit report`}]}),(0,G.jsxs)(`div`,{role:`tabpanel`,id:`rqtab-panel-${i}`,"aria-labelledby":`rqtab-${i}`,className:`min-w-0`,children:[i===`brd`&&(o?(0,G.jsx)(X,{text:s.text,error:s.error,label:`requirements report`}):(0,G.jsx)(m,{icon:A,title:`No requirements report yet`,action:(0,G.jsxs)(h,{size:`sm`,disabled:n,onClick:f,"data-tip":`Fold the reviews and your decisions into one report with ids (FR-001, NFR-001)`,children:[(0,G.jsx)(A,{"aria-hidden":`true`}),`Write it`]}),children:`The reviews and your decisions folded into one business requirements document, with ids that test cases trace to.`})),i===`decisions`&&(e.decisions.length?(0,G.jsx)(q,{children:(0,G.jsx)(J,{label:`Decisions`,children:(0,G.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:e.decisions.map((e,t)=>(0,G.jsxs)(`li`,{className:u(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`flex-col items-start gap-1`),children:[(0,G.jsxs)(`span`,{className:`text-body-sm`,children:[e.index,`. `,e.text]}),(0,G.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[e.answer?`Decided: ${e.answer}`:`Kept the proposed change`,` · `,e.section]})]},`${e.index}-${t}`))})})}):(0,G.jsx)(m,{icon:k,title:`No decisions yet`,children:`Every item was skipped (${l(e.items.length,`item`)}). Accept a change on Refine to keep a decision here.`})),i===`spec`&&(0,G.jsx)(X,{text:c.text,error:c.error,label:`Spec Circuit report`})]})]})]})}var Q=[{id:`review`,name:`Review`,tip:`The reviewers at work`},{id:`report`,name:`Spec report`,tip:`The Spec Circuit report and its score`},{id:`refine`,name:`Refine`,tip:`Resolve the gaps and questions`},{id:`brd`,name:`Requirements report`,tip:`The BRD with your decisions`}],ze=2e3;function Be({id:e,step:t}){let[r,i]=(0,U.useState)(null),[a,o]=(0,U.useState)(null),[s,c]=(0,U.useState)(``),[d,f]=(0,U.useState)(``),[p,m]=(0,U.useState)(!1),[_,x]=(0,U.useState)(null),S=(0,U.useCallback)(()=>Promise.all([W.review(e),W.job()]).then(([e,t])=>{i(e.review),o(t),c(``)},e=>c(e.message)),[e]);(0,U.useEffect)(()=>void S(),[S]);let C=!!a&&a.target===e,w=C&&a.running,T=w&&a.kind===`requirements-review`,D=(0,U.useRef)(!1);(0,U.useEffect)(()=>{if(!w){if(D.current){let e=a?.result?.error;S().then(()=>e&&c(e))}D.current=!1;return}D.current=!0;let e=oe(()=>void S(),ze);return()=>se(e)},[w,S,a]),(0,U.useEffect)(()=>{r?.proposal&&x(r.proposal.index)},[r?.proposal?.index]);let O=async e=>{m(!0),c(``);try{return o(await W.start(e)),!0}catch(e){return c(e.message),!1}finally{m(!1)}},ne=async()=>{m(!0),c(``);try{o(await W.stop()),S()}catch(e){c(e.message)}finally{m(!1)}};if(!r)return s?(0,G.jsx)(`p`,{role:`alert`,className:u(g.fail,`m-0`),children:s}):(0,G.jsx)(v,{shape:`detail`});let k=r.files.includes(`01-spec-circuit-report.md`),j=r.items.filter(e=>e.status===`open`).length,M=T||!k?0:j?2:Q.length-1,N=Q.findIndex(e=>e.id===t),P=N>=0&&N<=M?N:M===0?0:1,F=t=>location.hash=n(`requirements`,e,Q[t].id),I=Ce({id:e,status:r.status,open:j},a),L=r.document,R=L?L.replace(`.md`,`.pdf`):null,z=p||!!a?.running,B=[r.status,r.decisions.length,r.canUndo,r.files.join(`,`),r.quality.overall].join(`|`);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ee,{to:{href:n(`requirements`,`reviews`),label:`All reviews`}}),(0,G.jsx)(V,{icon:E,title:r.title||e,description:(0,G.jsxs)(G.Fragment,{children:[r.quality.overall===null?`Not scored yet`:`Scored ${r.quality.overall}/100`,r.personas.length?` · ${l(r.personas.length,`persona`)}`:``,r.created?` · ${ce(r.created)}`:``]}),actions:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(b,{tone:I.tone,children:I.label}),w?(0,G.jsxs)(h,{variant:`danger`,disabled:p,onClick:()=>void ne(),"data-tip":`Stop now; what was written is kept`,children:[(0,G.jsx)(ae,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]}):(0,G.jsxs)(G.Fragment,{children:[L&&(0,G.jsxs)(h,{size:`sm`,onClick:async()=>f(await y(L,()=>W.open(e,L))),"data-tip":`Open the report's Markdown in a new tab`,children:[(0,G.jsx)(A,{"aria-hidden":`true`}),`Export Markdown`]}),R&&(r.files.includes(R)?(0,G.jsxs)(h,{size:`sm`,onClick:async()=>f(await y(R,()=>W.open(e,R))),"data-tip":`Open the report as PDF in a new tab`,children:[(0,G.jsx)(re,{"aria-hidden":`true`}),`Export PDF`]}):(0,G.jsxs)(h,{size:`sm`,disabled:z,onClick:()=>void O({op:`export`,id:e}),"data-tip":`Write the report as PDF, then open it here`,children:[(0,G.jsx)(re,{"aria-hidden":`true`}),`Export PDF`]})),(0,G.jsxs)(h,{size:`sm`,disabled:z||!r.canUndo,onClick:()=>void O({op:`undo`,id:e}),"data-tip":r.canUndo?`Put back the version before the last change kept`:`Nothing to undo`,children:[(0,G.jsx)(te,{"aria-hidden":`true`}),`Undo`]})]})]})}),(0,G.jsx)(pe,{steps:Q,at:P,reached:M,onGo:F,label:`Requirement journey`}),w&&!T&&(0,G.jsxs)(`div`,{role:`status`,className:u(`surface rounded-lg bg-bg p-6 shadow-sm`,`flex items-center gap-4`),children:[(0,G.jsx)(b,{tone:`running`,children:`Working`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm`,children:K(a).at(-1)||`Starting…`})]}),s&&(0,G.jsx)(`p`,{role:`alert`,className:u(g.fail,`m-0`),children:s}),d&&(0,G.jsx)(`p`,{role:`status`,className:u(g.warn,`m-0`),children:d}),P===0&&(0,G.jsx)(Me,{review:r,job:C?a:null,live:T}),P===1&&(0,G.jsx)(Fe,{review:r,version:B}),P===2&&(0,G.jsx)(Ie,{review:r,locked:z,act:O,open:_,setOpen:x}),P===3&&(0,G.jsx)(Re,{review:r,version:B,locked:z,act:O}),(0,G.jsx)(he,{busy:p,...P>0?{onBack:()=>F(P-1)}:{},aside:P+1>M&&P<Q.length-1?P===0?`Once the reviewers have written the report`:`Keep or skip every open gap and question first (${j} open).`:void 0,next:P<Q.length-1?(0,G.jsxs)(G.Fragment,{children:[`Next: `,Q[P+1].name,(0,G.jsx)(ie,{"aria-hidden":`true`})]}):`All reviews`,disabled:P<Q.length-1&&P+1>M,onNext:()=>P<Q.length-1?F(P+1):location.hash=n(`requirements`,`reviews`)})]})}var Ve=new Set([H,`reviews`,`new`]);function $({tab:e,wide:t,action:r,children:i}){let a=f(`requirements`);return(0,G.jsx)(ue,{title:R(`requirements`),page:a,label:`Requirements`,current:e,tabHref:e=>e===`agent`?n(`requirements`,H):n(`requirements`,`reviews`),onPick:e=>location.hash=e===`agent`?n(`requirements`,H):n(`requirements`,`reviews`),tabs:[{id:`reviews`,label:`Reviews`,icon:E}],below:(0,G.jsx)(le,{page:a}),...t?{wide:t}:{},...r?{end:r}:{},children:i})}function He({sub:e}){let[t,r]=(e??``).split(`/`),[i,a]=(0,U.useState)(null),[o,s]=(0,U.useState)(``),c=(0,U.useCallback)(()=>{W.overview().then(e=>{a(e),s(``)},e=>s(e.message))},[]);(0,U.useEffect)(c,[c,t]);let l=!!i?.job?.running;(0,U.useEffect)(()=>{if(!l||t!==`reviews`)return;let e=oe(c,3e3);return()=>se(e)},[l,t,c]);let d=()=>location.hash=n(`requirements`,`new`),f=o&&(0,G.jsx)(`p`,{role:`alert`,className:u(g.fail,`m-0`),children:o}),p=!i&&!o&&(0,G.jsx)(v,{shape:t===`reviews`?`rows`:`lines`});return t===`new`?(0,G.jsxs)($,{tab:`reviews`,children:[f,p,i&&(0,G.jsx)(Se,{info:i,onStarted:e=>location.hash=n(`requirements`,e)})]}):t&&ve.test(t)&&!Ve.has(t)?(0,G.jsxs)($,{tab:`reviews`,wide:!0,children:[f,(0,G.jsx)(Be,{id:t,...r?{step:r}:{}},t)]}):t===`reviews`?(0,G.jsxs)($,{tab:`reviews`,action:i&&!i.reviews.length?void 0:(0,G.jsxs)(h,{variant:`accent`,disabled:!i||l,onClick:d,"data-tip":l?`A review is being written: wait for it, or stop it`:`New review`,children:[(0,G.jsx)(D,{"aria-hidden":`true`}),`New`]}),children:[f,p,i&&(i.reviews.length?(0,G.jsx)(Te,{rows:i.reviews,job:i.job}):(0,G.jsx)(m,{page:!0,icon:E,title:`No reviews yet`,action:(0,G.jsxs)(h,{size:`sm`,onClick:d,"data-tip":`New review`,children:[(0,G.jsx)(D,{"aria-hidden":`true`}),`New`]}),children:`Paste a requirement or a story and pick the business personas it is for, and the Requirements Agent reviews it before it is built. It reads it with what ForgeQE knows about your product (its knowledge, documents, requirements search, product graph and the decisions of earlier reviews), scores it, and lists its gaps and questions, each with a change to keep or leave.`}))]}):(0,G.jsx)($,{tab:H})}export{He as Requirements};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{r as n}from"./route-9BkoTWUE.js";import{I as r,L as i,P as a,V as o,a as s,c}from"./surface-c1kG1KPS.js";import{n as l,t as u}from"./utils-DJRAScIl.js";import{t as d}from"./jsx-runtime-LKYXHABd.js";import{d as f}from"./sectionList-B6NF3ZMb.js";import{L as p,v as m}from"./api-DS8XP38R.js";import{A as h,F as g,L as _,O as v,P as y,T as b,g as x,k as S,n as C}from"./pageBack-DU3mApVL.js";import{Cn as w,Cr as ee,Er as T,Gr as E,N as D,Qn as O,Rn as k,T as A,V as j,Vn as M,Yt as N,Zt as P,a as te,cn as ne,jt as F,kr as re,nn as ie,o as ae,or as oe,ur as se,vr as ce,wn as le,xt as I,yn as ue,z as L}from"./line-icons-Cwj9OmCz.js";import{Ht as R,J as de,Vt as z,Y as fe,Z as B,Zt as V,ct as pe,dt as H,ft as U,it as me,lt as W,ot as G,rt as K,ut as he}from"./frame-BANehQdX.js";import{u as ge}from"./nav-f8SqayfG.js";import{B as q,J as _e,K as ve,Y as ye,l as be,n as xe,t as Se,z as Ce}from"./index-Db_tsLSf.js";import{t as we}from"./step-mark-Bu6fNKW8.js";import{t as Te}from"./stepper-CEFz82T4.js";import{t as Ee}from"./parts-B0PK7ewd.js";var J=e(t(),1),Y={browserstack:`BrowserStack`,testmu:`TestMu AI`},De=/^rsp-\d{8}-\d{6}-[0-9a-f]{4}$/,X={info:()=>m(`GET`,`/api/responsive`),runs:()=>m(`GET`,`/api/responsive/runs`),run:e=>m(`GET`,`/api/responsive/runs/${encodeURIComponent(e)}`),shot:(e,t)=>p(`/api/responsive/runs/${encodeURIComponent(e)}/shots/${encodeURIComponent(t)}`,`image/jpeg`),start:e=>m(`POST`,`/api/responsive/runs`,e),stop:e=>m(`POST`,`/api/responsive/runs/${encodeURIComponent(e)}/stop`,{}),flows:()=>m(`GET`,`/api/responsive/flows`),saveFlow:(e,t,n=!1)=>m(`POST`,`/api/responsive/flows`,{label:e,prompt:t,replace:n}),cloudDevices:(e,t=!1)=>m(`GET`,`/api/responsive/clouds/${e}/devices${t?`?fresh=1`:``}`),cases:e=>m(`GET`,`/api/responsive/cases?q=${encodeURIComponent(e)}`),caseSteps:e=>m(`GET`,`/api/responsive/case?key=${encodeURIComponent(e)}`)};function Oe(e,t=`600px`){let[n,r]=(0,J.useState)(()=>typeof IntersectionObserver>`u`);return(0,J.useEffect)(()=>{let i=e.current;if(n||!i)return;let a=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(r(!0),a.disconnect())},{rootMargin:t});return a.observe(i),()=>a.disconnect()},[e,n,t]),n}var Z=d(),ke={phone:oe,tablet:ce,desktop:w};function Ae({devices:e,picked:t,max:n,onChange:r,drawnBy:i,real:a}){let[s,c]=(0,J.useState)(``),[l,d]=(0,J.useState)(`all`),f=s.trim().toLowerCase(),p=e.filter(e=>(l===`all`||e.category===l)&&(!f||`${e.label} ${e.os??``} ${e.width}x${e.height} ${e.width}×${e.height}`.toLowerCase().includes(f))),m=t.length>=n,g=t=>e.filter(e=>e.category===t).length;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Z.jsx)(v,{id:`rp-search`,label:`Search devices`,value:s,onChange:c,placeholder:`iPhone, Pixel, 1920…`,className:`flex-none`}),(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":`Which devices to list`,children:(0,Z.jsx)(b,{value:l,onChange:d,items:[{id:`all`,label:`All`,n:e.length},{id:`phone`,label:`Phones`,n:g(`phone`)},{id:`tablet`,label:`Tablets`,n:g(`tablet`)},...a?[]:[{id:`desktop`,label:`Desktops`,n:g(`desktop`)}]]})})]}),(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:[t.length,` of `,n,` picked`,m?`: remove one to add another.`:`.`,` `,a?`Real devices on ${a}, as it lists them now: each is its own session of your plan, and a real browser (Safari on iOS, Chrome on Android).`:(0,Z.jsxs)(Z.Fragment,{children:[`Each is emulated in full (size, pixel ratio, touch, user agent)`,i?` and drawn by ${i}.`:` and drawn by Chromium, so a Safari-only difference does not show.`]})]}),p.length?(0,Z.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-1 gap-2 p-0 @3xl:grid-cols-2`,children:p.map(e=>{let n=t.includes(e.id);return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`label`,{className:u(o,`gap-2`,!n&&m&&`cursor-not-allowed text-muted hover:bg-transparent hover:text-muted`),children:[(0,Z.jsx)(ve,{checked:n,disabled:!n&&m,onCheckedChange:n=>r(n?[...t,e.id]:t.filter(t=>t!==e.id))}),(0,Z.jsx)(y,{icon:ke[e.category],size:16,className:`flex-none text-muted`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,Z.jsx)(`span`,{className:`ml-auto flex-none text-body-sm text-muted`,children:e.os??`${e.width}×${e.height} · ${e.scale}x`})]})},e.id)})}):(0,Z.jsxs)(h,{children:[`No device matches “`,s,`”.`]})]})}function je({results:e}){return(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm`,"aria-label":`What happened on each device`,children:e.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,Z.jsx)(y,{icon:e.skipped?P:e.ok?D:L,size:16,className:u(`mt-1 flex-none`,e.skipped?`text-muted`:e.ok?`text-pass`:`text-fail`)}),(0,Z.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,Z.jsx)(`strong`,{className:`font-medium`,children:e.label}),(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,e.skipped?`nothing to do on this layout`:`${e.done} of ${l(e.of,`step`)}`]}),e.error&&(0,Z.jsx)(`span`,{className:`block text-muted`,children:e.error})]})]},e.device))})}var Me={running:{label:`Running`,tone:`running`},done:{label:`Done`,tone:`pass`},stopped:{label:`Stopped`,tone:`neutral`},failed:{label:`Failed`,tone:`fail`}},Ne=e=>{try{let t=new URL(e);return`${t.host}${t.pathname===`/`?``:t.pathname}`}catch{return e}},Pe=e=>e.status===`running`?`running`:e.findings?`findings`:`clean`;function Fe({rows:e}){let[t,r]=(0,J.useState)(`all`),i=t=>t===`all`?e.length:e.filter(e=>Pe(e)===t).length,a=e.filter(e=>t===`all`||Pe(e)===t),o=e=>location.hash=n(`responsive`,e);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Ce,{label:`Runs by state`,children:[(0,Z.jsx)(q,{dot:`neutral`,value:i(`all`),label:`runs`,onClick:()=>r(`all`),on:t===`all`}),(0,Z.jsx)(q,{dot:`running`,value:i(`running`),label:`running`,onClick:()=>r(`running`),on:t===`running`}),(0,Z.jsx)(q,{dot:`warn`,value:i(`findings`),label:`with findings`,onClick:()=>r(`findings`),on:t===`findings`}),(0,Z.jsx)(q,{dot:`pass`,value:i(`clean`),label:`clean`,onClick:()=>r(`clean`),on:t===`clean`})]}),(0,Z.jsx)(K,{label:`Runs`,placeholder:`Find a run`,empty:t===`all`?`No runs.`:`None here.`,resetKey:t,height:me,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Page`}),(0,Z.jsx)(`th`,{scope:`col`,className:u(W,`hidden @xl:table-cell`),children:`Devices`}),(0,Z.jsx)(`th`,{scope:`col`,className:u(W,`hidden @3xl:table-cell`),children:`How`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Findings`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Status`}),(0,Z.jsx)(`th`,{scope:`col`,className:u(W,`hidden @xl:table-cell`),children:`When`})]}),children:a.map(e=>{let t=Me[e.status];return(0,Z.jsxs)(`tr`,{onClick:()=>o(e.id),className:U,children:[(0,Z.jsxs)(`td`,{className:G,children:[(0,Z.jsx)(`a`,{href:n(`responsive`,e.id),onClick:e=>e.stopPropagation(),className:`font-medium text-ink no-underline [overflow-wrap:anywhere] hover:underline`,children:Ne(e.url)}),(0,Z.jsx)(`span`,{className:`block text-body-sm text-muted`,children:e.id})]}),(0,Z.jsxs)(`td`,{className:u(G,`hidden text-body-sm text-ink-2 @xl:table-cell`),children:[e.devices,e.on?(0,Z.jsxs)(`span`,{className:`block text-muted`,children:[`on `,Y[e.on]]}):null]}),(0,Z.jsx)(`td`,{className:u(G,`hidden text-body-sm text-ink-2 @3xl:table-cell`),children:e.mode===`guided`?`Guided, ${e.steps} step${e.steps===1?``:`s`}`:`Interactive${e.steps?`, ${e.steps} instruction${e.steps===1?``:`s`}`:``}`}),(0,Z.jsx)(`td`,{className:u(G,`text-body-sm whitespace-nowrap`),"data-sort":(e.high||0)*1e3+(e.findings||0),children:e.findings?(0,Z.jsxs)(`span`,{className:e.high?`text-fail`:`text-warn`,children:[e.findings,e.high?` · ${e.high} high`:``]}):e.status===`running`?(0,Z.jsx)(`span`,{className:`text-muted`,children:`So far none`}):(0,Z.jsx)(`span`,{className:`text-pass`,children:`None`})}),(0,Z.jsx)(`td`,{className:u(G,`whitespace-nowrap`),children:(0,Z.jsx)(S,{tone:t.tone,children:t.label})}),(0,Z.jsx)(`td`,{className:u(G,`hidden text-body-sm whitespace-nowrap text-muted @xl:table-cell`),"data-sort":new Date(e.endedAt||e.startedAt).getTime()||0,children:B(e.endedAt||e.startedAt)})]},e.id)})})]})}var Ie={high:{label:`High`,tone:`fail`},medium:{label:`Medium`,tone:`warn`},low:{label:`Low`,tone:`neutral`}},Le=1500,Re={chrome:`Chrome`,edge:`Edge`,firefox:`Firefox`,webkit:`WebKit`};function ze({id:e,file:t,label:n,className:r,onOpen:i,thumb:a}){let[o,c]=(0,J.useState)(``),[l,d]=(0,J.useState)(!1),f=(0,J.useRef)(null),p=Oe(f);(0,J.useEffect)(()=>{if(!p)return;let n=!1;return X.shot(e,t).then(e=>!n&&c(e),()=>!n&&d(!0)),()=>{n=!0}},[e,t,p]);let m=l?(0,Z.jsx)(`span`,{className:`grid min-h-24 place-items-center text-body-sm text-muted`,children:`No picture`}):o?(0,Z.jsx)(`img`,{src:o,alt:`${n} screenshot`,className:u(`block w-full object-top`,a?`h-24 object-cover`:`object-contain`)}):(0,Z.jsx)(`span`,{className:`block min-h-24`});return i?(0,Z.jsx)(`button`,{ref:f,type:`button`,onClick:i,"aria-label":`Show the ${n} screenshot larger`,"data-tip":`Show larger`,className:u(s,`block cursor-zoom-in overflow-hidden border-0 p-0`,r),children:m}):(0,Z.jsx)(`div`,{ref:f,className:u(s,`overflow-hidden`,r),children:m})}var Be=[`high`,`medium`,`low`],Ve={sideways:`Scrolls sideways`,small_text:`Text under 12px`,small_targets:`Tap targets under 24px`,broken_images:`Broken images`},Q=e=>e.check.startsWith(`custom-`),$=e=>Q(e)?e.title:Ve[e.check]??e.title,He=e=>{let t=e.steps.filter(e=>e>0);return t.length?`${t.length<e.steps.length?`Start, step`:`Step`}${t.length>1?`s`:``} ${t.join(`, `)}`:`At the start`};function Ue({run:e,onOpen:t}){let[n,r]=(0,J.useState)(`all`),i=t=>t===`all`?e.findings.length:e.findings.filter(e=>e.severity===t).length;if(!e.findings.length)return(0,Z.jsx)(h,{icon:A,title:e.status===`running`?`Nothing found so far`:`Nothing found`,children:e.status===`running`?`Each device is checked after every step; findings show here as they are made.`:`Every device passed the checks at each of the run's ${l(e.steps.length,`step`)}.`});let a=e.findings.filter(e=>n===`all`||e.severity===n).sort((e,t)=>Be.indexOf(e.severity)-Be.indexOf(t.severity)||Math.min(...e.steps)-Math.min(...t.steps));return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":`Which findings to show`,children:(0,Z.jsx)(b,{value:n,onChange:r,items:[{id:`all`,label:`All`,n:i(`all`)},{id:`high`,label:`High`,n:i(`high`)},{id:`medium`,label:`Medium`,n:i(`medium`)},{id:`low`,label:`Low`,n:i(`low`)}]})}),(0,Z.jsx)(K,{label:`Findings`,placeholder:`Find a finding`,empty:`None here.`,resetKey:n,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Finding`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Severity`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Device`}),(0,Z.jsx)(`th`,{scope:`col`,className:u(W,`hidden @xl:table-cell`),children:`When`})]}),children:a.map(e=>{let n=Ie[e.severity];return(0,Z.jsxs)(`tr`,{onClick:()=>t(e),className:U,children:[(0,Z.jsxs)(`td`,{className:G,children:[(0,Z.jsx)(g,{variant:`link`,size:`inline`,onClick:n=>(n.stopPropagation(),t(e)),className:`whitespace-normal text-left [overflow-wrap:anywhere]`,children:Q(e)?`“${$(e)}”`:$(e)}),(0,Z.jsx)(`span`,{className:`block text-body-sm text-muted [overflow-wrap:anywhere]`,children:Q(e)?`Your check`:e.title===$(e)?e.detail:e.title})]}),(0,Z.jsx)(`td`,{className:u(G,`whitespace-nowrap`),"data-sort":{high:3,medium:2,low:1}[e.severity]??0,children:(0,Z.jsx)(S,{tone:n.tone,icon:!1,children:n.label})}),(0,Z.jsx)(`td`,{className:u(G,`text-body-sm whitespace-nowrap`),children:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Z.jsx)(y,{icon:ke[e.layout],size:16,className:`flex-none text-muted`}),e.label]})}),(0,Z.jsx)(`td`,{className:u(G,`hidden text-body-sm whitespace-nowrap text-muted @xl:table-cell`),"data-sort":e.steps.length?Math.min(...e.steps):0,children:He(e)})]},e.id)})})]})}function We({f:e,run:t,onOpen:n}){let r=t.findings.filter(t=>t.check===e.check&&t.id!==e.id);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-body-sm`,children:[(0,Z.jsx)(S,{tone:Ie[e.severity].tone,icon:!1,children:Ie[e.severity].label}),(0,Z.jsx)(y,{icon:ke[e.layout],size:16,className:`flex-none text-muted`}),(0,Z.jsx)(`strong`,{className:`font-medium`,children:e.label}),(0,Z.jsx)(`span`,{className:`text-body-sm text-muted`,children:He(e)})]}),e.title!==$(e)&&(0,Z.jsx)(`p`,{className:`m-0 text-body-sm font-medium [overflow-wrap:anywhere]`,children:e.title}),e.detail&&(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:e.detail}),e.quote&&(0,Z.jsxs)(`p`,{className:u(_.info,`m-0`),children:[`On the screen: “`,e.quote,`”`]}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm text-ink-2`,children:e.steps.map(e=>(0,Z.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e?`Step ${e}: ${t.steps.find(t=>t.n===e)?.instruction??``}`:`When the page opened`},e))}),e.shot?(0,Z.jsx)(ze,{id:t.id,file:e.shot,label:e.label},e.shot):(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`No screenshot for this finding.`}),r.length>0&&(0,Z.jsx)(_e,{id:`rp-others`,level:3,icon:oe,title:(0,Z.jsxs)(Z.Fragment,{children:[`Also on `,l(new Set(r.map(e=>e.device)).size,`other device`)]}),children:(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-2 p-0`,children:r.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(g,{size:`sm`,onClick:()=>n(e),"data-tip":`Show it on ${e.label}`,children:[(0,Z.jsx)(y,{icon:ke[e.layout],size:16,"aria-hidden":`true`}),e.label]})},e.id))})})]})}function Ge({run:e,onShot:t}){let n=e.spec;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[n.prompt&&(0,Z.jsxs)(_e,{id:`rp-prompt`,level:3,icon:ue,title:`Your prompt`,className:u(`surface rounded-lg bg-bg p-6 shadow-sm`,`gap-2`),children:[(0,Z.jsx)(`p`,{className:u(`panel rounded-md bg-(--page-surface-strong) p-6`,`m-0 text-body-sm whitespace-pre-wrap [overflow-wrap:anywhere]`),children:n.prompt}),n.attachments&&n.attachments.length>0&&(0,Z.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`Attached: `,n.attachments.join(`, `)]}),(0,Z.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`Read as `,l(n.steps.length,`step`),n.custom.length?`, with ${l(n.custom.length,`check`)} of your own`:``,`: `,n.steps.join(` → `)||`none`]})]}),(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:e.steps.map(n=>{let r=e.shots.filter(e=>e.step===n.n),i=e.findings.filter(e=>e.steps.includes(n.n)).length;return(0,Z.jsxs)(`li`,{className:u(c,`flex min-w-0 flex-col gap-4`),children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(we,{state:`pending`,n:n.n}),(0,Z.jsx)(`h3`,{className:`m-0 min-w-0 flex-1 text-body-lg font-medium [overflow-wrap:anywhere]`,children:n.instruction}),(0,Z.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[i?`${l(i,`finding`)}`:`No findings`,` · `,B(n.at)]})]}),n.plan.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm text-muted`,children:n.plan.map(e=>(0,Z.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},e))}),n.results.length>0&&(0,Z.jsx)(je,{results:n.results}),!n.results.length&&n.note&&n.by!==`check`&&n.by!==`open`&&(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-warn [overflow-wrap:anywhere]`,children:n.note}),r.length>0&&(0,Z.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-2`,"aria-label":`Screenshots after step ${n.n}`,children:r.map(r=>{let i=e.spec.devices.includes(r.device)?r.device:`device`;return(0,Z.jsx)(ze,{id:e.id,file:r.file,label:i,className:`w-[120px] flex-none`,onOpen:()=>t(r.file,`${i}, step ${n.n}`)},r.file)})})]},`${n.n}-${n.at}`)})})]})}function Ke({run:e,onShot:t}){let n=[...new Set(e.shots.map(e=>e.step))];return n.length?(0,Z.jsx)(`div`,{className:`flex flex-col gap-6`,children:n.map(n=>{let r=e.steps.find(e=>e.n===n);return(0,Z.jsx)(_e,{id:`rp-shots-${n}`,level:3,icon:N,title:n?`Step ${n}: ${r?.instruction??``}`:`When the page opened`,className:`gap-2`,children:(0,Z.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-2 gap-4 p-0 @3xl:grid-cols-4 @5xl:grid-cols-6`,children:e.shots.filter(e=>e.step===n).map(r=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(ze,{id:e.id,file:r.file,label:r.device,onOpen:()=>t(r.file,`${r.device}, ${n?`step ${n}`:`start`}`)}),(0,Z.jsx)(`span`,{className:`truncate text-body-sm text-muted`,children:r.device})]},r.file))})},n)})}):(0,Z.jsx)(h,{children:`No screenshots were kept.`})}function qe({log:e}){let[t,n]=(0,J.useState)(`all`),r=e.filter(e=>e.level!==`info`),i=t===`all`?e:r;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":`Which lines to show`,children:(0,Z.jsx)(b,{value:t,onChange:n,items:[{id:`all`,label:`Everything`,n:e.length},{id:`problems`,label:`Errors and warnings`,n:r.length}]})}),i.length?(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,"aria-label":`Log`,children:i.map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 border-t border-line-soft py-2 text-body-sm first:border-t-0`,children:[(0,Z.jsx)(y,{icon:e.level===`error`?L:e.level===`warn`?T:P,size:16,className:u(`mt-1 flex-none`,e.level===`error`?`text-fail`:e.level===`warn`?`text-warn`:`text-muted`)}),(0,Z.jsx)(`span`,{className:`w-[72px] flex-none text-muted tabular-nums`,children:new Date(e.at).toLocaleTimeString()}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:e.text})]},`${e.at}-${t}`))}):(0,Z.jsx)(h,{children:t===`all`?`Nothing logged yet.`:`No errors or warnings.`})]})}function Je({run:e}){let t=e.steps.toReversed();return(0,Z.jsx)(K,{label:`Devices`,placeholder:`Find a device`,empty:`No devices.`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Device`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Last step`}),(0,Z.jsx)(`th`,{scope:`col`,className:he,children:`Findings`})]}),children:e.spec.devices.map(n=>{let r=t.find(e=>e.results.some(e=>e.device===n)),i=r?.results.find(e=>e.device===n),a=e.findings.filter(e=>e.device===n).length,o=i?.label||e.spec.labels?.[n]||e.findings.find(e=>e.device===n)?.label||n,s=e.shots.some(e=>e.device===n);return(0,Z.jsxs)(`tr`,{className:H,children:[(0,Z.jsx)(`td`,{className:u(G,`font-medium whitespace-nowrap`),children:o}),(0,Z.jsx)(`td`,{className:u(G,`text-body-sm`),children:i?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2`,children:[(0,Z.jsx)(y,{icon:i.skipped?P:i.ok?D:L,size:16,className:u(`mt-1 flex-none`,i.skipped?`text-muted`:i.ok?`text-pass`:`text-fail`)}),(0,Z.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`Step `,r.n,`: `,i.skipped?`nothing to do on this layout`:i.ok?`done`:i.error||`did not finish`]})]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:s?`Page opened`:`Opening…`})}),(0,Z.jsx)(`td`,{className:u(pe,`text-body-sm`,a?`text-warn`:`text-muted`),children:a})]},n)})})}function Ye({id:e,tab:t}){let[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)([]),[s,c]=(0,J.useState)(!1),[d,f]=(0,J.useState)(``),[p,m]=(0,J.useState)(!1),[h,v]=(0,J.useState)(null),[y,b]=(0,J.useState)(null),w=(0,J.useCallback)(()=>{X.run(e).then(e=>{i(e.run),o(e.log),c(e.live)},e=>f(e.message))},[e]);(0,J.useEffect)(w,[w]),(0,J.useEffect)(()=>{if(!s)return;let e=R(w,Le);return()=>z(e)},[s,w]);let ee=async()=>{m(!0),f(``);try{await X.stop(e),w()}catch(e){f(e.message)}finally{m(!1)}};if(!r)return d?(0,Z.jsx)(`p`,{role:`alert`,className:u(_.fail,`m-0`),children:d}):(0,Z.jsx)(x,{shape:`detail`});let T=Me[r.status],D=a.filter(e=>e.level!==`info`).length,O=s?[{id:`findings`,label:`Findings`,n:r.findings.length,tone:r.findings.length?`text-warn`:void 0},{id:`devices`,label:`Devices`,n:r.spec.devices.length},{id:`log`,label:`Log and errors`,n:D||void 0,tone:D?`text-fail`:void 0}]:[{id:`steps`,label:`Steps`,n:r.steps.length},{id:`findings`,label:`Findings`,n:r.findings.length,tone:r.findings.length?`text-warn`:void 0},{id:`shots`,label:`Screenshots`,n:r.shots.length},{id:`log`,label:`Log and errors`,n:D||void 0,tone:D?`text-fail`:void 0}],k=O.find(e=>e.id===t)?.id??O[0].id,A=t=>location.hash=t===O[0].id?n(`responsive`,e):n(`responsive`,e,t),j=r.steps.filter(e=>e.by===`plan`||e.by===`words`).length,M=r.spec.steps.length;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(C,{to:{href:n(`responsive`,`runs`),label:`All runs`}}),(0,Z.jsx)(ye,{icon:le,title:Ne(r.spec.url),description:(0,Z.jsxs)(Z.Fragment,{children:[l(r.spec.devices.length,`device`),r.spec.on?` on ${Y[r.spec.on]} (${r.spec.real?`real devices`:Re[r.spec.browser??`chrome`]})`:``,` · `,r.spec.mode===`guided`?`${M?l(M,`step`):`reading the prompt`}${r.spec.source?.label?` from ${r.spec.source.label}`:``}`:`interactive (an earlier kind of run)`,` · started `,B(r.startedAt)]}),actions:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(S,{tone:T.tone,children:T.label}),s&&(0,Z.jsxs)(g,{variant:`danger`,disabled:p,onClick:()=>void ee(),"data-tip":`Stop now; what was done is kept`,children:[(0,Z.jsx)(se,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]})}),s&&(0,Z.jsxs)(`div`,{className:u(`surface rounded-lg bg-bg p-6 shadow-sm`,`flex items-center gap-4`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm`,children:M?j<M?`Step ${Math.min(j+1,M)} of ${M}: ${r.spec.steps[j]??``}`:`Last checks…`:`Reading your prompt as steps…`}),(0,Z.jsx)(`span`,{className:`w-[160px] flex-none`,children:(0,Z.jsx)(Ee,{value:j/Math.max(1,M)*100,label:`Steps done`})})]}),r.error&&(0,Z.jsx)(`p`,{role:`alert`,className:u(_.fail,`m-0`),children:r.error}),d&&(0,Z.jsx)(`p`,{role:`alert`,className:u(_.fail,`m-0`),children:d}),(0,Z.jsx)(fe,{prefix:`rtab`,className:`mb-0`,tabs:O,current:k,onPick:A,label:`Run`}),(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`rtab-panel-${k}`,"aria-labelledby":`rtab-${k}`,className:`flex min-w-0 flex-col gap-4`,children:[k===`devices`&&s&&(0,Z.jsx)(Je,{run:r}),k===`steps`&&(0,Z.jsx)(Ge,{run:r,onShot:(e,t)=>v({file:e,label:t})}),k===`findings`&&(0,Z.jsx)(Ue,{run:r,onOpen:b}),k===`shots`&&(0,Z.jsx)(Ke,{run:r,onShot:(e,t)=>v({file:e,label:t})}),k===`log`&&(0,Z.jsx)(qe,{log:a})]}),(0,Z.jsx)(V,{open:!!h,onClose:()=>v(null),wide:!0,title:h?.label??`Screenshot`,footer:(0,Z.jsxs)(g,{onClick:()=>v(null),children:[(0,Z.jsx)(E,{"aria-hidden":`true`}),`Close`]}),children:h&&(0,Z.jsx)(ze,{id:r.id,file:h.file,label:h.label})}),(0,Z.jsx)(V,{open:!!y,onClose:()=>b(null),wide:!0,title:y?Q(y)?`“${$(y)}”`:$(y):`Finding`,...y&&Q(y)?{description:`A check of your own`}:{},footer:(0,Z.jsxs)(g,{onClick:()=>b(null),children:[(0,Z.jsx)(E,{"aria-hidden":`true`}),`Close`]}),children:y&&(0,Z.jsx)(We,{f:y,run:r,onOpen:b})})]})}var Xe=[{name:`Page and devices`,tip:`The page and the devices to show it on`},{name:`What to do`,tip:`Your prompt, files or a test case`},{name:`What to check`,tip:`Built-in checks and your own`},{name:`Review`,tip:`Check and start`}],Ze=8,Qe=[`The main menu can be opened`,`Sign in is visible without scrolling`,`The page title is shown`,`Prices show next to each product`],$e=`forgeqe:responsive`;function et(){try{let e=JSON.parse(localStorage.getItem($e)||`{}`);return e&&typeof e==`object`?e:{}}catch{return{}}}function tt(e){try{localStorage.setItem($e,JSON.stringify({...et(),...e}))}catch{}}function nt({id:e,label:t,help:n,children:r}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:e,className:`text-body-sm font-medium`,children:t}),r,n&&(0,Z.jsx)(`span`,{className:`text-body-sm text-muted`,children:n})]})}function rt({busy:e,onBack:t,next:n,onNext:r,disabled:i,aside:a}){return(0,Z.jsxs)(`div`,{className:`sticky bottom-0 flex flex-wrap items-center gap-4 border-t border-line-soft bg-canvas py-4`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-body-sm`,children:a}),t&&(0,Z.jsxs)(g,{variant:`ghost`,disabled:e,onClick:t,children:[(0,Z.jsx)(te,{"aria-hidden":`true`}),`Back`]}),(0,Z.jsx)(g,{variant:`primary`,disabled:e||i,onClick:r,children:n})]})}var it=4e3,at=3,ot=5e4,st=`Search for pliers, open the first result and add it to the cart, then open the cart.
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{r as n}from"./route-9BkoTWUE.js";import{I as r,L as i,P as a,V as o,a as s,c}from"./surface-c1kG1KPS.js";import{n as l,t as u}from"./utils-DJRAScIl.js";import{t as d}from"./jsx-runtime-LKYXHABd.js";import{d as f}from"./sectionList-B6NF3ZMb.js";import{L as p,v as m}from"./api-D1PU4zye.js";import{A as h,F as g,L as _,O as v,P as y,T as b,g as x,k as S,n as C}from"./pageBack-DfGBh1Hs.js";import{Cn as w,Cr as ee,Er as T,Gr as E,N as D,Qn as O,Rn as k,T as A,V as j,Vn as M,Yt as N,Zt as P,a as te,cn as ne,jt as F,kr as re,nn as ie,o as ae,or as oe,ur as se,vr as ce,wn as le,xt as I,yn as ue,z as L}from"./line-icons-Cwj9OmCz.js";import{Ht as R,J as de,Vt as z,Y as fe,Z as B,Zt as V,ct as pe,dt as H,ft as U,it as me,lt as W,ot as G,rt as K,ut as he}from"./frame-D0MS2ZMz.js";import{u as ge}from"./nav-CkrE6JFU.js";import{B as q,J as _e,K as ve,Y as ye,l as be,n as xe,t as Se,z as Ce}from"./index-F8zkXd19.js";import{t as we}from"./step-mark-Bu6fNKW8.js";import{t as Te}from"./stepper-DiPQQ2l6.js";import{t as Ee}from"./parts-DqfD-6Qb.js";var J=e(t(),1),Y={browserstack:`BrowserStack`,testmu:`TestMu AI`},De=/^rsp-\d{8}-\d{6}-[0-9a-f]{4}$/,X={info:()=>m(`GET`,`/api/responsive`),runs:()=>m(`GET`,`/api/responsive/runs`),run:e=>m(`GET`,`/api/responsive/runs/${encodeURIComponent(e)}`),shot:(e,t)=>p(`/api/responsive/runs/${encodeURIComponent(e)}/shots/${encodeURIComponent(t)}`,`image/jpeg`),start:e=>m(`POST`,`/api/responsive/runs`,e),stop:e=>m(`POST`,`/api/responsive/runs/${encodeURIComponent(e)}/stop`,{}),flows:()=>m(`GET`,`/api/responsive/flows`),saveFlow:(e,t,n=!1)=>m(`POST`,`/api/responsive/flows`,{label:e,prompt:t,replace:n}),cloudDevices:(e,t=!1)=>m(`GET`,`/api/responsive/clouds/${e}/devices${t?`?fresh=1`:``}`),cases:e=>m(`GET`,`/api/responsive/cases?q=${encodeURIComponent(e)}`),caseSteps:e=>m(`GET`,`/api/responsive/case?key=${encodeURIComponent(e)}`)};function Oe(e,t=`600px`){let[n,r]=(0,J.useState)(()=>typeof IntersectionObserver>`u`);return(0,J.useEffect)(()=>{let i=e.current;if(n||!i)return;let a=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(r(!0),a.disconnect())},{rootMargin:t});return a.observe(i),()=>a.disconnect()},[e,n,t]),n}var Z=d(),ke={phone:oe,tablet:ce,desktop:w};function Ae({devices:e,picked:t,max:n,onChange:r,drawnBy:i,real:a}){let[s,c]=(0,J.useState)(``),[l,d]=(0,J.useState)(`all`),f=s.trim().toLowerCase(),p=e.filter(e=>(l===`all`||e.category===l)&&(!f||`${e.label} ${e.os??``} ${e.width}x${e.height} ${e.width}×${e.height}`.toLowerCase().includes(f))),m=t.length>=n,g=t=>e.filter(e=>e.category===t).length;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Z.jsx)(v,{id:`rp-search`,label:`Search devices`,value:s,onChange:c,placeholder:`iPhone, Pixel, 1920…`,className:`flex-none`}),(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":`Which devices to list`,children:(0,Z.jsx)(b,{value:l,onChange:d,items:[{id:`all`,label:`All`,n:e.length},{id:`phone`,label:`Phones`,n:g(`phone`)},{id:`tablet`,label:`Tablets`,n:g(`tablet`)},...a?[]:[{id:`desktop`,label:`Desktops`,n:g(`desktop`)}]]})})]}),(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:[t.length,` of `,n,` picked`,m?`: remove one to add another.`:`.`,` `,a?`Real devices on ${a}, as it lists them now: each is its own session of your plan, and a real browser (Safari on iOS, Chrome on Android).`:(0,Z.jsxs)(Z.Fragment,{children:[`Each is emulated in full (size, pixel ratio, touch, user agent)`,i?` and drawn by ${i}.`:` and drawn by Chromium, so a Safari-only difference does not show.`]})]}),p.length?(0,Z.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-1 gap-2 p-0 @3xl:grid-cols-2`,children:p.map(e=>{let n=t.includes(e.id);return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`label`,{className:u(o,`gap-2`,!n&&m&&`cursor-not-allowed text-muted hover:bg-transparent hover:text-muted`),children:[(0,Z.jsx)(ve,{checked:n,disabled:!n&&m,onCheckedChange:n=>r(n?[...t,e.id]:t.filter(t=>t!==e.id))}),(0,Z.jsx)(y,{icon:ke[e.category],size:16,className:`flex-none text-muted`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,Z.jsx)(`span`,{className:`ml-auto flex-none text-body-sm text-muted`,children:e.os??`${e.width}×${e.height} · ${e.scale}x`})]})},e.id)})}):(0,Z.jsxs)(h,{children:[`No device matches “`,s,`”.`]})]})}function je({results:e}){return(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm`,"aria-label":`What happened on each device`,children:e.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,Z.jsx)(y,{icon:e.skipped?P:e.ok?D:L,size:16,className:u(`mt-1 flex-none`,e.skipped?`text-muted`:e.ok?`text-pass`:`text-fail`)}),(0,Z.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,Z.jsx)(`strong`,{className:`font-medium`,children:e.label}),(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,e.skipped?`nothing to do on this layout`:`${e.done} of ${l(e.of,`step`)}`]}),e.error&&(0,Z.jsx)(`span`,{className:`block text-muted`,children:e.error})]})]},e.device))})}var Me={running:{label:`Running`,tone:`running`},done:{label:`Done`,tone:`pass`},stopped:{label:`Stopped`,tone:`neutral`},failed:{label:`Failed`,tone:`fail`}},Ne=e=>{try{let t=new URL(e);return`${t.host}${t.pathname===`/`?``:t.pathname}`}catch{return e}},Pe=e=>e.status===`running`?`running`:e.findings?`findings`:`clean`;function Fe({rows:e}){let[t,r]=(0,J.useState)(`all`),i=t=>t===`all`?e.length:e.filter(e=>Pe(e)===t).length,a=e.filter(e=>t===`all`||Pe(e)===t),o=e=>location.hash=n(`responsive`,e);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Ce,{label:`Runs by state`,children:[(0,Z.jsx)(q,{dot:`neutral`,value:i(`all`),label:`runs`,onClick:()=>r(`all`),on:t===`all`}),(0,Z.jsx)(q,{dot:`running`,value:i(`running`),label:`running`,onClick:()=>r(`running`),on:t===`running`}),(0,Z.jsx)(q,{dot:`warn`,value:i(`findings`),label:`with findings`,onClick:()=>r(`findings`),on:t===`findings`}),(0,Z.jsx)(q,{dot:`pass`,value:i(`clean`),label:`clean`,onClick:()=>r(`clean`),on:t===`clean`})]}),(0,Z.jsx)(K,{label:`Runs`,placeholder:`Find a run`,empty:t===`all`?`No runs.`:`None here.`,resetKey:t,height:me,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Page`}),(0,Z.jsx)(`th`,{scope:`col`,className:u(W,`hidden @xl:table-cell`),children:`Devices`}),(0,Z.jsx)(`th`,{scope:`col`,className:u(W,`hidden @3xl:table-cell`),children:`How`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Findings`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Status`}),(0,Z.jsx)(`th`,{scope:`col`,className:u(W,`hidden @xl:table-cell`),children:`When`})]}),children:a.map(e=>{let t=Me[e.status];return(0,Z.jsxs)(`tr`,{onClick:()=>o(e.id),className:U,children:[(0,Z.jsxs)(`td`,{className:G,children:[(0,Z.jsx)(`a`,{href:n(`responsive`,e.id),onClick:e=>e.stopPropagation(),className:`font-medium text-ink no-underline [overflow-wrap:anywhere] hover:underline`,children:Ne(e.url)}),(0,Z.jsx)(`span`,{className:`block text-body-sm text-muted`,children:e.id})]}),(0,Z.jsxs)(`td`,{className:u(G,`hidden text-body-sm text-ink-2 @xl:table-cell`),children:[e.devices,e.on?(0,Z.jsxs)(`span`,{className:`block text-muted`,children:[`on `,Y[e.on]]}):null]}),(0,Z.jsx)(`td`,{className:u(G,`hidden text-body-sm text-ink-2 @3xl:table-cell`),children:e.mode===`guided`?`Guided, ${e.steps} step${e.steps===1?``:`s`}`:`Interactive${e.steps?`, ${e.steps} instruction${e.steps===1?``:`s`}`:``}`}),(0,Z.jsx)(`td`,{className:u(G,`text-body-sm whitespace-nowrap`),"data-sort":(e.high||0)*1e3+(e.findings||0),children:e.findings?(0,Z.jsxs)(`span`,{className:e.high?`text-fail`:`text-warn`,children:[e.findings,e.high?` · ${e.high} high`:``]}):e.status===`running`?(0,Z.jsx)(`span`,{className:`text-muted`,children:`So far none`}):(0,Z.jsx)(`span`,{className:`text-pass`,children:`None`})}),(0,Z.jsx)(`td`,{className:u(G,`whitespace-nowrap`),children:(0,Z.jsx)(S,{tone:t.tone,children:t.label})}),(0,Z.jsx)(`td`,{className:u(G,`hidden text-body-sm whitespace-nowrap text-muted @xl:table-cell`),"data-sort":new Date(e.endedAt||e.startedAt).getTime()||0,children:B(e.endedAt||e.startedAt)})]},e.id)})})]})}var Ie={high:{label:`High`,tone:`fail`},medium:{label:`Medium`,tone:`warn`},low:{label:`Low`,tone:`neutral`}},Le=1500,Re={chrome:`Chrome`,edge:`Edge`,firefox:`Firefox`,webkit:`WebKit`};function ze({id:e,file:t,label:n,className:r,onOpen:i,thumb:a}){let[o,c]=(0,J.useState)(``),[l,d]=(0,J.useState)(!1),f=(0,J.useRef)(null),p=Oe(f);(0,J.useEffect)(()=>{if(!p)return;let n=!1;return X.shot(e,t).then(e=>!n&&c(e),()=>!n&&d(!0)),()=>{n=!0}},[e,t,p]);let m=l?(0,Z.jsx)(`span`,{className:`grid min-h-24 place-items-center text-body-sm text-muted`,children:`No picture`}):o?(0,Z.jsx)(`img`,{src:o,alt:`${n} screenshot`,className:u(`block w-full object-top`,a?`h-24 object-cover`:`object-contain`)}):(0,Z.jsx)(`span`,{className:`block min-h-24`});return i?(0,Z.jsx)(`button`,{ref:f,type:`button`,onClick:i,"aria-label":`Show the ${n} screenshot larger`,"data-tip":`Show larger`,className:u(s,`block cursor-zoom-in overflow-hidden border-0 p-0`,r),children:m}):(0,Z.jsx)(`div`,{ref:f,className:u(s,`overflow-hidden`,r),children:m})}var Be=[`high`,`medium`,`low`],Ve={sideways:`Scrolls sideways`,small_text:`Text under 12px`,small_targets:`Tap targets under 24px`,broken_images:`Broken images`},Q=e=>e.check.startsWith(`custom-`),$=e=>Q(e)?e.title:Ve[e.check]??e.title,He=e=>{let t=e.steps.filter(e=>e>0);return t.length?`${t.length<e.steps.length?`Start, step`:`Step`}${t.length>1?`s`:``} ${t.join(`, `)}`:`At the start`};function Ue({run:e,onOpen:t}){let[n,r]=(0,J.useState)(`all`),i=t=>t===`all`?e.findings.length:e.findings.filter(e=>e.severity===t).length;if(!e.findings.length)return(0,Z.jsx)(h,{icon:A,title:e.status===`running`?`Nothing found so far`:`Nothing found`,children:e.status===`running`?`Each device is checked after every step; findings show here as they are made.`:`Every device passed the checks at each of the run's ${l(e.steps.length,`step`)}.`});let a=e.findings.filter(e=>n===`all`||e.severity===n).sort((e,t)=>Be.indexOf(e.severity)-Be.indexOf(t.severity)||Math.min(...e.steps)-Math.min(...t.steps));return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":`Which findings to show`,children:(0,Z.jsx)(b,{value:n,onChange:r,items:[{id:`all`,label:`All`,n:i(`all`)},{id:`high`,label:`High`,n:i(`high`)},{id:`medium`,label:`Medium`,n:i(`medium`)},{id:`low`,label:`Low`,n:i(`low`)}]})}),(0,Z.jsx)(K,{label:`Findings`,placeholder:`Find a finding`,empty:`None here.`,resetKey:n,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Finding`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Severity`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Device`}),(0,Z.jsx)(`th`,{scope:`col`,className:u(W,`hidden @xl:table-cell`),children:`When`})]}),children:a.map(e=>{let n=Ie[e.severity];return(0,Z.jsxs)(`tr`,{onClick:()=>t(e),className:U,children:[(0,Z.jsxs)(`td`,{className:G,children:[(0,Z.jsx)(g,{variant:`link`,size:`inline`,onClick:n=>(n.stopPropagation(),t(e)),className:`whitespace-normal text-left [overflow-wrap:anywhere]`,children:Q(e)?`“${$(e)}”`:$(e)}),(0,Z.jsx)(`span`,{className:`block text-body-sm text-muted [overflow-wrap:anywhere]`,children:Q(e)?`Your check`:e.title===$(e)?e.detail:e.title})]}),(0,Z.jsx)(`td`,{className:u(G,`whitespace-nowrap`),"data-sort":{high:3,medium:2,low:1}[e.severity]??0,children:(0,Z.jsx)(S,{tone:n.tone,icon:!1,children:n.label})}),(0,Z.jsx)(`td`,{className:u(G,`text-body-sm whitespace-nowrap`),children:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Z.jsx)(y,{icon:ke[e.layout],size:16,className:`flex-none text-muted`}),e.label]})}),(0,Z.jsx)(`td`,{className:u(G,`hidden text-body-sm whitespace-nowrap text-muted @xl:table-cell`),"data-sort":e.steps.length?Math.min(...e.steps):0,children:He(e)})]},e.id)})})]})}function We({f:e,run:t,onOpen:n}){let r=t.findings.filter(t=>t.check===e.check&&t.id!==e.id);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-body-sm`,children:[(0,Z.jsx)(S,{tone:Ie[e.severity].tone,icon:!1,children:Ie[e.severity].label}),(0,Z.jsx)(y,{icon:ke[e.layout],size:16,className:`flex-none text-muted`}),(0,Z.jsx)(`strong`,{className:`font-medium`,children:e.label}),(0,Z.jsx)(`span`,{className:`text-body-sm text-muted`,children:He(e)})]}),e.title!==$(e)&&(0,Z.jsx)(`p`,{className:`m-0 text-body-sm font-medium [overflow-wrap:anywhere]`,children:e.title}),e.detail&&(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:e.detail}),e.quote&&(0,Z.jsxs)(`p`,{className:u(_.info,`m-0`),children:[`On the screen: “`,e.quote,`”`]}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm text-ink-2`,children:e.steps.map(e=>(0,Z.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e?`Step ${e}: ${t.steps.find(t=>t.n===e)?.instruction??``}`:`When the page opened`},e))}),e.shot?(0,Z.jsx)(ze,{id:t.id,file:e.shot,label:e.label},e.shot):(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`No screenshot for this finding.`}),r.length>0&&(0,Z.jsx)(_e,{id:`rp-others`,level:3,icon:oe,title:(0,Z.jsxs)(Z.Fragment,{children:[`Also on `,l(new Set(r.map(e=>e.device)).size,`other device`)]}),children:(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-2 p-0`,children:r.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(g,{size:`sm`,onClick:()=>n(e),"data-tip":`Show it on ${e.label}`,children:[(0,Z.jsx)(y,{icon:ke[e.layout],size:16,"aria-hidden":`true`}),e.label]})},e.id))})})]})}function Ge({run:e,onShot:t}){let n=e.spec;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[n.prompt&&(0,Z.jsxs)(_e,{id:`rp-prompt`,level:3,icon:ue,title:`Your prompt`,className:u(`surface rounded-lg bg-bg p-6 shadow-sm`,`gap-2`),children:[(0,Z.jsx)(`p`,{className:u(`panel rounded-md bg-(--page-surface-strong) p-6`,`m-0 text-body-sm whitespace-pre-wrap [overflow-wrap:anywhere]`),children:n.prompt}),n.attachments&&n.attachments.length>0&&(0,Z.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`Attached: `,n.attachments.join(`, `)]}),(0,Z.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`Read as `,l(n.steps.length,`step`),n.custom.length?`, with ${l(n.custom.length,`check`)} of your own`:``,`: `,n.steps.join(` → `)||`none`]})]}),(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:e.steps.map(n=>{let r=e.shots.filter(e=>e.step===n.n),i=e.findings.filter(e=>e.steps.includes(n.n)).length;return(0,Z.jsxs)(`li`,{className:u(c,`flex min-w-0 flex-col gap-4`),children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(we,{state:`pending`,n:n.n}),(0,Z.jsx)(`h3`,{className:`m-0 min-w-0 flex-1 text-body-lg font-medium [overflow-wrap:anywhere]`,children:n.instruction}),(0,Z.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[i?`${l(i,`finding`)}`:`No findings`,` · `,B(n.at)]})]}),n.plan.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm text-muted`,children:n.plan.map(e=>(0,Z.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},e))}),n.results.length>0&&(0,Z.jsx)(je,{results:n.results}),!n.results.length&&n.note&&n.by!==`check`&&n.by!==`open`&&(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-warn [overflow-wrap:anywhere]`,children:n.note}),r.length>0&&(0,Z.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-2`,"aria-label":`Screenshots after step ${n.n}`,children:r.map(r=>{let i=e.spec.devices.includes(r.device)?r.device:`device`;return(0,Z.jsx)(ze,{id:e.id,file:r.file,label:i,className:`w-[120px] flex-none`,onOpen:()=>t(r.file,`${i}, step ${n.n}`)},r.file)})})]},`${n.n}-${n.at}`)})})]})}function Ke({run:e,onShot:t}){let n=[...new Set(e.shots.map(e=>e.step))];return n.length?(0,Z.jsx)(`div`,{className:`flex flex-col gap-6`,children:n.map(n=>{let r=e.steps.find(e=>e.n===n);return(0,Z.jsx)(_e,{id:`rp-shots-${n}`,level:3,icon:N,title:n?`Step ${n}: ${r?.instruction??``}`:`When the page opened`,className:`gap-2`,children:(0,Z.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-2 gap-4 p-0 @3xl:grid-cols-4 @5xl:grid-cols-6`,children:e.shots.filter(e=>e.step===n).map(r=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(ze,{id:e.id,file:r.file,label:r.device,onOpen:()=>t(r.file,`${r.device}, ${n?`step ${n}`:`start`}`)}),(0,Z.jsx)(`span`,{className:`truncate text-body-sm text-muted`,children:r.device})]},r.file))})},n)})}):(0,Z.jsx)(h,{children:`No screenshots were kept.`})}function qe({log:e}){let[t,n]=(0,J.useState)(`all`),r=e.filter(e=>e.level!==`info`),i=t===`all`?e:r;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":`Which lines to show`,children:(0,Z.jsx)(b,{value:t,onChange:n,items:[{id:`all`,label:`Everything`,n:e.length},{id:`problems`,label:`Errors and warnings`,n:r.length}]})}),i.length?(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,"aria-label":`Log`,children:i.map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 border-t border-line-soft py-2 text-body-sm first:border-t-0`,children:[(0,Z.jsx)(y,{icon:e.level===`error`?L:e.level===`warn`?T:P,size:16,className:u(`mt-1 flex-none`,e.level===`error`?`text-fail`:e.level===`warn`?`text-warn`:`text-muted`)}),(0,Z.jsx)(`span`,{className:`w-[72px] flex-none text-muted tabular-nums`,children:new Date(e.at).toLocaleTimeString()}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:e.text})]},`${e.at}-${t}`))}):(0,Z.jsx)(h,{children:t===`all`?`Nothing logged yet.`:`No errors or warnings.`})]})}function Je({run:e}){let t=e.steps.toReversed();return(0,Z.jsx)(K,{label:`Devices`,placeholder:`Find a device`,empty:`No devices.`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Device`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Last step`}),(0,Z.jsx)(`th`,{scope:`col`,className:he,children:`Findings`})]}),children:e.spec.devices.map(n=>{let r=t.find(e=>e.results.some(e=>e.device===n)),i=r?.results.find(e=>e.device===n),a=e.findings.filter(e=>e.device===n).length,o=i?.label||e.spec.labels?.[n]||e.findings.find(e=>e.device===n)?.label||n,s=e.shots.some(e=>e.device===n);return(0,Z.jsxs)(`tr`,{className:H,children:[(0,Z.jsx)(`td`,{className:u(G,`font-medium whitespace-nowrap`),children:o}),(0,Z.jsx)(`td`,{className:u(G,`text-body-sm`),children:i?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2`,children:[(0,Z.jsx)(y,{icon:i.skipped?P:i.ok?D:L,size:16,className:u(`mt-1 flex-none`,i.skipped?`text-muted`:i.ok?`text-pass`:`text-fail`)}),(0,Z.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`Step `,r.n,`: `,i.skipped?`nothing to do on this layout`:i.ok?`done`:i.error||`did not finish`]})]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:s?`Page opened`:`Opening…`})}),(0,Z.jsx)(`td`,{className:u(pe,`text-body-sm`,a?`text-warn`:`text-muted`),children:a})]},n)})})}function Ye({id:e,tab:t}){let[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)([]),[s,c]=(0,J.useState)(!1),[d,f]=(0,J.useState)(``),[p,m]=(0,J.useState)(!1),[h,v]=(0,J.useState)(null),[y,b]=(0,J.useState)(null),w=(0,J.useCallback)(()=>{X.run(e).then(e=>{i(e.run),o(e.log),c(e.live)},e=>f(e.message))},[e]);(0,J.useEffect)(w,[w]),(0,J.useEffect)(()=>{if(!s)return;let e=R(w,Le);return()=>z(e)},[s,w]);let ee=async()=>{m(!0),f(``);try{await X.stop(e),w()}catch(e){f(e.message)}finally{m(!1)}};if(!r)return d?(0,Z.jsx)(`p`,{role:`alert`,className:u(_.fail,`m-0`),children:d}):(0,Z.jsx)(x,{shape:`detail`});let T=Me[r.status],D=a.filter(e=>e.level!==`info`).length,O=s?[{id:`findings`,label:`Findings`,n:r.findings.length,tone:r.findings.length?`text-warn`:void 0},{id:`devices`,label:`Devices`,n:r.spec.devices.length},{id:`log`,label:`Log and errors`,n:D||void 0,tone:D?`text-fail`:void 0}]:[{id:`steps`,label:`Steps`,n:r.steps.length},{id:`findings`,label:`Findings`,n:r.findings.length,tone:r.findings.length?`text-warn`:void 0},{id:`shots`,label:`Screenshots`,n:r.shots.length},{id:`log`,label:`Log and errors`,n:D||void 0,tone:D?`text-fail`:void 0}],k=O.find(e=>e.id===t)?.id??O[0].id,A=t=>location.hash=t===O[0].id?n(`responsive`,e):n(`responsive`,e,t),j=r.steps.filter(e=>e.by===`plan`||e.by===`words`).length,M=r.spec.steps.length;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(C,{to:{href:n(`responsive`,`runs`),label:`All runs`}}),(0,Z.jsx)(ye,{icon:le,title:Ne(r.spec.url),description:(0,Z.jsxs)(Z.Fragment,{children:[l(r.spec.devices.length,`device`),r.spec.on?` on ${Y[r.spec.on]} (${r.spec.real?`real devices`:Re[r.spec.browser??`chrome`]})`:``,` · `,r.spec.mode===`guided`?`${M?l(M,`step`):`reading the prompt`}${r.spec.source?.label?` from ${r.spec.source.label}`:``}`:`interactive (an earlier kind of run)`,` · started `,B(r.startedAt)]}),actions:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(S,{tone:T.tone,children:T.label}),s&&(0,Z.jsxs)(g,{variant:`danger`,disabled:p,onClick:()=>void ee(),"data-tip":`Stop now; what was done is kept`,children:[(0,Z.jsx)(se,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]})}),s&&(0,Z.jsxs)(`div`,{className:u(`surface rounded-lg bg-bg p-6 shadow-sm`,`flex items-center gap-4`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm`,children:M?j<M?`Step ${Math.min(j+1,M)} of ${M}: ${r.spec.steps[j]??``}`:`Last checks…`:`Reading your prompt as steps…`}),(0,Z.jsx)(`span`,{className:`w-[160px] flex-none`,children:(0,Z.jsx)(Ee,{value:j/Math.max(1,M)*100,label:`Steps done`})})]}),r.error&&(0,Z.jsx)(`p`,{role:`alert`,className:u(_.fail,`m-0`),children:r.error}),d&&(0,Z.jsx)(`p`,{role:`alert`,className:u(_.fail,`m-0`),children:d}),(0,Z.jsx)(fe,{prefix:`rtab`,className:`mb-0`,tabs:O,current:k,onPick:A,label:`Run`}),(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`rtab-panel-${k}`,"aria-labelledby":`rtab-${k}`,className:`flex min-w-0 flex-col gap-4`,children:[k===`devices`&&s&&(0,Z.jsx)(Je,{run:r}),k===`steps`&&(0,Z.jsx)(Ge,{run:r,onShot:(e,t)=>v({file:e,label:t})}),k===`findings`&&(0,Z.jsx)(Ue,{run:r,onOpen:b}),k===`shots`&&(0,Z.jsx)(Ke,{run:r,onShot:(e,t)=>v({file:e,label:t})}),k===`log`&&(0,Z.jsx)(qe,{log:a})]}),(0,Z.jsx)(V,{open:!!h,onClose:()=>v(null),wide:!0,title:h?.label??`Screenshot`,footer:(0,Z.jsxs)(g,{onClick:()=>v(null),children:[(0,Z.jsx)(E,{"aria-hidden":`true`}),`Close`]}),children:h&&(0,Z.jsx)(ze,{id:r.id,file:h.file,label:h.label})}),(0,Z.jsx)(V,{open:!!y,onClose:()=>b(null),wide:!0,title:y?Q(y)?`“${$(y)}”`:$(y):`Finding`,...y&&Q(y)?{description:`A check of your own`}:{},footer:(0,Z.jsxs)(g,{onClick:()=>b(null),children:[(0,Z.jsx)(E,{"aria-hidden":`true`}),`Close`]}),children:y&&(0,Z.jsx)(We,{f:y,run:r,onOpen:b})})]})}var Xe=[{name:`Page and devices`,tip:`The page and the devices to show it on`},{name:`What to do`,tip:`Your prompt, files or a test case`},{name:`What to check`,tip:`Built-in checks and your own`},{name:`Review`,tip:`Check and start`}],Ze=8,Qe=[`The main menu can be opened`,`Sign in is visible without scrolling`,`The page title is shown`,`Prices show next to each product`],$e=`forgeqe:responsive`;function et(){try{let e=JSON.parse(localStorage.getItem($e)||`{}`);return e&&typeof e==`object`?e:{}}catch{return{}}}function tt(e){try{localStorage.setItem($e,JSON.stringify({...et(),...e}))}catch{}}function nt({id:e,label:t,help:n,children:r}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:e,className:`text-body-sm font-medium`,children:t}),r,n&&(0,Z.jsx)(`span`,{className:`text-body-sm text-muted`,children:n})]})}function rt({busy:e,onBack:t,next:n,onNext:r,disabled:i,aside:a}){return(0,Z.jsxs)(`div`,{className:`sticky bottom-0 flex flex-wrap items-center gap-4 border-t border-line-soft bg-canvas py-4`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-body-sm`,children:a}),t&&(0,Z.jsxs)(g,{variant:`ghost`,disabled:e,onClick:t,children:[(0,Z.jsx)(te,{"aria-hidden":`true`}),`Back`]}),(0,Z.jsx)(g,{variant:`primary`,disabled:e||i,onClick:r,children:n})]})}var it=4e3,at=3,ot=5e4,st=`Search for pliers, open the first result and add it to the cart, then open the cart.
|
|
2
2
|
The cart should show 1 item and its total should be visible without scrolling.`;function ct({prompt:e,setPrompt:t,files:n,setFiles:o,source:s,setSource:c,flows:d,onFlowsChanged:f,onError:p}){let[m,h]=(0,J.useState)(!1),[_,v]=(0,J.useState)(``),[y,b]=(0,J.useState)(null),[x,C]=(0,J.useState)(``),[w,ee]=(0,J.useState)(``),[T,D]=(0,J.useState)(``),k=(0,J.useRef)(null),A=(e,n)=>{t(e.slice(0,it)),c(n),p(``)},M=async t=>{try{let n=await X.saveFlow(x.trim(),e,t);D(``),ee(n.flow.label),C(``),f()}catch(e){let n=e.message;!t&&/saved already/.test(n)?D(n):p(n)}},N=async e=>{let t=[...e??[]];if(!t.length)return;if(n.length+t.length>at)return p(`Attach at most ${at} files.`);let r=[...n];for(let e of t){if(!/\.(txt|md|csv|feature)$/i.test(e.name)||e.size>262144)return p(`Attach .txt, .md, .csv or .feature files of at most 256 KB.`);let t=await e.text();if(t.length>ot)return p(`${e.name} is longer than ${ot/1e3}k characters.`);r.some(t=>t.name===e.name)||r.push({name:e.name.replace(/[^\w .()-]/g,`_`).slice(-80),text:t})}o(r),p(``)};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(nt,{id:`rp-prompt`,label:`What should ForgeQE do on every device?`,help:`Write it as you would tell a tester: what to do, in order, and what should be true. Attached files are read too. ${e.length}/${it}`,children:(0,Z.jsx)(i,{id:`rp-prompt`,value:e,rows:6,maxLength:it,placeholder:st,onChange:e=>t(e.target.value)})}),n.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-2 p-0`,"aria-label":`Attached files`,children:n.map(e=>(0,Z.jsx)(`li`,{className:`inline-flex`,children:(0,Z.jsxs)(S,{tone:`neutral`,icon:!1,children:[(0,Z.jsx)(I,{size:13,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`max-w-[240px] truncate`,children:e.name}),(0,Z.jsx)(g,{variant:`icon`,size:`icon-xs`,"aria-label":`Remove ${e.name}`,"data-tip":`Remove ${e.name}`,onClick:()=>o(n.filter(t=>t.name!==e.name)),children:(0,Z.jsx)(E,{"aria-hidden":`true`})})]})},e.name))}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(g,{size:`sm`,disabled:n.length>=at,onClick:()=>k.current?.click(),"data-tip":`Attach a test case, notes or a feature file (.txt, .md, .csv, .feature), read in this browser`,children:[(0,Z.jsx)(re,{"aria-hidden":`true`}),`Attach`]}),(0,Z.jsx)(`input`,{ref:k,type:`file`,multiple:!0,accept:`.txt,.md,.csv,.feature,text/plain,text/markdown,text/csv`,className:`hidden`,onChange:e=>{N(e.target.files),e.target.value=``}}),(0,Z.jsxs)(g,{size:`sm`,"aria-expanded":m,onClick:()=>h(!m),"data-tip":`Fill the prompt from a test case of test management`,children:[(0,Z.jsx)(j,{"aria-hidden":`true`}),`Test case`]}),(0,Z.jsxs)(r,{"aria-label":`A saved prompt`,size:`sm`,value:``,disabled:!d.length,onChange:e=>{let t=d.find(t=>t.name===e.target.value);t&&A(t.prompt,{kind:`flow`,label:t.label})},className:`min-w-0 flex-[0_1_220px]`,children:[(0,Z.jsx)(`option`,{value:``,children:d.length?`A saved prompt…`:`No saved prompts yet`}),d.map(e=>(0,Z.jsx)(`option`,{value:e.name,children:e.label},e.name))]}),(0,Z.jsx)(`span`,{className:`flex-1`}),(0,Z.jsx)(a,{"aria-label":`Name for the prompt`,size:`sm`,value:x,maxLength:80,placeholder:`Name to save as`,onChange:e=>C(e.target.value),className:`min-w-0 flex-[0_1_200px]`}),(0,Z.jsxs)(g,{size:`sm`,variant:`primary`,disabled:!x.trim()||!e.trim(),"data-tip":`Save this prompt to use again`,onClick:()=>void M(!1),children:[(0,Z.jsx)(F,{"aria-hidden":`true`}),`Save`]})]}),m&&(0,Z.jsxs)(`div`,{className:u(`panel rounded-md bg-(--page-surface-strong) p-6`,`flex flex-col gap-2`),children:[(0,Z.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:async e=>{e.preventDefault();try{b((await X.cases(_)).cases)}catch(e){p(e.message)}},children:[(0,Z.jsx)(a,{"aria-label":`Find a test case`,autoFocus:!0,value:_,maxLength:100,placeholder:`checkout, ADO-12…`,onChange:e=>v(e.target.value),className:`min-w-0 flex-[1_1_200px]`}),(0,Z.jsxs)(g,{size:`sm`,type:`submit`,"data-tip":`Find test cases from test management`,children:[(0,Z.jsx)(O,{"aria-hidden":`true`}),`Find`]})]}),y&&(y.length?(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:y.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,className:u(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`gap-2`),onClick:async()=>{try{let t=await X.caseSteps(e.key),n=t.key.split(`:`)[1];A(`Test case ${n}: ${t.title}\n${t.steps.map((e,t)=>`${t+1}. ${e}`).join(`
|
|
3
3
|
`)}`,{kind:`case`,label:`${n} ${t.title}`}),h(!1),b(null)}catch(e){p(e.message)}},children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,Z.jsxs)(`span`,{className:`flex-none text-body-sm text-muted`,children:[e.key.split(`:`)[1],` · `,l(e.steps,`step`)]})]})},e.key))}):(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`No test case with steps matches. Test management lists the cases of the plans Settings connects.`}))]}),s.kind!==`typed`&&s.label&&(0,Z.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`From `,s.kind===`flow`?`the saved prompt`:`the test case`,` `,(0,Z.jsx)(`strong`,{className:`font-medium text-ink-2`,children:s.label}),`; change it as you like.`]}),w&&(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 text-body-sm text-pass`,children:[`Saved as “`,w,`”.`]}),(0,Z.jsx)(V,{open:!!T,onClose:()=>D(``),title:`Replace the saved prompt?`,description:T,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(g,{onClick:()=>D(``),children:[(0,Z.jsx)(E,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(g,{variant:`accent`,onClick:()=>void M(!0),children:[(0,Z.jsx)(F,{"aria-hidden":`true`}),`Replace`]})]}),children:(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2`,children:`The saved prompt's old text is not kept.`})})]})}function lt({info:e,url:t,named:n,where:r,prompt:i,files:a,checks:o,custom:s}){let d=(e,t)=>(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-line-soft py-4 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,Z.jsx)(`span`,{className:`text-body-sm font-medium text-muted`,children:e}),(0,Z.jsx)(`div`,{className:`text-body-sm`,children:t})]});return(0,Z.jsxs)(`aside`,{"aria-label":`Summary`,className:u(c,`flex flex-col`),children:[d(`Page`,t.trim()?(0,Z.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:Ne(t.trim())}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`Not given yet`})),d(`Devices`,n.length?(0,Z.jsx)(`span`,{children:n.join(`, `)}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`None picked`})),d(`Runs on`,r),d(`What to do`,i.trim()?`Your prompt${a?` and ${l(a,`file`)}`:``}`:(0,Z.jsx)(`span`,{className:`text-muted`,children:`No prompt yet`})),d(`Checks`,o.length+s.filter(e=>e.trim()).length?(0,Z.jsx)(`span`,{children:[...o.map(t=>e.checks.find(e=>e.id===t)?.label??t),...s.filter(e=>e.trim())].join(` · `)}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`None yet`}))]})}function ut({info:e,onStarted:t}){let n=et(),i=(n.devices??[]).filter(t=>e.devices.some(e=>e.id===t)).slice(0,e.maxPanes),[o,s]=(0,J.useState)(0),[c,l]=(0,J.useState)(0),[d,f]=(0,J.useState)(n.address??e.start),[p,m]=(0,J.useState)(i.length?i:e.defaults),[h,v]=(0,J.useState)(``),[y,b]=(0,J.useState)([]),[x,S]=(0,J.useState)({kind:`typed`}),[C,w]=(0,J.useState)((n.checks??[]).filter(t=>e.checks.some(e=>e.id===t)).length?n.checks.filter(t=>e.checks.some(e=>e.id===t)):e.checks.map(e=>e.id)),[T,E]=(0,J.useState)([]),[D,O]=(0,J.useState)(n.on&&n.on!==`local`&&e.clouds[n.on]?.ready?n.on:`local`),[A,j]=(0,J.useState)(e.browsers.some(e=>e.id===n.browser)?n.browser:`chrome`),N=e.browsers.find(e=>e.id===A)?.label??A,[P,te]=(0,J.useState)(n.kind===`browser`?`browser`:`real`),[F,re]=(0,J.useState)(null),[ie,oe]=(0,J.useState)(``),[se,ce]=(0,J.useState)([]),I=D!==`local`&&P===`real`;(0,J.useEffect)(()=>{if(!I||F?.cloud===D)return;let e=!1;return oe(``),ce([]),X.cloudDevices(D).then(t=>!e&&re({cloud:D,devices:t.devices,max:t.max}),t=>!e&&oe(t.message)),()=>{e=!0}},[I,D,F?.cloud]);let L=F?.cloud===D?F.devices.map(e=>({id:e.id,label:e.name,category:e.category,width:0,height:0,scale:1,os:`${e.platform===`ios`?`iOS`:`Android`} ${e.version}`})):[],R=I?se:p,z=I?se.map(e=>F?.devices.find(t=>t.id===e)?.label??e):p.map(t=>e.devices.find(e=>e.id===t)?.label??t),fe=D===`local`?`This computer (Chromium)`:I?`${Y[D]}: real devices, one session each`:`${Y[D]}: ${N}`,[B,V]=(0,J.useState)([]),[pe,H]=(0,J.useState)(``),[U,me]=(0,J.useState)(!1),W=()=>void X.flows().then(e=>V(e.flows),()=>{});(0,J.useEffect)(W,[]);let G=e=>{H(``),s(e),l(t=>Math.max(t,e)),window.scrollTo({top:0})},K=T.map(e=>e.trim()).filter(Boolean),he=/^(https?:\/\/)?[^\s/]+\.[^\s]+|^https?:\/\/(localhost|127\.0\.0\.1)/i.test(d.trim()),ge=async()=>{me(!0),H(``);let e={url:d.trim(),devices:R,prompt:h.trim(),attachments:y,source:x,checks:C,custom:K,...D===`local`?{}:I?{on:D,real:!0}:{on:D,browser:A}};try{tt({...I?{}:{devices:p},address:d.trim(),checks:C,on:D,browser:A,kind:P}),t((await X.start(e)).id)}catch(e){H(e.message),me(!1)}};return(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,Z.jsx)(Te,{steps:Xe,at:o,reached:c,onGo:e=>!U&&G(e)}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,Z.jsxs)(`section`,{"aria-labelledby":`rp-step`,className:`flex min-w-0 flex-col gap-6`,children:[(0,Z.jsx)(ye,{id:`rp-step`,icon:[le,ue,ne,k][o],title:[`Which page, on which devices?`,`What should ForgeQE do?`,`What should be checked?`,`Check and start`][o]}),pe&&(0,Z.jsx)(`p`,{role:`alert`,className:u(_.fail,`m-0`),children:pe}),o===0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(nt,{id:`rp-url`,label:`Page address`,help:e.start&&d.trim()===e.start?`The active environment's web app, from env.yaml.`:`An http or https address; sign in on the page itself.`,children:(0,Z.jsx)(a,{id:`rp-url`,type:`url`,value:d,placeholder:`https://your-app.example.com`,spellCheck:!1,onChange:e=>f(e.target.value)})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{id:`rp-on`,className:`text-body-sm font-medium`,children:`Run on`}),(0,Z.jsx)(de,{labelledBy:`rp-on`,value:D,onChange:O,options:[{id:`local`,label:`This computer`,tip:`ForgeQE's own browser, in the background`},...[`browserstack`,`testmu`].map(t=>({id:t,label:Y[t],disabled:!e.clouds[t]?.ready,tip:e.clouds[t]?.ready?`A real browser on ${Y[t]}: one session for every device`:`Not signed in: ${e.clouds[t]?.missing??`no sign-in`}. Save it in Settings › Secrets.`}))]}),D!==`local`&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 pt-2`,children:[(0,Z.jsxs)(`span`,{id:`rp-kind`,className:`text-body-sm font-medium`,children:[`Devices on `,Y[D]]}),(0,Z.jsx)(de,{labelledBy:`rp-kind`,value:P,onChange:te,options:[{id:`real`,label:`Real devices`,tip:`Phones and tablets ${Y[D]} lists now, each its own session`},{id:`browser`,label:`Emulated in a browser`,tip:`The device list emulated in one desktop browser on the cloud`}]})]}),D!==`local`&&!I&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 pt-2`,children:[(0,Z.jsxs)(`label`,{htmlFor:`rp-browser`,className:`text-body-sm font-medium`,children:[`Browser on `,Y[D]]}),(0,Z.jsx)(r,{id:`rp-browser`,value:A,onChange:e=>j(e.target.value),className:`max-w-[360px]`,children:e.browsers.map(e=>(0,Z.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,Z.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`One `,Y[D],` session for the whole run, each device in its own window of it. It takes longer to start than this computer, and counts against your `,Y[D],` plan. A page on this computer or your own network cannot be reached from there.`]})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-body-sm font-medium`,children:`Devices`}),I?ie?(0,Z.jsx)(`p`,{role:`alert`,className:u(_.fail,`m-0`),children:ie}):F?.cloud===D?(0,Z.jsx)(Ae,{devices:L,picked:se,max:F.max,onChange:ce,real:Y[D]}):(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:[`Asking `,Y[D],` for its devices…`]}):(0,Z.jsx)(Ae,{devices:e.devices,picked:p,max:e.maxPanes,onChange:m,...D===`local`?{}:{drawnBy:`${N} on ${Y[D]}`}})]}),(0,Z.jsx)(rt,{busy:U,next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ae,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>G(1),disabled:!he||!R.length,aside:he?void 0:(0,Z.jsx)(`span`,{className:`text-muted`,children:`Enter the page's address.`})})]}),o===1&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:[`ForgeQE reads your prompt as steps and does each on every device in its own browser in the background, planned for each layout from what its screen shows (a phone's menu is often behind a button). After every step it checks every device and keeps a screenshot of each. What the prompt asks to verify becomes a check. It goes on if you leave the page.`,e.planner?``:` No model is set up, so the prompt is read line by line and only plain steps work (click …, scroll down, go back, press Enter).`]}),(0,Z.jsx)(ct,{prompt:h,setPrompt:v,files:y,setFiles:b,source:x,setSource:S,flows:B,onFlowsChanged:W,onError:H}),(0,Z.jsx)(rt,{busy:U,onBack:()=>G(0),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ae,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>G(2),disabled:!h.trim(),aside:h.trim()?void 0:(0,Z.jsx)(`span`,{className:`text-muted`,children:`Say what to do.`})})]}),o===2&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,Z.jsx)(`legend`,{className:`mb-2 p-0 text-body-sm font-medium`,children:`Checked by ForgeQE on every device`}),e.checks.map(e=>(0,Z.jsxs)(`label`,{className:u(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`items-start gap-2`),children:[(0,Z.jsx)(ve,{className:`mt-1`,checked:C.includes(e.id),onCheckedChange:t=>w(t?[...C,e.id]:C.filter(t=>t!==e.id))}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-body-sm`,children:e.label}),(0,Z.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.about})]})]},e.id))]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-body-sm font-medium`,children:`Your own checks`}),(0,Z.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`In plain words, judged on each layout from what its screen shows; a finding always quotes the screen.`,e.planner?``:` No model is set up, so these are not judged.`]}),T.map((e,t)=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(a,{"aria-label":`Your check ${t+1}`,value:e,maxLength:300,placeholder:`The cart total shows without scrolling`,onChange:e=>E(T.map((n,r)=>r===t?e.target.value:n)),className:`min-w-0 flex-1`}),(0,Z.jsx)(g,{variant:`icon`,size:`icon`,"aria-label":`Remove your check ${t+1}`,"data-tip":`Remove`,onClick:()=>E(T.filter((e,n)=>n!==t)),children:(0,Z.jsx)(ee,{"aria-hidden":`true`})})]},t)),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsxs)(g,{size:`sm`,disabled:T.length>=Ze,onClick:()=>E([...T,``]),children:[(0,Z.jsx)(M,{"aria-hidden":`true`}),`Add a check`]}),Qe.map(e=>(0,Z.jsxs)(g,{size:`sm`,disabled:T.includes(e)||T.length>=Ze,onClick:()=>E([...T.filter(e=>e.trim()),e]),children:[(0,Z.jsx)(M,{"aria-hidden":`true`}),e]},e))]})]}),(0,Z.jsx)(rt,{busy:U,onBack:()=>G(1),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ae,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>G(3),aside:!C.length&&!K.length?(0,Z.jsx)(`span`,{className:`text-muted`,children:`Only what your prompt asks to verify will be checked.`}):void 0})]}),o===3&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-[minmax(0,1fr)] gap-4 @xl:grid-cols-[160px_minmax(0,1fr)]`,children:[(0,Z.jsx)(`dt`,{className:`text-body-sm font-medium text-muted`,children:`Page`}),(0,Z.jsx)(`dd`,{className:`m-0 text-body-sm [overflow-wrap:anywhere]`,children:d.trim()}),(0,Z.jsx)(`dt`,{className:`text-body-sm font-medium text-muted`,children:`Devices`}),(0,Z.jsx)(`dd`,{className:`m-0 text-body-sm`,children:z.join(`, `)}),(0,Z.jsx)(`dt`,{className:`text-body-sm font-medium text-muted`,children:`Runs on`}),(0,Z.jsx)(`dd`,{className:`m-0 text-body-sm`,children:fe}),(0,Z.jsx)(`dt`,{className:`text-body-sm font-medium text-muted`,children:`What to do`}),(0,Z.jsx)(`dd`,{className:`m-0 text-body-sm`,children:(0,Z.jsxs)(`span`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:u(`panel rounded-md bg-(--page-surface-strong) p-6`,`whitespace-pre-wrap [overflow-wrap:anywhere]`),children:h.trim()}),y.length>0&&(0,Z.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`Attached: `,y.map(e=>e.name).join(`, `)]}),(0,Z.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Read as steps and checks when the run starts; the run's page shows how.`})]})}),(0,Z.jsx)(`dt`,{className:`text-body-sm font-medium text-muted`,children:`Checks`}),(0,Z.jsxs)(`dd`,{className:`m-0 flex flex-col gap-1 text-body-sm`,children:[C.map(t=>(0,Z.jsx)(`span`,{children:e.checks.find(e=>e.id===t)?.label},t)),K.map(t=>(0,Z.jsxs)(`span`,{className:u(!e.planner&&`text-muted`),children:[`“`,t,`”`,e.planner?``:` (not judged: no model)`]},t))]})]}),(0,Z.jsx)(rt,{busy:U,onBack:()=>G(2),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(k,{"aria-hidden":`true`}),U?`Starting…`:`Start`]}),onNext:()=>void ge(),aside:(0,Z.jsx)(`span`,{className:`text-muted`,children:`Opens in ForgeQE's own browser on this computer; screenshots and findings are kept with the run.`})})]})]}),(0,Z.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,Z.jsx)(lt,{info:e,url:d,named:z,where:fe,prompt:h,files:y.length,checks:C,custom:T})})]})]})}function dt({tab:e,wide:t,action:r,runs:i,children:a}){let o=f(`responsive`);return(0,Z.jsx)(xe,{title:ge(`responsive`),page:o,label:`Responsive`,current:e,tabHref:e=>e===`agent`?n(`responsive`,Se):n(`responsive`,`runs`),onPick:e=>location.hash=e===`agent`?n(`responsive`,Se):n(`responsive`,`runs`),tabs:[{id:`runs`,label:`Runs`,icon:k,...i===void 0?{}:{n:i}}],below:(0,Z.jsx)(be,{page:o}),...t?{wide:t}:{},...r?{end:r}:{},children:a})}function ft({sub:e}){let[t,r]=(e??``).split(`/`),[i,a]=(0,J.useState)(null),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(``),d=(0,J.useCallback)(()=>{Promise.all([X.info(),X.runs()]).then(([e,t])=>{a(e),s(t.runs),l(``)},e=>l(e.message))},[]);(0,J.useEffect)(d,[d,t]);let f=!!o?.some(e=>e.status===`running`);(0,J.useEffect)(()=>{if(!f||t!==`runs`)return;let e=R(d,3e3);return()=>z(e)},[f,t,d]);let p=()=>location.hash=n(`responsive`,`new`),m=c&&(0,Z.jsx)(`p`,{role:`alert`,className:u(_.fail,`m-0`),children:c}),v=!i&&!c&&(0,Z.jsx)(x,{shape:t===`runs`?`rows`:`lines`});if(t===`new`)return(0,Z.jsxs)(dt,{tab:`runs`,children:[m,v,i&&(0,Z.jsx)(ut,{info:i,onStarted:e=>location.hash=n(`responsive`,e)})]});if(t&&De.test(t))return(0,Z.jsxs)(dt,{tab:`runs`,wide:!0,children:[m,v,(0,Z.jsx)(Ye,{id:t,tab:r},t)]});if(t!==`runs`)return(0,Z.jsx)(dt,{tab:Se});let y=o?.find(e=>e.status===`running`);return(0,Z.jsxs)(dt,{tab:`runs`,...o?{runs:o.length}:{},action:o&&!o.length?void 0:(0,Z.jsxs)(g,{variant:`accent`,disabled:!i||!!y,onClick:p,"data-tip":y?`A run is going: finish or stop it first`:`New run`,children:[(0,Z.jsx)(M,{"aria-hidden":`true`}),`New`]}),children:[m,v,i&&o&&(o.length?(0,Z.jsx)(Fe,{rows:o}):(0,Z.jsx)(h,{page:!0,icon:ie,title:`No runs yet`,action:(0,Z.jsxs)(g,{size:`sm`,onClick:p,"data-tip":`New run`,children:[(0,Z.jsx)(M,{"aria-hidden":`true`}),`New`]}),children:`Start a run to see one page on phones, tablets and desktops at once. Say in a prompt what to do (or start from a test case or a saved prompt) and what to check; each device is checked after every step, with a screenshot of each.`}))]})}export{ft as Responsive};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{n,r}from"./route-9BkoTWUE.js";import{I as i,a,z as o}from"./surface-c1kG1KPS.js";import{t as s}from"./utils-DJRAScIl.js";import{t as c}from"./jsx-runtime-LKYXHABd.js";import{I as l}from"./palette-D8aKJo_q.js";import{$ as u,b as d}from"./api-DS8XP38R.js";import{A as f,F as p,I as m,L as h,T as g,g as _,n as v}from"./pageBack-DU3mApVL.js";import{E as y,Er as b,F as x,N as S,_t as C,vn as w,z as T}from"./line-icons-Cwj9OmCz.js";import{At as E,Dn as D,K as O,Z as k,s as A,t as j}from"./frame-BANehQdX.js";import{B as M,R as N,V as P,z as F}from"./index-Db_tsLSf.js";import{d as I}from"./qualityParts-C2Y38oFp.js";var L=e(t(),1),R=c(),z={server:{label:`The server answered differently`,hint:`A call returned another status: likely a product or backend change, not the test. File it as a defect if the first run was right.`},locator:{label:`An element was not found`,hint:`The page likely changed under the test. If the change was intended, heal the test; if not, it is a product bug.`},navigation:{label:`It reached another page`,hint:`A redirect, a sign-in, a feature flag or the environment's settings may differ between the runs.`},path:{label:`It took another path`,hint:`The run did something else here: the flow changed, or the agent found another way through it.`},data:{label:`Same step, another outcome`,hint:`The step was the same but ended otherwise: the test data, the account or what the page held likely differs.`},timing:{label:`Only the timing differs`,hint:`A slow environment, or a wait that races the page: a likely cause of flaky failures.`},errors:{label:`New browser errors`,hint:`The page raised errors in the second run that it did not in the first.`},missing:{label:`A step only one run did`,hint:`One run has a step the other does not: a dialog, a retry or a changed flow.`}},B=e=>`${(e/1e3).toFixed(1)}s`,V=e=>`${e.goal.slice(0,80)} · ${e.status} · ${k(e.at)}`;function H(e,t){let n=e.find(e=>e.id===t),r=e.filter(e=>e.id!==t);if(!n)return{same:[],other:r};let i=n.goal.trim().toLowerCase();return{same:r.filter(e=>e.goal.trim().toLowerCase()===i),other:r.filter(e=>e.goal.trim().toLowerCase()!==i)}}function U({run:e,step:t}){let[n,r]=(0,L.useState)(``),[i,o]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{let n=!1;return r(``),o(!1),t?.shot&&u.shot(e,t.n,t.shot).then(e=>!n&&r(e),()=>!n&&o(!0)),()=>{n=!0}},[e,t?.n,t?.shot]),t?!t.shot||i?(0,R.jsx)(`p`,{className:s(a,`m-0 px-4 py-6 text-center text-body-sm text-muted`),children:`No screenshot`}):n?(0,R.jsx)(`img`,{src:n,alt:`Step ${t.n} of ${e}`,className:s(a,`max-h-[420px] w-full object-contain object-top`)}):(0,R.jsx)(`div`,{className:s(a,`min-h-24`)}):(0,R.jsx)(`p`,{className:s(a,`m-0 px-4 py-6 text-center text-body-sm text-muted`),children:`Not in this run`})}function W({step:e,other:t}){if(!e)return(0,R.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Not in this run`});let n=e.ok?S:T,r=new Set((t?.calls??[]).map(e=>`${e.method} ${e.path} ${e.status}`)),i=t?e.calls.filter(e=>!r.has(`${e.method} ${e.path} ${e.status}`)):[];return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2`,children:[(0,R.jsx)(n,{size:14,"aria-label":e.ok?`Passed`:`Failed`,className:s(`mt-1 flex-none`,e.ok?`text-pass`:`text-fail`)}),(0,R.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:e.action||`–`})]}),(0,R.jsxs)(`span`,{className:`truncate text-body-sm text-muted`,"data-tip":e.title?`${e.title} · ${e.page}`:e.page,children:[e.page,typeof e.ms==`number`?` · ${B(e.ms)}`:``]}),e.error&&(0,R.jsx)(`span`,{className:`text-body-sm text-fail [overflow-wrap:anywhere]`,children:e.error}),i.slice(0,3).map(e=>(0,R.jsxs)(`span`,{className:s(`truncate font-mono text-body-sm`,e.status>=400||e.failed?`text-fail`:`text-muted`),"data-tip":`${e.method} ${e.path}`,children:[e.method,` `,e.path,` `,e.failed?`no answer`:e.status]},`${e.method} ${e.path}`)),e.problems.slice(0,2).map(e=>(0,R.jsx)(`span`,{className:`truncate text-body-sm text-warn`,"data-tip":e,children:e},e))]})}function G({row:e,i:t,a:n,b:r,focus:i,open:a,onToggle:o}){let c=e.a?.n,l=e.b?.n;return(0,R.jsxs)(`li`,{id:i?`look-here`:void 0,className:s(`border-t border-line-soft`,!e.same&&`bg-warn-soft/40`,i&&`outline-2 -outline-offset-2 outline-warn`),children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] items-start gap-4 px-4 py-2 text-body-sm`,children:[(0,R.jsx)(`span`,{className:`pt-1 text-muted tabular-nums`,"data-tip":c!==void 0&&l!==void 0&&c!==l?`Step ${c} of the first run, ${l} of the second`:void 0,children:c!==void 0&&l!==void 0&&c!==l?`${c}·${l}`:c??l??t+1}),(0,R.jsx)(W,{step:e.a,other:e.b}),(0,R.jsx)(W,{step:e.b,other:e.a}),(0,R.jsx)(p,{variant:`icon`,size:`icon-sm`,"aria-label":a?`Hide screenshots`:`Show screenshots`,"aria-expanded":a,onClick:o,"data-tip":a?`Hide screenshots`:`Show screenshots`,children:(0,R.jsx)(y,{"aria-hidden":`true`,className:s(`transition-transform`,a&&`rotate-180`)})})]}),!e.same&&(0,R.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pb-2 pl-[3.75rem] text-body-sm text-ink-2`,children:[i&&e.kind&&(0,R.jsxs)(`span`,{className:`font-medium text-warn`,children:[`Look here first: `,z[e.kind].label]}),e.differences.map(e=>(0,R.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e},e))]}),(0,R.jsx)(D,{open:a,children:(0,R.jsxs)(`div`,{className:`grid grid-cols-1 items-start gap-4 px-4 pb-4 @2xl:grid-cols-2`,children:[(0,R.jsx)(U,{run:n,step:e.a}),(0,R.jsx)(U,{run:r,step:e.b})]})})]})}function K({runs:e,a:t,b:n}){let[a,o]=(0,L.useState)(t??``),[s,c]=(0,L.useState)(n??``);(0,L.useEffect)(()=>{o(t??``),c(n??``)},[t,n]);let{same:l,other:u}=H(e,a);return(0,R.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),a&&s&&a!==s&&(location.hash=r(`run-diff`,`${encodeURIComponent(a)}~${encodeURIComponent(s)}`))},children:[(0,R.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-body-sm font-medium`,children:[`First run (as expected)`,(0,R.jsxs)(i,{size:`sm`,value:a,onChange:e=>o(e.target.value),children:[(0,R.jsx)(`option`,{value:``,children:`Pick a run`}),e.map(e=>(0,R.jsx)(`option`,{value:e.id,children:V(e)},e.id))]})]}),(0,R.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-body-sm font-medium`,children:[`Second run`,(0,R.jsxs)(i,{size:`sm`,value:s,onChange:e=>c(e.target.value),disabled:!a,children:[(0,R.jsx)(`option`,{value:``,children:a?`Pick a run to compare`:`Pick the first run`}),l.length>0&&(0,R.jsx)(`optgroup`,{label:`Same test`,children:l.map(e=>(0,R.jsx)(`option`,{value:e.id,children:V(e)},e.id))}),(0,R.jsx)(`optgroup`,{label:l.length?`Other runs`:`Runs`,children:u.map(e=>(0,R.jsx)(`option`,{value:e.id,children:V(e)},e.id))})]})]}),(0,R.jsxs)(p,{size:`sm`,variant:`primary`,type:`submit`,disabled:!a||!s||a===s,children:[(0,R.jsx)(C,{"aria-hidden":`true`}),`Compare`]})]})}function q({sub:e}){let[t,i]=(0,L.useState)(null),[a,c]=(0,L.useState)(null),[y,S]=(0,L.useState)(``),[C,T]=(0,L.useState)(`all`),[D,k]=(0,L.useState)(new Set),[V,H]=(0,L.useState)(``),[U,W]=(0,L.useMemo)(()=>{let t=(e?n(e):``).split(`~`);return t.length===2&&t[0]&&t[1]?[t[0],t[1]]:[void 0,void 0]},[e]);(0,L.useEffect)(()=>{u.runs().then(e=>i(e.runs),e=>S(e.message))},[]),(0,L.useEffect)(()=>{let e=!1;if(c(null),H(``),U&&W)return u.diff(U,W).then(t=>{e||(c(t),S(``),k(new Set(t.focus===void 0?[]:[t.focus])))},t=>!e&&S(t.message)),()=>{e=!0}},[U,W]);let q=async()=>{if(a)try{let{id:e}=await d.start(`Compare the browser runs ${a.a.id} and ${a.b.id} in the reports folder, step by step (their steps.json, network.json and screenshots). Say where they first differ and whether that is a product bug, a test that needs healing, test data or the environment, and what to do next.`,{});location.hash=r(`chats`,e)}catch(e){H(e.message)}},J=a?.rows??[],Y=J.map((e,t)=>({r:e,i:t})).filter(({r:e})=>C===`all`||!e.same),X=e=>e===void 0?void 0:J[e]?.b?.n??J[e]?.a?.n,Z=X(a?.first),Q=X(a?.focus);return(0,R.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,R.jsx)(A,{}),(0,R.jsxs)(`main`,{className:s(j,`@container flex-auto gap-4`),children:[(0,R.jsx)(v,{}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,R.jsx)(E,{pixel:l[`run-diff`],size:`lg`,head:!0}),(0,R.jsx)(`h1`,{className:`m-0 text-headline-md`,children:`Runs and reports`})]}),(0,R.jsx)(O,{label:`Runs and reports`,links:N,current:`run-diff`})]}),(0,R.jsx)(P,{more:(0,R.jsx)(R.Fragment,{children:`Compare a run that passed with one that failed, the same test on two environments or devices, or a test before and after it was healed. Steps are lined up by page and action, and the first one that differs is marked with what it likely means.`}),children:`Two browser runs side by side, step by step, to see where they part.`}),y&&(0,R.jsx)(`p`,{role:`alert`,className:s(h.fail,`m-0`),children:y}),!t&&!y&&(0,R.jsx)(_,{shape:`lines`}),t&&t.length<2&&(0,R.jsx)(f,{page:!0,icon:b,title:`Two runs are needed`,action:(0,R.jsxs)(`a`,{className:m({size:`sm`}),href:r(`record`),"data-tip":`Record a flow`,children:[(0,R.jsx)(x,{"aria-hidden":`true`}),`Record`]}),children:`Run a flow twice from a chat or the Record page, or a test case on two environments, and compare them here. Every browser run keeps its steps in the reports folder.`}),t&&t.length>=2&&(0,R.jsx)(K,{runs:t,a:U,b:W}),U&&W&&!a&&!y&&(0,R.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Comparing…`}),a&&(0,R.jsxs)(`section`,{"aria-label":`Comparison`,className:`flex min-w-0 flex-col gap-4`,children:[(0,R.jsxs)(F,{label:`How the runs compare`,children:[(0,R.jsx)(M,{dot:a.first===void 0?`pass`:`warn`,value:a.first===void 0?`Same`:`Differ`,label:a.first===void 0?`every step alike`:`from step ${Z??`?`}`}),(0,R.jsx)(M,{dot:`warn`,value:a.counts.differing,label:`of ${J.length} steps differ`}),(0,R.jsx)(M,{dot:`neutral`,value:`${a.a.steps} · ${a.b.steps}`,label:`steps, first · second`}),(0,R.jsx)(M,{dot:`neutral`,value:`${B(a.a.ms)} · ${B(a.b.ms)}`,label:`time, first · second`}),(0,R.jsx)(M,{dot:`fail`,value:a.counts.calls,label:`calls answered otherwise`}),(0,R.jsx)(M,{dot:`fail`,value:a.counts.errors,label:`new browser errors`})]}),(0,R.jsx)(`div`,{className:`grid grid-cols-1 gap-2 text-body-sm @2xl:grid-cols-2`,children:[a.a,a.b].map((e,t)=>(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`text-body-sm text-muted`,children:t?`Second run`:`First run`}),(0,R.jsx)(`span`,{className:`truncate font-medium`,"data-tip":e.goal,children:e.goal}),(0,R.jsxs)(`span`,{className:`truncate text-body-sm text-muted`,"data-tip":e.startUrl??e.id,children:[e.status,` · `,I(e.at),` · `,e.host??e.id]})]},e.id))}),!a.sameGoal&&(0,R.jsx)(`p`,{className:`m-0 text-body-sm text-warn`,children:`These runs had different goals: they may not be the same test.`}),a.kind&&(0,R.jsxs)(`div`,{className:s(h.warn,`flex flex-wrap items-start gap-4`),children:[(0,R.jsx)(b,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none text-warn`}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1`,children:[(0,R.jsxs)(`span`,{className:`font-medium`,children:[`Look at step `,Q??`?`,` of the second run: `,z[a.kind].label]}),(0,R.jsx)(`span`,{className:`text-ink-2`,children:z[a.kind].hint}),a.first!==a.focus&&a.first!==void 0&&J[a.first]?.kind&&(0,R.jsxs)(`span`,{className:`text-ink-2`,children:[`They first differ at step `,Z,`: `,z[J[a.first].kind].label.toLowerCase(),`.`]})]}),(0,R.jsx)(`a`,{href:`#look-here`,onClick:e=>(e.preventDefault(),document.getElementById(`look-here`)?.scrollIntoView({behavior:o(),block:`center`})),className:`self-center text-body-sm`,children:`Go to it`})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,R.jsx)(g,{items:[{id:`all`,label:`All steps`,n:J.length},{id:`diff`,label:`Only differences`,n:a.counts.differing,alert:!0}],value:C,onChange:T})}),(0,R.jsxs)(p,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void q(),className:`ml-auto`,children:[(0,R.jsx)(w,{"aria-hidden":`true`}),`Chat`]})]}),V&&(0,R.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:V}),(0,R.jsxs)(`div`,{className:s(`surface rounded-lg bg-bg p-6 shadow-sm`,`overflow-hidden p-0`),children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] gap-4 bg-surface-muted px-4 py-2 text-body-sm text-muted`,children:[(0,R.jsx)(`span`,{children:`Step`}),(0,R.jsx)(`span`,{children:`First run`}),(0,R.jsx)(`span`,{children:`Second run`}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Screenshots`})]}),Y.length?(0,R.jsx)(`ol`,{className:`m-0 list-none p-0`,children:Y.map(({r:e,i:t})=>(0,R.jsx)(G,{row:e,i:t,a:a.a.id,b:a.b.id,focus:t===a.focus,open:D.has(t),onToggle:()=>{let e=new Set(D);e.has(t)?e.delete(t):e.add(t),k(e)}},t))}):(0,R.jsx)(`p`,{className:`m-0 border-t border-line-soft px-4 py-4 text-body-sm text-muted`,children:`Nothing differs.`})]})]})]})]})}export{z as KIND_TEXT,q as RunDiff,H as choicesFor};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{n,r}from"./route-9BkoTWUE.js";import{I as i,a,z as o}from"./surface-c1kG1KPS.js";import{t as s}from"./utils-DJRAScIl.js";import{t as c}from"./jsx-runtime-LKYXHABd.js";import{I as l}from"./palette-dAh9kV3S.js";import{$ as u,b as d}from"./api-D1PU4zye.js";import{A as f,F as p,I as m,L as h,T as g,g as _,n as v}from"./pageBack-DfGBh1Hs.js";import{E as y,Er as b,F as x,N as S,_t as C,vn as w,z as T}from"./line-icons-Cwj9OmCz.js";import{At as E,Dn as D,K as O,Z as k,s as A,t as j}from"./frame-D0MS2ZMz.js";import{B as M,R as N,V as P,z as F}from"./index-F8zkXd19.js";import{d as I}from"./qualityParts-DcRvGy-_.js";var L=e(t(),1),R=c(),z={server:{label:`The server answered differently`,hint:`A call returned another status: likely a product or backend change, not the test. File it as a defect if the first run was right.`},locator:{label:`An element was not found`,hint:`The page likely changed under the test. If the change was intended, heal the test; if not, it is a product bug.`},navigation:{label:`It reached another page`,hint:`A redirect, a sign-in, a feature flag or the environment's settings may differ between the runs.`},path:{label:`It took another path`,hint:`The run did something else here: the flow changed, or the agent found another way through it.`},data:{label:`Same step, another outcome`,hint:`The step was the same but ended otherwise: the test data, the account or what the page held likely differs.`},timing:{label:`Only the timing differs`,hint:`A slow environment, or a wait that races the page: a likely cause of flaky failures.`},errors:{label:`New browser errors`,hint:`The page raised errors in the second run that it did not in the first.`},missing:{label:`A step only one run did`,hint:`One run has a step the other does not: a dialog, a retry or a changed flow.`}},B=e=>`${(e/1e3).toFixed(1)}s`,V=e=>`${e.goal.slice(0,80)} · ${e.status} · ${k(e.at)}`;function H(e,t){let n=e.find(e=>e.id===t),r=e.filter(e=>e.id!==t);if(!n)return{same:[],other:r};let i=n.goal.trim().toLowerCase();return{same:r.filter(e=>e.goal.trim().toLowerCase()===i),other:r.filter(e=>e.goal.trim().toLowerCase()!==i)}}function U({run:e,step:t}){let[n,r]=(0,L.useState)(``),[i,o]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{let n=!1;return r(``),o(!1),t?.shot&&u.shot(e,t.n,t.shot).then(e=>!n&&r(e),()=>!n&&o(!0)),()=>{n=!0}},[e,t?.n,t?.shot]),t?!t.shot||i?(0,R.jsx)(`p`,{className:s(a,`m-0 px-4 py-6 text-center text-body-sm text-muted`),children:`No screenshot`}):n?(0,R.jsx)(`img`,{src:n,alt:`Step ${t.n} of ${e}`,className:s(a,`max-h-[420px] w-full object-contain object-top`)}):(0,R.jsx)(`div`,{className:s(a,`min-h-24`)}):(0,R.jsx)(`p`,{className:s(a,`m-0 px-4 py-6 text-center text-body-sm text-muted`),children:`Not in this run`})}function W({step:e,other:t}){if(!e)return(0,R.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Not in this run`});let n=e.ok?S:T,r=new Set((t?.calls??[]).map(e=>`${e.method} ${e.path} ${e.status}`)),i=t?e.calls.filter(e=>!r.has(`${e.method} ${e.path} ${e.status}`)):[];return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2`,children:[(0,R.jsx)(n,{size:14,"aria-label":e.ok?`Passed`:`Failed`,className:s(`mt-1 flex-none`,e.ok?`text-pass`:`text-fail`)}),(0,R.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:e.action||`–`})]}),(0,R.jsxs)(`span`,{className:`truncate text-body-sm text-muted`,"data-tip":e.title?`${e.title} · ${e.page}`:e.page,children:[e.page,typeof e.ms==`number`?` · ${B(e.ms)}`:``]}),e.error&&(0,R.jsx)(`span`,{className:`text-body-sm text-fail [overflow-wrap:anywhere]`,children:e.error}),i.slice(0,3).map(e=>(0,R.jsxs)(`span`,{className:s(`truncate font-mono text-body-sm`,e.status>=400||e.failed?`text-fail`:`text-muted`),"data-tip":`${e.method} ${e.path}`,children:[e.method,` `,e.path,` `,e.failed?`no answer`:e.status]},`${e.method} ${e.path}`)),e.problems.slice(0,2).map(e=>(0,R.jsx)(`span`,{className:`truncate text-body-sm text-warn`,"data-tip":e,children:e},e))]})}function G({row:e,i:t,a:n,b:r,focus:i,open:a,onToggle:o}){let c=e.a?.n,l=e.b?.n;return(0,R.jsxs)(`li`,{id:i?`look-here`:void 0,className:s(`border-t border-line-soft`,!e.same&&`bg-warn-soft/40`,i&&`outline-2 -outline-offset-2 outline-warn`),children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] items-start gap-4 px-4 py-2 text-body-sm`,children:[(0,R.jsx)(`span`,{className:`pt-1 text-muted tabular-nums`,"data-tip":c!==void 0&&l!==void 0&&c!==l?`Step ${c} of the first run, ${l} of the second`:void 0,children:c!==void 0&&l!==void 0&&c!==l?`${c}·${l}`:c??l??t+1}),(0,R.jsx)(W,{step:e.a,other:e.b}),(0,R.jsx)(W,{step:e.b,other:e.a}),(0,R.jsx)(p,{variant:`icon`,size:`icon-sm`,"aria-label":a?`Hide screenshots`:`Show screenshots`,"aria-expanded":a,onClick:o,"data-tip":a?`Hide screenshots`:`Show screenshots`,children:(0,R.jsx)(y,{"aria-hidden":`true`,className:s(`transition-transform`,a&&`rotate-180`)})})]}),!e.same&&(0,R.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pb-2 pl-[3.75rem] text-body-sm text-ink-2`,children:[i&&e.kind&&(0,R.jsxs)(`span`,{className:`font-medium text-warn`,children:[`Look here first: `,z[e.kind].label]}),e.differences.map(e=>(0,R.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e},e))]}),(0,R.jsx)(D,{open:a,children:(0,R.jsxs)(`div`,{className:`grid grid-cols-1 items-start gap-4 px-4 pb-4 @2xl:grid-cols-2`,children:[(0,R.jsx)(U,{run:n,step:e.a}),(0,R.jsx)(U,{run:r,step:e.b})]})})]})}function K({runs:e,a:t,b:n}){let[a,o]=(0,L.useState)(t??``),[s,c]=(0,L.useState)(n??``);(0,L.useEffect)(()=>{o(t??``),c(n??``)},[t,n]);let{same:l,other:u}=H(e,a);return(0,R.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),a&&s&&a!==s&&(location.hash=r(`run-diff`,`${encodeURIComponent(a)}~${encodeURIComponent(s)}`))},children:[(0,R.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-body-sm font-medium`,children:[`First run (as expected)`,(0,R.jsxs)(i,{size:`sm`,value:a,onChange:e=>o(e.target.value),children:[(0,R.jsx)(`option`,{value:``,children:`Pick a run`}),e.map(e=>(0,R.jsx)(`option`,{value:e.id,children:V(e)},e.id))]})]}),(0,R.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-body-sm font-medium`,children:[`Second run`,(0,R.jsxs)(i,{size:`sm`,value:s,onChange:e=>c(e.target.value),disabled:!a,children:[(0,R.jsx)(`option`,{value:``,children:a?`Pick a run to compare`:`Pick the first run`}),l.length>0&&(0,R.jsx)(`optgroup`,{label:`Same test`,children:l.map(e=>(0,R.jsx)(`option`,{value:e.id,children:V(e)},e.id))}),(0,R.jsx)(`optgroup`,{label:l.length?`Other runs`:`Runs`,children:u.map(e=>(0,R.jsx)(`option`,{value:e.id,children:V(e)},e.id))})]})]}),(0,R.jsxs)(p,{size:`sm`,variant:`primary`,type:`submit`,disabled:!a||!s||a===s,children:[(0,R.jsx)(C,{"aria-hidden":`true`}),`Compare`]})]})}function q({sub:e}){let[t,i]=(0,L.useState)(null),[a,c]=(0,L.useState)(null),[y,S]=(0,L.useState)(``),[C,T]=(0,L.useState)(`all`),[D,k]=(0,L.useState)(new Set),[V,H]=(0,L.useState)(``),[U,W]=(0,L.useMemo)(()=>{let t=(e?n(e):``).split(`~`);return t.length===2&&t[0]&&t[1]?[t[0],t[1]]:[void 0,void 0]},[e]);(0,L.useEffect)(()=>{u.runs().then(e=>i(e.runs),e=>S(e.message))},[]),(0,L.useEffect)(()=>{let e=!1;if(c(null),H(``),U&&W)return u.diff(U,W).then(t=>{e||(c(t),S(``),k(new Set(t.focus===void 0?[]:[t.focus])))},t=>!e&&S(t.message)),()=>{e=!0}},[U,W]);let q=async()=>{if(a)try{let{id:e}=await d.start(`Compare the browser runs ${a.a.id} and ${a.b.id} in the reports folder, step by step (their steps.json, network.json and screenshots). Say where they first differ and whether that is a product bug, a test that needs healing, test data or the environment, and what to do next.`,{});location.hash=r(`chats`,e)}catch(e){H(e.message)}},J=a?.rows??[],Y=J.map((e,t)=>({r:e,i:t})).filter(({r:e})=>C===`all`||!e.same),X=e=>e===void 0?void 0:J[e]?.b?.n??J[e]?.a?.n,Z=X(a?.first),Q=X(a?.focus);return(0,R.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,R.jsx)(A,{}),(0,R.jsxs)(`main`,{className:s(j,`@container flex-auto gap-4`),children:[(0,R.jsx)(v,{}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,R.jsx)(E,{pixel:l[`run-diff`],size:`lg`,head:!0}),(0,R.jsx)(`h1`,{className:`m-0 text-headline-md`,children:`Runs and reports`})]}),(0,R.jsx)(O,{label:`Runs and reports`,links:N,current:`run-diff`})]}),(0,R.jsx)(P,{more:(0,R.jsx)(R.Fragment,{children:`Compare a run that passed with one that failed, the same test on two environments or devices, or a test before and after it was healed. Steps are lined up by page and action, and the first one that differs is marked with what it likely means.`}),children:`Two browser runs side by side, step by step, to see where they part.`}),y&&(0,R.jsx)(`p`,{role:`alert`,className:s(h.fail,`m-0`),children:y}),!t&&!y&&(0,R.jsx)(_,{shape:`lines`}),t&&t.length<2&&(0,R.jsx)(f,{page:!0,icon:b,title:`Two runs are needed`,action:(0,R.jsxs)(`a`,{className:m({size:`sm`}),href:r(`record`),"data-tip":`Record a flow`,children:[(0,R.jsx)(x,{"aria-hidden":`true`}),`Record`]}),children:`Run a flow twice from a chat or the Record page, or a test case on two environments, and compare them here. Every browser run keeps its steps in the reports folder.`}),t&&t.length>=2&&(0,R.jsx)(K,{runs:t,a:U,b:W}),U&&W&&!a&&!y&&(0,R.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Comparing…`}),a&&(0,R.jsxs)(`section`,{"aria-label":`Comparison`,className:`flex min-w-0 flex-col gap-4`,children:[(0,R.jsxs)(F,{label:`How the runs compare`,children:[(0,R.jsx)(M,{dot:a.first===void 0?`pass`:`warn`,value:a.first===void 0?`Same`:`Differ`,label:a.first===void 0?`every step alike`:`from step ${Z??`?`}`}),(0,R.jsx)(M,{dot:`warn`,value:a.counts.differing,label:`of ${J.length} steps differ`}),(0,R.jsx)(M,{dot:`neutral`,value:`${a.a.steps} · ${a.b.steps}`,label:`steps, first · second`}),(0,R.jsx)(M,{dot:`neutral`,value:`${B(a.a.ms)} · ${B(a.b.ms)}`,label:`time, first · second`}),(0,R.jsx)(M,{dot:`fail`,value:a.counts.calls,label:`calls answered otherwise`}),(0,R.jsx)(M,{dot:`fail`,value:a.counts.errors,label:`new browser errors`})]}),(0,R.jsx)(`div`,{className:`grid grid-cols-1 gap-2 text-body-sm @2xl:grid-cols-2`,children:[a.a,a.b].map((e,t)=>(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`text-body-sm text-muted`,children:t?`Second run`:`First run`}),(0,R.jsx)(`span`,{className:`truncate font-medium`,"data-tip":e.goal,children:e.goal}),(0,R.jsxs)(`span`,{className:`truncate text-body-sm text-muted`,"data-tip":e.startUrl??e.id,children:[e.status,` · `,I(e.at),` · `,e.host??e.id]})]},e.id))}),!a.sameGoal&&(0,R.jsx)(`p`,{className:`m-0 text-body-sm text-warn`,children:`These runs had different goals: they may not be the same test.`}),a.kind&&(0,R.jsxs)(`div`,{className:s(h.warn,`flex flex-wrap items-start gap-4`),children:[(0,R.jsx)(b,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none text-warn`}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1`,children:[(0,R.jsxs)(`span`,{className:`font-medium`,children:[`Look at step `,Q??`?`,` of the second run: `,z[a.kind].label]}),(0,R.jsx)(`span`,{className:`text-ink-2`,children:z[a.kind].hint}),a.first!==a.focus&&a.first!==void 0&&J[a.first]?.kind&&(0,R.jsxs)(`span`,{className:`text-ink-2`,children:[`They first differ at step `,Z,`: `,z[J[a.first].kind].label.toLowerCase(),`.`]})]}),(0,R.jsx)(`a`,{href:`#look-here`,onClick:e=>(e.preventDefault(),document.getElementById(`look-here`)?.scrollIntoView({behavior:o(),block:`center`})),className:`self-center text-body-sm`,children:`Go to it`})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,R.jsx)(g,{items:[{id:`all`,label:`All steps`,n:J.length},{id:`diff`,label:`Only differences`,n:a.counts.differing,alert:!0}],value:C,onChange:T})}),(0,R.jsxs)(p,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void q(),className:`ml-auto`,children:[(0,R.jsx)(w,{"aria-hidden":`true`}),`Chat`]})]}),V&&(0,R.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:V}),(0,R.jsxs)(`div`,{className:s(`surface rounded-lg bg-bg p-6 shadow-sm`,`overflow-hidden p-0`),children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] gap-4 bg-surface-muted px-4 py-2 text-body-sm text-muted`,children:[(0,R.jsx)(`span`,{children:`Step`}),(0,R.jsx)(`span`,{children:`First run`}),(0,R.jsx)(`span`,{children:`Second run`}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Screenshots`})]}),Y.length?(0,R.jsx)(`ol`,{className:`m-0 list-none p-0`,children:Y.map(({r:e,i:t})=>(0,R.jsx)(G,{row:e,i:t,a:a.a.id,b:a.b.id,focus:t===a.focus,open:D.has(t),onToggle:()=>{let e=new Set(D);e.has(t)?e.delete(t):e.add(t),k(e)}},t))}):(0,R.jsx)(`p`,{className:`m-0 border-t border-line-soft px-4 py-4 text-body-sm text-muted`,children:`Nothing differs.`})]})]})]})]})}export{z as KIND_TEXT,q as RunDiff,H as choicesFor};
|