@ycodium-ai/plugin-pull-requests 0.2.2510 → 0.2.2526
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/assets/ui.js +3 -0
- package/package.json +2 -2
package/assets/ui.js
CHANGED
|
@@ -15,7 +15,9 @@ ${t}`}function wf(e,t){return[...e.filter(o=>!o.id.startsWith(vf)),...t]}functio
|
|
|
15
15
|
`))?.[1]:void 0;g!==void 0&&Ku(g)?(l(),t.push({id:`attachment:${t.length}`,kind:"attachment",url:g,media:"video"}),u=I):o.push(f)}return l(),t}var qf,Tf,Af,Mf,Df,Bf,Nf,Gu,Wu=v(()=>{"use strict";qf=/^\s{0,3}((?:`{3,})|(?:~{3,}))(.*)$/u,Tf=/^(?: {4}|\t)/u,Af=/^<?(https?:\/\/\S+?)>?$/u,Mf=/\.(?:mp4|webm|mov|m4v|ogv)(?:$|[?#])/iu,Df=/^https:\/\/github\.com\/user-attachments\/assets\/[\w-]+$/iu,Bf=/<(?:video|source)\b[^>]*\bsrc\s*=\s*["']([^"']+)["']/iu,Nf=/^\s*<video\b/iu,Gu=/<\/video>\s*$/iu});function nt({text:e,cwd:t,environmentId:o,className:r}){let{t:l}=q(),s=Vu(e);return a("div",{className:k("space-y-3",r),children:s.map(u=>{if(u.kind==="markdown")return a(jn,{text:u.text,cwd:t,environmentId:o},u.id);let f=u.media==="video",i=f?Jo:Zo;return n("a",{href:u.url,rel:"noreferrer noopener",target:"_blank",className:"flex items-center gap-2 rounded-lg border border-border/60 bg-muted/30 px-3 py-2 text-sm hover:bg-muted/40",children:[a(i,{"aria-hidden":!0,className:"size-icon-2 shrink-0 text-muted-foreground"}),a("span",{className:"min-w-0 flex-1 truncate",children:l(f?"markdown.playVideoOnHost":"markdown.openAttachmentOnHost")}),a(Et,{"aria-hidden":!0,className:"size-3 shrink-0 text-muted-foreground"})]},u.id)})})}var mr=v(()=>{"use strict";_e();oa();Se();_u();Wu();U()});function jt({value:e,cwd:t,environmentId:o,placeholder:r,label:l,saving:s,allowEmpty:u=!1,className:f,onSave:i,onCancel:m}){let{t:p}=q(),[I,g]=b(e),[T,F]=b(!1),[S,re]=b(e);S!==e&&(re(e),g(e));let P=I.trim().length===0;return n("div",{className:k("space-y-2",f),onKeyDown:C=>{C.key!=="Escape"||s||(C.preventDefault(),m())},children:[n("div",{className:"flex items-center gap-1",children:[a(R,{size:"xs",variant:T?"ghost":"outline",disabled:s,onClick:()=>F(!1),children:p("markdownEditor.write")}),a(R,{size:"xs",variant:T?"outline":"ghost",disabled:s,onClick:()=>F(!0),children:p("markdownEditor.preview")})]}),T?a("div",{className:"rounded-lg border border-border/60 px-3 py-2",children:P?a("p",{className:"text-xs text-muted-foreground",children:p("markdownEditor.nothingToPreview")}):a(nt,{text:I,cwd:t,environmentId:o})}):a(It,{autoFocus:!0,disabled:s,value:I,rows:6,placeholder:r,"aria-label":l,onChange:C=>g(C.target.value)}),n("div",{className:"flex justify-end gap-2",children:[a(R,{size:"xs",variant:"ghost",disabled:s,onClick:m,children:p("action.cancel")}),a(R,{size:"xs",variant:"outline",disabled:s||P&&!u,onClick:()=>i(I),children:p(s?"action.saving":"action.save")})]})]})}var nn=v(()=>{"use strict";me();oa();Se();N();N();mr();U()});function Xn(e){return Ef[e]}function ln(e){return Of[e]}function Uf(e,t){return e.length<=1?e[0]??"":e.length===2?t("reactions.joinTwo",{first:e[0],second:e[1]}):t("reactions.joinMany",{list:e.slice(0,-1).join(t("reactions.listSeparator")),last:e.at(-1)})}function zf(e,t,o){return o(t?"reactions.others":"reactions.people",{count:e})}function ju(e,t){let o=e.actors.length<e.count,l=(e.viewerHasReacted&&o?[t("reactions.you"),...e.actors]:[...e.actors]).slice(0,Math.min(Hf,e.count)),s=Math.max(0,e.count-l.length),u=[...l,...s>0?[zf(s,l.length>0,t)]:[]];return t("reactions.tooltip",{names:Uf(u,t),emoji:t(ln(e.content))})}function $u(e,t){if(t.size===0)return e;let o=new Map(e.map(r=>[r.content,r]));for(let[r,l]of t){let s=o.get(r);if(s===void 0){l&&o.set(r,{content:r,count:1,actors:[],viewerHasReacted:!0});continue}if(s.viewerHasReacted===l)continue;let u=s.count+(l?1:-1);u<=0?o.delete(r):o.set(r,{...s,count:u,viewerHasReacted:l})}return $n.flatMap(r=>o.get(r)??[])}var $n,Ef,Of,Hf,Xu=v(()=>{"use strict";$n=["thumbs-up","thumbs-down","laugh","hooray","confused","heart","rocket","eyes"],Ef={"thumbs-up":"\u{1F44D}","thumbs-down":"\u{1F44E}",laugh:"\u{1F604}",hooray:"\u{1F389}",confused:"\u{1F615}",heart:"\u2764\uFE0F",rocket:"\u{1F680}",eyes:"\u{1F440}"},Of={"thumbs-up":"reactions.thumbsUp","thumbs-down":"reactions.thumbsDown",laugh:"reactions.laugh",hooray:"reactions.hooray",confused:"reactions.confused",heart:"reactions.heart",rocket:"reactions.rocket",eyes:"reactions.eyes"};Hf=3});function _f(e){return e.map(t=>`${t.content}:${t.count}:${t.viewerHasReacted?1:0}`).join(" ")}function lt({reactions:e,canReact:t,subjectId:o,environmentId:r,reference:l,onRefresh:s,className:u}){let{t:f}=q(),[i,m]=b(!1),[p,I]=b({signature:"",values:Qu}),g=Be(ge.converse,{reportFailure:!1}),T=_f(e),F=p.signature===T?p.values:Qu,S=$u(e,F),re=async(P,C)=>{if(I({signature:T,values:new Map([...F,[P,C]])}),(await g({environmentId:r,input:{op:"setReaction",...l,...o===void 0?{}:{subjectId:o},content:P,reacted:C}}))._tag==="Failure"){I(ve=>{let E=new Map(ve.values);return E.delete(P),{signature:ve.signature,values:E}}),se.error(f("notify.reactionSaveFailed"));return}s()};return S.length===0&&!t?null:n("div",{className:k("flex flex-wrap items-center gap-1",u),children:[S.map(P=>n(G,{children:[n(V,{render:a(R,{size:"compact",variant:"ghost","aria-pressed":P.viewerHasReacted,"aria-label":f("reactions.nameAndCount",{name:f(ln(P.content)),count:P.count}),softDisabled:!t,className:k("h-6 rounded-full px-2 sm:text-xs aria-disabled:border-inherit aria-disabled:bg-inherit aria-disabled:text-inherit",P.viewerHasReacted?"border-primary/60 bg-primary/10 text-foreground":"border-border/70 bg-muted/40 text-muted-foreground",t&&"hover:border-primary/60"),onClick:()=>{re(P.content,!P.viewerHasReacted)}}),children:[a("span",{"aria-hidden":!0,children:Xn(P.content)}),a("span",{className:"tabular-nums",children:P.count})]}),a(K,{side:"top",children:ju(P,f)})]},P.content)),t?n(ho,{open:i,onOpenChange:m,children:[a(yo,{render:a(R,{size:"compact",variant:"ghost","aria-label":f("reactions.addAria"),className:k("h-6 rounded-full border-border/70 px-1.5 text-muted-foreground hover:border-primary/60 hover:text-foreground sm:text-xs",S.length===0&&!i&&"opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 focus-visible:opacity-100")}),children:a(ar,{"aria-hidden":!0})}),a(xo,{align:"start",className:"w-auto",side:"top",viewportClassName:"py-2",children:a("div",{className:"flex items-center gap-0.5",children:$n.map(P=>{let C=S.find(ae=>ae.content===P)?.viewerHasReacted??!1;return a(R,{size:"icon-xs",variant:"ghost","aria-pressed":C,"aria-label":f(ln(P)),className:k("size-7 rounded-control-3 text-base sm:size-7 sm:text-base",C&&"bg-primary/10"),onClick:()=>{m(!1),re(P,!C)},children:a("span",{"aria-hidden":!0,children:Xn(P)})},P)})})})]}):null]})}var Qu,sn=v(()=>{"use strict";_e();me();oa();Se();Te();Te();Na();N();N();N();Xu();U();Qu=new Map});function sd(e,t,o){return!o&&(e.metaKey||e.ctrlKey)&&e.key==="Enter"&&t.trim().length>0}var id=v(()=>{"use strict"});function tp(e){return t=>{t.key==="Escape"&&e.onCancel&&(t.preventDefault(),e.onCancel()),sd(t,e.value,e.pending)&&(t.preventDefault(),e.onSubmit())}}function dd({comment:e,onRemove:t}){let{t:o}=q();return n("div",{className:k(ud,"border-dashed"),contentEditable:!1,onPointerDown:r=>r.stopPropagation(),children:[n("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a(ta,{className:"size-icon-2"}),a("span",{children:o("thread.pendingComment")}),a(R,{size:"icon-xs",variant:"ghost",className:"ml-auto","aria-label":o("action.discardCommentAria"),onClick:t,children:a(or,{})})]}),a("p",{className:"mt-2 whitespace-pre-wrap leading-relaxed",children:e.body})]})}function cd({thread:e,workspaceRoot:t,canReply:o,canResolve:r,canReact:l,environmentId:s,reference:u,pending:f,fixPending:i,fixLabel:m,onFix:p,onReply:I,onLoadMore:g,canEditComment:T,onEditComment:F,onToggleResolved:S,onReacted:re}){let{t:P}=q(),[C,ae]=b(!e.isResolved),[ve,E]=b(!1),[_,te]=b(""),[Ce,je]=b(null),[Q,la]=b(!1),le=De(!1),[Y,ue]=b(null),[xe,j]=b(!1),qe=Y?.threadId===e.id?Y:null,Oe=_n(e.comments,qe?.comments??[]),be=qe===null?e.nextCommentsCursor??null:qe.nextCursor,$=e.commentCount??Oe.length,Ge=P(m??"thread.fixInThread"),Ne=async(A,X)=>{if(Q)return;la(!0);let Re=await F(A,X);la(!1),Re&&(ue(ee=>ee?.threadId===e.id?{...ee,comments:xu(ee.comments,A,X)}:ee),je(null))},x=async()=>{let A=_.trim();if(!(A.length===0||f||le.current)){le.current=!0;try{await I(A)&&(ue(X=>X?.threadId===e.id?{...X,nextCursor:X.nextCursor??e.nextCommentsCursor??null}:X),te(""),E(!1))}finally{le.current=!1}}},W=async()=>{if(!(be===null||xe)){j(!0);try{let A=await g(be);if(A===null)return;ue(X=>({threadId:e.id,comments:_n(X?.threadId===e.id?X.comments:[],A.comments),nextCursor:A.nextCursor}))}finally{j(!1)}}};return n("div",{className:ud,contentEditable:!1,onPointerDown:A=>A.stopPropagation(),children:[n("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.isResolved?a(Ye,{className:"size-icon-2 text-emerald-600 dark:text-emerald-500"}):a(Uo,{className:"size-icon-2"}),n("button",{type:"button",className:"hover:text-foreground","aria-expanded":C,onClick:()=>ae(A=>!A),children:[e.isResolved?P("thread.resolved"):P("thread.open")," \xB7 ",$," ",P("comment.count",{count:$})]}),e.isOutdated?a("span",{children:P("thread.outdated")}):null,p?n(R,{size:"xs",variant:"ghost",className:"ml-auto",disabled:f||i,onClick:p,children:[a(Ea,{className:"size-3"}),i?P("thread.preparingFix"):Ge]}):null,r?a(R,{size:"xs",variant:"ghost",className:p?void 0:"ml-auto",disabled:f,onClick:S,children:e.isResolved?P("action.unresolve"):P("action.resolve")}):null]}),C?n(ye,{children:[a("div",{className:"mt-2 space-y-3",children:Oe.map(A=>n("article",{className:"group min-w-0",children:[n("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a(Oa,{actor:A.author,className:"text-foreground"}),a("span",{children:Xe(A.createdAt)})]}),Ce===A.id?a(jt,{className:"mt-1",value:A.body,cwd:t,environmentId:s,label:P("action.editComment"),saving:Q,onSave:X=>{Ne(A.id,X)},onCancel:()=>je(null)}):n("div",{className:"mt-1 flex items-start gap-1",children:[a(nt,{className:"min-w-0 flex-1 text-sm",text:A.body,cwd:t,environmentId:s}),T(A)?a(R,{size:"icon-xs",variant:"ghost",className:"shrink-0 text-muted-foreground opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 focus-visible:opacity-100","aria-label":P("action.editComment"),onClick:()=>je(A.id),children:a(wa,{className:"size-3"})}):null]}),a(lt,{className:"mt-1.5",reactions:A.reactions??[],canReact:l,subjectId:A.id,environmentId:s,reference:u,onRefresh:re})]},A.id))}),be!==null?a("div",{className:"mt-2",children:a(R,{size:"xs",variant:"ghost",className:"px-1",disabled:xe,onClick:()=>{W()},children:P(xe?"action.loading":"action.loadMoreComments")})}):null,o?ve?n("div",{className:"mt-2",children:[a(It,{autoFocus:!0,size:"sm",value:_,placeholder:P("action.reply"),"aria-label":P("action.replyAria"),onChange:A=>te(A.target.value),onKeyDown:tp({value:_,pending:f,onSubmit:()=>{x()},onCancel:()=>E(!1)})}),n("div",{className:"mt-2 flex justify-end gap-2",children:[a(R,{size:"xs",variant:"ghost",onClick:()=>E(!1),children:P("action.cancel")}),a(R,{size:"xs",disabled:f||_.trim().length===0,onClick:()=>{x()},children:P("action.reply")})]})]}):a(R,{size:"xs",variant:"ghost",className:"mt-2 px-1",onClick:()=>E(!0),children:P("action.reply")}):null]}):null]})}var ud,fd=v(()=>{"use strict";Se();_e();me();Dt();oa();N();N();id();wt();Ua();mr();nn();sn();U();ud="mx-3 my-2 rounded-xl border border-border/70 bg-background p-3 text-sm shadow-sm"});function md(){return pd+=1,`pending-review-comment-${pd}`}function hr(e){return`${e.projectId}/${e.repository}#${e.number}`}function $t(){for(let e of el)e()}function gd(e){return el.add(e),()=>{el.delete(e)}}function al(){return ie}function fn(e){let t=hr(e);return ha(o=>o.drafts[t]??cn)}var pd,cn,el,ie,ha,tl=v(()=>{"use strict";me();pd=0;cn=[],el=new Set;ie={drafts:{},summaries:{},addComment:(e,t)=>{ie={...ie,drafts:{...ie.drafts,[e]:[...ie.drafts[e]??cn,t]}},$t()},removeComment:(e,t)=>{let o=(ie.drafts[e]??cn).filter(r=>r.id!==t);if(o.length>0)ie={...ie,drafts:{...ie.drafts,[e]:o}};else{let{[e]:r,...l}=ie.drafts;ie={...ie,drafts:l}}$t()},removeComments:(e,t)=>{let o=new Set(t),r=(ie.drafts[e]??cn).filter(l=>!o.has(l.id));if(r.length>0)ie={...ie,drafts:{...ie.drafts,[e]:r}};else{let{[e]:l,...s}=ie.drafts;ie={...ie,drafts:s}}$t()},clear:e=>{let{[e]:t,...o}=ie.drafts;ie={...ie,drafts:o},$t()},setSummary:(e,t)=>{ie={...ie,summaries:{...ie.summaries,[e]:t}},$t()},clearSummary:(e,t)=>{if(ie.summaries[e]!==t)return;let{[e]:o,...r}=ie.summaries;ie={...ie,summaries:r},$t()}};ha=(e=>{let t=Tr(gd,al,al);return e===void 0?t:e(t)});ha.getState=al;ha.setState=e=>{ie={...ie,...e},$t()};ha.subscribe=gd});function hd({environmentId:e,reference:t,verdicts:o,onSubmitted:r}){let[l,s]=b(!1),{t:u}=q(),f=fn(t),i=hr(t),m=ha(C=>C.summaries[i]??""),p=ha(C=>C.clear),I=ha(C=>C.removeComments),g=ha(C=>C.setSummary),T=ha(C=>C.clearSummary),F=Be(ge.converse,{reportFailure:!1}),S=op.filter(C=>o.includes(C.value));if(S.length===0)return null;let re=async C=>{if(l)return;let ae=m,ve=f;s(!0);let E=await F({environmentId:e,input:{op:"submitReview",...t,verdict:C.value,body:ae,comments:ve}});if(s(!1),E._tag==="Failure"){se.error(u("bar.submitFailedTitle"));return}I(i,ve.map(_=>_.id)),T(i,ae),se.success(u(C.sentKey)),r()},P=C=>C==="approve"||m.trim().length>0||f.length>0;return n("div",{className:"px-4 py-3",children:[n("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a("span",{children:f.length===0?u("bar.noComments"):u("bar.commentsPending",{count:f.length})}),f.length>0?a(R,{size:"xs",variant:"ghost",disabled:l,onClick:()=>p(i),children:u("action.discard")}):null]}),a(It,{size:"sm",className:"mt-2",value:m,placeholder:u("bar.summaryPlaceholder"),"aria-label":u("bar.summaryAria"),onChange:C=>g(i,C.target.value)}),a("div",{className:"mt-2 flex flex-wrap justify-end gap-2",children:S.map(C=>a(R,{size:"xs",variant:C.value==="comment"?"outline":"default",disabled:l||!P(C.value),onClick:()=>{re(C)},children:n("span",{className:"flex items-center gap-1.5",children:[C.icon,u(C.labelKey)]})},C.value))})]})}var op,xd=v(()=>{"use strict";Se();_e();me();Te();Te();Na();N();N();tl();U();op=[{value:"comment",labelKey:"action.comment",sentKey:"bar.sentComment",icon:a(ta,{className:"size-3"})},{value:"approve",labelKey:"action.approve",sentKey:"bar.sentApprove",icon:a(Nt,{className:"size-3"})},{value:"request-changes",labelKey:"action.requestChanges",sentKey:"bar.sentRequestChanges",icon:a(Qe,{className:"size-3"})}]});var Id={};ac(Id,{PullRequestCodeTab:()=>yd,default:()=>sp});function xr(e){switch(e.kind){case"added":return{line:e.newLine,side:"right"};case"deleted":return{line:e.oldLine,side:"left"};case"context":return{line:e.side==="left"?e.oldLine:e.newLine,side:e.side};default:return{line:1,side:"right"}}}function rp(e){return(e.match(/^diff --git /gm)??[]).length}function np(e){let t=0,o=0;for(let r of e.split(`
|
|
16
16
|
`))r.startsWith("+")&&!r.startsWith("+++")?t+=1:r.startsWith("-")&&!r.startsWith("---")&&(o+=1);return{additions:t,deletions:o}}function lp({label:e,onCancel:t,onComment:o,onAddToAgent:r,addToAgentDisabledReason:l}){let{t:s}=q(),[u,f]=b("");return n("div",{className:"mx-3 my-2 space-y-2 rounded-xl border border-border/70 bg-background p-3 text-sm",children:[a("p",{className:"text-xs text-muted-foreground",children:e}),a("textarea",{className:"min-h-20 w-full rounded-md border border-input bg-transparent p-2 text-sm",value:u,onChange:i=>f(i.target.value)}),n("div",{className:"flex flex-wrap gap-2",children:[a(R,{size:"xs",onClick:()=>o(u),disabled:u.trim().length===0,children:s("code.addToReview")}),r?l===void 0?a(R,{size:"xs",variant:"outline",onClick:()=>r(u),disabled:u.trim().length===0,children:s("code.addToAgent")}):n(G,{children:[a(V,{render:a(R,{size:"xs",variant:"outline",softDisabled:!0,children:s("code.addToAgent")})}),a(K,{side:"top",children:l})]}):null,a(R,{size:"xs",variant:"ghost",onClick:t,children:s("action.cancel")})]})]})}function yd({environmentId:e,reference:t,detail:o,selectedCommitOid:r,onSelectedCommitChange:l,pendingFinding:s,fixFindingLabel:u,onFixFinding:f,onAddToAgentSelection:i,addToAgentDisabledReason:m,onRefresh:p,refreshToken:I=0}){let{t:g}=q(),T=u??"thread.fixInThread",F=o.capabilities.review,S=F.inlineComment&&r===null,[re,P]=b(ol),[C,ae]=b("stacked"),[ve,E]=b(!0),[_,te]=b(!1),[Ce,je]=b(!1),[Q,la]=b(!1),[le,Y]=b(null),[ue,xe]=b({key:"",cursor:null,slices:pn}),j=hr(t),qe=fn(t),Oe=ha(L=>L.addComment),be=ha(L=>L.removeComment),$=Be(ge.converse,{reportFailure:!1}),Ge=Be(ge.threadComments,{reportFailure:!1}),Ne=r,x=Ne===null?j:`${j}@${Ne}`;ne(()=>{Y(null),P(ol),je(!1),xe({key:x,cursor:null,slices:pn})},[x,I]);let W=ue.key===x?ue.slices:pn,A=ue.key===x?ue.cursor:null,X=Ta(ge.diff({environmentId:e,input:{...t,...A===null?{}:{cursor:A},...Ne===null?{}:{commit:Ne}}}));ne(()=>{let L=X.data;L===null||L.patch===void 0||xe(O=>{let Z=O.key===x?O.slices:pn,oe={cursor:A,patch:L.patch??"",truncated:L.truncated===!0,nextCursor:L.nextCursor??null,omittedFileStats:L.omittedFileStats??[]},fe=Z.findIndex(pa=>pa.cursor===A);return fe===-1?{key:x,cursor:A,slices:[...Z,oe]}:{key:x,cursor:A,slices:[...Z.slice(0,fe),oe]}})},[A,X.data,x]);let Re=B(()=>W.map(L=>L.patch).join(`
|
|
17
17
|
`),[W]),ee=W.at(-1)?.nextCursor??null,d=W.some(L=>L.truncated||L.omittedFileStats.length>0),Ke=rp(Re),Ga=np(Re),He=B(()=>o.commits.toSorted((L,O)=>Date.parse(O.committedDate)-Date.parse(L.committedDate)),[o.commits]),Ae=He.find(L=>L.oid===Ne);ne(()=>{Ne!==null&&Ae===void 0&&l(null)},[Ne,l,Ae]);let Le=Ia(async(L,O)=>{if(Q)return!1;la(!0);let Z=await O();return la(!1),Z._tag==="Failure"?(se.error(L),!1):(p(),!0)},[p,Q]),Ve=Ia(L=>a(cd,{thread:L,workspaceRoot:o.workspaceRoot,canReply:F.reply,canResolve:F.resolve,canReact:o.capabilities.reactions===!0,environmentId:e,reference:t,pending:Q,fixPending:s===Wt({kind:"thread",thread:L}),fixLabel:T,...f?{onFix:()=>f({kind:"thread",thread:L})}:{},onLoadMore:async O=>{let Z=await Ge({environmentId:e,input:{...t,threadId:L.id,cursor:O}});return Z._tag==="Failure"?(se.error(g("notify.moreCommentsFailed")),null):Z.value},onReply:O=>Le(g("notify.replyFailed"),()=>$({environmentId:e,input:{op:"replyToThread",...t,threadId:L.id,body:O}})),canEditComment:O=>bo(o,{author:O.author,kind:"review-comment"}),onEditComment:(O,Z)=>Le(g("notify.reviewCommentSaveFailed"),()=>$({environmentId:e,input:{op:"updateComment",...t,commentId:O,kind:"review-comment",body:Z}})),onToggleResolved:()=>{Le(g("notify.conversationUpdateFailed"),()=>$({environmentId:e,input:{op:"setThreadResolution",...t,threadId:L.id,resolved:!L.isResolved}}))},onReacted:p},`${t.projectId}#${t.number}:${L.id}`),[$,o,e,T,Ge,f,p,s,t,F.reply,F.resolve,Le,g,Q]),st=B(()=>{let L=new Set;for(let O of o.reviewThreads)O.line!==null&&L.add(O.id);return L},[o.reviewThreads]),Rt=B(()=>{let L=new Map,O=(Z,oe,fe)=>{let pa=`${Z}:${fe}:${oe}`,kt=L.get(pa);if(kt)return kt;let pe={path:Z,line:oe,side:fe==="left"?"left":"right",threads:[],pending:[],draft:!1};return L.set(pa,pe),pe};for(let Z of o.reviewThreads)Z.line!==null&&O(Z.path,Z.line,Z.side).threads.push(Z);for(let Z of qe){let oe=xr(Z.position);O(Z.path,oe.line,oe.side).pending.push(Z)}if(le){let Z=xr(le.position);O(le.path,Z.line,Z.side).draft=!0}return[...L.entries()].map(([Z,oe])=>({id:Z,path:oe.path,line:oe.line,side:oe.side,children:n("div",{className:"py-1 font-sans text-foreground",children:[oe.threads.map(Ve),oe.pending.map(fe=>a(dd,{comment:fe,onRemove:()=>be(j,fe.id)},fe.id)),oe.draft&&le?a(lp,{label:`${le.path}:${xr(le.position).line}`,onCancel:()=>Y(null),onComment:fe=>{Oe(j,{id:md(),path:le.path,position:le.position,body:fe}),Y(null)},...m===void 0?{}:{addToAgentDisabledReason:m},...i?{onAddToAgent:fe=>{i({comment:{id:`pull-request-selection:${le.path}:${xr(le.position).line}`,sectionId:`pull-request:${o.number}`,sectionTitle:`PR #${o.number} review`,filePath:le.path,startIndex:0,endIndex:0,rangeLabel:`${le.path}:${xr(le.position).line}`,text:fe,diff:"",fenceLanguage:tn(le.path)},request:fe}),Y(null)}}:{}}):null]})}))},[Oe,o.number,o.reviewThreads,le,m,i,qe,be,Ve,j]),Aa=Ae?Ae.messageHeadline:g("code.allCommits"),Ka=n("div",{className:"flex h-10 min-h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 bg-background px-4 text-xs text-muted-foreground",children:[n("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[He.length>0?n(zi,{children:[n(Gi,{className:"inline-flex h-6 max-w-64 items-center gap-1 rounded-control-2 bg-accent px-2 text-xs font-medium text-accent-foreground","aria-label":g("code.diffScopeAria",{scope:Aa}),children:[a("span",{className:"truncate",children:Aa}),a(ca,{className:"size-icon-1 shrink-0 opacity-70"})]}),n(_i,{align:"start",className:"w-80",children:[a(Kr,{onClick:()=>l(null),children:a("span",{children:g("code.allCommits")})}),He.slice(0,re).map(L=>n(Kr,{onClick:()=>l(L.oid),children:[a("span",{className:"min-w-0 truncate",children:L.messageHeadline}),a("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:L.oid.slice(0,7)})]},L.oid)),He.length>re?a(Kr,{onClick:()=>P(L=>L+ol),children:a("span",{className:"text-muted-foreground",children:g("code.showMore",{count:He.length-re})})}):null]})]}):null,n(Ha,{children:[n("span",{className:"shrink-0 tabular-nums",children:[g("detail.fileCount",{count:Ke,total:Ke}),ee===null?"":"+"]}),d?n(G,{children:[a(V,{render:a("span",{className:"flex shrink-0 items-center"}),children:a(ga,{"aria-label":g("code.withheldAria"),className:"size-icon-2 text-amber-600 dark:text-amber-500"})}),a(K,{side:"bottom",children:g("code.withheldDetail")})]}):null,Ne!==null&&F.inlineComment?n(G,{children:[a(V,{render:a("span",{className:"flex shrink-0 items-center"}),children:a($o,{"aria-label":g("code.wholeChangeAria"),className:"size-icon-2"})}),a(K,{side:"bottom",children:g("code.wholeChangeHint")})]}):null]})]}),n("div",{className:"flex shrink-0 items-center gap-1",children:[a(rt,{additions:Ga.additions,deletions:Ga.deletions,className:"mr-1"}),n(Gr,{className:"shrink-0 gap-1",size:"sm",value:[C],onValueChange:L=>{let O=Array.isArray(L)?L[0]:L;(O==="stacked"||O==="split")&&ae(O)},children:[a(Ya,{"aria-label":g("code.stackedViewAria"),value:"stacked",variant:"ghost",children:a(xt,{className:"size-icon-2"})}),a(Ya,{"aria-label":g("code.splitViewAria"),value:"split",variant:"ghost",children:a(pt,{className:"size-icon-2"})})]}),n(G,{children:[a(V,{render:a(Ya,{"aria-label":g(ve?"code.disableWrapAria":"code.enableWrapAria"),variant:"ghost",size:"sm",pressed:ve,onPressedChange:L=>E(!!L)}),children:a(yt,{className:"size-icon-2"})}),a(K,{side:"top",children:g(ve?"code.disableWrap":"code.enableWrap")})]})]})]}),sa=F.verdicts.length===0?null:a("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10",children:_?n("div",{className:"surface-glass pointer-events-auto absolute inset-x-3 bottom-3 rounded-xl border border-border/60 shadow-lg",children:[a(R,{type:"button",size:"icon-sm",variant:"ghost","aria-label":g("code.closeReviewAria"),className:"absolute right-2 top-2",onClick:()=>te(!1),children:a(nr,{})}),a(hd,{environmentId:e,reference:t,verdicts:F.verdicts,onSubmitted:()=>{p(),te(!1)}})]}):n(R,{className:"pointer-events-auto absolute right-4 bottom-3 rounded-full shadow-lg",onClick:()=>te(!0),size:"compact",variant:"glass",children:[a(ta,{}),g("code.review"),qe.length>0?a("span",{className:"flex size-4 items-center justify-center rounded-full bg-accent text-[10px] tabular-nums text-accent-foreground",children:qe.length}):null]})}),Je=L=>n("div",{className:"flex h-full min-h-0 flex-col",children:[Ka,n("div",{className:"relative min-h-0 flex-1",children:[a("div",{className:"h-full overflow-auto",children:L}),sa]})]});if(X.isPending&&W.length===0)return Je(a("p",{className:"p-4 text-sm text-muted-foreground",children:g("code.loadingDiff")}));if(X.error&&W.length===0)return Je(a("p",{className:"px-4 py-5 text-sm text-muted-foreground",children:X.error}));if(Re.length===0&&ee===null)return Je(a("p",{className:"px-4 py-5 text-sm text-muted-foreground",children:g(Ne===null?"code.noChangesPullRequest":"code.noChangesCommit")}));let Pt=o.reviewThreads.filter(L=>!st.has(L.id)),Me=new Map;for(let L of Pt){let O=Me.get(L.path);O?O.push(L):Me.set(L.path,[L])}return n("div",{className:"flex h-full min-h-0 flex-col",children:[Ka,Me.size>0?n(_t,{className:"shrink-0 border-b border-border/60",open:Ce,onOpenChange:je,children:[a("h2",{children:n(Kt,{className:"flex w-full items-center gap-1.5 px-4 py-2 text-left text-xs text-muted-foreground",children:[a("span",{children:g(ee===null?"code.offDiffConversations":"code.offDiffConversationsPartial")}),a("span",{className:"tabular-nums",children:Pt.length})]})}),a(Gt,{children:a("div",{className:"max-h-64 space-y-3 overflow-auto px-4 pb-3",children:[...Me].map(([L,O])=>n("div",{children:[a("p",{className:"truncate px-3 text-xs text-muted-foreground",children:L}),a("div",{className:"mt-1 space-y-2",children:O.map(Ve)})]},L))})})]}):null,n("div",{className:"relative min-h-0 flex-1",children:[a(Yi,{className:"h-full overflow-auto [scrollbar-gutter:stable]",patch:Re,split:C==="split",wrap:ve,annotations:Rt,enableLineSelection:S&&le===null,onSelectLines:L=>{S&&Y({path:L.path,position:L.side==="left"?{kind:"deleted",oldLine:L.endLine}:{kind:"added",newLine:L.endLine}})}}),ee!==null?a("div",{className:"flex items-center justify-center gap-2 py-2 text-xs text-muted-foreground",children:X.error!==null?n(ye,{children:[a("span",{children:g("code.loadFailed")}),a(R,{size:"xs",variant:"outline",onClick:()=>X.refresh(),children:g("action.retry")})]}):a(R,{size:"xs",variant:"outline",disabled:X.isPending,onClick:()=>xe(L=>({...L,cursor:ee})),children:X.isPending?g("code.loadingMoreFiles"):g("code.loadMoreFiles")})}):null,sa]})]})}var ol,pn,sp,vd=v(()=>{"use strict";_e();me();N();N();Se();Na();Te();pr();wt();Ua();fd();xd();tl();Un();U();ol=10,pn=[];sp=yd});var yn=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
18
|
+
@layer properties, theme, base, components, utilities;
|
|
18
19
|
@layer properties;
|
|
20
|
+
@layer utilities {
|
|
19
21
|
@scope (.ycodium-pull-requests-ui) {
|
|
20
22
|
.pointer-events-auto:where(:scope, *) {
|
|
21
23
|
pointer-events: auto;
|
|
@@ -1540,6 +1542,7 @@ ${t}`}function wf(e,t){return[...e.filter(o=>!o.id.startsWith(vf)),...t]}functio
|
|
|
1540
1542
|
}
|
|
1541
1543
|
}
|
|
1542
1544
|
}
|
|
1545
|
+
}
|
|
1543
1546
|
@keyframes spin {
|
|
1544
1547
|
to {
|
|
1545
1548
|
transform: rotate(360deg);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/plugin-pull-requests",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2526",
|
|
4
4
|
"description": "The pull request page, for GitHub and GitLab.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pull-requests",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tailwindcss": "^4.0.0",
|
|
31
31
|
"typescript": "~6.0.3",
|
|
32
32
|
"vite-plus": "0.2.2",
|
|
33
|
-
"@ycodium-ai/plugin-api": "0.2.
|
|
33
|
+
"@ycodium-ai/plugin-api": "0.2.2526"
|
|
34
34
|
},
|
|
35
35
|
"ycodium": {
|
|
36
36
|
"plugin": "./dist/index.js",
|