codex-mobile-re 0.1.113 → 0.1.115
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/assets/{AutomationsPanel-DlBkLmKR.js → AutomationsPanel-BmeZ3J9i.js} +1 -1
- package/dist/assets/{DirectoryHub-sS2h3U_D.js → DirectoryHub-Ciz8rVK4.js} +1 -1
- package/dist/assets/{QueuedMessages-D_o6pC9F.js → QueuedMessages-p3CX5QzM.js} +1 -1
- package/dist/assets/{ReviewPane-qS7hOyaM.js → ReviewPane-DcvdhrcS.js} +1 -1
- package/dist/assets/{RightFilePreview-D1LmPrpY.js → RightFilePreview-BjmHDwE1.js} +1 -1
- package/dist/assets/{RightFilesPanel-B5AIrAU3.js → RightFilesPanel-CFsAu6As.js} +1 -1
- package/dist/assets/{RightGitPanel-K_jp1qHA.js → RightGitPanel-NcqihWb7.js} +1 -1
- package/dist/assets/{SettingsDialog-C4aE-PFC.js → SettingsDialog-C-PIbb7v.js} +1 -1
- package/dist/assets/{ThreadConversation-Ccm62p-Y.css → ThreadConversation-BOs1zeme.css} +1 -1
- package/dist/assets/ThreadConversation-CcsAV6iU.js +39 -0
- package/dist/assets/{ThreadPendingRequestPanel-DNTrk7uR.js → ThreadPendingRequestPanel-C7aX0YrN.js} +1 -1
- package/dist/assets/{ThreadTerminalPanel-BLHMQWJI.js → ThreadTerminalPanel-2PMt2IWn.js} +1 -1
- package/dist/assets/{index-Cu_hRJGY.js → index-BJ-YiA9y.js} +17 -17
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/ThreadConversation-B4NZvuHw.js +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as Ze,H as Je,r as y,x as G,O as Qe,P as et,o as tt,f as o,h as at,p as Z,s as ke,j as a,n as se,u as c,w as ne,t as s,i as r,k as w,I as st,W as nt,F as C,l as E,y as U,m as N,q as ge,T as it,v as lt,c as b,X as ot,Y as rt,Z as ut,_ as dt}from"./index-Cu_hRJGY.js";const ct={class:"review-pane-header"},vt={class:"review-pane-heading"},pt={class:"review-pane-eyebrow"},ht={class:"review-pane-title"},ft={class:"review-pane-header-actions"},wt=["aria-label"],mt={class:"review-pane-toolbar"},_t={class:"review-pane-toolbar-controls"},yt={key:0,class:"review-pane-control-cluster"},bt={class:"review-pane-control-label"},kt={class:"review-pane-segmented"},gt=["data-active"],Ct=["data-active","disabled"],Bt={key:1,class:"review-pane-control-cluster"},Ft={class:"review-pane-control-label"},St={key:2,class:"review-pane-control-cluster"},It={class:"review-pane-control-label"},xt={class:"review-pane-segmented"},Lt=["data-active"],$t=["data-active"],At={class:"review-pane-toolbar-actions"},Pt=["disabled"],Et={key:1,class:"review-pane-meta"},Rt={class:"review-pane-summary-pill review-pane-summary-pill-add"},Tt={class:"review-pane-summary-pill review-pane-summary-pill-remove"},Nt={key:0},Mt={key:1},Dt={key:2},Wt={class:"review-pane-content"},zt={key:0,class:"review-pane-empty"},Vt={class:"review-pane-empty-title"},Gt={key:1,class:"review-pane-empty"},Ut={class:"review-pane-empty-title"},Ht={class:"review-pane-empty-text"},Ot=["disabled"],Xt={key:2,class:"review-pane-empty"},Kt={class:"review-pane-empty-title"},jt={class:"review-pane-empty-text"},Yt={key:0,class:"review-pane-bulk-actions"},qt=["disabled","onClick"],Zt={key:1,class:"review-pane-empty"},Jt={class:"review-pane-empty-title"},Qt={class:"review-pane-empty-text"},ea={key:0,class:"review-pane-file-list"},ta=["data-expanded","onClick"],aa=["data-expanded"],sa={class:"review-pane-tree-folder-name"},na={class:"review-pane-tree-folder-count"},ia=["data-active","title","onClick"],la={class:"review-pane-file-meta-row"},oa={class:"review-pane-file-path"},ra={class:"review-pane-file-delta"},ua={class:"review-pane-delta-add"},da={class:"review-pane-delta-remove"},ca=["data-operation"],va={class:"review-pane-diff"},pa={class:"review-pane-file-header"},ha={class:"review-pane-file-header-main"},fa={class:"review-pane-file-title"},wa={class:"review-pane-file-subtitle"},ma={key:0,class:"review-pane-row-actions"},_a=["disabled","onClick"],ya={key:0,class:"review-pane-raw-diff"},ba={key:1,class:"review-pane-hunks"},ka=["data-active","onClick"],ga={class:"review-pane-hunk-header"},Ca={class:"review-pane-hunk-title"},Ba={class:"review-pane-hunk-meta"},Fa={key:0,class:"review-pane-row-actions"},Sa=["disabled","onClick"],Ia={class:"review-pane-lines"},xa=["data-kind"],La={class:"review-pane-line-number"},$a={class:"review-pane-line-number"},Aa={class:"review-pane-line-marker"},Pa={class:"review-pane-line-code"},Ea={class:"review-pane-sheet-header"},Ra={class:"review-pane-sheet-title"},Ta={class:"review-pane-sheet-count"},Na={class:"review-pane-sheet-list"},Ma=["data-expanded","onClick"],Da=["data-expanded"],Wa={class:"review-pane-tree-folder-name"},za={class:"review-pane-tree-folder-count"},Va=["data-active","title","onClick"],Ga={class:"review-pane-file-meta-row"},Ua={class:"review-pane-file-path"},Ha={class:"review-pane-file-delta"},Oa={class:"review-pane-delta-add"},Xa={class:"review-pane-delta-remove"},Ka=["data-operation"],Ce="codex-web-local.review-pane-file-list-width.v1",ja=220,Ya=420,Be=288,qa=Ze({__name:"ReviewPane",props:{threadId:{},cwd:{},isThreadInProgress:{type:Boolean},initialFilePath:{},commitSha:{}},emits:["close"],setup(Fe,{emit:Se}){const g=Fe,Ie=Se,{isMobile:B}=Je(),{t:l}=lt(),m=y("workspace"),F=y("unstaged"),d=y(null),x=y(""),H=y(!1),L=y(""),I=y(""),O=y(!1),J=y(!1),R=y(!1),X=y(!1),M=y(""),$=y(""),K=y("");let j=null,A=null;const k=b(()=>{var e,t;return((e=d.value)==null?void 0:e.files.find(u=>u.id===L.value))??((t=d.value)==null?void 0:t.files[0])??null}),T=y({}),S=b(()=>{var e;return!!((e=g.commitSha)!=null&&e.trim())}),xe=b(()=>{var e;return(((e=d.value)==null?void 0:e.baseBranchOptions)??[]).map(t=>({value:t,label:t}))}),Le=b(()=>{var e;return((e=d.value)==null?void 0:e.scope)==="commit"||S.value?l("No file changes in this commit."):m.value==="workspace"?l("Your current workspace is clean."):l("No merge diff found against the base branch.")});function ie(e){return e.trim().replace(/\\/g,"/")}function $e(e){const t=ie(e);return!t||!d.value?null:d.value.files.find(u=>[u.path,u.absolutePath,u.previousPath,u.previousAbsolutePath].some(v=>typeof v=="string"&&ie(v)===t))??null}function le(){const e=$e(g.initialFilePath??"");return e?(te(e.id),!0):!1}const Ae=b(()=>{var e,t;return(e=d.value)!=null&&e.isGitRepo?S.value?d.value.commitSha?`${l("Commit")} ${ye(d.value.commitSha)}`:l("Commit"):m.value==="workspace"?F.value==="staged"?l("Staged changes"):l("Workspace changes"):(t=d.value)!=null&&t.baseBranch?`${l("Against")} ${d.value.baseBranch}`:l("Base branch"):l("Repository review")}),oe=b(()=>{var e;return!S.value&&m.value==="workspace"&&((e=d.value)==null?void 0:e.isGitRepo)===!0&&d.value.files.length>0}),re=b(()=>oe.value&&!R.value),Pe=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage all")}]:[{value:"stage",label:l("Stage all")},{value:"revert",label:l("Revert all")}]),Ee=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage file")}]:[{value:"stage",label:l("Stage file")},{value:"revert",label:l("Revert file")}]),Re=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage hunk")}]:[{value:"stage",label:l("Stage hunk")},{value:"revert",label:l("Revert hunk")}]),ue=b(()=>$.value||M.value||K.value),Te=b(()=>!!($.value||M.value)),Y=y(De()),Ne=b(()=>{const e={};return B.value||(e["--review-file-list-width"]=`${Y.value}px`),e}),de=b(()=>{var e;return Ge(((e=d.value)==null?void 0:e.files)??[],T.value)}),ce=b(()=>de.value.nodes),Me=b(()=>de.value.folderIdsByFileId);function Q(e){return Number.isFinite(e)?Math.min(Ya,Math.max(ja,Math.round(e))):Be}function De(){if(typeof window>"u")return Be;const e=window.localStorage.getItem(Ce),t=e?Number(e):Number.NaN;return Q(t)}function We(e){typeof window>"u"||window.localStorage.setItem(Ce,String(Q(e)))}function ze(e){if(B.value)return;e.preventDefault(),A==null||A();const t=e.clientX,u=Y.value,v=i=>{Y.value=Q(u+(i.clientX-t))},p=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",n),A=null},n=()=>{p(),We(Y.value)};window.addEventListener("pointermove",v),window.addEventListener("pointerup",n),A=p}function Ve(e){return e==="add"?"+":e==="remove"?"-":e==="hunk"?"@@":" "}function ve(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??e}function pe(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}function Ge(e,t){const u={folders:new Map,files:[]},v={};for(const f of e){const _=f.path.split("/").filter(Boolean),W=_.pop()??f.path;let h=u,P="";const be=[];for(const[qe,z]of _.entries()){P=P?`${P}/${z}`:z;let V=h.folders.get(z);V||(V={id:P,name:z,depth:qe,folders:new Map,files:[]},h.folders.set(z,V)),h=V,be.push(V.id)}h.files.push({file:f,name:W,depth:_.length}),v[f.id]=be}const p=[],n=f=>f.files.length+Array.from(f.folders.values()).reduce((_,W)=>_+n(W),0),i=f=>{const _=Array.from(f.folders.values()).sort((h,P)=>pe(h.name,P.name)),W=[...f.files].sort((h,P)=>pe(h.name,P.name));for(const h of _)p.push({kind:"folder",treeKey:`folder:${h.id}`,id:h.id,name:h.name,depth:h.depth,fileCount:n(h)}),t[h.id]!==!1&&i(h);for(const h of W)p.push({kind:"file",treeKey:`file:${h.file.id}`,id:h.file.id,name:h.name,depth:h.depth,file:h.file})};return i(u),{nodes:p,folderIdsByFileId:v}}function D(e){return T.value[e]!==!1}function he(e){T.value={...T.value,[e]:!D(e)}}function fe(e){const t=Me.value[e]??[];if(t.length===0)return;const u={...T.value};let v=!1;for(const p of t)u[p]===!1&&(u[p]=!0,v=!0);v&&(T.value=u)}function we(e){const t=B.value?8:10,u=B.value?12:14;return{paddingLeft:`${t+e*u}px`}}function me(){return{paddingLeft:B.value?"8px":"10px"}}function ee(e){return l(e==="add"?"Added":e==="delete"?"Deleted":e==="rename"?"Renamed":"Modified")}function Ue(e){const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null;return typeof(t==null?void 0:t.threadId)=="string"?t.threadId:""}async function q(){var e,t,u,v;if(g.cwd.trim()){J.value=!0,M.value="";try{const p=m.value==="baseBranch"?x.value.trim():"",n=((e=g.commitSha)==null?void 0:e.trim())??"",i=await ot(g.cwd,S.value?"commit":m.value,F.value,p||null,n||null);if(i.baseBranchOptions.length>0){const _=i.baseBranch??i.baseBranchOptions[0]??"";x.value!==_&&(H.value=!0,x.value=_)}else x.value!==""&&(H.value=!0,x.value="");d.value=i;const f=i.files.some(_=>_.id===L.value);!le()&&!f&&(L.value=((t=i.files[0])==null?void 0:t.id)??"",I.value=((v=(u=i.files[0])==null?void 0:u.hunks[0])==null?void 0:v.id)??"")}catch(p){M.value=p instanceof Error?p.message:"Failed to load review snapshot"}finally{J.value=!1}}}async function _e(){await q()}function He(){Ie("close")}function te(e){var u,v;fe(e),L.value=e;const t=((u=d.value)==null?void 0:u.files.find(p=>p.id===e))??null;I.value=((v=t==null?void 0:t.hunks[0])==null?void 0:v.id)??"",B.value&&(O.value=!1)}function ye(e){return e.trim().slice(0,7)}async function ae(e,t,u=""){var v,p,n;if(d.value){R.value=!0,$.value="";try{const i=await ut({cwd:g.cwd,scope:m.value,workspaceView:F.value,action:e,level:t,patch:u});d.value=i,i.files.some(_=>_.id===L.value)||(L.value=((v=i.files[0])==null?void 0:v.id)??"",I.value=((n=(p=i.files[0])==null?void 0:p.hunks[0])==null?void 0:n.id)??"")}catch(i){$.value=i instanceof Error?i.message:"Failed to apply review action"}finally{R.value=!1}}}async function Oe(e){await ae(e,"all")}async function Xe(e,t){await ae(e,"file",t.diff)}async function Ke(e,t){I.value=t.id,await ae(e,"hunk",t.patch)}async function je(){if(g.cwd.trim()){X.value=!0,$.value="";try{await rt(g.cwd),await q()}catch(e){$.value=e instanceof Error?e.message:"Failed to initialize Git"}finally{X.value=!1}}}function Ye(e){if(Ue(e)!==g.threadId)return;const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null,u=(t==null?void 0:t.item)!==null&&typeof(t==null?void 0:t.item)=="object"&&!Array.isArray(t.item)?t.item:null,v=typeof(u==null?void 0:u.type)=="string"?u.type:"";if(e.method==="item/started"&&v==="enteredReviewMode"){K.value=typeof(u==null?void 0:u.review)=="string"?u.review:"Review in progress";return}e.method==="item/completed"&&v==="exitedReviewMode"&&(K.value="")}return G(()=>[g.threadId,g.cwd,g.commitSha],()=>{S.value&&(m.value="workspace"),L.value="",I.value="",$.value="",K.value="",_e()},{immediate:!0}),G(()=>[g.initialFilePath,g.commitSha],()=>{le()}),G(()=>[m.value,F.value],()=>{L.value="",I.value="",$.value="",M.value="",q()}),G(x,(e,t)=>{if(H.value){H.value=!1;return}m.value==="baseBranch"&&(!e||e===t||q())}),G(k,e=>{var t;e&&(fe(e.id),e.hunks.some(u=>u.id===I.value)||(I.value=((t=e.hunks[0])==null?void 0:t.id)??""))}),Qe(()=>{j=et(Ye)}),tt(()=>{j&&(j(),j=null),A==null||A()}),(e,t)=>(o(),at(it,{to:"body"},[Z(ge,{name:"review-pane-modal"},{default:ke(()=>{var u,v,p;return[a("div",{class:se(["review-pane-backdrop",{"is-mobile":c(B)}]),onClick:He},[a("section",{class:se(["review-pane",{"is-mobile":c(B)}]),onPointerdown:t[9]||(t[9]=ne(()=>{},["stop"])),onClick:t[10]||(t[10]=ne(()=>{},["stop"]))},[a("header",ct,[a("div",vt,[a("p",pt,s(c(l)("Review")),1),a("p",ht,s(Ae.value),1)]),a("div",ft,[c(B)&&((u=d.value)!=null&&u.files.length)?(o(),r("button",{key:0,type:"button",class:"review-pane-mobile-files-button",onClick:t[0]||(t[0]=n=>O.value=!0)},s(c(l)("Files")),1)):w("",!0),a("button",{type:"button",class:"review-pane-close","aria-label":c(l)("Close review pane"),onClick:t[1]||(t[1]=n=>e.$emit("close"))},[Z(st,{class:"icon-svg"})],8,wt)])]),a("div",mt,[a("div",_t,[S.value?w("",!0):(o(),r("div",yt,[a("span",bt,s(c(l)("Compare")),1),a("div",kt,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":m.value==="workspace",onClick:t[2]||(t[2]=n=>m.value="workspace")},s(c(l)("Workspace")),9,gt),a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":m.value==="baseBranch",disabled:!((v=d.value)!=null&&v.baseBranch),onClick:t[3]||(t[3]=n=>m.value="baseBranch")},s(c(l)("Base branch")),9,Ct)])])),!S.value&&m.value==="baseBranch"&&((p=d.value)!=null&&p.baseBranchOptions.length)?(o(),r("div",Bt,[a("span",Ft,s(c(l)("Branch")),1),Z(nt,{modelValue:x.value,"onUpdate:modelValue":t[4]||(t[4]=n=>x.value=n),class:"review-pane-branch-dropdown",options:xe.value,placeholder:c(l)("Branch"),"enable-search":"","search-placeholder":c(l)("Search branches...")},null,8,["modelValue","options","placeholder","search-placeholder"])])):w("",!0),!S.value&&m.value==="workspace"?(o(),r("div",St,[a("span",It,s(c(l)("Changes")),1),a("div",xt,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":F.value==="unstaged",onClick:t[5]||(t[5]=n=>F.value="unstaged")},s(c(l)("Unstaged")),9,Lt),a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":F.value==="staged",onClick:t[6]||(t[6]=n=>F.value="staged")},s(c(l)("Staged")),9,$t)])])):w("",!0)]),a("div",At,[a("button",{type:"button",class:"review-pane-refresh",disabled:J.value,onClick:_e},s(c(l)("Refresh")),9,Pt)])]),ue.value?(o(),r("div",{key:0,class:se(["review-pane-banner",{"is-error":Te.value}])},s(ue.value),3)):w("",!0),d.value?(o(),r("div",Et,[a("span",null,s(d.value.summary.fileCount)+" "+s(c(l)("files")),1),a("span",Rt,"+"+s(d.value.summary.addedLineCount),1),a("span",Tt,"-"+s(d.value.summary.removedLineCount),1),d.value.headBranch?(o(),r("span",Nt,s(d.value.headBranch),1)):w("",!0),S.value&&d.value.commitSha?(o(),r("span",Mt,s(ye(d.value.commitSha)),1)):w("",!0),!S.value&&m.value==="baseBranch"&&d.value.baseBranch?(o(),r("span",Dt,"vs "+s(d.value.baseBranch),1)):w("",!0)])):w("",!0),a("div",Wt,[d.value?d.value.isGitRepo?!S.value&&m.value==="baseBranch"&&!d.value.baseBranch?(o(),r("div",Xt,[a("p",Kt,s(c(l)("Base branch unavailable")),1),a("p",jt,s(c(l)("Could not resolve `origin/HEAD`, `main`, or `master` for this repository.")),1)])):(o(),r(C,{key:3},[oe.value?(o(),r("div",Yt,[(o(!0),r(C,null,E(Pe.value,n=>(o(),r("button",{key:n.value,type:"button",class:"review-pane-bulk-button",disabled:R.value,onClick:i=>Oe(n.value)},s(n.label),9,qt))),128))])):w("",!0),d.value.files.length?(o(),r("div",{key:2,class:"review-pane-main",style:U(Ne.value)},[c(B)?w("",!0):(o(),r("aside",ea,[(o(!0),r(C,null,E(ce.value,n=>{var i;return o(),r(C,{key:n.treeKey},[n.kind==="folder"?(o(),r("button",{key:0,type:"button",class:"review-pane-tree-folder",style:U(we(n.depth)),"data-expanded":D(n.id),onClick:f=>he(n.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":D(n.id)},null,8,aa),a("span",sa,s(n.name),1),a("span",na,s(n.fileCount),1)],12,ta)):(o(),r("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:U(me()),"data-active":((i=k.value)==null?void 0:i.id)===n.file.id,title:n.file.path,onClick:f=>te(n.file.id)},[a("span",la,[a("span",oa,[N(s(n.name)+" ",1),n.file.previousPath?(o(),r(C,{key:0},[N(" ← "+s(ve(n.file.previousPath)),1)],64)):w("",!0)]),a("span",ra,[a("span",ua,"+"+s(n.file.addedLineCount),1),t[11]||(t[11]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",da,"-"+s(n.file.removedLineCount),1)])]),a("span",{class:"review-pane-file-op","data-operation":n.file.operation},s(ee(n.file.operation)),9,ca)],12,ia))],64)}),128))])),c(B)?w("",!0):(o(),r("div",{key:1,class:"review-pane-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file list",onPointerdown:ze},null,32)),a("section",va,[k.value?(o(),r(C,{key:0},[a("div",pa,[a("div",ha,[a("p",fa,[N(s(k.value.path)+" ",1),k.value.previousPath?(o(),r(C,{key:0},[N(" ← "+s(k.value.previousPath),1)],64)):w("",!0)]),a("p",wa,s(ee(k.value.operation))+" · +"+s(k.value.addedLineCount)+" / -"+s(k.value.removedLineCount),1)]),re.value?(o(),r("div",ma,[(o(!0),r(C,null,E(Ee.value,n=>(o(),r("button",{key:`${k.value.id}:${n.value}`,type:"button",class:"review-pane-row-button",disabled:R.value,onClick:i=>Xe(n.value,k.value)},s(n.label),9,_a))),128))])):w("",!0)]),k.value.hunks.length===0?(o(),r("div",ya,[a("pre",null,s(k.value.diff||"No unified diff available."),1)])):(o(),r("div",ba,[(o(!0),r(C,null,E(k.value.hunks,n=>(o(),r("article",{key:n.id,class:"review-pane-hunk","data-active":I.value===n.id,onClick:i=>I.value=n.id},[a("div",ga,[a("div",null,[a("p",Ca,s(n.header),1),a("p",Ba,"+"+s(n.addedLineCount)+" / -"+s(n.removedLineCount),1)]),re.value?(o(),r("div",Fa,[(o(!0),r(C,null,E(Re.value,i=>(o(),r("button",{key:`${n.id}:${i.value}`,type:"button",class:"review-pane-row-button",disabled:R.value,onClick:f=>Ke(i.value,n)},s(i.label),9,Sa))),128))])):w("",!0)]),a("div",Ia,[(o(!0),r(C,null,E(n.lines,i=>(o(),r("div",{key:i.key,class:"review-pane-line","data-kind":i.kind},[a("span",La,s(i.oldLine??""),1),a("span",$a,s(i.newLine??""),1),a("span",Aa,s(Ve(i.kind)),1),a("code",Pa,s(i.text||" "),1)],8,xa))),128))])],8,ka))),128))]))],64)):w("",!0)])],4)):(o(),r("div",Zt,[a("p",Jt,s(c(l)("No changes in this scope")),1),a("p",Qt,s(Le.value),1)]))],64)):(o(),r("div",Gt,[a("p",Ut,s(c(l)("This folder is not a Git repository")),1),a("p",Ht,s(c(l)("Initialize Git to review local changes and run Codex review.")),1),a("button",{type:"button",class:"review-pane-primary-cta",disabled:X.value,onClick:je},s(X.value?c(l)("Initializing…"):c(l)("Initialize Git")),9,Ot)])):(o(),r("div",zt,[a("p",Vt,s(c(l)("Loading review state")),1)]))]),Z(ge,{name:"review-pane-sheet"},{default:ke(()=>{var n;return[c(B)&&O.value&&((n=d.value)!=null&&n.files.length)?(o(),r("div",{key:0,class:"review-pane-sheet-backdrop",onClick:t[8]||(t[8]=i=>O.value=!1)},[a("div",{class:"review-pane-sheet",onClick:t[7]||(t[7]=ne(()=>{},["stop"]))},[t[13]||(t[13]=a("div",{class:"review-pane-sheet-handle","aria-hidden":"true"},null,-1)),a("div",Ea,[a("p",Ra,s(c(l)("Changed files")),1),a("p",Ta,s(d.value.files.length),1)]),a("div",Na,[(o(!0),r(C,null,E(ce.value,i=>{var f;return o(),r(C,{key:`sheet:${i.treeKey}`},[i.kind==="folder"?(o(),r("button",{key:0,type:"button",class:"review-pane-tree-folder review-pane-tree-folder-sheet",style:U(we(i.depth)),"data-expanded":D(i.id),onClick:_=>he(i.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":D(i.id)},null,8,Da),a("span",Wa,s(i.name),1),a("span",za,s(i.fileCount),1)],12,Ma)):(o(),r("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:U(me()),"data-active":((f=k.value)==null?void 0:f.id)===i.file.id,title:i.file.path,onClick:_=>te(i.file.id)},[a("span",Ga,[a("span",Ua,[N(s(i.name)+" ",1),i.file.previousPath?(o(),r(C,{key:0},[N(" ← "+s(ve(i.file.previousPath)),1)],64)):w("",!0)]),a("span",Ha,[a("span",Oa,"+"+s(i.file.addedLineCount),1),t[12]||(t[12]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",Xa,"-"+s(i.file.removedLineCount),1)])]),a("span",{class:"review-pane-file-op","data-operation":i.file.operation},s(ee(i.file.operation)),9,Ka)],12,Va))],64)}),128))])])])):w("",!0)]}),_:1})],34)],2)]}),_:1})]))}}),Ja=dt(qa,[["__scopeId","data-v-e9fd9327"]]);export{Ja as default};
|
|
1
|
+
import{e as Ze,H as Je,r as y,x as G,O as Qe,P as et,o as tt,f as o,h as at,p as Z,s as ke,j as a,n as se,u as c,w as ne,t as s,i as r,k as w,I as st,W as nt,F as C,l as E,y as U,m as N,q as ge,T as it,v as lt,c as b,X as ot,Y as rt,Z as ut,_ as dt}from"./index-BJ-YiA9y.js";const ct={class:"review-pane-header"},vt={class:"review-pane-heading"},pt={class:"review-pane-eyebrow"},ht={class:"review-pane-title"},ft={class:"review-pane-header-actions"},wt=["aria-label"],mt={class:"review-pane-toolbar"},_t={class:"review-pane-toolbar-controls"},yt={key:0,class:"review-pane-control-cluster"},bt={class:"review-pane-control-label"},kt={class:"review-pane-segmented"},gt=["data-active"],Ct=["data-active","disabled"],Bt={key:1,class:"review-pane-control-cluster"},Ft={class:"review-pane-control-label"},St={key:2,class:"review-pane-control-cluster"},It={class:"review-pane-control-label"},xt={class:"review-pane-segmented"},Lt=["data-active"],$t=["data-active"],At={class:"review-pane-toolbar-actions"},Pt=["disabled"],Et={key:1,class:"review-pane-meta"},Rt={class:"review-pane-summary-pill review-pane-summary-pill-add"},Tt={class:"review-pane-summary-pill review-pane-summary-pill-remove"},Nt={key:0},Mt={key:1},Dt={key:2},Wt={class:"review-pane-content"},zt={key:0,class:"review-pane-empty"},Vt={class:"review-pane-empty-title"},Gt={key:1,class:"review-pane-empty"},Ut={class:"review-pane-empty-title"},Ht={class:"review-pane-empty-text"},Ot=["disabled"],Xt={key:2,class:"review-pane-empty"},Kt={class:"review-pane-empty-title"},jt={class:"review-pane-empty-text"},Yt={key:0,class:"review-pane-bulk-actions"},qt=["disabled","onClick"],Zt={key:1,class:"review-pane-empty"},Jt={class:"review-pane-empty-title"},Qt={class:"review-pane-empty-text"},ea={key:0,class:"review-pane-file-list"},ta=["data-expanded","onClick"],aa=["data-expanded"],sa={class:"review-pane-tree-folder-name"},na={class:"review-pane-tree-folder-count"},ia=["data-active","title","onClick"],la={class:"review-pane-file-meta-row"},oa={class:"review-pane-file-path"},ra={class:"review-pane-file-delta"},ua={class:"review-pane-delta-add"},da={class:"review-pane-delta-remove"},ca=["data-operation"],va={class:"review-pane-diff"},pa={class:"review-pane-file-header"},ha={class:"review-pane-file-header-main"},fa={class:"review-pane-file-title"},wa={class:"review-pane-file-subtitle"},ma={key:0,class:"review-pane-row-actions"},_a=["disabled","onClick"],ya={key:0,class:"review-pane-raw-diff"},ba={key:1,class:"review-pane-hunks"},ka=["data-active","onClick"],ga={class:"review-pane-hunk-header"},Ca={class:"review-pane-hunk-title"},Ba={class:"review-pane-hunk-meta"},Fa={key:0,class:"review-pane-row-actions"},Sa=["disabled","onClick"],Ia={class:"review-pane-lines"},xa=["data-kind"],La={class:"review-pane-line-number"},$a={class:"review-pane-line-number"},Aa={class:"review-pane-line-marker"},Pa={class:"review-pane-line-code"},Ea={class:"review-pane-sheet-header"},Ra={class:"review-pane-sheet-title"},Ta={class:"review-pane-sheet-count"},Na={class:"review-pane-sheet-list"},Ma=["data-expanded","onClick"],Da=["data-expanded"],Wa={class:"review-pane-tree-folder-name"},za={class:"review-pane-tree-folder-count"},Va=["data-active","title","onClick"],Ga={class:"review-pane-file-meta-row"},Ua={class:"review-pane-file-path"},Ha={class:"review-pane-file-delta"},Oa={class:"review-pane-delta-add"},Xa={class:"review-pane-delta-remove"},Ka=["data-operation"],Ce="codex-web-local.review-pane-file-list-width.v1",ja=220,Ya=420,Be=288,qa=Ze({__name:"ReviewPane",props:{threadId:{},cwd:{},isThreadInProgress:{type:Boolean},initialFilePath:{},commitSha:{}},emits:["close"],setup(Fe,{emit:Se}){const g=Fe,Ie=Se,{isMobile:B}=Je(),{t:l}=lt(),m=y("workspace"),F=y("unstaged"),d=y(null),x=y(""),H=y(!1),L=y(""),I=y(""),O=y(!1),J=y(!1),R=y(!1),X=y(!1),M=y(""),$=y(""),K=y("");let j=null,A=null;const k=b(()=>{var e,t;return((e=d.value)==null?void 0:e.files.find(u=>u.id===L.value))??((t=d.value)==null?void 0:t.files[0])??null}),T=y({}),S=b(()=>{var e;return!!((e=g.commitSha)!=null&&e.trim())}),xe=b(()=>{var e;return(((e=d.value)==null?void 0:e.baseBranchOptions)??[]).map(t=>({value:t,label:t}))}),Le=b(()=>{var e;return((e=d.value)==null?void 0:e.scope)==="commit"||S.value?l("No file changes in this commit."):m.value==="workspace"?l("Your current workspace is clean."):l("No merge diff found against the base branch.")});function ie(e){return e.trim().replace(/\\/g,"/")}function $e(e){const t=ie(e);return!t||!d.value?null:d.value.files.find(u=>[u.path,u.absolutePath,u.previousPath,u.previousAbsolutePath].some(v=>typeof v=="string"&&ie(v)===t))??null}function le(){const e=$e(g.initialFilePath??"");return e?(te(e.id),!0):!1}const Ae=b(()=>{var e,t;return(e=d.value)!=null&&e.isGitRepo?S.value?d.value.commitSha?`${l("Commit")} ${ye(d.value.commitSha)}`:l("Commit"):m.value==="workspace"?F.value==="staged"?l("Staged changes"):l("Workspace changes"):(t=d.value)!=null&&t.baseBranch?`${l("Against")} ${d.value.baseBranch}`:l("Base branch"):l("Repository review")}),oe=b(()=>{var e;return!S.value&&m.value==="workspace"&&((e=d.value)==null?void 0:e.isGitRepo)===!0&&d.value.files.length>0}),re=b(()=>oe.value&&!R.value),Pe=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage all")}]:[{value:"stage",label:l("Stage all")},{value:"revert",label:l("Revert all")}]),Ee=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage file")}]:[{value:"stage",label:l("Stage file")},{value:"revert",label:l("Revert file")}]),Re=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage hunk")}]:[{value:"stage",label:l("Stage hunk")},{value:"revert",label:l("Revert hunk")}]),ue=b(()=>$.value||M.value||K.value),Te=b(()=>!!($.value||M.value)),Y=y(De()),Ne=b(()=>{const e={};return B.value||(e["--review-file-list-width"]=`${Y.value}px`),e}),de=b(()=>{var e;return Ge(((e=d.value)==null?void 0:e.files)??[],T.value)}),ce=b(()=>de.value.nodes),Me=b(()=>de.value.folderIdsByFileId);function Q(e){return Number.isFinite(e)?Math.min(Ya,Math.max(ja,Math.round(e))):Be}function De(){if(typeof window>"u")return Be;const e=window.localStorage.getItem(Ce),t=e?Number(e):Number.NaN;return Q(t)}function We(e){typeof window>"u"||window.localStorage.setItem(Ce,String(Q(e)))}function ze(e){if(B.value)return;e.preventDefault(),A==null||A();const t=e.clientX,u=Y.value,v=i=>{Y.value=Q(u+(i.clientX-t))},p=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",n),A=null},n=()=>{p(),We(Y.value)};window.addEventListener("pointermove",v),window.addEventListener("pointerup",n),A=p}function Ve(e){return e==="add"?"+":e==="remove"?"-":e==="hunk"?"@@":" "}function ve(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??e}function pe(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}function Ge(e,t){const u={folders:new Map,files:[]},v={};for(const f of e){const _=f.path.split("/").filter(Boolean),W=_.pop()??f.path;let h=u,P="";const be=[];for(const[qe,z]of _.entries()){P=P?`${P}/${z}`:z;let V=h.folders.get(z);V||(V={id:P,name:z,depth:qe,folders:new Map,files:[]},h.folders.set(z,V)),h=V,be.push(V.id)}h.files.push({file:f,name:W,depth:_.length}),v[f.id]=be}const p=[],n=f=>f.files.length+Array.from(f.folders.values()).reduce((_,W)=>_+n(W),0),i=f=>{const _=Array.from(f.folders.values()).sort((h,P)=>pe(h.name,P.name)),W=[...f.files].sort((h,P)=>pe(h.name,P.name));for(const h of _)p.push({kind:"folder",treeKey:`folder:${h.id}`,id:h.id,name:h.name,depth:h.depth,fileCount:n(h)}),t[h.id]!==!1&&i(h);for(const h of W)p.push({kind:"file",treeKey:`file:${h.file.id}`,id:h.file.id,name:h.name,depth:h.depth,file:h.file})};return i(u),{nodes:p,folderIdsByFileId:v}}function D(e){return T.value[e]!==!1}function he(e){T.value={...T.value,[e]:!D(e)}}function fe(e){const t=Me.value[e]??[];if(t.length===0)return;const u={...T.value};let v=!1;for(const p of t)u[p]===!1&&(u[p]=!0,v=!0);v&&(T.value=u)}function we(e){const t=B.value?8:10,u=B.value?12:14;return{paddingLeft:`${t+e*u}px`}}function me(){return{paddingLeft:B.value?"8px":"10px"}}function ee(e){return l(e==="add"?"Added":e==="delete"?"Deleted":e==="rename"?"Renamed":"Modified")}function Ue(e){const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null;return typeof(t==null?void 0:t.threadId)=="string"?t.threadId:""}async function q(){var e,t,u,v;if(g.cwd.trim()){J.value=!0,M.value="";try{const p=m.value==="baseBranch"?x.value.trim():"",n=((e=g.commitSha)==null?void 0:e.trim())??"",i=await ot(g.cwd,S.value?"commit":m.value,F.value,p||null,n||null);if(i.baseBranchOptions.length>0){const _=i.baseBranch??i.baseBranchOptions[0]??"";x.value!==_&&(H.value=!0,x.value=_)}else x.value!==""&&(H.value=!0,x.value="");d.value=i;const f=i.files.some(_=>_.id===L.value);!le()&&!f&&(L.value=((t=i.files[0])==null?void 0:t.id)??"",I.value=((v=(u=i.files[0])==null?void 0:u.hunks[0])==null?void 0:v.id)??"")}catch(p){M.value=p instanceof Error?p.message:"Failed to load review snapshot"}finally{J.value=!1}}}async function _e(){await q()}function He(){Ie("close")}function te(e){var u,v;fe(e),L.value=e;const t=((u=d.value)==null?void 0:u.files.find(p=>p.id===e))??null;I.value=((v=t==null?void 0:t.hunks[0])==null?void 0:v.id)??"",B.value&&(O.value=!1)}function ye(e){return e.trim().slice(0,7)}async function ae(e,t,u=""){var v,p,n;if(d.value){R.value=!0,$.value="";try{const i=await ut({cwd:g.cwd,scope:m.value,workspaceView:F.value,action:e,level:t,patch:u});d.value=i,i.files.some(_=>_.id===L.value)||(L.value=((v=i.files[0])==null?void 0:v.id)??"",I.value=((n=(p=i.files[0])==null?void 0:p.hunks[0])==null?void 0:n.id)??"")}catch(i){$.value=i instanceof Error?i.message:"Failed to apply review action"}finally{R.value=!1}}}async function Oe(e){await ae(e,"all")}async function Xe(e,t){await ae(e,"file",t.diff)}async function Ke(e,t){I.value=t.id,await ae(e,"hunk",t.patch)}async function je(){if(g.cwd.trim()){X.value=!0,$.value="";try{await rt(g.cwd),await q()}catch(e){$.value=e instanceof Error?e.message:"Failed to initialize Git"}finally{X.value=!1}}}function Ye(e){if(Ue(e)!==g.threadId)return;const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null,u=(t==null?void 0:t.item)!==null&&typeof(t==null?void 0:t.item)=="object"&&!Array.isArray(t.item)?t.item:null,v=typeof(u==null?void 0:u.type)=="string"?u.type:"";if(e.method==="item/started"&&v==="enteredReviewMode"){K.value=typeof(u==null?void 0:u.review)=="string"?u.review:"Review in progress";return}e.method==="item/completed"&&v==="exitedReviewMode"&&(K.value="")}return G(()=>[g.threadId,g.cwd,g.commitSha],()=>{S.value&&(m.value="workspace"),L.value="",I.value="",$.value="",K.value="",_e()},{immediate:!0}),G(()=>[g.initialFilePath,g.commitSha],()=>{le()}),G(()=>[m.value,F.value],()=>{L.value="",I.value="",$.value="",M.value="",q()}),G(x,(e,t)=>{if(H.value){H.value=!1;return}m.value==="baseBranch"&&(!e||e===t||q())}),G(k,e=>{var t;e&&(fe(e.id),e.hunks.some(u=>u.id===I.value)||(I.value=((t=e.hunks[0])==null?void 0:t.id)??""))}),Qe(()=>{j=et(Ye)}),tt(()=>{j&&(j(),j=null),A==null||A()}),(e,t)=>(o(),at(it,{to:"body"},[Z(ge,{name:"review-pane-modal"},{default:ke(()=>{var u,v,p;return[a("div",{class:se(["review-pane-backdrop",{"is-mobile":c(B)}]),onClick:He},[a("section",{class:se(["review-pane",{"is-mobile":c(B)}]),onPointerdown:t[9]||(t[9]=ne(()=>{},["stop"])),onClick:t[10]||(t[10]=ne(()=>{},["stop"]))},[a("header",ct,[a("div",vt,[a("p",pt,s(c(l)("Review")),1),a("p",ht,s(Ae.value),1)]),a("div",ft,[c(B)&&((u=d.value)!=null&&u.files.length)?(o(),r("button",{key:0,type:"button",class:"review-pane-mobile-files-button",onClick:t[0]||(t[0]=n=>O.value=!0)},s(c(l)("Files")),1)):w("",!0),a("button",{type:"button",class:"review-pane-close","aria-label":c(l)("Close review pane"),onClick:t[1]||(t[1]=n=>e.$emit("close"))},[Z(st,{class:"icon-svg"})],8,wt)])]),a("div",mt,[a("div",_t,[S.value?w("",!0):(o(),r("div",yt,[a("span",bt,s(c(l)("Compare")),1),a("div",kt,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":m.value==="workspace",onClick:t[2]||(t[2]=n=>m.value="workspace")},s(c(l)("Workspace")),9,gt),a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":m.value==="baseBranch",disabled:!((v=d.value)!=null&&v.baseBranch),onClick:t[3]||(t[3]=n=>m.value="baseBranch")},s(c(l)("Base branch")),9,Ct)])])),!S.value&&m.value==="baseBranch"&&((p=d.value)!=null&&p.baseBranchOptions.length)?(o(),r("div",Bt,[a("span",Ft,s(c(l)("Branch")),1),Z(nt,{modelValue:x.value,"onUpdate:modelValue":t[4]||(t[4]=n=>x.value=n),class:"review-pane-branch-dropdown",options:xe.value,placeholder:c(l)("Branch"),"enable-search":"","search-placeholder":c(l)("Search branches...")},null,8,["modelValue","options","placeholder","search-placeholder"])])):w("",!0),!S.value&&m.value==="workspace"?(o(),r("div",St,[a("span",It,s(c(l)("Changes")),1),a("div",xt,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":F.value==="unstaged",onClick:t[5]||(t[5]=n=>F.value="unstaged")},s(c(l)("Unstaged")),9,Lt),a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":F.value==="staged",onClick:t[6]||(t[6]=n=>F.value="staged")},s(c(l)("Staged")),9,$t)])])):w("",!0)]),a("div",At,[a("button",{type:"button",class:"review-pane-refresh",disabled:J.value,onClick:_e},s(c(l)("Refresh")),9,Pt)])]),ue.value?(o(),r("div",{key:0,class:se(["review-pane-banner",{"is-error":Te.value}])},s(ue.value),3)):w("",!0),d.value?(o(),r("div",Et,[a("span",null,s(d.value.summary.fileCount)+" "+s(c(l)("files")),1),a("span",Rt,"+"+s(d.value.summary.addedLineCount),1),a("span",Tt,"-"+s(d.value.summary.removedLineCount),1),d.value.headBranch?(o(),r("span",Nt,s(d.value.headBranch),1)):w("",!0),S.value&&d.value.commitSha?(o(),r("span",Mt,s(ye(d.value.commitSha)),1)):w("",!0),!S.value&&m.value==="baseBranch"&&d.value.baseBranch?(o(),r("span",Dt,"vs "+s(d.value.baseBranch),1)):w("",!0)])):w("",!0),a("div",Wt,[d.value?d.value.isGitRepo?!S.value&&m.value==="baseBranch"&&!d.value.baseBranch?(o(),r("div",Xt,[a("p",Kt,s(c(l)("Base branch unavailable")),1),a("p",jt,s(c(l)("Could not resolve `origin/HEAD`, `main`, or `master` for this repository.")),1)])):(o(),r(C,{key:3},[oe.value?(o(),r("div",Yt,[(o(!0),r(C,null,E(Pe.value,n=>(o(),r("button",{key:n.value,type:"button",class:"review-pane-bulk-button",disabled:R.value,onClick:i=>Oe(n.value)},s(n.label),9,qt))),128))])):w("",!0),d.value.files.length?(o(),r("div",{key:2,class:"review-pane-main",style:U(Ne.value)},[c(B)?w("",!0):(o(),r("aside",ea,[(o(!0),r(C,null,E(ce.value,n=>{var i;return o(),r(C,{key:n.treeKey},[n.kind==="folder"?(o(),r("button",{key:0,type:"button",class:"review-pane-tree-folder",style:U(we(n.depth)),"data-expanded":D(n.id),onClick:f=>he(n.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":D(n.id)},null,8,aa),a("span",sa,s(n.name),1),a("span",na,s(n.fileCount),1)],12,ta)):(o(),r("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:U(me()),"data-active":((i=k.value)==null?void 0:i.id)===n.file.id,title:n.file.path,onClick:f=>te(n.file.id)},[a("span",la,[a("span",oa,[N(s(n.name)+" ",1),n.file.previousPath?(o(),r(C,{key:0},[N(" ← "+s(ve(n.file.previousPath)),1)],64)):w("",!0)]),a("span",ra,[a("span",ua,"+"+s(n.file.addedLineCount),1),t[11]||(t[11]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",da,"-"+s(n.file.removedLineCount),1)])]),a("span",{class:"review-pane-file-op","data-operation":n.file.operation},s(ee(n.file.operation)),9,ca)],12,ia))],64)}),128))])),c(B)?w("",!0):(o(),r("div",{key:1,class:"review-pane-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file list",onPointerdown:ze},null,32)),a("section",va,[k.value?(o(),r(C,{key:0},[a("div",pa,[a("div",ha,[a("p",fa,[N(s(k.value.path)+" ",1),k.value.previousPath?(o(),r(C,{key:0},[N(" ← "+s(k.value.previousPath),1)],64)):w("",!0)]),a("p",wa,s(ee(k.value.operation))+" · +"+s(k.value.addedLineCount)+" / -"+s(k.value.removedLineCount),1)]),re.value?(o(),r("div",ma,[(o(!0),r(C,null,E(Ee.value,n=>(o(),r("button",{key:`${k.value.id}:${n.value}`,type:"button",class:"review-pane-row-button",disabled:R.value,onClick:i=>Xe(n.value,k.value)},s(n.label),9,_a))),128))])):w("",!0)]),k.value.hunks.length===0?(o(),r("div",ya,[a("pre",null,s(k.value.diff||"No unified diff available."),1)])):(o(),r("div",ba,[(o(!0),r(C,null,E(k.value.hunks,n=>(o(),r("article",{key:n.id,class:"review-pane-hunk","data-active":I.value===n.id,onClick:i=>I.value=n.id},[a("div",ga,[a("div",null,[a("p",Ca,s(n.header),1),a("p",Ba,"+"+s(n.addedLineCount)+" / -"+s(n.removedLineCount),1)]),re.value?(o(),r("div",Fa,[(o(!0),r(C,null,E(Re.value,i=>(o(),r("button",{key:`${n.id}:${i.value}`,type:"button",class:"review-pane-row-button",disabled:R.value,onClick:f=>Ke(i.value,n)},s(i.label),9,Sa))),128))])):w("",!0)]),a("div",Ia,[(o(!0),r(C,null,E(n.lines,i=>(o(),r("div",{key:i.key,class:"review-pane-line","data-kind":i.kind},[a("span",La,s(i.oldLine??""),1),a("span",$a,s(i.newLine??""),1),a("span",Aa,s(Ve(i.kind)),1),a("code",Pa,s(i.text||" "),1)],8,xa))),128))])],8,ka))),128))]))],64)):w("",!0)])],4)):(o(),r("div",Zt,[a("p",Jt,s(c(l)("No changes in this scope")),1),a("p",Qt,s(Le.value),1)]))],64)):(o(),r("div",Gt,[a("p",Ut,s(c(l)("This folder is not a Git repository")),1),a("p",Ht,s(c(l)("Initialize Git to review local changes and run Codex review.")),1),a("button",{type:"button",class:"review-pane-primary-cta",disabled:X.value,onClick:je},s(X.value?c(l)("Initializing…"):c(l)("Initialize Git")),9,Ot)])):(o(),r("div",zt,[a("p",Vt,s(c(l)("Loading review state")),1)]))]),Z(ge,{name:"review-pane-sheet"},{default:ke(()=>{var n;return[c(B)&&O.value&&((n=d.value)!=null&&n.files.length)?(o(),r("div",{key:0,class:"review-pane-sheet-backdrop",onClick:t[8]||(t[8]=i=>O.value=!1)},[a("div",{class:"review-pane-sheet",onClick:t[7]||(t[7]=ne(()=>{},["stop"]))},[t[13]||(t[13]=a("div",{class:"review-pane-sheet-handle","aria-hidden":"true"},null,-1)),a("div",Ea,[a("p",Ra,s(c(l)("Changed files")),1),a("p",Ta,s(d.value.files.length),1)]),a("div",Na,[(o(!0),r(C,null,E(ce.value,i=>{var f;return o(),r(C,{key:`sheet:${i.treeKey}`},[i.kind==="folder"?(o(),r("button",{key:0,type:"button",class:"review-pane-tree-folder review-pane-tree-folder-sheet",style:U(we(i.depth)),"data-expanded":D(i.id),onClick:_=>he(i.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":D(i.id)},null,8,Da),a("span",Wa,s(i.name),1),a("span",za,s(i.fileCount),1)],12,Ma)):(o(),r("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:U(me()),"data-active":((f=k.value)==null?void 0:f.id)===i.file.id,title:i.file.path,onClick:_=>te(i.file.id)},[a("span",Ga,[a("span",Ua,[N(s(i.name)+" ",1),i.file.previousPath?(o(),r(C,{key:0},[N(" ← "+s(ve(i.file.previousPath)),1)],64)):w("",!0)]),a("span",Ha,[a("span",Oa,"+"+s(i.file.addedLineCount),1),t[12]||(t[12]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",Xa,"-"+s(i.file.removedLineCount),1)])]),a("span",{class:"review-pane-file-op","data-operation":i.file.operation},s(ee(i.file.operation)),9,Ka)],12,Va))],64)}),128))])])])):w("",!0)]}),_:1})],34)],2)]}),_:1})]))}}),Ja=dt(qa,[["__scopeId","data-v-e9fd9327"]]);export{Ja as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as u,x as _,aC as g,f as a,i as r,j as i,t,u as n,k as w,v as m,r as p,c as y,_ as k}from"./index-
|
|
1
|
+
import{e as u,x as _,aC as g,f as a,i as r,j as i,t,u as n,k as w,v as m,r as p,c as y,_ as k}from"./index-BJ-YiA9y.js";const b={class:"right-file-preview"},x={class:"right-file-preview-header"},F={class:"right-file-preview-title-wrap"},P={class:"right-file-preview-title"},L={class:"right-file-preview-path"},B=["href"],C={class:"right-file-preview-body"},E={key:0,class:"right-file-preview-empty"},I={key:1,class:"right-file-preview-empty is-error"},R=["src","alt"],U={key:3,class:"right-file-preview-code"},N={key:4,class:"right-file-preview-empty"},O=["href"],S={key:0,class:"right-file-preview-footer"},T=u({__name:"RightFilePreview",props:{filePath:{},name:{}},setup(c){const f=c,{t:l}=m(),e=p(null),h=p(!1),v=p(""),d=y(()=>{const s=f.filePath.replace(/\\/g,"/"),o=s.startsWith("/")?s:`/${s}`;return`/codex-local-browse${encodeURI(o)}`});return _(()=>f.filePath,async s=>{if(e.value=null,v.value="",!!s){h.value=!0;try{e.value=await g(s)}catch(o){v.value=o instanceof Error?o.message:"Failed to preview file"}finally{h.value=!1}}},{immediate:!0}),(s,o)=>(a(),r("div",b,[i("div",x,[i("div",F,[i("span",P,t(c.name),1),i("span",L,t(c.filePath),1)]),i("a",{class:"right-file-preview-open",href:d.value,target:"_blank",rel:"noopener noreferrer"},t(n(l)("Open in browser")),9,B)]),i("div",C,[h.value?(a(),r("div",E,t(n(l)("Loading file…")),1)):v.value?(a(),r("div",I,t(v.value),1)):e.value&&e.value.isImage?(a(),r("img",{key:2,class:"right-file-preview-image",src:d.value,alt:c.name},null,8,R)):e.value&&e.value.isText&&e.value.content!==void 0?(a(),r("pre",U,t(e.value.content),1)):(a(),r("div",N,[i("p",null,t(n(l)("This file type cannot be previewed.")),1),i("a",{class:"right-file-preview-open",href:d.value,target:"_blank",rel:"noopener noreferrer"},t(n(l)("Open in browser")),9,O)]))]),e.value&&e.value.truncated?(a(),r("div",S,t(n(l)("File is large; showing the first part.")),1)):w("",!0)]))}}),$=k(T,[["__scopeId","data-v-11e988a2"]]);export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as E,O as T,x as O,f as o,i as r,j as d,a2 as U,a3 as V,u as P,t as u,F as j,l as q,y as z,v as I,r as m,c as C,aB as Q,_ as W}from"./index-
|
|
1
|
+
import{e as E,O as T,x as O,f as o,i as r,j as d,a2 as U,a3 as V,u as P,t as u,F as j,l as q,y as z,v as I,r as m,c as C,aB as Q,_ as W}from"./index-BJ-YiA9y.js";const A={class:"right-files-panel"},G={class:"rfp-toolbar"},H=["placeholder"],J={key:0,class:"rfp-empty"},K={key:1,class:"rfp-empty is-error"},X={key:2,class:"rfp-empty"},Y={key:3,class:"rfp-groups"},Z=["aria-expanded","onClick"],ee={class:"rfp-dir-chevron","aria-hidden":"true"},te={class:"rfp-dir-icon","aria-hidden":"true"},ne={class:"rfp-dir-name"},ae=["title","onClick"],se={class:"rfp-file-label"},ie=E({__name:"RightFilesPanel",props:{cwd:{}},emits:["open-preview"],setup(D,{emit:L}){const x=D,S=L,{t:y}=I(),_=m([]),k=m(!1),f=m(""),h=m(""),v=m(new Set);function b(n){return n.sort((e,t)=>e.kind!==t.kind?e.kind==="dir"?-1:1:e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:"base"}))}function B(n){const e=[],t=new Map;function l(s){let a="",i=e;for(const c of s){a=a?`${a}/${c}`:c;let p=t.get(a);p||(p={name:c,path:"",relativePath:a,kind:"dir",children:[]},t.set(a,p),i.push(p)),i=p.children}return t.get(a)}for(const s of n){const a=s.relativePath.split("/").filter(Boolean);if(a.length===0)continue;if(s.isDirectory){const R=l(a);R.path=s.path;continue}const i=a[a.length-1],c=a.slice(0,-1);(c.length>0?l(c).children:e).push({name:i,path:s.path,relativePath:s.relativePath,kind:"file",children:[]})}b(e);for(const s of t.values())b(s.children);return e}const N=C(()=>B(_.value)),w=C(()=>{const n=h.value.trim().toLowerCase(),e=[];function t(s){return!n||s.relativePath.toLowerCase().includes(n)?!0:s.children.some(t)}function l(s,a){for(const i of s){if(n&&!t(i)||(e.push({node:i,depth:a}),i.kind==="file"))continue;(n?!0:!v.value.has(i.relativePath))&&l(i.children,a+1)}}return l(N.value,0),e});function g(n){return h.value.trim()?!0:!v.value.has(n)}function $(n){const e=new Set(v.value);e.has(n)?e.delete(n):e.add(n),v.value=e}function M(n){S("open-preview",{path:n.path,label:n.name})}async function F(){const n=x.cwd.trim();if(!n){_.value=[],f.value="";return}k.value=!0,f.value="";try{_.value=await Q(n)}catch(e){_.value=[],f.value=e instanceof Error?e.message:"Failed to load workspace files"}finally{k.value=!1}}return T(()=>{F()}),O(()=>x.cwd,()=>{v.value=new Set,h.value="",F()}),(n,e)=>(o(),r("div",A,[d("div",G,[U(d("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>h.value=t),class:"rfp-search",type:"text",placeholder:P(y)("Filter files...")},null,8,H),[[V,h.value]])]),k.value?(o(),r("div",J,u(P(y)("Loading files...")),1)):f.value?(o(),r("div",K,u(f.value),1)):w.value.length===0?(o(),r("div",X,u(P(y)("No files in workspace.")),1)):(o(),r("div",Y,[(o(!0),r(j,null,q(w.value,t=>(o(),r("div",{key:t.node.relativePath,class:"rfp-row",style:z({paddingLeft:`${t.depth*12+6}px`})},[t.node.kind==="dir"?(o(),r("button",{key:0,class:"rfp-dir",type:"button","aria-expanded":g(t.node.relativePath),onClick:l=>$(t.node.relativePath)},[d("span",ee,u(g(t.node.relativePath)?"▾":"▸"),1),d("span",te,u(g(t.node.relativePath)?"📂":"📁"),1),d("span",ne,u(t.node.name),1)],8,Z)):(o(),r("button",{key:1,class:"rfp-file",type:"button",title:t.node.relativePath,onClick:l=>M(t.node)},[e[1]||(e[1]=d("span",{class:"rfp-file-icon","aria-hidden":"true"},"📄",-1)),d("span",se,u(t.node.name),1)],8,ae))],4))),128))]))]))}}),re=W(ie,[["__scopeId","data-v-686d6084"]]);export{re as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as de,O as he,J as pe,x as W,f as i,i as l,p as ve,az as me,j as s,t as o,u as c,k as p,n as P,F as b,l as S,a2 as T,a3 as z,aA as ge,a0 as D,w as k,r as _,c as v,v as _e,a as ye,z as Ce,_ as be}from"./index-
|
|
1
|
+
import{e as de,O as he,J as pe,x as W,f as i,i as l,p as ve,az as me,j as s,t as o,u as c,k as p,n as P,F as b,l as S,a2 as T,a3 as z,aA as ge,a0 as D,w as k,r as _,c as v,v as _e,a as ye,z as Ce,_ as be}from"./index-BJ-YiA9y.js";const fe={class:"right-git-panel"},ke={class:"rgp-review-label"},we={class:"rgp-review-delta"},Be={class:"rgp-added"},Se={class:"rgp-removed"},$e={class:"rgp-state"},Fe={class:"rgp-state-label"},Re={class:"rgp-state-value"},Le={key:0,class:"rgp-state-meta"},xe=["href"],je={key:2,class:"rgp-section"},Pe={class:"rgp-section-title"},Te={class:"rgp-file-list"},De=["title","onClick"],Ee={class:"rgp-file-status"},He={class:"rgp-file-path"},Me={key:0,class:"rgp-file-previous-path"},Ne={class:"rgp-section"},Ve={class:"rgp-section-title"},Ke={class:"rgp-search-wrap"},Ae=["placeholder"],Ie={class:"rgp-branches",role:"listbox"},Oe={class:"rgp-branch-row"},Ue=["disabled","onClick"],We={class:"rgp-branch-name"},ze={key:0,class:"rgp-branch-meta"},Ge={key:1,class:"rgp-branch-meta"},qe=["disabled","onClick"],Qe={key:0,class:"rgp-empty"},Je={class:"rgp-section"},Xe={class:"rgp-section-title"},Ye={class:"rgp-search-wrap"},Ze=["placeholder"],et={class:"rgp-toggle-row"},tt={class:"rgp-commit-list"},st={key:0,class:"rgp-empty"},at={key:1,class:"rgp-empty"},ot={key:2,class:"rgp-empty is-error"},rt=["disabled","title","onClick"],nt={class:"rgp-commit-top"},it=["title","onClick","onKeydown"],lt={class:"rgp-commit-meta"},ct={key:0,class:"rgp-branch-meta"},ut={class:"rgp-commit-subject"},dt={key:0,class:"rgp-empty"},ht={key:3,class:"rgp-section"},pt={class:"rgp-section-title"},vt=["title"],mt=["disabled"],gt={class:"rgp-commit-detail-subject"},_t={class:"rgp-file-list"},yt={key:0,class:"rgp-empty"},Ct={key:1,class:"rgp-empty is-error"},bt=["title","onClick"],ft={class:"rgp-file-meta-row"},kt={class:"rgp-file-status"},wt={class:"rgp-file-delta"},Bt={class:"rgp-added"},St={class:"rgp-removed"},$t={class:"rgp-file-path"},Ft={key:0,class:"rgp-file-previous-path"},Rt={key:0,class:"rgp-empty"},Lt=de({__name:"RightGitPanel",props:{currentBranch:{},headSha:{},headSubject:{},headDate:{},detached:{type:Boolean},dirty:{type:Boolean},worktreeChangeSummary:{},worktreeChanges:{},branches:{},commitsByBranch:{},commitsLoadingFor:{},commitsError:{},commitFilesBySha:{},commitFilesLoadingFor:{},commitFilesError:{},loading:{type:Boolean},busy:{type:Boolean},error:{},reviewOpen:{type:Boolean},showReview:{type:Boolean}},emits:["toggleReview","checkoutBranch","resetBranchToCommit","loadCommits","loadCommitFiles","openCommitFile"],setup(d,{emit:G}){const r=d,g=G,E=_(null),$=_(""),F=_(""),u=_(""),y=_(""),w=_(""),R=_(""),C=_(!0),q=v(()=>r.showReview!==!1),{buildFeedbackMailto:Q,feedbackMailtoBase:J,recordVisibleFailure:X}=Ce(),{t:n}=_e(),Y=J();function Z(t,a){X(a);const e=t.currentTarget;e instanceof HTMLAnchorElement&&(e.href=Q())}const ee=v(()=>r.currentBranch?r.currentBranch:r.headSubject?r.headSubject:r.headSha?`${n("Detached")} ${r.headSha}`:r.loading?n("Loading branch..."):n("Detached HEAD")),H=v(()=>{var e;const t=[r.headSha,r.headDate].filter(Boolean).join(" · "),a=((e=r.headSubject)==null?void 0:e.trim())??"";return a&&t?`${a} (${t})`:a||t}),B=v(()=>r.busy||r.loading),L=v(()=>r.error||(r.dirty?n("Tracked changes must be committed, stashed, or discarded before switching or resetting. Untracked files are allowed unless Git would overwrite them."):"")),M=v(()=>r.error?"error":"info"),N=v(()=>{const t=$.value.trim().toLowerCase(),a=[...r.branches].sort((e,m)=>e.isRemote===!0&&m.isRemote!==!0?1:e.isRemote!==!0&&m.isRemote===!0?-1:0);return t?a.filter(e=>e.label.toLowerCase().includes(t)||e.value.toLowerCase().includes(t)):a}),te=v(()=>r.branches.find(t=>t.value===u.value)??null),V=v(()=>{var t;return((t=te.value)==null?void 0:t.isRemote)===!0}),x=v(()=>u.value?`${u.value}\0${C.value?"with-reset-history":"without-reset-history"}`:""),j=v(()=>x.value?r.commitsByBranch[x.value]||[]:[]),h=v(()=>j.value.find(t=>t.sha===y.value)??null),K=v(()=>h.value?r.commitFilesBySha[h.value.sha]||[]:[]),A=v(()=>{const t=F.value.trim().toLowerCase(),a=j.value;return t?a.filter(e=>e.sha.toLowerCase().includes(t)||e.shortSha.toLowerCase().includes(t)||e.subject.toLowerCase().includes(t)||e.date.toLowerCase().includes(t)):a});function se(t){u.value=t,y.value="",g("loadCommits",{branch:t,includeResetHistory:C.value})}function ae(){u.value&&g("loadCommits",{branch:u.value,includeResetHistory:C.value})}function I(t){var e;const a=((e=r.headSha)==null?void 0:e.trim())??"";return a?t.sha===a||t.shortSha===a||t.sha.startsWith(a):!1}function oe(t){return`${n("Show")} ${t.shortSha} ${n("files")}`}function re(t){y.value=t.sha,g("loadCommitFiles",t.sha)}function f(t){const a=t.sha.trim()||t.shortSha.trim();a&&(w.value=t.sha,ye(a).catch(()=>{w.value=""}))}function ne(){!u.value||!h.value||V.value||g("resetBranchToCommit",{branch:u.value,sha:h.value.sha})}function O(t){return typeof t=="number"&&Number.isFinite(t)?String(t):"-"}function ie(t){h.value&&g("openCommitFile",{sha:h.value.sha,path:t})}function le(t){r.headSha&&g("openCommitFile",{sha:r.headSha,path:t})}function U(){var a,e;const t=(a=r.currentBranch)==null?void 0:a.trim();return t||(((e=r.branches[0])==null?void 0:e.value)??"")}function ce(){const t=u.value||U();t&&(u.value=t,g("loadCommits",{branch:t,includeResetHistory:C.value}))}return he(()=>{ce(),pe(()=>{var t;return(t=E.value)==null?void 0:t.focus()})}),W(()=>[r.currentBranch,r.branches.map(t=>t.value).join(`
|
|
2
2
|
`)],()=>{var m;const t=U();if(!t){u.value="",R.value="";return}const a=((m=r.currentBranch)==null?void 0:m.trim())??"",e=a!==R.value;R.value=a,(e||!u.value||!r.branches.some(ue=>ue.value===u.value))&&(u.value=t),u.value&&g("loadCommits",{branch:u.value,includeResetHistory:C.value})},{immediate:!0}),W(j,t=>{y.value&&(t.some(a=>a.sha===y.value)||(y.value=""))}),(t,a)=>(i(),l("div",fe,[q.value?(i(),l("button",{key:0,class:"rgp-review",type:"button",onClick:a[0]||(a[0]=e=>g("toggleReview"))},[ve(me,{class:"rgp-review-icon"}),s("span",ke,o(d.reviewOpen?c(n)("Review Worktree Changes (Open)"):c(n)("Review Worktree Changes")),1),s("span",we,[s("span",Be,"+"+o(d.worktreeChangeSummary.addedLineCount),1),s("span",Se,"-"+o(d.worktreeChangeSummary.removedLineCount),1)])])):p("",!0),s("div",$e,[s("span",Fe,o(d.detached?c(n)("Detached HEAD"):c(n)("Current branch")),1),s("span",Re,o(ee.value),1),H.value?(i(),l("span",Le,o(H.value),1)):p("",!0)]),L.value?(i(),l("div",{key:1,class:P(["rgp-status",{"is-error":M.value==="error"}])},[s("span",null,o(L.value),1),M.value==="error"?(i(),l("a",{key:0,class:"rgp-feedback",href:c(Y),onClick:a[1]||(a[1]=e=>Z(e,L.value))},o(c(n)("Send feedback")),9,xe)):p("",!0)],2)):p("",!0),r.worktreeChanges.length>0?(i(),l("div",je,[s("div",Pe,o(r.worktreeChanges.length)+" "+o(r.worktreeChanges.length===1?c(n)("file changed"):c(n)("files changed")),1),s("div",Te,[(i(!0),l(b,null,S(r.worktreeChanges,e=>(i(),l("button",{key:`${e.status}:${e.previousPath??""}:${e.path}`,class:"rgp-file",type:"button",title:e.previousPath?`${e.previousPath} → ${e.path}`:e.path,onClick:m=>le(e.path)},[s("span",Ee,o(e.label),1),s("span",He,o(e.path),1),e.previousPath?(i(),l("span",Me,"← "+o(e.previousPath),1)):p("",!0)],8,De))),128))])])):p("",!0),s("div",Ne,[s("div",Ve,o(c(n)("Branches")),1),s("div",Ke,[T(s("input",{ref_key:"searchInputRef",ref:E,"onUpdate:modelValue":a[2]||(a[2]=e=>$.value=e),class:"rgp-search",type:"text",placeholder:c(n)("Search branches...")},null,8,Ae),[[z,$.value]])]),s("ul",Ie,[(i(!0),l(b,null,S(N.value,e=>(i(),l("li",{key:e.value,class:"rgp-branch-item"},[s("div",Oe,[s("button",{class:P(["rgp-branch-button",{"is-current":e.value===d.currentBranch,"is-selected":e.value===u.value}]),type:"button",disabled:B.value,onClick:m=>se(e.value)},[s("span",We,o(e.label),1),e.value===d.currentBranch?(i(),l("span",ze,o(c(n)("current")),1)):e.isRemote?(i(),l("span",Ge,o(c(n)("remote")),1)):p("",!0)],10,Ue),e.value===u.value&&e.value!==d.currentBranch&&!e.isRemote?(i(),l("button",{key:0,class:"rgp-branch-checkout",type:"button",disabled:B.value,onClick:m=>g("checkoutBranch",e.value)},o(c(n)("Checkout")),9,qe)):p("",!0)])]))),128)),N.value.length===0?(i(),l("li",Qe,o(c(n)("No branches found.")),1)):p("",!0)])]),s("div",Je,[s("div",Xe,o(c(n)("Commits")),1),s("div",Ye,[T(s("input",{"onUpdate:modelValue":a[3]||(a[3]=e=>F.value=e),class:"rgp-search",type:"text",placeholder:c(n)("Search commits...")},null,8,Ze),[[z,F.value]])]),s("label",et,[T(s("input",{"onUpdate:modelValue":a[4]||(a[4]=e=>C.value=e),type:"checkbox",onChange:ae},null,544),[[ge,C.value]]),s("span",null,o(c(n)("Reset-history refs")),1)]),s("div",tt,[u.value?d.commitsLoadingFor===x.value?(i(),l("div",at,o(c(n)("Loading commits...")),1)):d.commitsError?(i(),l("div",ot,o(d.commitsError),1)):(i(),l(b,{key:3},[(i(!0),l(b,null,S(A.value,e=>(i(),l("button",{key:e.sha,class:P(["rgp-commit",{"is-current":I(e),"is-selected":e.sha===y.value}]),type:"button",disabled:B.value,title:oe(e),onClick:m=>re(e)},[s("span",nt,[s("span",{class:"rgp-ref",role:"button",tabindex:"0",title:w.value===e.sha?c(n)("Copied commit ref"):`${c(n)("Copy")} ${e.sha}`,onClick:k(m=>f(e),["stop"]),onKeydown:[D(k(m=>f(e),["prevent","stop"]),["enter"]),D(k(m=>f(e),["prevent","stop"]),["space"])]},o(e.shortSha),41,it),s("span",lt,[I(e)?(i(),l("span",ct,o(c(n)("current")),1)):p("",!0),s("span",null,o(e.date),1)])]),s("span",ut,o(e.subject),1)],10,rt))),128)),A.value.length===0?(i(),l("div",dt,o(c(n)("No commits found.")),1)):p("",!0)],64)):(i(),l("div",st,o(c(n)("Select a branch.")),1))])]),h.value?(i(),l("div",ht,[s("div",pt,[s("span",{class:"rgp-ref",role:"button",tabindex:"0",title:w.value===h.value.sha?c(n)("Copied commit ref"):`${c(n)("Copy")} ${h.value.sha}`,onClick:a[5]||(a[5]=k(e=>f(h.value),["stop"])),onKeydown:a[6]||(a[6]=D(k(e=>f(h.value),["prevent","stop"]),["enter"]))},o(h.value.shortSha),41,vt),s("button",{class:"rgp-reset-commit",type:"button",disabled:B.value||V.value||!u.value,onClick:ne},o(c(n)("Reset")),9,mt)]),s("p",gt,o(h.value.subject),1),s("div",_t,[d.commitFilesLoadingFor===h.value.sha?(i(),l("div",yt,o(c(n)("Loading files...")),1)):d.commitFilesError?(i(),l("div",Ct,o(d.commitFilesError),1)):(i(),l(b,{key:2},[(i(!0),l(b,null,S(K.value,e=>(i(),l("button",{key:`${e.status}:${e.previousPath??""}:${e.path}`,class:"rgp-file",type:"button",title:e.previousPath?`${e.previousPath} → ${e.path}`:e.path,onClick:m=>ie(e.path)},[s("span",ft,[s("span",kt,o(e.label),1),s("span",wt,[s("span",Bt,"+"+o(O(e.addedLineCount)),1),s("span",St,"-"+o(O(e.removedLineCount)),1)])]),s("span",$t,o(e.path),1),e.previousPath?(i(),l("span",Ft,"← "+o(e.previousPath),1)):p("",!0)],8,bt))),128)),K.value.length===0?(i(),l("div",Rt,o(c(n)("No file changes.")),1)):p("",!0)],64))])])):p("",!0)]))}}),jt=be(Lt,[["__scopeId","data-v-76cdff49"]]);export{jt as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{e as P,f as d,i as r,F as C,l as w,j as t,t as s,k as m,v as D,_ as K,u as n,n as f,h as H,w as B,p as F,I as Z,a2 as M,ay as E,W as $,a0 as T,T as q,r as Q}from"./index-
|
|
1
|
+
import{e as P,f as d,i as r,F as C,l as w,j as t,t as s,k as m,v as D,_ as K,u as n,n as f,h as H,w as B,p as F,I as Z,a2 as M,ay as E,W as $,a0 as T,T as q,r as Q}from"./index-BJ-YiA9y.js";const X={key:0,class:"rate-limit-status","aria-live":"polite"},j=["title"],z={class:"rate-limit-card-header"},J={class:"rate-limit-card-title"},Y={key:0,class:"rate-limit-card-plan"},_={class:"rate-limit-card-metrics"},ee={key:0,class:"rate-limit-card-footer"},te=P({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){const{t:b}=D();function o(l){var c,g;return((c=l.limitId)==null?void 0:c.trim())||((g=l.limitName)==null?void 0:g.trim())||"__default__"}function h(l){var c,g;return((c=l.limitName)==null?void 0:c.trim())||((g=l.limitId)==null?void 0:g.trim())||b("Rate limits")}function u(l){const c=l.trim();return c?c.replace(/[_-]+/g," ").replace(/\b\w/g,g=>g.toUpperCase()):""}function v(l){return!l||l<=0?b("Window"):l%1440===0?`${l/1440}d`:l%60===0?`${l/60}h`:l<60?`${l}m`:`${Math.round(l/60*10)/10}h`}function I(l){const c=Math.max(0,Math.min(100,100-l));return`${Math.round(c)}% ${b("left")}`}function p(l){return`${Math.round(l)}%`}function a(l,c){return{key:c,label:`${v(l.windowDurationMins)} ${I(l.usedPercent)}`}}function R(l){const c=[];return l.primary&&c.push(a(l.primary,"primary")),l.secondary&&c.push(a(l.secondary,"secondary")),c}function i(l){if(!l)return"";const c=new Date(l*1e3),g=c.getMonth()+1,y=String(c.getDate()).padStart(2,"0"),A=String(c.getHours()).padStart(2,"0"),S=String(c.getMinutes()).padStart(2,"0");return`${g}.${y} ${A}:${S}`}function k(l){if(!(l!=null&&l.resetsAt))return"";const c=l.resetsAt*1e3-Date.now();if(c<=0)return b("Resetting now");const g=Math.round(c/6e4);if(g<60)return`${b("Resets in")} ${g}m`;const y=Math.round(g/60);if(y<24)return`${b("Resets in")} ${y}h`;const A=Math.round(y/24);return`${b("Resets in")} ${A}d`}function L(l){return[l.primary,l.secondary].filter(c=>c!==null)}function O(l){const c=L(l);return c.length===0?null:[...c].sort((g,y)=>{const A=g.windowDurationMins??Number.MAX_SAFE_INTEGER,S=y.windowDurationMins??Number.MAX_SAFE_INTEGER;return A!==S?A-S:(g.resetsAt??Number.MAX_SAFE_INTEGER)-(y.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function N(l){const c=L(l);if(c.length===0)return"";const g=[...c].sort((A,S)=>{const W=A.windowDurationMins??-1,U=S.windowDurationMins??-1;return W!==U?U-W:(S.resetsAt??-1)-(A.resetsAt??-1)})[0],y=i(g.resetsAt);return y||""}function G(l){const c=l.credits;return c?c.unlimited?b("Unlimited credits"):c.balance?`${b("Credits")} ${c.balance}`:c.hasCredits?b("Credits available"):"":""}function x(l){return[k(O(l)),N(l),G(l)].filter(c=>c.length>0)}function V(l){const c=[h(l)];for(const g of R(l))c.push(g.label);for(const g of L(l))c.push(`${v(g.windowDurationMins)} used ${p(g.usedPercent)}`);for(const g of x(l))c.push(g);return c.join(`
|
|
2
2
|
`)}return(l,c)=>e.snapshots.length>0?(d(),r("aside",X,[(d(!0),r(C,null,w(e.snapshots,g=>(d(),r("div",{key:o(g),class:"rate-limit-card",title:V(g)},[t("div",z,[t("span",J,s(h(g)),1),g.planType?(d(),r("span",Y,s(u(g.planType)),1)):m("",!0)]),t("div",_,[(d(!0),r(C,null,w(R(g),y=>(d(),r("span",{key:y.key,class:"rate-limit-card-metric"},s(y.label),1))),128))]),x(g).length>0?(d(),r("div",ee,s(x(g).join(" | ")),1)):m("",!0)],8,j))),128))])):m("",!0)}}),ne=K(te,[["__scopeId","data-v-1fd5e1ec"]]),oe={class:"sidebar-settings-account-section"},se={class:"sidebar-settings-account-header"},ie={class:"sidebar-settings-account-header-main"},ae=["aria-expanded","title"],le={class:"sidebar-settings-account-collapse-icon"},ce={class:"sidebar-settings-account-title"},de={class:"sidebar-settings-account-count"},re=["disabled"],ue={key:0,class:"sidebar-settings-account-error visible-error-with-feedback"},ge=["href"],be={class:"sidebar-settings-account-login"},me=["disabled"],he=["href"],ve={key:1,class:"sidebar-settings-account-empty"},ye={key:2,class:"sidebar-settings-account-list"},Ce=["title","onMouseenter","onMouseleave"],fe={class:"sidebar-settings-account-main"},ke={class:"sidebar-settings-account-email"},Ae={class:"sidebar-settings-account-meta"},Se={class:"sidebar-settings-account-quota"},Fe={class:"sidebar-settings-account-id"},we={class:"sidebar-settings-account-actions"},Re=["disabled","onClick"],Le=["disabled","onClick"],pe=P({__name:"SettingsAccountsPanel",props:{accounts:{},isAccountsSectionCollapsed:{type:Boolean},isRefreshingAccounts:{type:Boolean},isSwitchingAccounts:{type:Boolean},isStartingCodexLogin:{type:Boolean},isCompletingCodexLogin:{type:Boolean},accountActionError:{},codexLoginUrl:{},feedbackMailto:{},isAccountUnavailable:{type:Function},isRemoveConfirmationActive:{type:Function},isRemoveVisible:{type:Function},buildAccountTitle:{type:Function},formatAccountMeta:{type:Function},formatAccountQuota:{type:Function},shortAccountId:{type:Function},isAccountActionDisabled:{type:Function},getAccountSwitchLabel:{type:Function},getAccountRemoveLabel:{type:Function},onRefreshAccounts:{type:Function},onStartCodexLogin:{type:Function},onSwitchAccount:{type:Function},onRemoveAccount:{type:Function},onAccountCardPointerEnter:{type:Function},onAccountCardPointerLeave:{type:Function},toggleAccountsSectionCollapsed:{type:Function},prepareFeedbackLink:{type:Function}},setup(e){const{t:b}=D();return(o,h)=>(d(),r("div",oe,[t("div",se,[t("div",ie,[t("button",{class:"sidebar-settings-account-collapse",type:"button","aria-expanded":!e.isAccountsSectionCollapsed,title:e.isAccountsSectionCollapsed?n(b)("Expand accounts"):n(b)("Collapse accounts"),onClick:h[0]||(h[0]=(...u)=>e.toggleAccountsSectionCollapsed&&e.toggleAccountsSectionCollapsed(...u))},[t("span",le,s(e.isAccountsSectionCollapsed?"▸":"▾"),1)],8,ae),t("span",ce,s(n(b)("Accounts")),1),t("span",de,s(e.accounts.length),1)]),t("button",{class:"sidebar-settings-account-refresh",type:"button",disabled:e.isRefreshingAccounts||e.isSwitchingAccounts||e.isStartingCodexLogin||e.isCompletingCodexLogin,onClick:h[1]||(h[1]=(...u)=>e.onRefreshAccounts&&e.onRefreshAccounts(...u))},s(e.isRefreshingAccounts?n(b)("Reloading…"):n(b)("Reload")),9,re)]),e.isAccountsSectionCollapsed?m("",!0):(d(),r(C,{key:0},[e.accountActionError?(d(),r("div",ue,[t("span",null,s(e.accountActionError),1),t("a",{class:"visible-error-feedback",href:e.feedbackMailto,onClick:h[2]||(h[2]=u=>e.prepareFeedbackLink(u,e.accountActionError))},s(n(b)("Send feedback")),9,ge)])):m("",!0),t("div",be,[t("button",{class:"sidebar-settings-account-login-button",type:"button",disabled:e.isRefreshingAccounts||e.isSwitchingAccounts||e.isStartingCodexLogin||e.isCompletingCodexLogin,onClick:h[3]||(h[3]=(...u)=>e.onStartCodexLogin&&e.onStartCodexLogin(...u))},s(e.isStartingCodexLogin?n(b)("Starting login…"):n(b)("Login")),9,me),e.codexLoginUrl?(d(),r("a",{key:0,class:"sidebar-settings-account-login-link",href:e.codexLoginUrl,target:"_blank",rel:"noreferrer"},s(n(b)("Open login URL")),9,he)):m("",!0)]),e.accounts.length===0?(d(),r("p",ve,s(n(b)("Click Login, or run `codex login`, then click reload.")),1)):(d(),r("div",ye,[(d(!0),r(C,null,w(e.accounts,u=>(d(),r("article",{key:u.storageId,class:f(["sidebar-settings-account-item",{"is-active":u.isActive,"is-unavailable":e.isAccountUnavailable(u),"is-confirming-remove":e.isRemoveConfirmationActive(u),"is-remove-visible":e.isRemoveVisible(u)}]),title:e.buildAccountTitle(u),onMouseenter:v=>e.onAccountCardPointerEnter(u.storageId),onMouseleave:v=>e.onAccountCardPointerLeave(u.storageId)},[t("div",fe,[t("p",ke,s(u.email||n(b)("Account")),1),t("p",Ae,s(e.formatAccountMeta(u)),1),t("p",Se,s(e.formatAccountQuota(u)),1),t("p",Fe," Workspace "+s(e.shortAccountId(u.accountId)),1)]),t("div",we,[t("button",{class:"sidebar-settings-account-switch",type:"button",disabled:e.isAccountActionDisabled(u)||u.isActive||e.isAccountUnavailable(u),onClick:v=>e.onSwitchAccount(u.storageId)},s(e.getAccountSwitchLabel(u)),9,Re),t("button",{class:f(["sidebar-settings-account-remove",{"is-visible":e.isRemoveVisible(u),"is-confirming":e.isRemoveConfirmationActive(u)}]),type:"button",disabled:e.isAccountActionDisabled(u),onClick:v=>e.onRemoveAccount(u.storageId)},s(e.getAccountRemoveLabel(u)),11,Le)])],42,Ce))),128))]))],64))]))}}),Me=K(pe,[["__scopeId","data-v-828a7adf"]]),Ee=["aria-label"],$e={class:"settings-dialog-header"},Te={class:"settings-dialog-title"},Ie=["aria-label","title"],xe={class:"settings-dialog-body"},Pe=["aria-label"],De=["aria-current","onClick"],Ke={class:"settings-group-content"},We=["title"],Ue={class:"sidebar-settings-label"},Be=["title"],Oe={class:"sidebar-settings-label"},Ne={class:"sidebar-settings-value"},Ge=["title"],Ve={class:"sidebar-settings-label"},He={class:"sidebar-settings-value"},Ze=["title"],qe={class:"sidebar-settings-label"},Qe=["title"],Xe={class:"sidebar-settings-label"},je={class:"sidebar-settings-value"},ze=["title"],Je={class:"sidebar-settings-label"},Ye=["title"],_e={class:"sidebar-settings-label"},et=["title"],tt={class:"sidebar-settings-label"},nt=["title"],ot={class:"sidebar-settings-label"},st=["href"],it={class:"sidebar-settings-label"},at={class:"sidebar-settings-value"},lt=["title"],ct={class:"sidebar-settings-label"},dt={key:0,class:"sidebar-settings-row sidebar-settings-error"},rt=["href"],ut={key:1,class:"sidebar-settings-row sidebar-settings-row--input"},gt={class:"sidebar-settings-provider-info"},bt={class:"sidebar-settings-label"},mt={class:"sidebar-settings-provider-link",href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer"},ht={class:"sidebar-settings-key-group"},vt={class:"sidebar-settings-key-masked"},yt=["disabled","title"],Ct=["model-value","placeholder"],ft=["disabled"],kt={class:"sidebar-settings-row sidebar-settings-row--select",style:{"margin-top":"4px",padding:"0"}},At={class:"sidebar-settings-label"},St=["aria-label"],Ft=["disabled"],wt=["disabled"],Rt={key:2,class:"sidebar-settings-row sidebar-settings-row--input"},Lt={class:"sidebar-settings-provider-info"},pt={class:"sidebar-settings-label"},Mt={class:"sidebar-settings-provider-link",href:"https://opencode.ai/auth",target:"_blank",rel:"noopener noreferrer"},Et={class:"sidebar-settings-key-group"},$t=["model-value","placeholder"],Tt=["disabled"],It={key:3,class:"sidebar-settings-row sidebar-settings-row--input"},xt={class:"sidebar-settings-label"},Pt={class:"sidebar-settings-key-group"},Dt=["model-value","placeholder"],Kt={class:"sidebar-settings-label",style:{"margin-top":"4px"}},Wt={class:"sidebar-settings-key-group"},Ut=["model-value","placeholder"],Bt=["disabled"],Ot={class:"sidebar-settings-row sidebar-settings-row--select",style:{"margin-top":"4px",padding:"0"}},Nt={class:"sidebar-settings-label"},Gt=["aria-label"],Vt={class:"sidebar-settings-label"},Ht={class:"sidebar-settings-value"},Zt={key:0,class:"sidebar-settings-telegram-panel"},qt={class:"sidebar-settings-field"},Qt={class:"sidebar-settings-field-label"},Xt=["value"],jt={class:"sidebar-settings-field"},zt={class:"sidebar-settings-field-label"},Jt=["value"],Yt={class:"sidebar-settings-field-help"},_t={key:0,class:"sidebar-settings-telegram-error"},en=["href"],tn={class:"sidebar-settings-telegram-actions"},nn=["disabled"],on={class:"sidebar-settings-hooks-section"},sn={class:"sidebar-settings-hooks-header"},an={class:"sidebar-settings-hooks-title"},ln=["disabled","title"],cn={key:0,class:"sidebar-settings-hooks-empty"},dn={key:0,class:"sidebar-settings-hooks-empty"},rn={key:1,class:"sidebar-settings-hooks-empty"},un={key:2,class:"sidebar-settings-hooks-list"},gn={class:"sidebar-settings-hooks-cwd"},bn={class:"sidebar-settings-hooks-event"},mn={class:"sidebar-settings-hooks-command"},hn={class:"sidebar-settings-remote-section"},vn={class:"sidebar-settings-remote-header"},yn={class:"sidebar-settings-remote-title"},Cn=["disabled","title"],fn={class:"sidebar-settings-remote-toggle-label"},kn={key:0,class:"sidebar-settings-remote-empty"},An={key:0,class:"sidebar-settings-remote-error"},Sn={key:1,class:"sidebar-settings-remote-notice"},Fn={key:2,class:"sidebar-settings-remote-empty"},wn=["disabled"],Rn={class:"sidebar-settings-remote-label"},Ln={class:"sidebar-settings-remote-value"},pn={class:"sidebar-settings-remote-clients"},Mn={class:"sidebar-settings-remote-clients-header"},En={class:"sidebar-settings-remote-label"},$n=["disabled"],Tn={key:0,class:"sidebar-settings-remote-empty"},In={class:"sidebar-settings-remote-client-name"},xn=["disabled","onClick"],Pn={class:"sidebar-settings-rate-limits"},Dn=["aria-label"],Kn=P({__name:"SettingsDialog",props:{activeSettingsGroup:{},accounts:{},isAccountsSectionCollapsed:{type:Boolean},isRefreshingAccounts:{type:Boolean},isSwitchingAccounts:{type:Boolean},isStartingCodexLogin:{type:Boolean},isCompletingCodexLogin:{type:Boolean},accountActionError:{},codexLoginUrl:{},feedbackMailto:{},isAccountUnavailable:{type:Function},isRemoveConfirmationActive:{type:Function},isRemoveVisible:{type:Function},buildAccountTitle:{type:Function},formatAccountMeta:{type:Function},formatAccountQuota:{type:Function},shortAccountId:{type:Function},isAccountActionDisabled:{type:Function},getAccountSwitchLabel:{type:Function},getAccountRemoveLabel:{type:Function},onRefreshAccounts:{type:Function},onStartCodexLogin:{type:Function},onSwitchAccount:{type:Function},onRemoveAccount:{type:Function},onAccountCardPointerEnter:{type:Function},onAccountCardPointerLeave:{type:Function},toggleAccountsSectionCollapsed:{type:Function},prepareFeedbackLink:{type:Function},sendWithEnter:{type:Boolean},inProgressSendMode:{},darkMode:{},uiLanguage:{},uiLanguageOptions:{},chatWidthLabel:{},dictationClickToToggle:{type:Boolean},dictationAutoSend:{type:Boolean},dictationLanguage:{},dictationLanguageOptions:{},autoCompactThreshold:{},autoCompactThresholdOptions:{},hasVisibleFeedbackError:{type:Boolean},selectedProvider:{},providerDropdownOptions:{},freeModeLoading:{type:Boolean},providerError:{},freeModeHasCustomKey:{type:Boolean},freeModeCustomKey:{},freeModeCustomKeyMasked:{},freeModeCustomKeySaving:{type:Boolean},openRouterWireApi:{},opencodeZenKey:{},customEndpointUrl:{},customEndpointKey:{},customEndpointWireApi:{},isTelegramConfigOpen:{type:Boolean},telegramStatusText:{},telegramBotTokenDraft:{},telegramAllowedUserIdsDraft:{},telegramConfigError:{},isTelegramSaving:{type:Boolean},supportsHooks:{type:Boolean},isHooksLoading:{type:Boolean},hooksList:{},supportsRemoteControl:{type:Boolean},remoteControlStatus:{},isRemoteControlActionInFlight:{type:Boolean},remoteControlError:{},remoteControlNotice:{},isRemoteControlLoading:{type:Boolean},remoteControlActionName:{},pairingCode:{},accountRateLimitSnapshots:{},worktreeName:{},appVersion:{},onClose:{type:Function},onActiveSettingsGroupChange:{type:Function},toggleSendWithEnter:{type:Function},cycleInProgressSendMode:{type:Function},cycleDarkMode:{type:Function},onUiLanguageChange:{type:Function},cycleChatWidth:{type:Function},toggleDictationClickToToggle:{type:Function},toggleDictationAutoSend:{type:Function},onDictationLanguageChange:{type:Function},onAutoCompactThresholdChange:{type:Function},onProviderChange:{type:Function},onFreeModeCustomKeyChange:{type:Function},clearFreeModeCustomKey:{type:Function},saveFreeModeCustomKey:{type:Function},setOpenRouterWireApi:{type:Function},onOpencodeZenKeyChange:{type:Function},saveOpencodeZen:{type:Function},onCustomEndpointUrlChange:{type:Function},onCustomEndpointKeyChange:{type:Function},saveCustomEndpoint:{type:Function},onCustomEndpointWireApiChange:{type:Function},onTelegramConfigOpenChange:{type:Function},onTelegramBotTokenDraftChange:{type:Function},onTelegramAllowedUserIdsDraftChange:{type:Function},saveTelegramConfig:{type:Function},refreshHooks:{type:Function},toggleRemoteControl:{type:Function},startRemotePairing:{type:Function},refreshRemoteClients:{type:Function},revokeRemoteClient:{type:Function}},setup(e,{expose:b}){const{t:o}=D(),h=Q(null),u=[{id:"general",label:"General settings"},{id:"models",label:"Models & providers"},{id:"integrations",label:"Integrations"},{id:"usage",label:"Usage & about"}],v={sendWithEnter:o("When enabled, press Enter to send. When disabled, use Command+Enter to send."),inProgressSendMode:o("If a turn is still running, choose whether a new prompt should steer the current turn or be queued."),appearance:o("Switch between system theme, light mode, and dark mode."),chatWidth:o("Choose how wide the conversation column and composer can grow on desktop screens."),dictationClickToToggle:o("Use click-to-start and click-to-stop dictation instead of hold-to-talk."),dictationAutoSend:o("Automatically send transcribed dictation when recording stops."),dictationLanguage:o("Choose transcription language or keep auto-detect.")};function I(p){var a;return((a=h.value)==null?void 0:a.contains(p))??!1}return b({containsTarget:I}),(p,a)=>{var R;return d(),H(q,{to:"body"},[t("div",{class:"settings-dialog-backdrop",role:"presentation",onClick:a[36]||(a[36]=B((...i)=>e.onClose&&e.onClose(...i),["self"]))},[t("div",{ref_key:"settingsPanelRef",ref:h,class:"sidebar-settings-panel",role:"dialog","aria-modal":"true","aria-label":n(o)("Settings"),onClick:a[35]||(a[35]=B(()=>{},["stop"]))},[t("div",$e,[t("h2",Te,s(n(o)("Settings")),1),t("button",{class:"settings-dialog-close",type:"button","aria-label":n(o)("Close"),title:n(o)("Close"),onClick:a[0]||(a[0]=(...i)=>e.onClose&&e.onClose(...i))},[F(Z,{class:"settings-dialog-close-icon"})],8,Ie)]),t("div",xe,[t("nav",{class:"settings-group-nav","aria-label":n(o)("Settings groups")},[(d(),r(C,null,w(u,i=>t("button",{key:i.id,type:"button",class:f(["settings-group-nav-item",{"is-active":e.activeSettingsGroup===i.id}]),"aria-current":e.activeSettingsGroup===i.id?"true":void 0,onClick:k=>e.onActiveSettingsGroupChange(i.id)},s(n(o)(i.label)),11,De)),64))],8,Pe),t("div",Ke,[M(t("div",null,[F(Me,{accounts:e.accounts,"is-accounts-section-collapsed":e.isAccountsSectionCollapsed,"is-refreshing-accounts":e.isRefreshingAccounts,"is-switching-accounts":e.isSwitchingAccounts,"is-starting-codex-login":e.isStartingCodexLogin,"is-completing-codex-login":e.isCompletingCodexLogin,"account-action-error":e.accountActionError,"codex-login-url":e.codexLoginUrl,"feedback-mailto":e.feedbackMailto,"is-account-unavailable":e.isAccountUnavailable,"is-remove-confirmation-active":e.isRemoveConfirmationActive,"is-remove-visible":e.isRemoveVisible,"build-account-title":e.buildAccountTitle,"format-account-meta":e.formatAccountMeta,"format-account-quota":e.formatAccountQuota,"short-account-id":e.shortAccountId,"is-account-action-disabled":e.isAccountActionDisabled,"get-account-switch-label":e.getAccountSwitchLabel,"get-account-remove-label":e.getAccountRemoveLabel,"on-refresh-accounts":e.onRefreshAccounts,"on-start-codex-login":e.onStartCodexLogin,"on-switch-account":e.onSwitchAccount,"on-remove-account":e.onRemoveAccount,"on-account-card-pointer-enter":e.onAccountCardPointerEnter,"on-account-card-pointer-leave":e.onAccountCardPointerLeave,"toggle-accounts-section-collapsed":e.toggleAccountsSectionCollapsed,"prepare-feedback-link":e.prepareFeedbackLink},null,8,["accounts","is-accounts-section-collapsed","is-refreshing-accounts","is-switching-accounts","is-starting-codex-login","is-completing-codex-login","account-action-error","codex-login-url","feedback-mailto","is-account-unavailable","is-remove-confirmation-active","is-remove-visible","build-account-title","format-account-meta","format-account-quota","short-account-id","is-account-action-disabled","get-account-switch-label","get-account-remove-label","on-refresh-accounts","on-start-codex-login","on-switch-account","on-remove-account","on-account-card-pointer-enter","on-account-card-pointer-leave","toggle-accounts-section-collapsed","prepare-feedback-link"]),t("button",{class:"sidebar-settings-row",type:"button",title:v.sendWithEnter,onClick:a[1]||(a[1]=(...i)=>e.toggleSendWithEnter&&e.toggleSendWithEnter(...i))},[t("span",Ue,s(n(o)("Require ⌘ + enter to send")),1),t("span",{class:f(["sidebar-settings-toggle",{"is-on":!e.sendWithEnter}])},null,2)],8,We),t("button",{class:"sidebar-settings-row",type:"button",title:v.inProgressSendMode,onClick:a[2]||(a[2]=(...i)=>e.cycleInProgressSendMode&&e.cycleInProgressSendMode(...i))},[t("span",Oe,s(n(o)("When busy, send as")),1),t("span",Ne,s(e.inProgressSendMode==="steer"?n(o)("Steer"):n(o)("Queue")),1)],8,Be),t("button",{class:"sidebar-settings-row",type:"button",title:v.appearance,onClick:a[3]||(a[3]=(...i)=>e.cycleDarkMode&&e.cycleDarkMode(...i))},[t("span",Ve,s(n(o)("Appearance")),1),t("span",He,s(e.darkMode==="system"?n(o)("System"):e.darkMode==="dark"?n(o)("Dark"):n(o)("Light")),1)],8,Ge),t("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:n(o)("Choose the interface language for the app.")},[t("span",qe,s(n(o)("UI language")),1),F($,{class:"sidebar-settings-provider-dropdown","model-value":e.uiLanguage,options:e.uiLanguageOptions,placeholder:n(o)("UI language"),"menu-align":"end","onUpdate:modelValue":a[4]||(a[4]=i=>e.onUiLanguageChange(i))},null,8,["model-value","options","placeholder"])],8,Ze),t("button",{class:"sidebar-settings-row",type:"button",title:v.chatWidth,onClick:a[5]||(a[5]=(...i)=>e.cycleChatWidth&&e.cycleChatWidth(...i))},[t("span",Xe,s(n(o)("Chat width")),1),t("span",je,s(e.chatWidthLabel),1)],8,Qe),t("button",{class:"sidebar-settings-row",type:"button",title:v.dictationClickToToggle,onClick:a[6]||(a[6]=(...i)=>e.toggleDictationClickToToggle&&e.toggleDictationClickToToggle(...i))},[t("span",Je,s(n(o)("Click to toggle dictation")),1),t("span",{class:f(["sidebar-settings-toggle",{"is-on":e.dictationClickToToggle}])},null,2)],8,ze),t("button",{class:"sidebar-settings-row",type:"button",title:v.dictationAutoSend,onClick:a[7]||(a[7]=(...i)=>e.toggleDictationAutoSend&&e.toggleDictationAutoSend(...i))},[t("span",_e,s(n(o)("Auto send dictation")),1),t("span",{class:f(["sidebar-settings-toggle",{"is-on":e.dictationAutoSend}])},null,2)],8,Ye),t("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:v.dictationLanguage},[t("span",tt,s(n(o)("Dictation language")),1),F($,{class:"sidebar-settings-language-dropdown","model-value":e.dictationLanguage,options:e.dictationLanguageOptions,placeholder:n(o)("Auto-detect"),"open-direction":"up","enable-search":!0,"search-placeholder":n(o)("Search language..."),"onUpdate:modelValue":e.onDictationLanguageChange},null,8,["model-value","options","placeholder","search-placeholder","onUpdate:modelValue"])],8,et),t("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:n(o)("Auto-compact at or below remaining context percentage. 0 disables auto-compaction and falls back to server-side compaction.")},[t("span",ot,s(n(o)("Auto-compact before send")),1),F($,{class:"sidebar-settings-auto-compact-dropdown","model-value":String(e.autoCompactThreshold),options:e.autoCompactThresholdOptions,placeholder:n(o)("Off"),"menu-align":"end","onUpdate:modelValue":e.onAutoCompactThresholdChange},null,8,["model-value","options","placeholder","onUpdate:modelValue"])],8,nt),e.hasVisibleFeedbackError?(d(),r("a",{key:0,class:"sidebar-settings-row sidebar-settings-feedback-row",href:e.feedbackMailto,onClick:a[8]||(a[8]=(...i)=>e.prepareFeedbackLink&&e.prepareFeedbackLink(...i))},[t("span",it,s(n(o)("Send feedback")),1),t("span",at,s(n(o)("Issue detected")),1)],8,st)):m("",!0)],512),[[E,e.activeSettingsGroup==="general"]]),M(t("div",null,[t("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:n(o)("Choose the API provider for the Codex backend")},[t("span",ct,s(n(o)("Provider")),1),F($,{class:"sidebar-settings-provider-dropdown","model-value":e.selectedProvider,options:e.providerDropdownOptions,placeholder:n(o)("Provider"),disabled:e.freeModeLoading,"menu-align":"end","onUpdate:modelValue":e.onProviderChange},null,8,["model-value","options","placeholder","disabled","onUpdate:modelValue"])],8,lt),e.providerError?(d(),r("div",dt,[t("span",null,s(e.providerError),1),t("a",{class:"visible-error-feedback",href:e.feedbackMailto,onClick:a[9]||(a[9]=i=>e.prepareFeedbackLink(i,e.providerError))},s(n(o)("Send feedback")),9,rt)])):m("",!0),e.selectedProvider==="openrouter"?(d(),r("div",ut,[t("div",gt,[t("span",bt,s(n(o)("OpenRouter API key")),1),t("a",mt,s(n(o)("Get API key")),1)]),t("div",ht,[e.freeModeHasCustomKey&&!e.freeModeCustomKey?(d(),r(C,{key:0},[t("span",vt,s(e.freeModeCustomKeyMasked),1),t("button",{class:"sidebar-settings-key-clear",type:"button",disabled:e.freeModeCustomKeySaving,title:n(o)("Remove custom key, use community keys"),onClick:a[10]||(a[10]=(...i)=>e.clearFreeModeCustomKey&&e.clearFreeModeCustomKey(...i))},"✕",8,yt)],64)):(d(),r(C,{key:1},[t("input",{"model-value":e.freeModeCustomKey,onInput:a[11]||(a[11]=i=>e.onFreeModeCustomKeyChange(i.target.value)),class:"sidebar-settings-key-input",type:"password",placeholder:n(o)("sk-or-v1-... (optional, uses free keys if empty)"),onKeydown:a[12]||(a[12]=T((...i)=>e.saveFreeModeCustomKey&&e.saveFreeModeCustomKey(...i),["enter"]))},null,40,Ct),t("button",{class:"sidebar-settings-key-save",type:"button",disabled:e.freeModeCustomKeySaving||!e.freeModeCustomKey.trim(),onClick:a[13]||(a[13]=(...i)=>e.saveFreeModeCustomKey&&e.saveFreeModeCustomKey(...i))},s(e.freeModeCustomKeySaving?"...":n(o)("Set")),9,ft)],64))]),t("div",kt,[t("span",At,s(n(o)("API format")),1),t("div",{class:"sidebar-settings-segmented",role:"group","aria-label":n(o)("OpenRouter API format")},[t("button",{type:"button",class:f(["sidebar-settings-segmented-option",{"is-active":e.openRouterWireApi==="responses"}]),disabled:e.freeModeCustomKeySaving||e.freeModeLoading,onClick:a[14]||(a[14]=i=>e.setOpenRouterWireApi("responses"))},s(n(o)("Responses")),11,Ft),t("button",{type:"button",class:f(["sidebar-settings-segmented-option",{"is-active":e.openRouterWireApi==="chat"}]),disabled:e.freeModeCustomKeySaving||e.freeModeLoading,onClick:a[15]||(a[15]=i=>e.setOpenRouterWireApi("chat"))},s(n(o)("Completions")),11,wt)],8,St)])])):m("",!0),e.selectedProvider==="opencode-zen"?(d(),r("div",Rt,[t("div",Lt,[t("span",pt,s(n(o)("OpenCode Zen API key")),1),t("a",Mt,s(n(o)("Get API key")),1)]),t("div",Et,[t("input",{"model-value":e.opencodeZenKey,onInput:a[16]||(a[16]=i=>e.onOpencodeZenKeyChange(i.target.value)),class:"sidebar-settings-key-input",type:"password",placeholder:n(o)("sk-..."),onKeydown:a[17]||(a[17]=T((...i)=>e.saveOpencodeZen&&e.saveOpencodeZen(...i),["enter"]))},null,40,$t),t("button",{class:"sidebar-settings-key-save",type:"button",disabled:e.freeModeCustomKeySaving||!e.opencodeZenKey.trim(),onClick:a[18]||(a[18]=(...i)=>e.saveOpencodeZen&&e.saveOpencodeZen(...i))},s(e.freeModeCustomKeySaving?"...":n(o)("Save")),9,Tt)])])):m("",!0),e.selectedProvider==="custom"?(d(),r("div",It,[t("span",xt,s(n(o)("Custom endpoint URL")),1),t("div",Pt,[t("input",{"model-value":e.customEndpointUrl,onInput:a[19]||(a[19]=i=>e.onCustomEndpointUrlChange(i.target.value)),class:"sidebar-settings-key-input",type:"url",placeholder:n(o)("https://api.example.com/v1"),onKeydown:a[20]||(a[20]=T((...i)=>e.saveCustomEndpoint&&e.saveCustomEndpoint(...i),["enter"]))},null,40,Dt)]),t("span",Kt,s(n(o)("API key")),1),t("div",Wt,[t("input",{"model-value":e.customEndpointKey,onInput:a[21]||(a[21]=i=>e.onCustomEndpointKeyChange(i.target.value)),class:"sidebar-settings-key-input",type:"password",placeholder:n(o)("Bearer token (optional)"),onKeydown:a[22]||(a[22]=T((...i)=>e.saveCustomEndpoint&&e.saveCustomEndpoint(...i),["enter"]))},null,40,Ut),t("button",{class:"sidebar-settings-key-save",type:"button",disabled:e.freeModeCustomKeySaving||!e.customEndpointUrl.trim(),onClick:a[23]||(a[23]=(...i)=>e.saveCustomEndpoint&&e.saveCustomEndpoint(...i))},s(e.freeModeCustomKeySaving?"...":n(o)("Save")),9,Bt)]),t("div",Ot,[t("span",Nt,s(n(o)("API format")),1),t("div",{class:"sidebar-settings-segmented",role:"group","aria-label":n(o)("Custom endpoint API format")},[t("button",{type:"button",class:f(["sidebar-settings-segmented-option",{"is-active":e.customEndpointWireApi==="responses"}]),onClick:a[24]||(a[24]=i=>e.onCustomEndpointWireApiChange("responses"))},s(n(o)("Responses")),3),t("button",{type:"button",class:f(["sidebar-settings-segmented-option",{"is-active":e.customEndpointWireApi==="chat"}]),onClick:a[25]||(a[25]=i=>e.onCustomEndpointWireApiChange("chat"))},s(n(o)("Completions")),3)],8,Gt)])])):m("",!0)],512),[[E,e.activeSettingsGroup==="models"]]),M(t("div",null,[t("button",{class:"sidebar-settings-row",type:"button","aria-live":"polite",onClick:a[26]||(a[26]=i=>e.onTelegramConfigOpenChange(!e.isTelegramConfigOpen))},[t("span",Vt,s(n(o)("Telegram")),1),t("span",Ht,s(e.telegramStatusText),1)]),e.isTelegramConfigOpen?(d(),r("div",Zt,[t("label",qt,[t("span",Qt,s(n(o)("Bot token")),1),t("input",{value:e.telegramBotTokenDraft,onInput:a[27]||(a[27]=i=>e.onTelegramBotTokenDraftChange(i.target.value)),class:"sidebar-settings-input",type:"password",placeholder:"123456:ABCDEF",autocomplete:"off",spellcheck:"false"},null,40,Xt)]),t("label",jt,[t("span",zt,s(n(o)("Allowed Telegram user IDs")),1),t("textarea",{value:e.telegramAllowedUserIdsDraft,onInput:a[28]||(a[28]=i=>e.onTelegramAllowedUserIdsDraftChange(i.target.value)),class:"sidebar-settings-textarea",rows:"3",placeholder:`123456789
|
|
3
3
|
987654321`,spellcheck:"false"},null,40,Jt)]),t("div",Yt,s(n(o)("Put one Telegram user ID per line or separate them with commas. Use `*` to allow all Telegram users. Unauthorized users will see their own ID in the rejection message so they can copy it here.")),1),e.telegramConfigError?(d(),r("div",_t,[t("span",null,s(e.telegramConfigError),1),t("a",{class:"visible-error-feedback",href:e.feedbackMailto,onClick:a[29]||(a[29]=i=>e.prepareFeedbackLink(i,e.telegramConfigError))},s(n(o)("Send feedback")),9,en)])):m("",!0),t("div",tn,[t("button",{class:"sidebar-settings-telegram-save",type:"button",disabled:e.isTelegramSaving,onClick:a[30]||(a[30]=(...i)=>e.saveTelegramConfig&&e.saveTelegramConfig(...i))},s(e.isTelegramSaving?n(o)("Saving…"):n(o)("Save Telegram config")),9,nn)])])):m("",!0),t("div",on,[t("div",sn,[t("span",an,s(n(o)("Hooks")),1),t("button",{class:"sidebar-settings-hooks-reload",type:"button",disabled:e.isHooksLoading,title:n(o)("Reload lifecycle hooks"),onClick:a[31]||(a[31]=i=>e.refreshHooks({force:!0}))},s(e.isHooksLoading?n(o)("Reloading…"):n(o)("Reload")),9,ln)]),e.supportsHooks?(d(),r(C,{key:1},[e.isHooksLoading?(d(),r("p",dn,s(n(o)("Loading hooks…")),1)):e.hooksList.length===0?(d(),r("p",rn,s(n(o)("No hooks registered.")),1)):(d(),r("div",un,[(d(!0),r(C,null,w(e.hooksList,i=>(d(),r("div",{key:i.cwd||"__global__",class:"sidebar-settings-hooks-entry"},[t("p",gn,s(i.cwd||n(o)("Global")),1),(d(!0),r(C,null,w(i.hooks,(k,L)=>(d(),r("div",{key:`${i.cwd}:${k.event}:${L}`,class:"sidebar-settings-hooks-item"},[t("span",{class:f(["sidebar-settings-hooks-state",{"is-on":k.enabled!==!1}])},s(k.enabled===!1?n(o)("Disabled"):n(o)("Enabled")),3),t("span",bn,s(k.event),1),t("code",mn,s(k.command),1)]))),128))]))),128))]))],64)):(d(),r("p",cn,s(n(o)("Hooks are not supported by this Codex version.")),1))]),t("div",hn,[t("div",vn,[t("span",yn,s(n(o)("Remote control")),1),t("button",{class:"sidebar-settings-remote-toggle",type:"button",disabled:e.isRemoteControlActionInFlight||e.isRemoteControlLoading,title:n(o)("Enable or disable remote control"),onClick:a[32]||(a[32]=(...i)=>e.toggleRemoteControl&&e.toggleRemoteControl(...i))},[t("span",{class:f(["sidebar-settings-remote-toggle-track",{"is-on":e.remoteControlStatus.enabled}])},[...a[37]||(a[37]=[t("span",{class:"sidebar-settings-remote-toggle-thumb"},null,-1)])],2),t("span",fn,s(e.remoteControlStatus.enabled?n(o)("Enabled"):n(o)("Disabled")),1)],8,Cn)]),e.supportsRemoteControl?(d(),r(C,{key:1},[e.remoteControlError?(d(),r("p",An,s(e.remoteControlError),1)):m("",!0),e.remoteControlNotice?(d(),r("p",Sn,s(e.remoteControlNotice),1)):m("",!0),e.isRemoteControlLoading?(d(),r("p",Fn,s(n(o)("Loading…")),1)):(d(),r(C,{key:3},[t("button",{class:"sidebar-settings-remote-row",type:"button",disabled:!e.remoteControlStatus.enabled||e.isRemoteControlActionInFlight,onClick:a[33]||(a[33]=(...i)=>e.startRemotePairing&&e.startRemotePairing(...i))},[t("span",Rn,s(n(o)("Pair a new device")),1),t("span",Ln,s(e.remoteControlActionName==="pairing"?n(o)("Starting…"):(R=e.pairingCode)!=null&&R.pairingCode?e.pairingCode.pairingCode:n(o)("Generate code")),1)],8,wn),t("div",pn,[t("div",Mn,[t("span",En,s(n(o)("Paired devices")),1),t("button",{class:"sidebar-settings-remote-reload",type:"button",disabled:e.isRemoteControlActionInFlight,onClick:a[34]||(a[34]=(...i)=>e.refreshRemoteClients&&e.refreshRemoteClients(...i))},s(e.remoteControlActionName==="clients"?n(o)("Reloading…"):n(o)("Reload")),9,$n)]),e.remoteControlStatus.clients.length===0?(d(),r("p",Tn,s(n(o)("No paired devices.")),1)):m("",!0),(d(!0),r(C,null,w(e.remoteControlStatus.clients,i=>(d(),r("div",{key:i.clientId,class:"sidebar-settings-remote-client"},[t("span",In,s(i.deviceName||i.clientId),1),t("button",{class:"sidebar-settings-remote-client-revoke",type:"button",disabled:e.isRemoteControlActionInFlight,onClick:k=>e.revokeRemoteClient(i.clientId)},s(e.remoteControlActionName===`revoke:${i.clientId}`?n(o)("Removing…"):n(o)("Revoke")),9,xn)]))),128))])],64))],64)):(d(),r("p",kn,s(n(o)("Remote control is not supported by this Codex version.")),1))])],512),[[E,e.activeSettingsGroup==="integrations"]]),M(t("div",null,[t("div",Pn,[F(ne,{snapshots:e.accountRateLimitSnapshots},null,8,["snapshots"])]),t("div",{class:"sidebar-settings-build-label","aria-label":n(o)("Worktree name and version")}," WT "+s(e.worktreeName)+" · v"+s(e.appVersion),9,Dn)],512),[[E,e.activeSettingsGroup==="usage"]])])])],8,Ee)])])}}}),Un=K(Kn,[["__scopeId","data-v-e1fcd625"]]);export{Un as default};
|