pi-web-ui 0.27.0 → 0.27.1

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/README.md CHANGED
@@ -190,7 +190,7 @@ Any CSS file dropped into your **data-dir themes folder** shows up in the theme
190
190
 
191
191
  Easiest way to write one: copy `themes/light.css` (or the bundled dark `web/src/styles.css` from the source repo) and change the `:root` colors plus any hardcoded values — the file must be **self-contained**. Notes:
192
192
 
193
- - The **xterm terminal canvas keeps its dark palette** in every theme (`TERM_THEME` in `TermXterm.tsx`); keep the terminal's container background matching it so the canvas blends.
193
+ - The **terminal follows the theme** set the `--term-*` variables (terminal ANSI palette + `--term-bg`) in your `:root` and both the xterm canvas and its padded container adapt automatically (see the defaults in `styles.css` and the light values in `themes/light.css`).
194
194
  - Syntax-highlight colors (`highlight.js`'s `github-dark.css` is bundled) must be overridden in your theme file or code will be unreadable — see the `.hljs` overrides at the bottom of `themes/light.css` for the pattern.
195
195
  - Theme ids must match `^[A-Za-z0-9_-]+$` (no dots/slashes — path-traversal guard on the server).
196
196
 
@@ -204,7 +204,7 @@ Want your theme shipped to everyone? Open a pull request at [github.com/xing-shu
204
204
  4. If you only changed colors in `styles.css` and want the bundled light theme updated too, regenerate it with `node make-light-theme.mjs`.
205
205
  5. Commit (`git add themes/<id>.css`) and open the PR. The `themes/` folder is already in the npm package `files` whitelist, so once merged and released, `npm i -g pi-web-ui` will ship your theme to everyone.
206
206
 
207
- Rules for merged themes: the file must be a single self-contained CSS file, be a full standalone theme (no imports of the base `styles.css`), keep the xterm area dark, and override `.hljs` syntax colors for readable code.
207
+ Rules for merged themes: the file must be a single self-contained CSS file, be a full standalone theme (no imports of the base `styles.css`), set the `--term-*` variables for a readable terminal, and override `.hljs` syntax colors for readable code.
208
208
 
209
209
  ## Security
210
210
 
package/README.zh-CN.md CHANGED
@@ -185,7 +185,7 @@ pi-web-ui server unquiesce # 解除排空,恢复接收新工
185
185
 
186
186
  最容易的写法:复制 `themes/light.css`(或源码仓库里内置的深色 `web/src/styles.css`),改 `:root` 颜色和必要的硬编码值即可 —— 文件必须**自包含**。注意:
187
187
 
188
- - **xterm 终端画布在所有主题下都保持深色**(`TermXterm.tsx` `TERM_THEME`);终端容器背景要与其保持一致,画布才能自然融合。
188
+ - **终端跟随主题** —— 在你的 `:root` 里设置 `--term-*` 变量(终端 ANSI 配色 + `--term-bg`),xterm 画布和它的内边距容器都会自动适配(默认值见 `styles.css`,亮色值见 `themes/light.css`)。
189
189
  - 代码高亮色(打包自带 `highlight.js` 的 `github-dark.css`)必须在你的主题文件里覆盖,否则代码会看不清 —— 参照 `themes/light.css` 末尾的 `.hljs` 覆盖写法。
190
190
  - 主题 id 必须匹配 `^[A-Za-z0-9_-]+$`(不能有点和斜杠 —— 服务端有路径穿越防护)。
191
191
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-web-ui",
3
- "version": "0.27.0",
3
+ "version": "0.27.1",
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
  "type": "module",
package/themes/light.css CHANGED
@@ -17,6 +17,28 @@
17
17
  --red: #dc2626;
18
18
  --red-soft: rgba(220, 38, 38, 0.1);
19
19
  --amber: #d97706;
20
+ /* Terminal ANSI palette — light: canvas + padded area both light. */
21
+ --term-bg: #f5f6fa;
22
+ --term-fg: #1c2030;
23
+ --term-cursor: #7c3aed;
24
+ --term-cursor-accent: #f5f6fa;
25
+ --term-selection: rgba(124, 58, 237, 0.3);
26
+ --term-black: #e8eaf0;
27
+ --term-red: #dc2626;
28
+ --term-green: #059669;
29
+ --term-yellow: #d97706;
30
+ --term-blue: #2563eb;
31
+ --term-magenta: #9333ea;
32
+ --term-cyan: #0e7490;
33
+ --term-white: #1c2030;
34
+ --term-bright-black: #8a91a3;
35
+ --term-bright-red: #dc2626;
36
+ --term-bright-green: #059669;
37
+ --term-bright-yellow: #d97706;
38
+ --term-bright-blue: #2563eb;
39
+ --term-bright-magenta: #9333ea;
40
+ --term-bright-cyan: #0e7490;
41
+ --term-bright-white: #000000;
20
42
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
21
43
  --sans:
22
44
  -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
@@ -1142,7 +1164,7 @@ body {
1142
1164
  flex-direction: column;
1143
1165
  min-width: 0;
1144
1166
  min-height: 0;
1145
- background: #0b0d12;
1167
+ background: var(--term-bg);
1146
1168
  /* Padding lives here (not on .term-xterm): FitAddon measures the xterm's
1147
1169
  parent element and only subtracts the xterm's own padding, so padding on
1148
1170
  .term-xterm made it compute rows for more space than is actually visible
@@ -1166,7 +1188,7 @@ body {
1166
1188
  background so it blends with the terminal content (three-class selector
1167
1189
  beats the injected xterm.css rule). */
1168
1190
  .term-xterm .xterm .xterm-viewport {
1169
- background-color: #0b0d12;
1191
+ background-color: var(--term-bg);
1170
1192
  }
1171
1193
 
1172
1194
  .term-empty {
@@ -5344,6 +5366,10 @@ body {
5344
5366
  padding: 28px;
5345
5367
  }
5346
5368
 
5369
+ .fp-overlay.fullscreen {
5370
+ padding: 0;
5371
+ }
5372
+
5347
5373
  .fp {
5348
5374
  display: flex;
5349
5375
  flex-direction: column;
@@ -5357,6 +5383,16 @@ body {
5357
5383
  overflow: hidden;
5358
5384
  }
5359
5385
 
5386
+ .fp.fullscreen {
5387
+ width: 100vw;
5388
+ height: 100vh;
5389
+ max-width: none;
5390
+ max-height: none;
5391
+ border-radius: 0;
5392
+ border-left: 0;
5393
+ border-right: 0;
5394
+ }
5395
+
5360
5396
  .fp-head {
5361
5397
  display: flex;
5362
5398
  align-items: center;
@@ -5426,7 +5462,11 @@ body {
5426
5462
  .fp-attach.wrap:hover,
5427
5463
  .fp-attach.wrap.on,
5428
5464
  .fp-attach.edit:hover,
5429
- .fp-attach.edit.on {
5465
+ .fp-attach.edit.on,
5466
+ .fp-attach.zoom-in:hover,
5467
+ .fp-attach.zoom-out:hover,
5468
+ .fp-attach.full:hover,
5469
+ .fp-attach.full.on {
5430
5470
  background: var(--accent);
5431
5471
  border-color: var(--accent);
5432
5472
  color: #fff;
@@ -5465,6 +5505,30 @@ body {
5465
5505
  opacity: 1;
5466
5506
  }
5467
5507
 
5508
+ /* Zoom control in the header: [-] 100% [+], % resets to 100. */
5509
+ .fp-zoom {
5510
+ display: inline-flex;
5511
+ align-items: center;
5512
+ gap: 4px;
5513
+ }
5514
+ .fp-zoom-val {
5515
+ min-width: 42px;
5516
+ height: 26px;
5517
+ padding: 0 4px;
5518
+ border: 1px solid var(--border);
5519
+ border-radius: 6px;
5520
+ background: var(--bg-elev);
5521
+ color: var(--text-dim);
5522
+ font-size: 10.5px;
5523
+ line-height: 1;
5524
+ text-align: center;
5525
+ cursor: pointer;
5526
+ }
5527
+ .fp-zoom-val:hover {
5528
+ border-color: var(--accent);
5529
+ color: var(--text);
5530
+ }
5531
+
5468
5532
  .fp-close {
5469
5533
  display: inline-flex;
5470
5534
  align-items: center;
@@ -5516,7 +5580,7 @@ body {
5516
5580
  padding: 12px 14px;
5517
5581
  background: rgba(0, 0, 0, 0.22);
5518
5582
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
5519
- font-size: 12px;
5583
+ font-size: calc(12px * var(--fp-zoom, 1));
5520
5584
  line-height: 1.55;
5521
5585
  color: var(--text-dim);
5522
5586
  white-space: pre;
@@ -5528,7 +5592,7 @@ body {
5528
5592
  overflow: auto;
5529
5593
  background: rgba(0, 0, 0, 0.22);
5530
5594
  font-family: var(--mono);
5531
- font-size: 12px;
5595
+ font-size: calc(12px * var(--fp-zoom, 1));
5532
5596
  line-height: 1.6;
5533
5597
  padding: 6px 0;
5534
5598
  user-select: none;
@@ -5552,7 +5616,12 @@ body {
5552
5616
  word-break: break-word;
5553
5617
  overflow-wrap: anywhere;
5554
5618
  }
5555
- .fp-markdown .md {
5619
+ /* Markdown typography uses fixed px/clamp sizes, so scale the whole body with
5620
+ CSS zoom (a zoom-out can leave side whitespace — acceptable). */
5621
+ .fp-markdown-zoom {
5622
+ zoom: var(--fp-zoom, 1);
5623
+ }
5624
+ .fp-markdown-zoom > .md {
5556
5625
  width: 100%;
5557
5626
  max-width: 860px;
5558
5627
  min-width: 0;
@@ -5768,7 +5837,7 @@ body {
5768
5837
  background: rgba(0, 0, 0, 0.22);
5769
5838
  color: var(--text);
5770
5839
  font-family: var(--mono);
5771
- font-size: 12px;
5840
+ font-size: calc(12px * var(--fp-zoom, 1));
5772
5841
  line-height: 1.6;
5773
5842
  white-space: pre-wrap;
5774
5843
  overflow-wrap: anywhere;