pisper 0.6.25 → 0.6.26
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/package.json +6 -6
- package/web/.vite/manifest.json +573 -573
- package/web/assets/{AppDialog-CuxO26Km.js → AppDialog-B9y7rq_4.js} +1 -1
- package/web/assets/{AppOverlays-Bt5SL3PY.js → AppOverlays-CzdCHrpC.js} +1 -1
- package/web/assets/{AssetsPage-BE6AzOGC.js → AssetsPage-MzCklx_a.js} +1 -1
- package/web/assets/{BoardPage-DX0fJ_ap.js → BoardPage-CjQXbluj.js} +3 -3
- package/web/assets/{ChannelsPage-CyT7oDYZ.js → ChannelsPage-C6HqgnP7.js} +1 -1
- package/web/assets/{ChatAppearancePage-B6Dzj2Bj.js → ChatAppearancePage-BRlvWkJX.js} +1 -1
- package/web/assets/{ChatHistoryPage-Cq20l93c.js → ChatHistoryPage-D3jSE4oY.js} +1 -1
- package/web/assets/{ChatPage-DgiS-Qj_.js → ChatPage-BfG3KbJi.js} +3 -3
- package/web/assets/{ConfigPage-CgrWdzb5.js → ConfigPage-CshLFv2D.js} +1 -1
- package/web/assets/{DesktopWindowControls-D8axeuEx.js → DesktopWindowControls-BZu-eiS1.js} +1 -1
- package/web/assets/{FeaturePage-BB1TeMlr.js → FeaturePage-DD_32h19.js} +1 -1
- package/web/assets/{FileAttachmentPreview-DPjT_iYk.js → FileAttachmentPreview-DDX_cRzm.js} +1 -1
- package/web/assets/{FloatingWidgets-FI1S4hdn.js → FloatingWidgets-Dc4Lhl5d.js} +1 -1
- package/web/assets/{FocusRuntimeControls-CvAx-KDV.js → FocusRuntimeControls-CkYJXBrP.js} +1 -1
- package/web/assets/{GitDiffViewer-DwFfeFOA.js → GitDiffViewer-DeVUAwce.js} +1 -1
- package/web/assets/{ManageProjectsDialog-BSLNf6qD.js → ManageProjectsDialog-DPzESWUB.js} +1 -1
- package/web/assets/{MarkdownMessage-NK7Ixb4Y.js → MarkdownMessage-BfSy1Cg4.js} +1 -1
- package/web/assets/{McpPage-Cn-yDgC5.js → McpPage-CcJDe2nE.js} +1 -1
- package/web/assets/MemoryEvolution-Cwdreg5P.js +1 -0
- package/web/assets/{MemoryPage-ZwoG_oj6.js → MemoryPage-BkALQ2WN.js} +2 -2
- package/web/assets/{MobileNavigation-DK5a0kZU.js → MobileNavigation-C1mjjmqO.js} +1 -1
- package/web/assets/{MorePage-BL8nDnTQ.js → MorePage-C7kCRfpo.js} +1 -1
- package/web/assets/{NewFolderDialog-COkq83LW.js → NewFolderDialog-sqiEXqxJ.js} +1 -1
- package/web/assets/{PageHeader-BBTCMqXc.js → PageHeader-DDaW4Sdv.js} +1 -1
- package/web/assets/{PhoneDrawer-BcPKJWl-.js → PhoneDrawer-Be7C0xLf.js} +1 -1
- package/web/assets/{PhoneMenuButton-D6vdTZdF.js → PhoneMenuButton-1dPMDaRV.js} +1 -1
- package/web/assets/{PhoneTopBar-MqNeI69v.js → PhoneTopBar-BLXoPO6P.js} +1 -1
- package/web/assets/{PluginsPage-Bp71HpKD.js → PluginsPage-Bjp82DPO.js} +1 -1
- package/web/assets/{SafeModePrompt-CpvvU5wL.js → SafeModePrompt-D_OCmR6G.js} +1 -1
- package/web/assets/{SchedulesPage-Drs10rEV.js → SchedulesPage-DCOhjQ8W.js} +1 -1
- package/web/assets/{SessionBrowserPane-DjtB4MCI.js → SessionBrowserPane-Cvmqo12R.js} +2 -2
- package/web/assets/{SessionContextPanel-ETfnp4pT.js → SessionContextPanel-B9KtrMwl.js} +2 -2
- package/web/assets/{SessionHome-CHBw3ZvP.js → SessionHome-DMAZBF3M.js} +1 -1
- package/web/assets/{SessionInspector-DVaRflQy.js → SessionInspector-DfinUUs5.js} +1 -1
- package/web/assets/{SessionShell-CwfQAX7i.js → SessionShell-BxYZQh_O.js} +1 -1
- package/web/assets/{SettingsSidebar-FgC-tlY2.js → SettingsSidebar-DWXc-Z4_.js} +1 -1
- package/web/assets/{ShortcutHelpDialog-DKbIkUnk.js → ShortcutHelpDialog-QBYqmifG.js} +1 -1
- package/web/assets/{ShortcutKeys-BuHXNKVW.js → ShortcutKeys-B6hllpKE.js} +1 -1
- package/web/assets/{SidebarUpdateStatus-LKwNKESF.js → SidebarUpdateStatus-C-ebi4wI.js} +1 -1
- package/web/assets/{SkillsPage-BbnerW44.js → SkillsPage-CcNononn.js} +1 -1
- package/web/assets/{TaskProcessesPane-B2fyZEK9.js → TaskProcessesPane-D442bSux.js} +1 -1
- package/web/assets/{TaskTerminalView-CKApgF75.js → TaskTerminalView-B4fD3kVF.js} +1 -1
- package/web/assets/{TerminalPanel-D03WycYm.js → TerminalPanel-64E97AR4.js} +1 -1
- package/web/assets/{WebDesktopPet-K2dbcbnQ.js → WebDesktopPet-DUpnoJ1_.js} +1 -1
- package/web/assets/{WorkflowsPage-CmzftCtz.js → WorkflowsPage-Cj0mQmb3.js} +1 -1
- package/web/assets/{WorkspacePicker-DbdbTOV2.js → WorkspacePicker-_dbgAw5b.js} +1 -1
- package/web/assets/{api-BW_X0FMZ.js → api-_MWfl2VL.js} +1 -1
- package/web/assets/{app-update-DYFXTosD.js → app-update-CJSjwHEp.js} +1 -1
- package/web/assets/{approval-confirm-DQ5N_lJB.js → approval-confirm-D9j-l9WE.js} +1 -1
- package/web/assets/{board-projects-CrejrMrn.js → board-projects-BI5ssHIa.js} +1 -1
- package/web/assets/{bots-store-CNXTx3UY.js → bots-store-D8M80DQa.js} +1 -1
- package/web/assets/{chat-api-Bo6nhq40.js → chat-api-9V8j4rSS.js} +1 -1
- package/web/assets/{client-store-DzgOPMlh.js → client-store-xZC2AfqC.js} +1 -1
- package/web/assets/{config-search-BiQmWst4.js → config-search-VE6brXfx.js} +1 -1
- package/web/assets/{dialog-DFZX_Dek.js → dialog-BgFAhLng.js} +1 -1
- package/web/assets/{events-PfANjkHx.js → events-C96FsPEU.js} +1 -1
- package/web/assets/{focus-session-composer-bits-C_LOpJH_.js → focus-session-composer-bits-DJHZmmrf.js} +1 -1
- package/web/assets/{folder-paths-aRRH_MYq.js → folder-paths-BguW7FsR.js} +1 -1
- package/web/assets/{hosts-lvoPwC3T.js → hosts-D2X7ud3S.js} +1 -1
- package/web/assets/i18n-zKD1z9i9.js +1 -0
- package/web/assets/{index-D_zLThH_.js → index-CwdjZZLG.js} +2 -2
- package/web/assets/{memory-api-DkPje--t.js → memory-api-DilYLnpG.js} +1 -1
- package/web/assets/{mount-app-7pFSwVLO.js → mount-app-Dc-WeJ9N.js} +3 -3
- package/web/assets/{permission-rules-api-CAJsSBA5.js → permission-rules-api-CW4GK6hJ.js} +1 -1
- package/web/assets/{pick-system-directory-yk6L7wR2.js → pick-system-directory-UTgPstWX.js} +1 -1
- package/web/assets/{placements-CMrgmg3t.js → placements-Cw2TcTmd.js} +2 -2
- package/web/assets/{popover--q2hs_pT.js → popover-Cw7QFeII.js} +1 -1
- package/web/assets/{public-DkqrpWXx.js → public-4OSY9BE4.js} +2 -2
- package/web/assets/{public-DWbrDr0p.js → public-DaL-1TT_.js} +1 -1
- package/web/assets/{public-62LVX7HU.js → public-DdhGlwHC.js} +1 -1
- package/web/assets/{public-components-DHMvCgH2.js → public-components-C0KUBrxH.js} +1 -1
- package/web/assets/public-diff-ooK8-fn0.js +1 -0
- package/web/assets/public-events-ntCr-b1Y.js +1 -0
- package/web/assets/{public-flags-D9LdpQwJ.js → public-flags-D6y-DU98.js} +1 -1
- package/web/assets/{public-greeting-DEKYruJJ.js → public-greeting-JGqTdWhf.js} +1 -1
- package/web/assets/{public-session-B9UHA6rN.js → public-session-fPM64rB7.js} +1 -1
- package/web/assets/{public-sidebar-Lne86i_K.js → public-sidebar-CvLw1vam.js} +1 -1
- package/web/assets/{runtime-capabilities-store-BNM5Ug-5.js → runtime-capabilities-store-CWJvmV83.js} +1 -1
- package/web/assets/{safe-mode-instance-DnTP7EUr.js → safe-mode-instance-Dz4-ObZg.js} +1 -1
- package/web/assets/safe-mode-sentinel-Bg8pbnu-.js +1 -0
- package/web/assets/{session-change-summary-api-DMTwGz7o.js → session-change-summary-api-C3QE98fZ.js} +1 -1
- package/web/assets/{session-home-DUpZt2dn.js → session-home-CLGrhgld.js} +1 -1
- package/web/assets/{session-organization-api-BGyp66Uv.js → session-organization-api-B2UGOx0B.js} +1 -1
- package/web/assets/{session-scope-DZITSvZr.js → session-scope-okdygSiV.js} +1 -1
- package/web/assets/{session-tree-actions-CRWyFqAD.js → session-tree-actions-9m9DHqIx.js} +1 -1
- package/web/assets/{session-tree-summary-HTmAo_9V.js → session-tree-summary-u-RSxXXY.js} +1 -1
- package/web/assets/{shortcuts-D72gQCwH.js → shortcuts-CVPFuAiJ.js} +1 -1
- package/web/assets/{side-chat-context-D1hZOT7g.js → side-chat-context-By5GbAvl.js} +4 -4
- package/web/assets/{sidebar-sj8X80Y9.js → sidebar-BWHi3RGN.js} +1 -1
- package/web/assets/{sidebar-store-CXZ7QrOr.js → sidebar-store-CLA6EfOm.js} +1 -1
- package/web/assets/{speech-session-D2GQEOAL.js → speech-session-CFUz5f6J.js} +1 -1
- package/web/assets/{startup-queries-CuEXV1Zu.js → startup-queries-Xa-I9BT7.js} +1 -1
- package/web/assets/{use-i18n-_vdxObu5.js → use-i18n-CIheiCov.js} +1 -1
- package/web/assets/{use-open-bot-BTxzOAbZ.js → use-open-bot-zjJ_Tnfv.js} +1 -1
- package/web/assets/{use-studio-actions-CbMHRZpd.js → use-studio-actions-BiRUtcRX.js} +1 -1
- package/web/assets/{useCatalogProjects-BEkCpADy.js → useCatalogProjects-CbyrRuIn.js} +1 -1
- package/web/assets/{useNewProjectPicker-CUtLjwYE.js → useNewProjectPicker-6iK1xIT3.js} +2 -2
- package/web/assets/{useNow-eQeBCqQk.js → useNow-CE8ZJGxH.js} +1 -1
- package/web/assets/{usePhoneShell-DZHZWXnN.js → usePhoneShell-sWQz-gv8.js} +1 -1
- package/web/assets/{useSessionListQuery-BoUzmjZC.js → useSessionListQuery-K7Hh_V_2.js} +1 -1
- package/web/assets/{useSessionRowActions-DCqDrGZY.js → useSessionRowActions-Geuo0bzR.js} +1 -1
- package/web/assets/{useSidebarModel-CZAfH4Fa.js → useSidebarModel-BuyZjTgh.js} +1 -1
- package/web/assets/{web-preview-XrRFo42l.js → web-preview-0hEXH_IN.js} +1 -1
- package/web/assets/{web-preview-events-Ba6duwGi.js → web-preview-events-B5w8DSl2.js} +1 -1
- package/web/assets/{workspace-order-store-Ao4OZ13V.js → workspace-order-store-GwJH1aiS.js} +1 -1
- package/web/index.html +1 -1
- package/web/assets/MemoryEvolution-B8IeSLcd.js +0 -1
- package/web/assets/i18n-EVP8yIdy.js +0 -1
- package/web/assets/public-diff-WjbTu91T.js +0 -1
- package/web/assets/public-events-CTdTIu5Q.js +0 -1
- package/web/assets/safe-mode-sentinel-DOhqH4gj.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./index-D_zLThH_.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./use-i18n-_vdxObu5.js";import{t as a}from"./storage-DtvZ_lEu.js";import{t as o}from"./useQuery-DdcpUQhO.js";import{a as s,n as c,o as l,t as u}from"./startup-queries-CuEXV1Zu.js";import{t as d}from"./api-BW_X0FMZ.js";import{t as ee}from"./usePhoneShell-DZHZWXnN.js";import{t as f}from"./createLucideIcon-Cd-3GVxJ.js";import{t as te}from"./archive-ojKJT7Fp.js";import{t as ne}from"./ellipsis-CfGKfbq6.js";import{t as re}from"./pencil-U08v_vV9.js";import{t as ie}from"./pin-off-BpRu_vrC.js";import{t as p}from"./pin-CU0FG0lI.js";import{t as ae}from"./refresh-cw-TbWxTY4K.js";import{t as oe}from"./square-pen-hYbjKh6A.js";import{t as se}from"./trash-2-CNrPOoPR.js";import{t as m}from"./brand-DIEc3fK8.js";import{t as ce}from"./more-pages-D_PnxLN0.js";import{c as le,i as h,p as ue,r as de,t as fe}from"./dropdown-menu-Ds0gD8S8.js";import{t as g}from"./utils-C8uzG5AZ.js";import{n as pe,t as _}from"./button-CCcCN8tE.js";import{c as me,t as v,u as y,y as he}from"./events-PfANjkHx.js";import{s as ge}from"./shortcuts-D72gQCwH.js";import{n as _e,t as ve}from"./session-organization-api-BGyp66Uv.js";import{a as ye,o as be}from"./format-DMJQzoZ7.js";import{t as b}from"./StatusGlyph-1KgitlUg.js";import{t as x}from"./session-change-summary-api-DMTwGz7o.js";import{n as S}from"./PageState-Cz6vFMXv.js";import{a as xe,i as Se,n as Ce,o as we,r as Te,s as Ee,t as De}from"./FeaturePage-BB1TeMlr.js";import{t as Oe}from"./badge-CWB3lj2H.js";import{a as C,t as ke}from"./session-list-BRMu9JWa.js";var Ae=f(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),je=f(`folder-closed`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M2 10h20`,key:`1ir3d8`}]]),w=e(n(),1),T=864e5;function E(e,t=Date.now()){if(e.pinned)return`pinned`;let n=Date.parse(e.modified||``);if(!Number.isFinite(n))return`earlier`;let r=new Date(t);return r.setHours(0,0,0,0),n>=r.getTime()?`today`:n>=r.getTime()-6*T?`week`:`earlier`}function D(e,t,n=Date.now()){let r=new Map;return e.forEach((e,i)=>{let a=E(e,n),o=r.get(a)??{key:a,count:0,items:[]};o.count+=1,i<t&&o.items.push(e),r.set(a,o)}),[...r.values()].filter(e=>e.items.length>0)}function Me(e,t,n,r=`active`,i=Date.now()){let a=t.trim().toLowerCase(),o=a?e.filter(e=>`${e.name||``} ${e.firstMessage||``} ${e.cwd||``} ${e.model||``}`.toLowerCase().includes(a)):e.filter(e=>!!e.archived==(r===`archived`)),s=C(o),c=s.slice(0,Math.max(0,n));return{total:o.length,items:c,groups:D(s,c.length,i)}}var O=r();function Ne({sessionId:e,lastCompletedAt:t,streaming:n}){let{t:r}=i(),a=(0,w.useRef)(null),[s,c]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let e=a.current;if(!e||s)return;if(!(`IntersectionObserver`in window)){c(!0);return}let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(c(!0),t.disconnect())},{rootMargin:`120px`});return t.observe(e),()=>t.disconnect()},[s]);let{data:l}=o({queryKey:[`session-change-summary`,e,t],queryFn:()=>x(e),enabled:s,staleTime:6e4,retry:0,refetchInterval:n&&s?2e4:!1});return l?.status!==`known`||!l.changedFiles?(0,O.jsx)(`span`,{ref:a}):(0,O.jsx)(`span`,{ref:a,className:`ml-1 inline-flex items-center gap-1 tabular-nums before:mr-1 before:content-['·']`,children:r(`chat:chatHistoryPage.changeSummary`,{count:l.changedFiles,added:l.added||0,removed:l.removed||0})})}function k(e){s.setQueryData(u,t=>t&&{...t,sessions:e(t.sessions||[])})}function A({navigate:e,onBack:n,onNewTask:r,notify:s,requestConfirm:u,requestText:f}){let{t:x,language:T}=i(),E=ee(),D=ge(`focusSearch`),[A,j]=(0,w.useState)(``),M=o(l(`sessions`)),N=(0,w.useMemo)(()=>C(M.data?.sessions||[]),[M.data]),[P,Pe]=(0,w.useState)(`active`),F=`${P}\0${A}`,[I,L]=(0,w.useState)({filterKey:F,count:50}),R=(0,w.useRef)(!1),z=(0,w.useRef)(null),[B,V]=(0,w.useState)(()=>t.getItem(a.activeSession)||``),[Fe,H]=(0,w.useState)(!1),[U,W]=(0,w.useState)(``),G=M.isPending||Fe,K=M.error&&!M.data?M.error instanceof Error?M.error.message:String(M.error):``;(0,w.useEffect)(()=>{L(e=>e.filterKey===F&&e.count===50?e:{filterKey:F,count:50})},[F]);let q=(0,w.useCallback)(async()=>{H(!0),W(``);try{await c(`sessions`,!0)}catch(e){W(e instanceof Error?e.message:String(e))}finally{H(!1)}},[]);(0,w.useEffect)(()=>(document.title=`${x(`chat:chatHistoryPage.chatHistory`)} · ${m}`,()=>{document.title=m}),[x]),(0,w.useEffect)(()=>{let e=e=>V(e.detail?.id||t.getItem(a.activeSession)||``);return window.addEventListener(v,e),()=>window.removeEventListener(v,e)},[]);let J=I.filterKey===F?I.count:50,Y=(0,w.useMemo)(()=>Me(N,A,J,P),[P,A,N,J]),X=N.filter(e=>e.archived).length,Z={active:N.length-X,archived:X},Ie={pinned:x(`chat:chatHistoryPage.groupPinned`),today:x(`chat:chatHistoryPage.groupToday`),week:x(`chat:chatHistoryPage.groupWeek`),earlier:x(`chat:chatHistoryPage.groupEarlier`)};(0,w.useEffect)(()=>{R.current&&(R.current=!1,z.current?.focus())},[Y.items.length,Y.total]);let Le=t=>{he(t),e(`chat`)},Re=async e=>{let t=await f({title:x(`chat:chatHistoryPage.renameChat`),inputLabel:x(`chat:chatHistoryPage.chatTitle`),value:e.name,confirmLabel:x(`chat:chatHistoryPage.save`)});if(t!==null&&t!==e.name)try{let n=await d(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`PATCH`,body:JSON.stringify({name:t})});k(t=>t.map(t=>t.id===e.id?{...t,name:n.name}:t)),y({id:e.id,name:n.name}),s(x(`chat:chatHistoryPage.chatTitleUpdated`))}catch(e){W(e instanceof Error?e.message:String(e))}},Q=async(e,t,n)=>{try{let r=await _e(e.id,t);k(e=>ke(e,r)),s(n)}catch(e){W(e instanceof ve?x(`chat:chatHistoryPage.sessionUpdateFailed`):e instanceof Error?e.message:String(e))}},ze=async e=>{if(await u({title:x(`chat:chatHistoryPage.deleteChat`),message:x(`chat:chatHistoryPage.deleteChatNameThisAlsoRemovesLocalChatHistory`,{name:e.name}),confirmLabel:x(`chat:chatHistoryPage.delete`)}))try{await d(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`});let n=N.filter(t=>t.id!==e.id);if(k(t=>t.filter(t=>t.id!==e.id)),B===e.id){let e=n[0]?.id||``;V(e),e?t.setItem(a.activeSession,e):t.removeItem(a.activeSession),me(e)}y({deletedIds:[e.id]}),s(x(`chat:chatHistoryPage.chatDeleted`))}catch(e){W(e instanceof Error?e.message:String(e))}},Be=e=>e.streaming?(0,O.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-content-secondary`,children:[(0,O.jsx)(b,{status:`run`,className:`size-3.5`}),x(`chat:chatHistoryPage.statusRunning`)]}):e.needsAttention?(0,O.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 font-medium text-warning-strong`,children:[(0,O.jsx)(b,{status:`attention`,className:`size-3.5`}),e.attentionReason===`failure`?x(`chat:chatHistoryPage.statusFailed`):e.attentionReason===`approval`?x(`chat:chatHistoryPage.statusApproval`):x(`chat:chatHistoryPage.needsAttention`)]}):null,$=x(`chat:chatHistoryPage.chatHistory`),Ve=A?x(`chat:chatHistoryPage.noMatchingConversations`):P===`archived`?x(`chat:chatHistoryPage.noArchivedChats`):N.length?x(`chat:chatHistoryPage.noActiveChats`):x(`chat:chatHistoryPage.noConversationsHaveLeftAnEchoYet`),He=A?x(`chat:chatHistoryPage.tryADifferentSearch`):P===`archived`?x(`chat:chatHistoryPage.archivedChatsAppearHere`):N.length?x(`chat:chatHistoryPage.restoreArchivedChats`):x(`chat:chatHistoryPage.onceAConversationBeginsItWillBeQuietlyGatheredHere`);return(0,O.jsx)(Te,{title:$,description:x(`chat:chatHistoryPage.lede`),back:n&&{label:x(`navigation:sidebar.features`),ariaLabel:x(`navigation:shell.backToFeaturesLabel`),onBack:n},toolbar:(0,O.jsx)(Ee,{search:(0,O.jsx)(xe,{id:ce,value:A,onValueChange:j,placeholder:x(`navigation:pageHeader.searchPage`,{page:$}),shortcut:D,clearLabel:x(`navigation:more.clearSearch`)}),actions:r&&!E&&(0,O.jsxs)(_,{type:`button`,className:`h-9`,onClick:r,children:[(0,O.jsx)(oe,{}),x(`navigation:shell.newTask`)]}),filters:(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,O.jsx)(`div`,{role:`group`,"aria-label":x(`chat:chatHistoryPage.historySections`),className:`inline-grid h-8 grid-cols-2 rounded-md border border-stroke bg-chrome p-[3px] max-[650px]:h-auto max-[650px]:flex-1 max-[650px]:rounded-[10px] pointer-coarse:h-auto`,children:[`active`,`archived`].map(e=>(0,O.jsxs)(`button`,{type:`button`,"aria-pressed":P===e,"aria-label":e===`active`?x(`chat:chatHistoryPage.activeChatsCount`,{count:Z.active}):x(`chat:chatHistoryPage.archivedChats`,{count:Z.archived}),className:g(`inline-flex min-w-0 items-center justify-center gap-1.5 rounded-sm border border-transparent px-3 text-sm text-content-secondary transition-colors duration-(--d-fast) hover:text-content max-[650px]:h-11 max-[650px]:text-base pointer-coarse:h-11`,P===e&&`border-key-border bg-key font-medium text-content shadow-key`),onClick:()=>Pe(e),children:[x(e===`active`?`chat:chatHistoryPage.activeChats`:`chat:chatHistoryPage.archived`),(0,O.jsx)(`span`,{className:g(`text-xs font-normal tabular-nums`,P===e?`text-content-secondary`:`text-content-muted`),children:Z[e]})]},e))}),(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-xs text-content-muted tabular-nums`,children:[(0,O.jsxs)(`span`,{className:g(`truncate`,!A&&`max-[650px]:hidden`),children:[x(`chat:chatHistoryPage.countChatHistoryItems`,{count:N.length}),` · `,A?x(`chat:chatHistoryPage.countCurrentlyFiltered`,{count:Y.total}):x(`chat:chatHistoryPage.sortedByMostRecentlyUpdated`)]}),(0,O.jsx)(_,{variant:`ghost`,size:`icon-sm`,className:`text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":x(`chat:chatHistoryPage.refresh`),title:x(`chat:chatHistoryPage.refresh`),onClick:()=>void q(),disabled:G,children:G?(0,O.jsx)(pe,{className:`text-current`}):(0,O.jsx)(ae,{size:14})})]})]})}),children:G&&!N.length?(0,O.jsx)(S,{kind:`loading`,title:x(`chat:chatHistoryPage.loadingChatHistory`)}):K&&!N.length?(0,O.jsx)(S,{kind:`error`,title:x(`chat:chatHistoryPage.loadFailed`),description:K,action:(0,O.jsx)(_,{variant:`secondary`,className:`max-[650px]:h-11`,loading:G,disabled:G,onClick:()=>void q(),children:x(`common:pageTemplate.retry`)})}):(0,O.jsxs)(O.Fragment,{children:[(U||K)&&(0,O.jsx)(De,{children:U||K}),Y.total?(0,O.jsxs)(`div`,{className:`chat-history-list`,children:[Y.groups.map(e=>(0,O.jsx)(we,{title:Ie[e.key],count:e.count,children:(0,O.jsx)(Ce,{children:e.items.map(e=>{let t=e.name||x(`chat:chatHistoryPage.untitledChat`),n=e.model&&!/(^|\/)unknown$/i.test(String(e.model))?String(e.model).split(`/`).at(-1):``,r=e.id===B;return(0,O.jsx)(Se,{"data-history-session":e.id,"data-current":r||void 0,className:g(`chat-history-row relative`,r&&`after:absolute after:top-3.5 after:bottom-3.5 after:-left-3 after:w-[3px] after:rounded-r-[3px] after:bg-star max-[650px]:after:-left-2.5`),onOpen:()=>Le(e.id),openLabel:x(`chat:chatHistoryPage.openChatNamed`,{name:t}),name:(0,O.jsxs)(`span`,{className:`chat-history-copy inline-flex max-w-full min-w-0 items-center gap-2`,children:[e.unread&&(0,O.jsx)(`span`,{role:`img`,"aria-label":x(`chat:chatHistoryPage.unread`),className:`size-1.5 shrink-0 rounded-full bg-ink`}),e.pinned&&(0,O.jsx)(p,{className:`size-3.5 shrink-0 text-content-muted`,"aria-hidden":`true`}),(0,O.jsx)(`strong`,{"data-history-name":!0,className:`min-w-0 truncate font-medium`,title:t,children:t})]}),description:(0,O.jsx)(`span`,{className:g(`line-clamp-1`,e.firstMessage?`text-content-secondary`:void 0),children:e.firstMessage||x(`chat:chatHistoryPage.noMessageSummary`)}),meta:(0,O.jsxs)(O.Fragment,{children:[Be(e),e.archived&&A.trim()&&(0,O.jsx)(Oe,{children:x(`chat:chatHistoryPage.archived`)}),(0,O.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 font-mono`,children:[(0,O.jsx)(je,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:be(e.projectless?``:e.cwd,T)})]}),(0,O.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,O.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:x(`chat:chatHistoryPage.countMessages`,{count:e.messageCount||0})}),n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`max-[650px]:hidden`,children:`·`}),(0,O.jsx)(`span`,{className:`min-w-0 truncate font-mono max-[650px]:hidden`,children:n})]}),(0,O.jsx)(Ne,{sessionId:e.id,lastCompletedAt:e.lastCompletedAt,streaming:e.streaming})]}),status:(0,O.jsx)(`time`,{dateTime:e.modified,children:ye(e.modified,T)}),actions:(0,O.jsxs)(fe,{children:[(0,O.jsx)(ue,{asChild:!0,children:(0,O.jsx)(_,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 shrink-0 text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":x(`chat:chatHistoryPage.moreActionsForChat`,{name:t}),children:(0,O.jsx)(ne,{size:16})})}),(0,O.jsxs)(de,{align:`end`,className:`min-w-48`,children:[(0,O.jsxs)(h,{className:`min-h-11`,onSelect:()=>void Re(e),children:[(0,O.jsx)(re,{}),x(`chat:chatHistoryPage.renameChat`)]}),(0,O.jsxs)(h,{className:`min-h-11`,onSelect:()=>void Q(e,{pinned:!e.pinned},e.pinned?x(`chat:chatHistoryPage.unpinned`):x(`chat:chatHistoryPage.pinned`)),children:[e.pinned?(0,O.jsx)(ie,{}):(0,O.jsx)(p,{}),e.pinned?x(`chat:chatHistoryPage.unpin`):x(`chat:chatHistoryPage.pin`)]}),(0,O.jsxs)(h,{className:`min-h-11`,onSelect:()=>void Q(e,{archived:!e.archived},e.archived?x(`chat:chatHistoryPage.restored`):x(`chat:chatHistoryPage.movedToArchive`)),children:[e.archived?(0,O.jsx)(Ae,{}):(0,O.jsx)(te,{}),e.archived?x(`chat:chatHistoryPage.restore`):x(`chat:chatHistoryPage.archive`)]}),e.unread&&(0,O.jsx)(h,{className:`min-h-11`,onSelect:()=>void Q(e,{read:!0},x(`chat:chatHistoryPage.markedRead`)),children:x(`chat:chatHistoryPage.markRead`)}),(0,O.jsx)(le,{}),(0,O.jsxs)(h,{variant:`destructive`,className:`min-h-11`,onSelect:()=>void ze(e),children:[(0,O.jsx)(se,{}),x(`chat:chatHistoryPage.deleteChat`)]})]})]})},e.id)})})},e.key)),Y.total>50&&(0,O.jsx)(`div`,{className:`flex justify-center pt-4`,children:Y.total>Y.items.length?(0,O.jsx)(_,{type:`button`,variant:`secondary`,className:`tabular-nums max-[650px]:min-h-11 pointer-coarse:min-h-11`,onClick:()=>{let e=J+50;R.current=e>=Y.total,L({filterKey:F,count:e})},children:x(`chat:chatHistoryPage.loadMoreChats`,{shown:Y.items.length,total:Y.total})}):(0,O.jsx)(`p`,{ref:z,tabIndex:-1,role:`status`,className:`py-2 text-xs text-content-muted tabular-nums`,children:x(`chat:chatHistoryPage.allChatsShown`,{count:Y.total})})})]}):(0,O.jsx)(S,{kind:`empty`,title:Ve,description:He})]})})}export{A as ChatHistoryPage};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./index-CwdjZZLG.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./use-i18n-CIheiCov.js";import{t as a}from"./storage-DtvZ_lEu.js";import{t as o}from"./useQuery-DdcpUQhO.js";import{a as s,n as c,o as l,t as u}from"./startup-queries-Xa-I9BT7.js";import{t as d}from"./api-_MWfl2VL.js";import{t as ee}from"./usePhoneShell-sWQz-gv8.js";import{t as f}from"./createLucideIcon-Cd-3GVxJ.js";import{t as te}from"./archive-ojKJT7Fp.js";import{t as ne}from"./ellipsis-CfGKfbq6.js";import{t as re}from"./pencil-U08v_vV9.js";import{t as ie}from"./pin-off-BpRu_vrC.js";import{t as p}from"./pin-CU0FG0lI.js";import{t as ae}from"./refresh-cw-TbWxTY4K.js";import{t as oe}from"./square-pen-hYbjKh6A.js";import{t as se}from"./trash-2-CNrPOoPR.js";import{t as m}from"./brand-DIEc3fK8.js";import{t as ce}from"./more-pages-D_PnxLN0.js";import{c as le,i as h,p as ue,r as de,t as fe}from"./dropdown-menu-Ds0gD8S8.js";import{t as g}from"./utils-C8uzG5AZ.js";import{n as pe,t as _}from"./button-CCcCN8tE.js";import{c as me,t as v,u as y,y as he}from"./events-C96FsPEU.js";import{s as ge}from"./shortcuts-CVPFuAiJ.js";import{n as _e,t as ve}from"./session-organization-api-B2UGOx0B.js";import{a as ye,o as be}from"./format-DMJQzoZ7.js";import{t as b}from"./StatusGlyph-1KgitlUg.js";import{t as x}from"./session-change-summary-api-C3QE98fZ.js";import{n as S}from"./PageState-Cz6vFMXv.js";import{a as xe,i as Se,n as Ce,o as we,r as Te,s as Ee,t as De}from"./FeaturePage-DD_32h19.js";import{t as Oe}from"./badge-CWB3lj2H.js";import{a as C,t as ke}from"./session-list-BRMu9JWa.js";var Ae=f(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),je=f(`folder-closed`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M2 10h20`,key:`1ir3d8`}]]),w=e(n(),1),T=864e5;function E(e,t=Date.now()){if(e.pinned)return`pinned`;let n=Date.parse(e.modified||``);if(!Number.isFinite(n))return`earlier`;let r=new Date(t);return r.setHours(0,0,0,0),n>=r.getTime()?`today`:n>=r.getTime()-6*T?`week`:`earlier`}function D(e,t,n=Date.now()){let r=new Map;return e.forEach((e,i)=>{let a=E(e,n),o=r.get(a)??{key:a,count:0,items:[]};o.count+=1,i<t&&o.items.push(e),r.set(a,o)}),[...r.values()].filter(e=>e.items.length>0)}function Me(e,t,n,r=`active`,i=Date.now()){let a=t.trim().toLowerCase(),o=a?e.filter(e=>`${e.name||``} ${e.firstMessage||``} ${e.cwd||``} ${e.model||``}`.toLowerCase().includes(a)):e.filter(e=>!!e.archived==(r===`archived`)),s=C(o),c=s.slice(0,Math.max(0,n));return{total:o.length,items:c,groups:D(s,c.length,i)}}var O=r();function Ne({sessionId:e,lastCompletedAt:t,streaming:n}){let{t:r}=i(),a=(0,w.useRef)(null),[s,c]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let e=a.current;if(!e||s)return;if(!(`IntersectionObserver`in window)){c(!0);return}let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(c(!0),t.disconnect())},{rootMargin:`120px`});return t.observe(e),()=>t.disconnect()},[s]);let{data:l}=o({queryKey:[`session-change-summary`,e,t],queryFn:()=>x(e),enabled:s,staleTime:6e4,retry:0,refetchInterval:n&&s?2e4:!1});return l?.status!==`known`||!l.changedFiles?(0,O.jsx)(`span`,{ref:a}):(0,O.jsx)(`span`,{ref:a,className:`ml-1 inline-flex items-center gap-1 tabular-nums before:mr-1 before:content-['·']`,children:r(`chat:chatHistoryPage.changeSummary`,{count:l.changedFiles,added:l.added||0,removed:l.removed||0})})}function k(e){s.setQueryData(u,t=>t&&{...t,sessions:e(t.sessions||[])})}function A({navigate:e,onBack:n,onNewTask:r,notify:s,requestConfirm:u,requestText:f}){let{t:x,language:T}=i(),E=ee(),D=ge(`focusSearch`),[A,j]=(0,w.useState)(``),M=o(l(`sessions`)),N=(0,w.useMemo)(()=>C(M.data?.sessions||[]),[M.data]),[P,Pe]=(0,w.useState)(`active`),F=`${P}\0${A}`,[I,L]=(0,w.useState)({filterKey:F,count:50}),R=(0,w.useRef)(!1),z=(0,w.useRef)(null),[B,V]=(0,w.useState)(()=>t.getItem(a.activeSession)||``),[Fe,H]=(0,w.useState)(!1),[U,W]=(0,w.useState)(``),G=M.isPending||Fe,K=M.error&&!M.data?M.error instanceof Error?M.error.message:String(M.error):``;(0,w.useEffect)(()=>{L(e=>e.filterKey===F&&e.count===50?e:{filterKey:F,count:50})},[F]);let q=(0,w.useCallback)(async()=>{H(!0),W(``);try{await c(`sessions`,!0)}catch(e){W(e instanceof Error?e.message:String(e))}finally{H(!1)}},[]);(0,w.useEffect)(()=>(document.title=`${x(`chat:chatHistoryPage.chatHistory`)} · ${m}`,()=>{document.title=m}),[x]),(0,w.useEffect)(()=>{let e=e=>V(e.detail?.id||t.getItem(a.activeSession)||``);return window.addEventListener(v,e),()=>window.removeEventListener(v,e)},[]);let J=I.filterKey===F?I.count:50,Y=(0,w.useMemo)(()=>Me(N,A,J,P),[P,A,N,J]),X=N.filter(e=>e.archived).length,Z={active:N.length-X,archived:X},Ie={pinned:x(`chat:chatHistoryPage.groupPinned`),today:x(`chat:chatHistoryPage.groupToday`),week:x(`chat:chatHistoryPage.groupWeek`),earlier:x(`chat:chatHistoryPage.groupEarlier`)};(0,w.useEffect)(()=>{R.current&&(R.current=!1,z.current?.focus())},[Y.items.length,Y.total]);let Le=t=>{he(t),e(`chat`)},Re=async e=>{let t=await f({title:x(`chat:chatHistoryPage.renameChat`),inputLabel:x(`chat:chatHistoryPage.chatTitle`),value:e.name,confirmLabel:x(`chat:chatHistoryPage.save`)});if(t!==null&&t!==e.name)try{let n=await d(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`PATCH`,body:JSON.stringify({name:t})});k(t=>t.map(t=>t.id===e.id?{...t,name:n.name}:t)),y({id:e.id,name:n.name}),s(x(`chat:chatHistoryPage.chatTitleUpdated`))}catch(e){W(e instanceof Error?e.message:String(e))}},Q=async(e,t,n)=>{try{let r=await _e(e.id,t);k(e=>ke(e,r)),s(n)}catch(e){W(e instanceof ve?x(`chat:chatHistoryPage.sessionUpdateFailed`):e instanceof Error?e.message:String(e))}},ze=async e=>{if(await u({title:x(`chat:chatHistoryPage.deleteChat`),message:x(`chat:chatHistoryPage.deleteChatNameThisAlsoRemovesLocalChatHistory`,{name:e.name}),confirmLabel:x(`chat:chatHistoryPage.delete`)}))try{await d(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`});let n=N.filter(t=>t.id!==e.id);if(k(t=>t.filter(t=>t.id!==e.id)),B===e.id){let e=n[0]?.id||``;V(e),e?t.setItem(a.activeSession,e):t.removeItem(a.activeSession),me(e)}y({deletedIds:[e.id]}),s(x(`chat:chatHistoryPage.chatDeleted`))}catch(e){W(e instanceof Error?e.message:String(e))}},Be=e=>e.streaming?(0,O.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-content-secondary`,children:[(0,O.jsx)(b,{status:`run`,className:`size-3.5`}),x(`chat:chatHistoryPage.statusRunning`)]}):e.needsAttention?(0,O.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 font-medium text-warning-strong`,children:[(0,O.jsx)(b,{status:`attention`,className:`size-3.5`}),e.attentionReason===`failure`?x(`chat:chatHistoryPage.statusFailed`):e.attentionReason===`approval`?x(`chat:chatHistoryPage.statusApproval`):x(`chat:chatHistoryPage.needsAttention`)]}):null,$=x(`chat:chatHistoryPage.chatHistory`),Ve=A?x(`chat:chatHistoryPage.noMatchingConversations`):P===`archived`?x(`chat:chatHistoryPage.noArchivedChats`):N.length?x(`chat:chatHistoryPage.noActiveChats`):x(`chat:chatHistoryPage.noConversationsHaveLeftAnEchoYet`),He=A?x(`chat:chatHistoryPage.tryADifferentSearch`):P===`archived`?x(`chat:chatHistoryPage.archivedChatsAppearHere`):N.length?x(`chat:chatHistoryPage.restoreArchivedChats`):x(`chat:chatHistoryPage.onceAConversationBeginsItWillBeQuietlyGatheredHere`);return(0,O.jsx)(Te,{title:$,description:x(`chat:chatHistoryPage.lede`),back:n&&{label:x(`navigation:sidebar.features`),ariaLabel:x(`navigation:shell.backToFeaturesLabel`),onBack:n},toolbar:(0,O.jsx)(Ee,{search:(0,O.jsx)(xe,{id:ce,value:A,onValueChange:j,placeholder:x(`navigation:pageHeader.searchPage`,{page:$}),shortcut:D,clearLabel:x(`navigation:more.clearSearch`)}),actions:r&&!E&&(0,O.jsxs)(_,{type:`button`,className:`h-9`,onClick:r,children:[(0,O.jsx)(oe,{}),x(`navigation:shell.newTask`)]}),filters:(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,O.jsx)(`div`,{role:`group`,"aria-label":x(`chat:chatHistoryPage.historySections`),className:`inline-grid h-8 grid-cols-2 rounded-md border border-stroke bg-chrome p-[3px] max-[650px]:h-auto max-[650px]:flex-1 max-[650px]:rounded-[10px] pointer-coarse:h-auto`,children:[`active`,`archived`].map(e=>(0,O.jsxs)(`button`,{type:`button`,"aria-pressed":P===e,"aria-label":e===`active`?x(`chat:chatHistoryPage.activeChatsCount`,{count:Z.active}):x(`chat:chatHistoryPage.archivedChats`,{count:Z.archived}),className:g(`inline-flex min-w-0 items-center justify-center gap-1.5 rounded-sm border border-transparent px-3 text-sm text-content-secondary transition-colors duration-(--d-fast) hover:text-content max-[650px]:h-11 max-[650px]:text-base pointer-coarse:h-11`,P===e&&`border-key-border bg-key font-medium text-content shadow-key`),onClick:()=>Pe(e),children:[x(e===`active`?`chat:chatHistoryPage.activeChats`:`chat:chatHistoryPage.archived`),(0,O.jsx)(`span`,{className:g(`text-xs font-normal tabular-nums`,P===e?`text-content-secondary`:`text-content-muted`),children:Z[e]})]},e))}),(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-xs text-content-muted tabular-nums`,children:[(0,O.jsxs)(`span`,{className:g(`truncate`,!A&&`max-[650px]:hidden`),children:[x(`chat:chatHistoryPage.countChatHistoryItems`,{count:N.length}),` · `,A?x(`chat:chatHistoryPage.countCurrentlyFiltered`,{count:Y.total}):x(`chat:chatHistoryPage.sortedByMostRecentlyUpdated`)]}),(0,O.jsx)(_,{variant:`ghost`,size:`icon-sm`,className:`text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":x(`chat:chatHistoryPage.refresh`),title:x(`chat:chatHistoryPage.refresh`),onClick:()=>void q(),disabled:G,children:G?(0,O.jsx)(pe,{className:`text-current`}):(0,O.jsx)(ae,{size:14})})]})]})}),children:G&&!N.length?(0,O.jsx)(S,{kind:`loading`,title:x(`chat:chatHistoryPage.loadingChatHistory`)}):K&&!N.length?(0,O.jsx)(S,{kind:`error`,title:x(`chat:chatHistoryPage.loadFailed`),description:K,action:(0,O.jsx)(_,{variant:`secondary`,className:`max-[650px]:h-11`,loading:G,disabled:G,onClick:()=>void q(),children:x(`common:pageTemplate.retry`)})}):(0,O.jsxs)(O.Fragment,{children:[(U||K)&&(0,O.jsx)(De,{children:U||K}),Y.total?(0,O.jsxs)(`div`,{className:`chat-history-list`,children:[Y.groups.map(e=>(0,O.jsx)(we,{title:Ie[e.key],count:e.count,children:(0,O.jsx)(Ce,{children:e.items.map(e=>{let t=e.name||x(`chat:chatHistoryPage.untitledChat`),n=e.model&&!/(^|\/)unknown$/i.test(String(e.model))?String(e.model).split(`/`).at(-1):``,r=e.id===B;return(0,O.jsx)(Se,{"data-history-session":e.id,"data-current":r||void 0,className:g(`chat-history-row relative`,r&&`after:absolute after:top-3.5 after:bottom-3.5 after:-left-3 after:w-[3px] after:rounded-r-[3px] after:bg-star max-[650px]:after:-left-2.5`),onOpen:()=>Le(e.id),openLabel:x(`chat:chatHistoryPage.openChatNamed`,{name:t}),name:(0,O.jsxs)(`span`,{className:`chat-history-copy inline-flex max-w-full min-w-0 items-center gap-2`,children:[e.unread&&(0,O.jsx)(`span`,{role:`img`,"aria-label":x(`chat:chatHistoryPage.unread`),className:`size-1.5 shrink-0 rounded-full bg-ink`}),e.pinned&&(0,O.jsx)(p,{className:`size-3.5 shrink-0 text-content-muted`,"aria-hidden":`true`}),(0,O.jsx)(`strong`,{"data-history-name":!0,className:`min-w-0 truncate font-medium`,title:t,children:t})]}),description:(0,O.jsx)(`span`,{className:g(`line-clamp-1`,e.firstMessage?`text-content-secondary`:void 0),children:e.firstMessage||x(`chat:chatHistoryPage.noMessageSummary`)}),meta:(0,O.jsxs)(O.Fragment,{children:[Be(e),e.archived&&A.trim()&&(0,O.jsx)(Oe,{children:x(`chat:chatHistoryPage.archived`)}),(0,O.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 font-mono`,children:[(0,O.jsx)(je,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:be(e.projectless?``:e.cwd,T)})]}),(0,O.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,O.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:x(`chat:chatHistoryPage.countMessages`,{count:e.messageCount||0})}),n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`max-[650px]:hidden`,children:`·`}),(0,O.jsx)(`span`,{className:`min-w-0 truncate font-mono max-[650px]:hidden`,children:n})]}),(0,O.jsx)(Ne,{sessionId:e.id,lastCompletedAt:e.lastCompletedAt,streaming:e.streaming})]}),status:(0,O.jsx)(`time`,{dateTime:e.modified,children:ye(e.modified,T)}),actions:(0,O.jsxs)(fe,{children:[(0,O.jsx)(ue,{asChild:!0,children:(0,O.jsx)(_,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 shrink-0 text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":x(`chat:chatHistoryPage.moreActionsForChat`,{name:t}),children:(0,O.jsx)(ne,{size:16})})}),(0,O.jsxs)(de,{align:`end`,className:`min-w-48`,children:[(0,O.jsxs)(h,{className:`min-h-11`,onSelect:()=>void Re(e),children:[(0,O.jsx)(re,{}),x(`chat:chatHistoryPage.renameChat`)]}),(0,O.jsxs)(h,{className:`min-h-11`,onSelect:()=>void Q(e,{pinned:!e.pinned},e.pinned?x(`chat:chatHistoryPage.unpinned`):x(`chat:chatHistoryPage.pinned`)),children:[e.pinned?(0,O.jsx)(ie,{}):(0,O.jsx)(p,{}),e.pinned?x(`chat:chatHistoryPage.unpin`):x(`chat:chatHistoryPage.pin`)]}),(0,O.jsxs)(h,{className:`min-h-11`,onSelect:()=>void Q(e,{archived:!e.archived},e.archived?x(`chat:chatHistoryPage.restored`):x(`chat:chatHistoryPage.movedToArchive`)),children:[e.archived?(0,O.jsx)(Ae,{}):(0,O.jsx)(te,{}),e.archived?x(`chat:chatHistoryPage.restore`):x(`chat:chatHistoryPage.archive`)]}),e.unread&&(0,O.jsx)(h,{className:`min-h-11`,onSelect:()=>void Q(e,{read:!0},x(`chat:chatHistoryPage.markedRead`)),children:x(`chat:chatHistoryPage.markRead`)}),(0,O.jsx)(le,{}),(0,O.jsxs)(h,{variant:`destructive`,className:`min-h-11`,onSelect:()=>void ze(e),children:[(0,O.jsx)(se,{}),x(`chat:chatHistoryPage.deleteChat`)]})]})]})},e.id)})})},e.key)),Y.total>50&&(0,O.jsx)(`div`,{className:`flex justify-center pt-4`,children:Y.total>Y.items.length?(0,O.jsx)(_,{type:`button`,variant:`secondary`,className:`tabular-nums max-[650px]:min-h-11 pointer-coarse:min-h-11`,onClick:()=>{let e=J+50;R.current=e>=Y.total,L({filterKey:F,count:e})},children:x(`chat:chatHistoryPage.loadMoreChats`,{shown:Y.items.length,total:Y.total})}):(0,O.jsx)(`p`,{ref:z,tabIndex:-1,role:`status`,className:`py-2 text-xs text-content-muted tabular-nums`,children:x(`chat:chatHistoryPage.allChatsShown`,{count:Y.total})})})]}):(0,O.jsx)(S,{kind:`empty`,title:Ve,description:He})]})})}export{A as ChatHistoryPage};
|