@capagents/forgeqe 2.8.7 → 2.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/docs-site/docs/search.js +1 -1
  2. package/dist/docs-site/docs/web-app/index.html +34 -19
  3. package/dist/web/assets/Agent-Cp8VlBIz.js +4 -0
  4. package/dist/web/assets/ApiTests-BcZLc09C.js +10 -0
  5. package/dist/web/assets/Browse-C_YjgIEb.js +1 -0
  6. package/dist/web/assets/{Chat-fm1mQ6Dn.js → Chat-BoCGL6_O.js} +3 -3
  7. package/dist/web/assets/{CommandPalette-CKjhw2tZ.js → CommandPalette-BfM5HzzB.js} +1 -1
  8. package/dist/web/assets/Cost-TS6CXmoR.js +1 -0
  9. package/dist/web/assets/Data-CBPzLyv3.js +6 -0
  10. package/dist/web/assets/Evidence-BZq0G649.js +1 -0
  11. package/dist/web/assets/Explore-l6Hdu8Sv.js +2 -0
  12. package/dist/web/assets/{Features-C524ttY_.js → Features-YYJcXLBf.js} +1 -1
  13. package/dist/web/assets/Flags-C60CLbzH.js +2 -0
  14. package/dist/web/assets/Flaky-BkLguGXu.js +1 -0
  15. package/dist/web/assets/{ForceGraph-CF_VTwpL.js → ForceGraph-D1krkEJe.js} +1 -1
  16. package/dist/web/assets/Impact-640wqe0S.js +3 -0
  17. package/dist/web/assets/Jobs-C97GqHLF.js +5 -0
  18. package/dist/web/assets/KindPage-Bux228tV.js +6 -0
  19. package/dist/web/assets/Migration-VTuXJ3MF.js +2 -0
  20. package/dist/web/assets/Product-BNDHj6KV.js +7 -0
  21. package/dist/web/assets/Production-BC-kcNIt.js +1 -0
  22. package/dist/web/assets/Quality-CuSQTvtJ.js +1 -0
  23. package/dist/web/assets/{Readiness-BB0cXc33.js → Readiness-Bh2cynJx.js} +1 -1
  24. package/dist/web/assets/Record-DJfuaIqW.js +2 -0
  25. package/dist/web/assets/Regression-oW_4rSE7.js +5 -0
  26. package/dist/web/assets/{Reports-DKUL0k5P.js → Reports-CBkl7Abx.js} +2 -2
  27. package/dist/web/assets/Response-f5217Gw2.js +4 -0
  28. package/dist/web/assets/{RunDiff-LRfdsMSV.js → RunDiff-B7o9vQBr.js} +1 -1
  29. package/dist/web/assets/Runs-CkdASpHU.js +2 -0
  30. package/dist/web/assets/TestCases-BPif-KCg.js +1 -0
  31. package/dist/web/assets/TestData-CQAI8n3o.js +2 -0
  32. package/dist/web/assets/TestDebt-C94phbAj.js +1 -0
  33. package/dist/web/assets/Tosca-CX7hZsNJ.js +2 -0
  34. package/dist/web/assets/{WhatsNew-BER-EaIL.js → WhatsNew-ktL7koKS.js} +1 -1
  35. package/dist/web/assets/dataParts-DD_0rviO.js +3 -0
  36. package/dist/web/assets/{families-CEvnlSA9.js → families-7ZW63NF1.js} +1 -1
  37. package/dist/web/assets/frame-Ct3Ey3bQ.js +4 -0
  38. package/dist/web/assets/index-DvuGI8X3.css +2 -0
  39. package/dist/web/assets/index-tdO1bZWq.js +45 -0
  40. package/dist/web/assets/{logos-BhPgCy8m.js → logos-Czko8FVx.js} +1 -1
  41. package/dist/web/assets/{parts-BSjKRNsS.js → parts-ryIgw8NG.js} +1 -1
  42. package/dist/web/assets/{productParts-DRnaru9e.js → productParts-CSw1V5I9.js} +1 -1
  43. package/dist/web/assets/qualityParts-Czf68wgs.js +1 -0
  44. package/dist/web/assets/segmented-CCfjZKVa.js +1 -0
  45. package/dist/web/assets/{thread-D9rH8Pqa.js → thread-_hyYtCeH.js} +1 -1
  46. package/dist/web/assets/{usePageChat-Dc5vwcs6.js → usePageChat-Cm84Zkf4.js} +1 -1
  47. package/dist/web/index.html +3 -3
  48. package/docs/WEB_APP.md +23 -15
  49. package/package.json +1 -1
  50. package/py/forgeqe_engine/browser.py +119 -1
  51. package/py/forgeqe_engine/logins.py +8 -6
  52. package/py/forgeqe_engine/recordsession.py +8 -8
  53. package/py/forgeqe_engine/service.py +18 -1
  54. package/dist/web/assets/Agent-D4tEZgR9.js +0 -4
  55. package/dist/web/assets/ApiTests-D1-uM3Fv.js +0 -10
  56. package/dist/web/assets/Cost-B8e9LW5N.js +0 -1
  57. package/dist/web/assets/Data-CKh8Xfjg.js +0 -6
  58. package/dist/web/assets/Evidence-CB_eYXrI.js +0 -1
  59. package/dist/web/assets/Explore-8NeU-stI.js +0 -2
  60. package/dist/web/assets/Flags-CS0Z1uKT.js +0 -2
  61. package/dist/web/assets/Flaky-Dove4iHu.js +0 -1
  62. package/dist/web/assets/Impact-BtXbEuuU.js +0 -3
  63. package/dist/web/assets/Jobs-C87BMhJy.js +0 -5
  64. package/dist/web/assets/KindPage-CrIV2IIg.js +0 -6
  65. package/dist/web/assets/Migration-DVcQFlj_.js +0 -2
  66. package/dist/web/assets/Product-DqS1GJ3S.js +0 -7
  67. package/dist/web/assets/Production-hjSrU2D4.js +0 -1
  68. package/dist/web/assets/Quality-DKKQwotS.js +0 -1
  69. package/dist/web/assets/Record-CJDeATYI.js +0 -2
  70. package/dist/web/assets/Regression-C7pe1hch.js +0 -5
  71. package/dist/web/assets/Response-CeWmqeLe.js +0 -4
  72. package/dist/web/assets/Runs-Zas3nnfB.js +0 -2
  73. package/dist/web/assets/TestCases-DYEIEFbv.js +0 -1
  74. package/dist/web/assets/TestData-CL9aY1ud.js +0 -2
  75. package/dist/web/assets/TestDebt-htU1GPXa.js +0 -1
  76. package/dist/web/assets/Tosca-DxTzAjuU.js +0 -2
  77. package/dist/web/assets/dataParts-JknpHCgp.js +0 -3
  78. package/dist/web/assets/frame-ihNrEidT.js +0 -4
  79. package/dist/web/assets/index-3D5uDfcc.css +0 -2
  80. package/dist/web/assets/index-DHLqPOSP.js +0 -45
  81. package/dist/web/assets/qualityParts-D0zOx0qp.js +0 -1
  82. package/dist/web/assets/segmented-BgffNagW.js +0 -1
