@pi-chamber/web 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{CommitSection-BMoPmxW5.js → CommitSection-IIhrK4u7.js} +1 -1
- package/dist/assets/{DiagramView-DQqjMY2l.js → DiagramView-BKKPzX5U.js} +1 -1
- package/dist/assets/{DiffView-CA4gogOk.js → DiffView-BZAyvJ3r.js} +1 -1
- package/dist/assets/{FilesView-B6u279g1.js → FilesView-mwjEX08j.js} +1 -1
- package/dist/assets/{GitView-BZVWI9Uo.js → GitView-C1ltD6da.js} +3 -3
- package/dist/assets/{JsonTreeView-Lcl4hDE0.js → JsonTreeView-De-9zk3N.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-Uz4H4e3u.js → MarkdownRendererImpl-BJjIFNhO.js} +1 -1
- package/dist/assets/PatchDiff-DuR1fglg.js +1 -0
- package/dist/assets/{PierreDiffViewer-CODKwHC9.js → PierreDiffViewer-B_1JcH3B.js} +1 -1
- package/dist/assets/{SessionSwitcherContent-Cp2Zm5gn.js → SessionSwitcherContent-DoEWfM8C.js} +1 -1
- package/dist/assets/{SessionSwitcherDropdown-BdQTFOMs.js → SessionSwitcherDropdown-CJWqyz1O.js} +2 -2
- package/dist/assets/{SessionUnreadDot-CyaUql-t.js → SessionUnreadDot-DB-YvwMh.js} +1 -1
- package/dist/assets/{SettingsView-BtYR1m1l.js → SettingsView-ZwPgZh-7.js} +3 -3
- package/dist/assets/{SettingsWindow-BWemjgov.js → SettingsWindow-nCTzNqyu.js} +1 -1
- package/dist/assets/{ToolOutputDialog-BmSMXqFj.js → ToolOutputDialog-CIzj2Pxu.js} +5 -5
- package/dist/assets/{ToolPartDiffPreview-qaLAaq5N.js → ToolPartDiffPreview-BgewaN20.js} +1 -1
- package/dist/assets/{VirtualizedFileDiff-B-r2zJ_k.js → VirtualizedFileDiff-aTd42JT9.js} +3 -3
- package/dist/assets/{WindowsWindowControls-NzKm1MYj.js → WindowsWindowControls-CdHYDpHx.js} +9 -9
- package/dist/assets/{computeVirtualFileMetrics-DOtVuPAu.js → computeVirtualFileMetrics-CcGhkiFO.js} +1 -1
- package/dist/assets/{contextFileOpenGuard-CR2p7-61.js → contextFileOpenGuard-DRkKhovc.js} +1 -1
- package/dist/assets/{index-Z6Hwnczz.js → index-DmJfzwE5.js} +1 -1
- package/dist/assets/{isDiffPlainText-DKfgU8d8.js → isDiffPlainText-DL6dDuVG.js} +1 -1
- package/dist/assets/{isFilePlainText-2ndX4gYw.js → isFilePlainText-nuUWsdc6.js} +1 -1
- package/dist/assets/{main-BfG1ShoJ.js → main-Bajw-SZm.js} +2 -2
- package/dist/assets/{main-CsU2nR8Q.js → main-DIAtlyFC.js} +4 -4
- package/dist/assets/{markdownCore-BaZ2plrB.js → markdownCore-CrfGNEFF.js} +2 -2
- package/dist/assets/{miniChat-BpFgzk2I.js → miniChat-Dfoj435F.js} +2 -2
- package/dist/assets/{mobile-Dh_Vvtjt.js → mobile-DFIt0gxE.js} +2 -2
- package/dist/assets/{renderElectronMiniChatApp-DNmqLSsJ.js → renderElectronMiniChatApp-DKsf3ft3.js} +2 -2
- package/dist/assets/{renderMobileApp-BZbx_IU1.js → renderMobileApp-iiD58RxE.js} +4 -4
- package/dist/assets/{useInlineCommentController-TZXHonVr.js → useInlineCommentController-5paFhtYM.js} +2 -2
- package/dist/assets/usePanelSlide-D7Cl581q.js +56 -0
- package/dist/assets/{usePushVisibilityBeacon-9FqcXiL9.js → usePushVisibilityBeacon-BOPrDYSe.js} +2 -2
- package/dist/assets/{useSwitcherItems-DZW2vj37.js → useSwitcherItems-DP5ufRVs.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-DXJ_-7WI.js → vendor-codemirror-language-data-B9y74Qvn.js} +2 -2
- package/dist/assets/{web-components-RWdkgqgC.js → web-components-CD0f7QZj.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/mini-chat.html +1 -1
- package/dist/mobile.html +1 -1
- package/package.json +1 -1
- package/server/lib/pi/session-daemon/DOCUMENTATION.md +1 -1
- package/server/lib/pi/session-daemon/session-daemon.js +3 -1
- package/server/lib/pi/session-daemon/session-daemon.test.js +38 -1
- package/dist/assets/PatchDiff-DpAN_LfK.js +0 -1
- package/dist/assets/usePanelSlide-SCy9Q8Wl.js +0 -56
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as N,j as t,R as c}from"./vendor-react-DYyjh7Q0.js";import{a$ as
|
|
2
|
-
`).length>3;return t.jsxs(oe,{open:k,onOpenChange:f,children:[t.jsx(re,{render:t.jsx("div",{className:F("rounded-lg border shadow-none w-full max-w-[min(100%,calc(var(--oc-context-panel-width,100vw)-var(--oc-editor-gutter-width,0px)))] overflow-hidden transition-all duration-200",h),style:{backgroundColor:p?.colors?.surface?.elevated,borderColor:p?.colors?.interactive?.border,maxWidth:d?`${Math.max(200,Math.floor(d))}px`:void 0},"data-comment-card":"true",onContextMenu:b=>{b.preventDefault(),f(!0)}}),children:t.jsxs("div",{className:"flex items-start justify-between gap-2 p-3",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground mb-1.5",children:[t.jsx("span",{className:"truncate max-w-[200px]",title:n.fileLabel,children:n.fileLabel}),t.jsx("span",{children:"•"}),t.jsx("span",{children:`Lines ${n.startLine}-${n.endLine}`}),n.side&&t.jsxs("span",{children:["(",n.side,")"]})]}),t.jsxs(le,{open:m||!i,onOpenChange:j,children:[t.jsx("div",{className:F("text-sm whitespace-pre-wrap break-words leading-relaxed",!m&&i&&"line-clamp-3"),children:u}),i&&t.jsx(de,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-6 px-0 mt-1 text-xs text-muted-foreground hover:text-foreground w-full justify-start",children:m?t.jsxs(t.Fragment,{children:[t.jsx(w,{name:"arrow-up-s",className:"size-3 mr-1"}),"Show less"]}):t.jsxs(t.Fragment,{children:[t.jsx(w,{name:"arrow-down-s",className:"size-3 mr-1"}),"Show more"]})})}),t.jsx(me,{})]})]}),t.jsxs(Q,{children:[t.jsx(W,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"h-6 w-6 -mr-1 text-muted-foreground hover:text-foreground",children:t.jsx(w,{name:"more",className:"size-4"})})}),t.jsxs(Z,{align:"end",children:[t.jsxs(q,{onClick:a,children:[t.jsx(w,{name:"edit",className:"size-4 mr-2"}),"Edit comment"]}),t.jsxs(q,{onClick:r,className:"text-destructive",children:[t.jsx(w,{name:"delete-bin",className:"size-4 mr-2"}),"Delete comment"]})]})]})]})}),t.jsxs(ae,{children:[t.jsxs(U,{onClick:a,children:[t.jsx(w,{name:"edit",className:"size-4 mr-2"}),"Edit comment"]}),t.jsxs(U,{onClick:r,className:"text-destructive focus:text-destructive",children:[t.jsx(w,{name:"delete-bin",className:"size-4 mr-2"}),"Delete comment"]})]})]})}function ve({initialText:n="",onTextChange:a,onSave:r,onCancel:h,fileLabel:d,lineRange:l,isEditing:p=!1,className:m,maxWidth:j}){const f=
|
|
1
|
+
import{r as N,j as t,R as c}from"./vendor-react-DYyjh7Q0.js";import{a$ as J,B as E,I as w,am as Q,an as W,ao as Z,as as q,aJ as ee,g as O,x as te,aF as R,dT as se,dU as B,t as ne}from"./WindowsWindowControls-CdHYDpHx.js";import{p as oe,q as re,t as ae,v as U,N as ie}from"./usePanelSlide-D7Cl581q.js";import{m as F,a as ce}from"./index--5Zr-fSk.js";import{C as le,a as de,b as me}from"./collapsible-IV1T6v7c.js";function Ce({draft:n,onEdit:a,onDelete:r,className:h,maxWidth:d}){const p=J()?.currentTheme,[m,j]=N.useState(!1),[k,f]=N.useState(!1),u=typeof n.text=="string"?n.text:"",i=u.length>150||u.split(`
|
|
2
|
+
`).length>3;return t.jsxs(oe,{open:k,onOpenChange:f,children:[t.jsx(re,{render:t.jsx("div",{className:F("rounded-lg border shadow-none w-full max-w-[min(100%,calc(var(--oc-context-panel-width,100vw)-var(--oc-editor-gutter-width,0px)))] overflow-hidden transition-all duration-200",h),style:{backgroundColor:p?.colors?.surface?.elevated,borderColor:p?.colors?.interactive?.border,maxWidth:d?`${Math.max(200,Math.floor(d))}px`:void 0},"data-comment-card":"true",onContextMenu:b=>{b.preventDefault(),f(!0)}}),children:t.jsxs("div",{className:"flex items-start justify-between gap-2 p-3",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground mb-1.5",children:[t.jsx("span",{className:"truncate max-w-[200px]",title:n.fileLabel,children:n.fileLabel}),t.jsx("span",{children:"•"}),t.jsx("span",{children:`Lines ${n.startLine}-${n.endLine}`}),n.side&&t.jsxs("span",{children:["(",n.side,")"]})]}),t.jsxs(le,{open:m||!i,onOpenChange:j,children:[t.jsx("div",{className:F("text-sm whitespace-pre-wrap break-words leading-relaxed",!m&&i&&"line-clamp-3"),children:u}),i&&t.jsx(de,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-6 px-0 mt-1 text-xs text-muted-foreground hover:text-foreground w-full justify-start",children:m?t.jsxs(t.Fragment,{children:[t.jsx(w,{name:"arrow-up-s",className:"size-3 mr-1"}),"Show less"]}):t.jsxs(t.Fragment,{children:[t.jsx(w,{name:"arrow-down-s",className:"size-3 mr-1"}),"Show more"]})})}),t.jsx(me,{})]})]}),t.jsxs(Q,{children:[t.jsx(W,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"h-6 w-6 -mr-1 text-muted-foreground hover:text-foreground",children:t.jsx(w,{name:"more",className:"size-4"})})}),t.jsxs(Z,{align:"end",children:[t.jsxs(q,{onClick:a,children:[t.jsx(w,{name:"edit",className:"size-4 mr-2"}),"Edit comment"]}),t.jsxs(q,{onClick:r,className:"text-destructive",children:[t.jsx(w,{name:"delete-bin",className:"size-4 mr-2"}),"Delete comment"]})]})]})]})}),t.jsxs(ae,{children:[t.jsxs(U,{onClick:a,children:[t.jsx(w,{name:"edit",className:"size-4 mr-2"}),"Edit comment"]}),t.jsxs(U,{onClick:r,className:"text-destructive focus:text-destructive",children:[t.jsx(w,{name:"delete-bin",className:"size-4 mr-2"}),"Delete comment"]})]})]})}function ve({initialText:n="",onTextChange:a,onSave:r,onCancel:h,fileLabel:d,lineRange:l,isEditing:p=!1,className:m,maxWidth:j}){const f=J()?.currentTheme,{isMobile:u}=ee(),[i,b]=c.useState(n),D=N.useRef(null),M=e=>{b(e),a?.(e)},T=N.useRef(l);N.useEffect(()=>{l&&(T.current=l)},[l]);const v=e=>{if(!e)return;const o=Math.min(e.start,e.end),g=Math.max(e.start,e.end);return{...e,start:o,end:g}},x=v(l);N.useEffect(()=>{const e=D.current;if(!e)return;const o=e.closest(".overlay-scrollbar-container"),g=o?.scrollTop??window.scrollY,I=o?.scrollLeft??window.scrollX;if(u){e.scrollIntoView({behavior:"auto",block:"nearest"});try{e.focus({preventScroll:!0})}catch{e.focus()}return}try{e.focus({preventScroll:!0})}catch{e.focus()}const z=e.value.length;try{e.setSelectionRange(z,z)}catch{}requestAnimationFrame(()=>{o?(o.scrollTop=g,o.scrollLeft=I):window.scrollTo({top:g,left:I})})},[u]);const L=e=>{(e.metaKey||e.ctrlKey)&&e.key==="Enter"?(e.preventDefault(),i.trim()&&r(i,v(T.current))):e.key==="Escape"&&(e.preventDefault(),h())},y=e=>{e.stopPropagation(),i.trim()&&r(i,v(T.current))};return t.jsx("div",{className:F("rounded-lg border shadow-none w-full max-w-[min(100%,calc(var(--oc-context-panel-width,100vw)-var(--oc-editor-gutter-width,0px)))] overflow-hidden animate-in fade-in zoom-in-95 duration-200",m),style:{backgroundColor:f?.colors?.surface?.elevated,borderColor:f?.colors?.interactive?.border,maxWidth:j?`${Math.max(200,Math.floor(j))}px`:void 0},"data-comment-input":"true",onPointerDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),children:t.jsxs("div",{className:"p-3",children:[(d||l)&&t.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground mb-2",children:[d&&t.jsx("span",{className:"truncate max-w-[200px]",children:d}),d&&l&&t.jsx("span",{children:"•"}),x&&t.jsx("span",{children:`Lines ${x.start}-${x.end}`})]}),t.jsx(ie,{simple:!0,ref:D,value:i,onChange:e=>M(e.target.value),onKeyDown:L,placeholder:u?"Add a comment...":"Add a comment... (Cmd+Enter to save)",outerClassName:"rounded-[var(--radius-xl)] bg-[var(--surface-subtle)] ring-1 ring-inset ring-border/60 focus-within:ring-2 focus-within:ring-[var(--interactive-focus-ring)]",className:"min-h-[80px] px-3 py-2.5 text-sm resize-y"}),t.jsxs("div",{className:"flex items-center justify-end gap-2 mt-3",children:[t.jsx(E,{variant:"ghost",size:"sm",onClick:h,onPointerDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),className:"h-8 text-muted-foreground hover:text-foreground",children:"Cancel"}),t.jsx(E,{size:"sm",onClick:y,onPointerDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),disabled:!i.trim(),className:"h-8 min-w-[80px]",style:{backgroundColor:f?.colors?.status?.success,color:f?.colors?.status?.successForeground},children:p?"Save":"Comment"})]})]})})}const ue=n=>{const a=Math.min(n.startLine,n.endLine),r=Math.max(n.startLine,n.endLine);return{...n,startLine:a,endLine:r}},Y=n=>{const a=Math.min(n.start,n.end),r=Math.max(n.start,n.end);return{...n,start:a,end:r}};function we(n){const{source:a,fileLabel:r,language:h,getCodeForRange:d,toStoreRange:l,fromDraftRange:p}=n,m=O(s=>s.currentSessionId),j=O(s=>s.newSessionDraft?.open),k=te(),f=O(c.useCallback(s=>m?s.getDirectoryForSession(m):null,[m])),u=R(s=>s.addDraft),i=R(s=>s.updateDraft),b=R(s=>s.removeDraft),[D,M]=c.useState(null),[T,v]=c.useState(""),[x,L]=c.useState(null),y=m??(j?"draft":null),e=f??k,o=c.useMemo(()=>!y||!e?null:{directory:e,sessionKey:y},[e,y]),g=o?se(ce(),o.directory,o.sessionKey):null,I=R(c.useCallback(s=>g?s.drafts[g]??B:B,[g])),z=c.useMemo(()=>!o||!r?[]:I.filter(s=>s.source===a&&s.fileLabel===r),[r,I,a,o]),C=c.useCallback(()=>{M(null),v(""),L(null)},[]),V=c.useCallback(()=>{C()},[C]),X=c.useCallback(s=>{const P=Y(p(s));M(P),v(s.text),L(s.id)},[p]),G=c.useCallback(s=>{o&&(b(o,s.id),x===s.id&&C())},[x,b,C,o]),H=c.useCallback((s,P)=>{const $=P??D,K=s.trim();if(!$||!K||!r)return;if(!o){ne.error("Select a session to save comment");return}const A=Y($),S=ue(l(A)),_=d(A);x?i(o,x,{fileLabel:r,startLine:S.startLine,endLine:S.endLine,side:S.side,code:_,language:h,text:K}):u(o,{source:a,fileLabel:r,startLine:S.startLine,endLine:S.endLine,side:S.side,code:_,language:h,text:K}),C()},[u,x,r,d,h,C,D,a,o,l,i]);return{sessionKey:y,drafts:z,selection:D,setSelection:M,commentText:T,setCommentText:v,editingDraftId:x,setEditingDraftId:L,reset:C,cancel:V,startEdit:X,deleteDraft:G,saveComment:H,fromDraftRange:p}}export{ve as I,Ce as a,Y as n,we as u};
|