pi-web-ui 0.86.1 → 0.86.2

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/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.86.2] — 2026-09-15
14
+
15
+ ### Fixed
16
+
17
+ - **升级重启后主题下拉可能只剩深色** —— 主题列表是页面打开时一次性拉取的(`useTheme` 只在挂载时 fetch,没有重试):若那次请求撞上服务端重启窗口而扑空,列表就永远是空的 —— 聊天(WS 自动重连)与其他数据(快照自动恢复)都不受影响,所以看起来「只有主题丢了」。现在主题下拉与「⋯」溢出菜单打开时,若列表为空会自动补拉一次。遇到时刷新页面(Ctrl+R)同样可恢复。
18
+
13
19
  ## [0.86.1] — 2026-09-15
14
20
 
15
21
  ### Fixed
@@ -848,7 +854,8 @@ when?, children?}`,也收 `topbar` / `settings` 这类简写别名);宿主
848
854
  - 0.35.1(2026-08-27):编辑重问保留附件(#18)+ 全窗口拖放(#19)。
849
855
  - 0.29.0(2026-08-23):全局搜索弹窗(Ctrl+K)+ 消息列表惰性窗口化。
850
856
 
851
- [Unreleased]: https://github.com/xing-shuyin/pi-web-ui/compare/v0.86.1...main
857
+ [Unreleased]: https://github.com/xing-shuyin/pi-web-ui/compare/v0.86.2...main
858
+ [0.86.2]: https://github.com/xing-shuyin/pi-web-ui/releases/tag/v0.86.2
852
859
  [0.86.1]: https://github.com/xing-shuyin/pi-web-ui/releases/tag/v0.86.1
853
860
  [0.86.0]: https://github.com/xing-shuyin/pi-web-ui/releases/tag/v0.86.0
854
861
  [0.84.0]: https://github.com/xing-shuyin/pi-web-ui/releases/tag/v0.84.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-web-ui",
3
- "version": "0.86.1",
3
+ "version": "0.86.2",
4
4
  "description": "Web chat interface for the pi coding agent, powered by the pi SDK (@earendil-works/pi-coding-agent) — one-command run, Docker/systemd/launchd deployable",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,4 +1,4 @@
1
- import{a as i,j as n}from"./markdown-D3PKeHAZ.js";import{u as P,b as M,T as z,a as f,c as W,F as Y,d as H,e as Z,f as q,g as ee,h as ne,i as te,j as se,r as ae}from"./index-CCrF953V.js";import{D as re,o as ie}from"./xterm-B96xOxS9.js";import"./react-w24rH0km.js";function le(t){let c=null;return{clean:t.replace(/\r?\n?\[pi-term-exit:(-?\d+)\]\r?\n?/g,(h,u)=>(c=Number(u),`\r
1
+ import{a as i,j as n}from"./markdown-D3PKeHAZ.js";import{u as P,b as M,T as z,a as f,c as W,F as Y,d as H,e as Z,f as q,g as ee,h as ne,i as te,j as se,r as ae}from"./index-Dmwji4Cr.js";import{D as re,o as ie}from"./xterm-B96xOxS9.js";import"./react-w24rH0km.js";function le(t){let c=null;return{clean:t.replace(/\r?\n?\[pi-term-exit:(-?\d+)\]\r?\n?/g,(h,u)=>(c=Number(u),`\r
2
2
  `)).replace(/\r?\n?\x1b\[90m\[(?:进程已退出,退出码 |Process exited with code )-?\d+\]\x1b\[0m\r?\n?/g,`\r
3
3
  `),exitCode:c}}function ce({conversationId:t,terminalId:c,command:s,cwd:h,title:u,agentBash:_,active:p,running:j,exitCode:v,register:b}){const g=i.useRef(null),o=i.useRef(null),{locale:y}=P(),C=i.useRef(y);C.current=y;const k=s?JSON.stringify(s):"",x=i.useRef(j===!1);i.useEffect(()=>{const m=g.current;if(!m)return;const r=new re({theme:M(),fontFamily:'"SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace',fontSize:13,cursorBlink:!0,scrollback:8e3}),w=new ie;r.loadAddon(w),r.open(m),o.current={term:r,fit:w},p&&r.focus();const F=()=>{r.options.theme=M()};window.addEventListener(z,F),r.attachCustomKeyEventHandler(d=>{if(d.type!=="keydown")return!0;const S=d.key?.toLowerCase();if((d.ctrlKey||d.metaKey)&&S==="v")return!1;if(d.ctrlKey&&!d.shiftKey&&!d.altKey&&S==="c"&&r.hasSelection()){const D=r.textarea;return D&&(D.value=r.getSelection(),D.select()),!1}return!0});const $=b(t,c,{write:d=>r.write(le(d).clean),dispose:()=>r.dispose()}),R=()=>{try{w.fit(),f({type:"terminal_resize",terminalId:c,conversationId:t,cols:r.cols,rows:r.rows})}catch{}},A=requestAnimationFrame(()=>{try{w.fit()}catch{}x.current||(s?f({type:"run_command",terminalId:c,conversationId:t,command:s,cols:r.cols,rows:r.rows}):f({type:"terminal_create",terminalId:c,title:u,locale:C.current,agentBash:_,conversationId:t,cwd:h,cols:r.cols,rows:r.rows}))}),I=r.onData(d=>{f({type:"terminal_input",terminalId:c,conversationId:t,data:d})});let T=null;return typeof ResizeObserver<"u"&&(T=new ResizeObserver(()=>{m.offsetWidth>0&&m.offsetHeight>0&&R()}),T.observe(m)),()=>{cancelAnimationFrame(A),I.dispose(),window.removeEventListener(z,F),T?.disconnect(),$(),r.dispose(),o.current=null}},[t,c,k,b]),i.useEffect(()=>{if(!p)return;const m=requestAnimationFrame(()=>{const r=o.current;if(r){try{r.fit.fit(),f({type:"terminal_resize",terminalId:c,conversationId:t,cols:r.term.cols,rows:r.term.rows})}catch{}r.term.focus()}});return()=>cancelAnimationFrame(m)},[p]);const{t:E}=P(),B=i.useRef(void 0);return i.useEffect(()=>{if(j===B.current||(B.current=j,j!==!1))return;const m=o.current;m&&m.term.write(`\r
4
4
  \x1B[90m${E("exitBanner",{code:v??""})}\x1B[0m\r