@@ -1 +0,0 @@
1
- import{Ao as e,Do as t,Ea as n,Fn as r,Mt as i,Oa as a,Qr as o,To as s,Vn as c,da as l,dn as u,do as d,dt as f,et as p,gt as m,la as h,pr as g,qn as _,st as v,ua as y,zi as b}from"./frame-ihNrEidT.js";import{d as x,r as S,s as C}from"./index-DHLqPOSP.js";var w=e(t(),1),T=s(),E=[`critical`,`serious`,`moderate`,`minor`],D={critical:`fail`,serious:`fail`,moderate:`warn`,minor:`neutral`},O=[{key:`lcp`,label:`LCP`,good:2500,poor:4e3,unit:`ms`},{key:`cls`,label:`CLS`,good:.1,poor:.25,unit:``},{key:`inp`,label:`INP`,good:200,poor:500,unit:`ms`},{key:`fcp`,label:`FCP`,good:1800,poor:3e3,unit:`ms`},{key:`ttfb`,label:`TTFB`,good:800,poor:1800,unit:`ms`},{key:`load`,label:`Load`,good:1/0,poor:1/0,unit:`ms`}],k={same:{label:`Same`,tone:`pass`},changed:{label:`Changed`,tone:`warn`},new:{label:`New baseline`,tone:`neutral`},no_baseline:{label:`No baseline`,tone:`neutral`}},A=e=>new Date(e).toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),j=(e,t)=>t?e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`:e.toFixed(3).replace(/0+$/,``).replace(/\.$/,``),M=(e,t)=>`${e} ${t}${e===1?``:`s`}`,N=e=>e.replace(/(data:[\w/+.-]+;base64,)[A-Za-z0-9+/=]{24,}/g,`$1…`),P=e=>{try{let t=new URL(e),n=t.pathname===`/`?``:t.pathname.length>44?`${t.pathname.slice(0,20)}…${t.pathname.slice(-20)}`:t.pathname;return`${t.host}${n}${t.search?`?…`:``}`}catch{return e.length>70?`${e.slice(0,68)}…`:e}},F=e=>!!(e.breaches||e.a11y?.failed||e.perf.over||e.visual?.changed);function I({run:e,standard:t,disclaimer:n}){let i=e.report,[o,s]=(0,w.useState)(new Set),[c,l]=(0,w.useState)(`all`),[u,d]=(0,w.useState)(!1);if(!i?.accessibility.pages)return(0,T.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`This run has no accessibility results: report.accessibility was off, or the run visited no page.`});let f=i.accessibility,h=i.breaches.filter(e=>e.kind===`accessibility`),_=f.failed.filter(e=>c===`all`||e.impact===c).sort((e,t)=>E.indexOf(e.impact)-E.indexOf(t.impact)||t.count-e.count),v=e=>{let t=new Set(o);t.has(e)?t.delete(e):t.add(e),s(t)};return(0,T.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,T.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[t,` with `,i.engine||`axe`,` on `,M(f.pages,`page`),`: `,(0,T.jsxs)(`span`,{className:`text-pass`,children:[M(f.passed.length,`rule`),` passed`]}),`, `,(0,T.jsxs)(`span`,{className:f.failed.length?`text-fail`:``,children:[f.failed.length,` failed`]}),`.`,` `,i.budgets.accessibility?h.length?`${M(h.length,`budget`)} exceeded.`:`Within the budget.`:`No budget set, so nothing here fails the run.`]}),h.map((e,t)=>(0,T.jsxs)(`p`,{className:`m-0 rounded-[8px] bg-fail-soft px-3 py-1.5 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Over budget · `,P(e.page),`: `,e.text]},t)),f.failed.length>0&&(0,T.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,T.jsx)(`div`,{role:`group`,"aria-label":`Impact`,className:`flex flex-wrap gap-1`,children:[`all`,...E].map(e=>{let t=e===`all`?f.failed.length:f.failed.filter(t=>t.impact===e).length;return e!==`all`&&!t?null:(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":c===e,onClick:()=>l(e),className:a(`inline-flex min-h-7 cursor-pointer items-center gap-1 rounded-[6px] border px-2 text-[12px] capitalize`,c===e?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:text-ink`),children:[e,` `,(0,T.jsx)(`span`,{className:`tabular-nums opacity-75`,children:t})]},e)})})}),f.failed.length?(0,T.jsx)(p,{label:`Failed rules`,placeholder:`Find a rule, WCAG criterion, page or element`,resetKey:c,empty:`Nothing matches.`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[96px] py-1.5 pl-3 font-medium`,children:`Impact`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Rule`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @2xl:table-cell`,children:`WCAG`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Elements`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Pages`})]}),children:_.map(t=>{let n=o.has(t.rule),i=e.examples[t.rule]??[];return(0,T.jsxs)(w.Fragment,{children:[(0,T.jsxs)(`tr`,{onClick:()=>v(t.rule),"aria-expanded":n,className:a(`cursor-pointer border-t border-line-soft align-top hover:bg-surface-muted`,n&&`bg-surface-muted`),children:[(0,T.jsx)(`td`,{className:`py-1.5 pl-3`,children:(0,T.jsx)(m,{tone:D[t.impact],className:`min-h-5 px-2 text-[11px] capitalize`,children:t.impact})}),(0,T.jsx)(`td`,{className:`py-1.5 pr-3`,children:(0,T.jsxs)(`span`,{className:`flex items-start gap-1`,children:[(0,T.jsx)(r,{size:13,"aria-hidden":`true`,className:a(`mt-0.5 flex-none text-muted transition-transform`,!n&&`-rotate-90`)}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,T.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:t.help}),(0,T.jsx)(`span`,{className:`font-mono text-[11.5px] text-muted`,children:t.rule})]})]})}),(0,T.jsx)(`td`,{className:`hidden py-1.5 pr-3 whitespace-nowrap text-ink-2 @2xl:table-cell`,children:t.wcag?`${t.wcag}${t.level?` · ${t.level}`:``}`:`–`}),(0,T.jsx)(`td`,{className:`py-1.5 pr-3 text-right tabular-nums`,children:t.count}),(0,T.jsx)(`td`,{className:`py-1.5 pr-3 text-right tabular-nums`,children:t.pages})]}),n&&(0,T.jsxs)(`tr`,{className:`bg-surface-muted`,children:[(0,T.jsx)(`td`,{}),(0,T.jsx)(`td`,{colSpan:4,className:`pr-3 pb-3`,children:(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5 pl-[17px]`,children:[i.length?i.map((e,t)=>(0,T.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-[8px] border border-line-soft bg-bg px-2.5 py-1.5`,children:[(0,T.jsxs)(`span`,{className:`flex min-w-0 gap-1.5 text-[12px] text-muted`,children:[(0,T.jsx)(`span`,{className:`flex-none`,"data-tip":e.page,children:P(e.page)}),e.target&&(0,T.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-[11.5px]`,"data-tip":e.target,children:[`· `,e.target]})]}),e.html&&(0,T.jsx)(`code`,{className:`line-clamp-3 font-mono text-[12px] break-all text-ink-2`,children:N(e.html)})]},t)):(0,T.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`No elements were kept for this rule.`}),t.helpUrl&&x(t.helpUrl)===`web`&&(0,T.jsxs)(`a`,{href:t.helpUrl,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-1 self-start text-[12.5px]`,children:[`How to fix it `,(0,T.jsx)(g,{size:12,"aria-hidden":`true`})]})]})})]})]},t.rule)})}):(0,T.jsx)(`p`,{className:`m-0 text-[13px] text-pass`,children:`No rule failed on the pages this run visited.`}),f.passed.length>0&&(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,T.jsxs)(`button`,{type:`button`,"aria-expanded":u,onClick:()=>d(!u),className:`flex cursor-pointer items-center gap-1 self-start border-0 bg-transparent p-0 text-[13px] font-medium text-ink`,children:[(0,T.jsx)(r,{size:13,"aria-hidden":`true`,className:a(`text-muted transition-transform`,!u&&`-rotate-90`)}),`Rules that passed `,(0,T.jsx)(`span`,{className:`font-normal text-muted tabular-nums`,children:f.passed.length})]}),u&&(0,T.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-1 p-0`,children:f.passed.map(e=>(0,T.jsx)(`li`,{className:`rounded-[6px] bg-pass-soft px-2 py-0.5 font-mono text-[11.5px] text-pass`,children:e},e))})]}),(0,T.jsx)(`p`,{className:`m-0 text-[12px] text-muted`,children:n})]})}function L({run:e}){let t=e.report;if(!t?.performance.pages.length)return(0,T.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`This run has no timings: the run visited no page.`});let n=(e,t)=>e>t.poor?`poor`:e>t.good?`needs improvement`:`good`,r={poor:`text-fail`,"needs improvement":`text-warn`,good:`text-pass`},i=t.breaches.filter(e=>e.kind===`performance`);return(0,T.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,T.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Core Web Vitals of each page, from one visit in the browser the agent drove, against Google's thresholds: `,(0,T.jsx)(`span`,{className:`text-pass`,children:`good`}),`, `,(0,T.jsx)(`span`,{className:`text-warn`,children:`needs improvement`}),`, `,(0,T.jsx)(`span`,{className:`text-fail`,children:`poor`}),`.`,` `,t.budgets.performance?`Pages over quality.budgets.performance are marked.`:`No performance budget set: nothing fails on timings.`]}),i.map((e,t)=>(0,T.jsxs)(`p`,{className:`m-0 rounded-[8px] bg-fail-soft px-3 py-1.5 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Over budget · `,P(e.page),`: `,e.text]},t)),(0,T.jsx)(p,{label:`Timings`,minWidth:720,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Page`}),O.map(e=>(0,T.jsx)(`th`,{className:`px-2 py-1.5 text-right font-medium`,"data-tip":e.label,children:e.label},e.key)),(0,T.jsx)(`th`,{className:`px-2 py-1.5 text-right font-medium`,children:`Requests`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 pl-2 text-right font-medium`,children:`Size`})]}),children:t.performance.pages.map((e,t)=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft align-top`,children:[(0,T.jsxs)(`td`,{className:`py-1.5 pr-3 pl-3`,children:[(0,T.jsx)(`span`,{className:`block max-w-[340px] truncate font-mono text-[12px]`,"data-tip":e.url,children:P(e.url)}),e.over.length>0&&(0,T.jsxs)(`span`,{className:`text-[11.5px] text-fail`,children:[`over: `,e.over.join(`, `)]})]}),O.map(t=>{let i=e[t.key];return(0,T.jsxs)(`td`,{className:a(`px-2 py-1.5 text-right whitespace-nowrap tabular-nums`,typeof i==`number`&&t.good!==1/0?r[n(i,t)]:typeof i==`number`?`text-ink-2`:`text-muted`),children:[typeof i==`number`?j(i,t.unit):`–`,typeof i==`number`&&t.good!==1/0&&(0,T.jsxs)(`span`,{className:`sr-only`,children:[` (`,n(i,t),`)`]})]},t.key)}),(0,T.jsx)(`td`,{className:`px-2 py-1.5 text-right whitespace-nowrap text-muted tabular-nums`,children:e.requests??`–`}),(0,T.jsx)(`td`,{className:`py-1.5 pr-3 pl-2 text-right whitespace-nowrap text-muted tabular-nums`,children:e.kb===void 0?`–`:`${e.kb} KB`})]},t))}),(0,T.jsxs)(`p`,{className:`m-0 text-[12px] text-muted`,children:[O.filter(e=>e.good!==1/0).map(e=>`${e.label}: good up to ${j(e.good,e.unit)}, poor over ${j(e.poor,e.unit)}`).join(` · `),`. Lab values from one visit, not data from real users.`]})]})}function R({run:e,index:t,which:n,label:r}){let[i,a]=(0,w.useState)(``),[s,c]=(0,w.useState)(!1);return(0,w.useEffect)(()=>{let r=!1;return a(``),c(!1),d.image(e,t,n).then(e=>!r&&a(e),()=>!r&&c(!0)),()=>{r=!0}},[e,t,n]),(0,T.jsxs)(`figure`,{className:`m-0 flex min-w-0 flex-col gap-1.5`,children:[(0,T.jsx)(`figcaption`,{className:`text-[12px] font-medium text-muted`,children:r}),i?(0,T.jsx)(`img`,{src:i,alt:`${r} of the page`,className:`block h-auto w-full rounded-[10px] border border-line-soft bg-surface-muted`}):(0,T.jsx)(`span`,{className:`flex h-[120px] items-center justify-center gap-2 rounded-[10px] border border-line-soft bg-surface-muted text-[12px] text-muted`,children:s?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(u,{icon:o,size:14}),` Not available`]}):`Loading…`})]})}function z({run:e,budget:t,onChange:i}){let[o,s]=(0,w.useState)(null),[l,u]=(0,w.useState)(``),[h,g]=(0,w.useState)(!1),[_,v]=(0,w.useState)(``),[y,x]=(0,w.useState)(new Set),[S,C]=(0,w.useState)(`all`),E=e.visual?.pages??[],D=E.find(e=>e.status===`changed`)?.index;(0,w.useEffect)(()=>x(D===void 0?new Set:new Set([D])),[e.id,D]);let O=async e=>{g(!0),v(``);try{i(await e()),s(null),u(``)}catch(e){v(e.message)}finally{g(!1)}};if(!e.visual)return e.captured?(0,T.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,T.jsxs)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:[`This run captured `,M(e.captured,`page`),` but they were not compared with the baselines yet.`]}),(0,T.jsxs)(n,{size:`sm`,variant:`primary`,disabled:h,onClick:()=>O(()=>d.compare(e.id)),children:[(0,T.jsx)(b,{"aria-hidden":`true`}),`Compare with the baselines`]}),_&&(0,T.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:_})]}):(0,T.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`This run has no visual captures: quality.visual.enabled was off, or the run visited no page.`});let A=E.filter(e=>e.status===`changed`),j=(S===`changed`?A:E).slice().sort((e,t)=>Number(t.status===`changed`)-Number(e.status===`changed`)||(t.diffPercent??0)-(e.diffPercent??0)),N=e=>{let t=new Set(y);t.has(e)?t.delete(e):t.add(e),x(t)};return(0,T.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,T.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Each page captured with animations frozen and masked regions hidden, against its approved baseline. `,t?`A page over quality.budgets.visual fails the run.`:`No visual budget set: a change does not fail the run.`]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,T.jsx)(`div`,{role:`group`,"aria-label":`Show`,className:`flex gap-1`,children:[[`all`,`All pages`,E.length],[`changed`,`Changed`,A.length]].map(([e,t,n])=>(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":S===e,onClick:()=>C(e),className:a(`inline-flex min-h-7 cursor-pointer items-center gap-1 rounded-[6px] border px-2 text-[12px]`,S===e?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:text-ink`),children:[t,` `,(0,T.jsx)(`span`,{className:`tabular-nums opacity-75`,children:n})]},e))}),(0,T.jsx)(`span`,{className:`flex-1`}),A.length>1&&(0,T.jsxs)(n,{size:`sm`,disabled:h,onClick:()=>s(A.map(e=>e.url)),children:[`Approve all `,A.length,` changes`]})]}),o&&(0,T.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Approve as baseline`,className:`flex flex-col gap-2 rounded-[10px] border border-accent-line bg-accent-soft p-3 text-[13px]`,children:[(0,T.jsxs)(`span`,{className:`font-medium`,children:[`Make this run's capture the baseline of `,o.length===1?P(o[0]):M(o.length,`page`),`?`]}),(0,T.jsx)(`span`,{className:`text-ink-2`,children:`Later runs are compared with it. Approve only a change that was intended; one that was not is a visual defect.`}),(0,T.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[`Why it changed (kept with the baseline)`,(0,T.jsx)(f,{size:`sm`,value:l,maxLength:300,placeholder:`New checkout banner`,onChange:e=>u(e.target.value),className:`max-w-[480px] bg-bg`})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,T.jsxs)(n,{size:`sm`,variant:`primary`,disabled:h,onClick:()=>O(()=>d.approve(e.id,o,l.trim()||void 0)),children:[(0,T.jsx)(c,{"aria-hidden":`true`}),`Approve`]}),(0,T.jsx)(n,{size:`sm`,onClick:()=>s(null),children:`Cancel`})]})]}),_&&(0,T.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:_}),(0,T.jsx)(p,{label:`Pages against their baselines`,fixed:!0,resetKey:S,empty:`No page changed.`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Page`}),(0,T.jsx)(`th`,{className:`hidden w-[110px] py-1.5 pr-3 font-medium @2xl:table-cell`,children:`Size`}),(0,T.jsx)(`th`,{className:`w-[90px] py-1.5 pr-3 text-right font-medium`,children:`Changed`}),(0,T.jsx)(`th`,{className:`w-[120px] py-1.5 pr-3 font-medium`,children:`Result`}),(0,T.jsx)(`th`,{className:`w-[96px] py-1.5 pr-3`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Approve`})})]}),children:j.map(t=>{let i=y.has(t.index);return(0,T.jsxs)(w.Fragment,{children:[(0,T.jsxs)(`tr`,{onClick:()=>N(t.index),"aria-expanded":i,className:a(`cursor-pointer border-t border-line-soft align-top hover:bg-surface-muted`,i&&`bg-surface-muted`),children:[(0,T.jsx)(`td`,{className:`py-1.5 pr-3 pl-3`,children:(0,T.jsxs)(`span`,{className:`flex items-start gap-1`,children:[(0,T.jsx)(r,{size:13,"aria-hidden":`true`,className:a(`mt-0.5 flex-none text-muted transition-transform`,!i&&`-rotate-90`)}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,T.jsx)(`span`,{className:`truncate`,"data-tip":t.title||t.url,children:t.title||P(t.url)}),(0,T.jsx)(`span`,{className:`truncate font-mono text-[11.5px] text-muted`,"data-tip":t.url,children:P(t.url)})]})]})}),(0,T.jsxs)(`td`,{className:`hidden py-1.5 pr-3 whitespace-nowrap text-muted @2xl:table-cell`,children:[t.size||`–`,t.resized?` · resized ${t.resized}`:``]}),(0,T.jsx)(`td`,{className:a(`py-1.5 pr-3 text-right whitespace-nowrap tabular-nums`,t.over?`text-fail`:t.status===`changed`?`text-warn`:`text-muted`),children:t.status===`changed`?`${t.diffPercent}%${t.limit===void 0?``:` / ${t.limit}%`}`:`–`}),(0,T.jsx)(`td`,{className:`py-1.5 pr-3`,children:(0,T.jsx)(m,{tone:t.over?`fail`:k[t.status].tone,className:`min-h-5 px-2 text-[11px]`,children:t.over?`Over budget`:k[t.status].label})}),(0,T.jsx)(`td`,{className:`py-1 pr-3 text-right`,onClick:e=>e.stopPropagation(),children:t.status===`changed`&&(0,T.jsx)(n,{size:`sm`,variant:`ghost`,disabled:h,onClick:()=>s([t.url]),className:`min-h-7`,children:`Approve`})})]}),i&&(0,T.jsx)(`tr`,{className:`bg-surface-muted`,children:(0,T.jsx)(`td`,{colSpan:5,className:`px-3 pb-3`,children:(0,T.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-3`,children:[t.images.baseline&&(0,T.jsx)(R,{run:e.id,index:t.index,which:`baseline`,label:`Baseline`}),t.images.current&&(0,T.jsx)(R,{run:e.id,index:t.index,which:`current`,label:`This run`}),t.images.diff&&(0,T.jsx)(R,{run:e.id,index:t.index,which:`diff`,label:`Difference (in red)`})]})})})]},t.index)})})]})}function B({values:e}){if(e.length<2)return null;let t=Math.max(1,...e),n=e.map((n,r)=>`${r/(e.length-1)*96+2},${22-n/t*20}`).join(` `);return(0,T.jsx)(`svg`,{width:`100`,height:`24`,viewBox:`0 0 100 24`,"aria-label":`Violations over the last ${e.length} runs: ${e.join(`, `)}`,role:`img`,className:`flex-none text-muted`,children:(0,T.jsx)(`polyline`,{points:n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinejoin:`round`})})}function V({icon:e,className:t,lines:n}){return n.length?(0,T.jsxs)(`span`,{className:a(`flex items-start gap-1.5 text-[13px]`,t),children:[(0,T.jsx)(u,{icon:e,size:14,className:`mt-0.5 flex-none`}),(0,T.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:n.join(` · `)})]}):null}function H({trends:e}){return e.length?(0,T.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.map(e=>{let t=e.a11y.latest?E.reduce((t,n)=>t+(e.a11y.latest[n]||0),0):void 0;return(0,T.jsxs)(`li`,{className:`flex flex-col gap-1.5 border-t border-line-soft py-3 first:border-t-0`,children:[(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-3`,children:[(0,T.jsx)(`span`,{className:`min-w-0 flex-[1_1_240px] truncate font-mono text-[13px]`,"data-tip":e.page,children:/^https?:/.test(e.page)?P(e.page):e.page}),(0,T.jsx)(B,{values:e.a11y.trail}),(0,T.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[M(e.runs,`run`),t===void 0?``:` · ${M(t,`violation`)} now`]})]}),(0,T.jsx)(V,{icon:y,className:`text-fail`,lines:[...e.perf.worse.map(e=>`slower: ${e}`),...e.a11y.newRules.map(e=>`newly failing: ${e}`)]}),(0,T.jsx)(V,{icon:h,className:`text-pass`,lines:[...e.perf.better.map(e=>`faster: ${e}`),...e.a11y.fixedRules.map(e=>`fixed: ${e}`)]})]},e.page)})}):(0,T.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No history yet: every browser run adds each page's accessibility and timings to quality-history.json in the reports folder.`})}var U={accessibility:e=>!!e.a11y?.pages,performance:e=>e.perf.pages>0,visual:e=>!!e.visual||e.captured>0},W={accessibility:e=>!!e.a11y?.failed,performance:e=>e.perf.over>0,visual:e=>!!(e.visual?.changed||e.visual?.over)},G=(e,t)=>t.filter(U[e]);function K({kind:e,runs:t}){let[n,r]=(0,w.useState)(`all`),o=G(e,t),s=n===`attention`?o.filter(W[e]):o,u=t=>location.hash=i(e,encodeURIComponent(t)),d=`py-2 pr-3 text-right tabular-nums`;return(0,T.jsx)(p,{label:`Runs`,placeholder:`Find a run by what it did`,resetKey:n,empty:`Nothing matches.`,tools:(0,T.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,T.jsx)(v,{items:[{id:`all`,label:`All`,n:o.length},{id:`attention`,label:`Needs a look`,n:o.filter(W[e]).length,alert:!0}],value:n,onChange:r})}),head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[46%] py-1.5 pr-3 pl-3 font-medium`,children:`Run`}),e===`accessibility`&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Rules failed`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @2xl:table-cell`,children:`Critical · serious`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @3xl:table-cell`,children:`Moderate · minor`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @xl:table-cell`,children:`Pages`})]}),e===`performance`&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Over budget`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @xl:table-cell`,children:`Pages timed`})]}),e===`visual`&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Changed`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @2xl:table-cell`,children:`New`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @xl:table-cell`,children:`Same`})]}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`When`})]}),children:s.map(t=>{let n=W[e](t),r=(t.over?.[e]??0)>0;return(0,T.jsxs)(`tr`,{onClick:()=>u(t.id),className:`cursor-pointer border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(r?_:n?l:c,{size:15,"aria-label":r?`Over a budget`:n?`Needs a look`:`Within budgets`,className:a(`flex-none`,r?`text-fail`:n?`text-warn`:`text-pass`)}),(0,T.jsx)(`a`,{href:i(e,encodeURIComponent(t.id)),onClick:e=>e.stopPropagation(),"data-tip":t.goal,className:`truncate text-ink no-underline hover:underline`,children:t.goal})]})}),e===`accessibility`&&t.a11y&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`td`,{className:a(d,t.a11y.failed?`text-fail`:`text-muted`),children:t.a11y.failed}),(0,T.jsx)(`td`,{className:a(d,`hidden @2xl:table-cell`,t.a11y.critical+t.a11y.serious?`text-fail`:`text-muted`),children:`${t.a11y.critical} · ${t.a11y.serious}`}),(0,T.jsx)(`td`,{className:a(d,`hidden text-muted @3xl:table-cell`),children:`${t.a11y.moderate} · ${t.a11y.minor}`}),(0,T.jsx)(`td`,{className:a(d,`hidden text-muted @xl:table-cell`),children:t.a11y.pages})]}),e===`performance`&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`td`,{className:a(d,t.perf.over?`text-fail`:`text-muted`),children:t.perf.over}),(0,T.jsx)(`td`,{className:a(d,`hidden text-muted @xl:table-cell`),children:t.perf.pages})]}),e===`visual`&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`td`,{className:a(d,t.visual?.changed?`text-warn`:`text-muted`),children:t.visual?t.visual.changed:`not compared`}),(0,T.jsx)(`td`,{className:a(d,`hidden text-muted @2xl:table-cell`),children:t.visual?t.visual.new+t.visual.no_baseline:`–`}),(0,T.jsx)(`td`,{className:a(d,`hidden text-muted @xl:table-cell`),children:t.visual?t.visual.same:`–`})]}),(0,T.jsx)(`td`,{className:`hidden py-2 pr-3 whitespace-nowrap text-[12.5px] text-muted @xl:table-cell`,"data-tip":A(t.at),children:S(t.at)})]},t.id)})})}function q({kind:e,id:t,view:n,onChanged:a}){let[o,s]=(0,w.useState)(null),[c,l]=(0,w.useState)(``);(0,w.useEffect)(()=>{let e=!1;return s(null),d.run(t).then(t=>{e||(s(t),l(``))},t=>!e&&l(t.message)),()=>{e=!0}},[t]);let u=(0,T.jsxs)(`a`,{href:i(e),className:`inline-flex items-center gap-1 self-start text-[13px] no-underline`,children:[(0,T.jsx)(r,{size:14,"aria-hidden":`true`,className:`rotate-90`}),`All runs`]});return c||!o?(0,T.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[u,c?(0,T.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail`,children:c}):(0,T.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Loading…`})]}):(0,T.jsxs)(`section`,{"aria-labelledby":`run-h`,className:`flex min-w-0 flex-col gap-3`,children:[u,(0,T.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,T.jsx)(`h2`,{id:`run-h`,"data-tip":o.goal,className:`m-0 truncate text-[16px] leading-snug font-semibold`,children:o.goal}),(0,T.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-[12.5px] text-muted`,children:[A(o.at),` · `,(0,T.jsx)(C,{path:o.dir}),` · `,(0,T.jsx)(`a`,{href:i(`quality`,encodeURIComponent(o.id)),children:`Everything it measured`})]})]}),e===`accessibility`&&(0,T.jsx)(I,{run:o,standard:n.standard,disclaimer:n.disclaimer}),e===`performance`&&(0,T.jsx)(L,{run:o}),e===`visual`&&(0,T.jsx)(z,{run:o,budget:n.budgets.visual,onChange:e=>{s(e),a()}})]})}function J({r:e,to:t,line:r}){return(0,T.jsxs)(`div`,{className:`ml-12 flex flex-wrap items-center gap-x-4 gap-y-2 rounded-[14px] card border px-4 py-3`,children:[(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col`,children:[(0,T.jsx)(`span`,{className:`text-[14.5px] font-medium [overflow-wrap:anywhere]`,children:e.goal}),(0,T.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:r})]}),(0,T.jsx)(n,{size:`sm`,variant:`primary`,onClick:()=>location.hash=t,children:`Open the run`})]})}function Y({label:e,value:t,sub:n,tone:r}){return(0,T.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5 px-3 py-2`,children:[(0,T.jsx)(`span`,{className:`text-[11.5px] text-muted`,children:e}),(0,T.jsx)(`span`,{className:a(`text-[16px] leading-tight font-semibold tabular-nums`,r),children:t}),n&&(0,T.jsx)(`span`,{className:`truncate text-[11.5px] text-muted`,children:n})]})}export{A as _,K as a,J as c,z as d,j as f,P as g,G as h,q as i,H as l,M as m,E as n,Y as o,F as p,D as r,L as s,I as t,O as u};
@@ -1 +0,0 @@
1
- import{Oa as e,To as t}from"./frame-ihNrEidT.js";var n=t(),r=`flex w-fit max-w-full flex-wrap gap-1 rounded-[10px] bg-surface-strong p-1`,i=t=>e(`inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-[7px] border-0 px-3 text-sm font-medium whitespace-nowrap`,t?`bg-bg text-ink shadow-sm`:`bg-transparent text-muted hover:text-ink`);function a({tabs:t,current:a,onPick:o,label:s,className:c}){return(0,n.jsx)(`div`,{role:`tablist`,"aria-label":s,className:e(`mb-5`,r,c),children:t.map((e,r)=>(0,n.jsxs)(`button`,{id:`tab-${e.id}`,type:`button`,role:`tab`,"aria-selected":a===e.id,"aria-controls":`panel-${e.id}`,tabIndex:a===e.id?0:-1,onClick:()=>o(e.id),onKeyDown:e=>{let n=e.key===`ArrowRight`?t[(r+1)%t.length]:e.key===`ArrowLeft`?t[(r-1+t.length)%t.length]:void 0;n&&(o(n.id),document.getElementById(`tab-${n.id}`)?.focus())},className:i(a===e.id),children:[e.label,e.n!==void 0&&(0,n.jsx)(`span`,{className:`text-[12px] text-muted tabular-nums`,children:e.n})]},e.id))})}function o({links:t,current:a,label:o,className:s}){return(0,n.jsx)(`nav`,{"aria-label":o,className:e(r,s),children:t.map(t=>(0,n.jsx)(`a`,{href:t.href,"aria-current":a===t.id?`page`:void 0,className:e(i(a===t.id),`no-underline hover:no-underline`,a===t.id&&`hover:text-ink`),children:t.label},t.id))})}export{i,a as n,r,o as t};