pi-sakura-cyberdeck 1.5.4 → 1.5.5

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
@@ -3,6 +3,37 @@
3
3
  All notable changes to pi-sakura-cyberdeck. Pi >= 1.5.0 shows new package entries
4
4
  once after updating; run `/sakura-changelog` on any supported Pi to read this file.
5
5
 
6
+ ## [1.5.5] - 2026-12-03
7
+
8
+ ### Highlights
9
+
10
+ - **Linear sakura→sky frame gradients**: sent messages, tool cards and selector borders now flow
11
+ linearly from sakura pink (`#F2A7C6`) on the left to sky blue (`#9FD3F2`) on the right, with
12
+ sky-blue right tool rails (`│`) matching `╮` and `╯`.
13
+ - **Fullscreen `auto` scrollbar border clearance**: tool cards and user message hairlines reserve
14
+ 1 right-edge column under Pi's default fullscreen `auto` scrollbar so the scrollbar no longer
15
+ overwrites card right borders.
16
+
17
+ ### Fixed
18
+
19
+ - **Linear sakura→sky frame gradients**: `renderSakuraFrameGradient` now delegates directly to the
20
+ linear sakura→sky gradient (matching the editor and header) instead of curving pink → sky → pink.
21
+ Tool card right vertical rails (`│`) now use sky blue (`#9FD3F2`) so `╮`, `│` and `╯` connect
22
+ seamlessly.
23
+ - **Fullscreen `auto` scrollbar border clearance**: in Pi's fullscreen mode under the default
24
+ `fullscreenScrollbar: "auto"` setting, `ScrollView` passes full width `W` to transcript children
25
+ and overlays the transient scrollbar onto column `W - 1`, overwriting tool card right borders.
26
+ Tool cards and user message hairlines now reserve 1 right-edge column in fullscreen `"auto"` mode
27
+ (leaving `"always"`, `"hidden"` and `regular` mode untouched) so frames stay closed, aligned and
28
+ jitter-free while scrolling, with mouse hit-testing and render caches updated across live mode and
29
+ setting switches.
30
+
31
+ ### Docs
32
+
33
+ - Updated README and social preview screenshots (`docs/screenshots/session.png` and
34
+ `docs/screenshots/social-preview.png`) to match the linear sakura→sky borders and sky-blue right
35
+ tool rails.
36
+
6
37
  ## [1.5.4] - 2026-12-03
7
38
 
8
39
  ### Highlights
package/README.md CHANGED
@@ -18,7 +18,7 @@ Then pick the theme in `/settings` → **sakura-macaron** and restart Pi once. D
18
18
  <sub>Real Pi 1.5.2 session rendered by this pack (scripted demo model; GohuFont uni14 Nerd Font Mono).</sub>
19
19
  </p>
20
20
 
21
- **v1.5.4** — full Pi 1.7.0 compatibility, identity-preserving render caches, async non-blocking probes, atomic config persistence and broad robustness hardening. See [what changed](#154).
21
+ **v1.5.5** — linear sakura→sky frame gradients, fullscreen `auto` scrollbar clearance so tool card right borders stay intact, and updated preview screenshots. See [what changed](#155).
22
22
 
23
23
  ## What’s inside
24
24
 
@@ -147,9 +147,9 @@ Restart Pi after updating. Pi **>= 1.5.0** shows what changed under **Extension
147
147
  Pi does not push package updates automatically. Users who pinned a version, tag or commit must explicitly select the new version:
148
148
 
149
149
  ```bash
150
- pi install npm:pi-sakura-cyberdeck@1.5.4
150
+ pi install npm:pi-sakura-cyberdeck@1.5.5
151
151
  # or
152
- pi install git:github.com/beautifulrem/pi-sakura-cyberdeck@v1.5.4
152
+ pi install git:github.com/beautifulrem/pi-sakura-cyberdeck@v1.5.5
153
153
  ```
154
154
 
155
155
  Notes for 1.2.0:
@@ -175,7 +175,7 @@ Or start with `pi --tui-mode fullscreen`. Pack styling (editor chrome, footer, s
175
175
 
176
176
  ### Load only some pieces
177
177
 
178
- Pi can filter a package's resources. Replace the plain source string in `~/.pi/agent/settings.json` with an object. Keep `source` exactly as it is in your settings (a Git source, or an npm version pin such as `npm:pi-sakura-cyberdeck@1.5.4`); changing it installs a different package rather than filtering the one you have.
178
+ Pi can filter a package's resources. Replace the plain source string in `~/.pi/agent/settings.json` with an object. Keep `source` exactly as it is in your settings (a Git source, or an npm version pin such as `npm:pi-sakura-cyberdeck@1.5.5`); changing it installs a different package rather than filtering the one you have.
179
179
 
180
180
  ```jsonc
181
181
  {
@@ -239,22 +239,19 @@ Avoid stacking with `pi-zentui`, `pi-powerline-footer`, stock `pi-claude-shimmer
239
239
 
240
240
  Full history: [CHANGELOG.md](CHANGELOG.md) (also available in Pi via `/sakura-changelog`).
241
241
 
242
- ### 1.5.4
242
+ ### 1.5.5
243
243
 
244
- - Full Pi 1.7.0 support: `readonly string[]` render contract and `Container` identity caching,
245
- lowercase `SettingsList` hints in `/zentui`, mouse and keybinding controls for `/zentui` and
246
- `/sakura-changelog`, and lazy `getAgentDir()` resolution for `--agent-dir`.
247
- - Performance: identity-preserving frame caches for the footer, editor and selector borders; scalar
248
- RGB-to-256 conversion with LRU gradient/style caching and SGR coalescing; non-blocking async git,
249
- runtime and package-version probes with `AbortSignal`; iterative `footer-format` parsing and
250
- linear `thinking-trail` fence scanning (fixing CRLF fences).
251
- - Robustness: atomic symlink- and size-guarded config saves, immediate mid-session `/theme` updates,
252
- BiDi/SGR sanitization for extension statuses, `.unref()` across all timers, and standalone
253
- extension hardening across `claude-shimmer`, `matrix`, `header` and `changelog`.
244
+ - Linear sakura→sky frame gradients: `renderSakuraFrameGradient` now runs linearly from sakura
245
+ pink (`#F2A7C6`) on the left to sky blue (`#9FD3F2`) on the right (matching the editor and header),
246
+ and tool card right rails (`│`) use sky blue so `╮`, `│` and `╯` connect seamlessly.
247
+ - Fullscreen `auto` scrollbar clearance: tool cards and user message hairlines now reserve 1
248
+ right-edge column under Pi's fullscreen `auto` scrollbar mode so the scrollbar no longer overwrites
249
+ card right borders, while keeping `"always"`, `"hidden"` and `regular` mode untouched.
250
+ - Updated README and social preview screenshots to match the linear borders and sky-blue right rails.
254
251
 
255
252
  ### Earlier versions
256
253
 
257
- See [CHANGELOG.md](CHANGELOG.md) for 1.0.0 – 1.5.3.
254
+ See [CHANGELOG.md](CHANGELOG.md) for 1.0.0 – 1.5.4.
258
255
 
259
256
  ## Development
260
257
 
package/README.zh-CN.md CHANGED
@@ -50,7 +50,7 @@ pi install npm:pi-sakura-cyberdeck
50
50
 
51
51
  ## 只加载部分组件
52
52
 
53
- 在 `~/.pi/agent/settings.json` 里把包来源写成对象,可以按需过滤。`source` 保持你设置里原来的写法(比如 Git 来源,或者 `npm:pi-sakura-cyberdeck@1.5.4` 这样锁定版本的写法);改了它就等于装了另一个包,而不是过滤现有的这个。
53
+ 在 `~/.pi/agent/settings.json` 里把包来源写成对象,可以按需过滤。`source` 保持你设置里原来的写法(比如 Git 来源,或者 `npm:pi-sakura-cyberdeck@1.5.5` 这样锁定版本的写法);改了它就等于装了另一个包,而不是过滤现有的这个。
54
54
 
55
55
  ```jsonc
56
56
  {
@@ -26,6 +26,27 @@ export function normalizeWidth(width: number): number {
26
26
  return Number.isFinite(width) && width > 0 ? Math.floor(width) : 0;
27
27
  }
28
28
 
29
+ /**
30
+ * Resolve an optional right-edge inset (e.g. fullscreen overlay scrollbar clearance) to a
31
+ * non-negative integer, clamping to 0 if applying it would push width below `minWidth`.
32
+ */
33
+ export function resolveRightInset(
34
+ getRightInset: (() => number) | undefined,
35
+ width: number,
36
+ minWidth: number,
37
+ ): number {
38
+ if (!getRightInset) return 0;
39
+ let raw: unknown;
40
+ try {
41
+ raw = getRightInset();
42
+ } catch {
43
+ return 0;
44
+ }
45
+ if (typeof raw !== "number" || !Number.isFinite(raw) || raw <= 0) return 0;
46
+ const inset = Math.floor(raw);
47
+ return width - inset >= minWidth ? inset : 0;
48
+ }
49
+
29
50
  /**
30
51
  * Compare two rendered line arrays, taking an O(1) identity fast path when Pi's
31
52
  * Container/Component render cache returns the exact same array reference.
@@ -153,20 +153,11 @@ export function renderSakuraGradient(text: string, phase = 0): string {
153
153
  }
154
154
 
155
155
  /**
156
- * Box-frame gradient: sakura at BOTH ends, macaron spectrum through the middle.
157
- * Avoids the linear L→R look where the right corner jumps to sky cyan.
156
+ * Box-frame gradient: linear sakura pink (#F2A7C6) on the left → sky blue (#9FD3F2) on the right,
157
+ * matching the editor and header gradients.
158
158
  */
159
159
  export function renderSakuraFrameGradient(text: string): string {
160
- if (!text || getColorMode() === "none") return text;
161
- const cacheKey = `\0frame\0${text}`;
162
- const cached = cacheGet(cacheKey);
163
- if (cached !== undefined) return cached;
164
- // 0 → 1 → 0 so left/right corners share sakura pink.
165
- const rendered = paintPositions(text, (pos) =>
166
- sampleSakuraGradient(pos <= 0.5 ? pos * 2 : (1 - pos) * 2),
167
- );
168
- cacheSet(cacheKey, rendered);
169
- return rendered;
160
+ return renderSakuraGradient(text);
170
161
  }
171
162
 
172
163
  /** Context fill palettes — stay macaron, shift with severity. */
@@ -110,6 +110,37 @@ function sameProjectProbes(a: ProjectProbePlan, b: ProjectProbePlan): boolean {
110
110
  );
111
111
  }
112
112
 
113
+ type ActiveTuiLike = Pick<TUI, "invalidate" | "requestRender"> & { readonly mode?: unknown };
114
+
115
+ /**
116
+ * Pi's fullscreen `ScrollView` subtracts 1 column only when `fullscreenScrollbar` is `"always"`.
117
+ * Under the default `"auto"` mode, transcript children receive the full width `W` and the
118
+ * transient scrollbar overlays column `W - 1`, overwriting the right border of framed cards.
119
+ * Reserving 1 column ourselves in fullscreen `"auto"` keeps card frames closed and aligned with
120
+ * `"always"` without width jitter as the scrollbar appears and fades.
121
+ */
122
+ function transcriptRightInset(pi: ExtensionAPI, tui: ActiveTuiLike | undefined): number {
123
+ const liveMode = typeof tui?.mode === "string" ? tui.mode : undefined;
124
+ if (liveMode === "regular") return 0;
125
+
126
+ let settings: { tuiMode?: unknown; fullscreenScrollbar?: unknown } | undefined;
127
+ if (typeof (pi as { getSettings?: unknown }).getSettings === "function") {
128
+ try {
129
+ const raw = pi.getSettings();
130
+ if (raw && typeof raw === "object") settings = raw;
131
+ } catch {
132
+ // Older or restricted host: fall back to live TUI mode below.
133
+ }
134
+ }
135
+
136
+ const tuiMode =
137
+ liveMode ?? (settings ? (settings.tuiMode === "regular" ? "regular" : "fullscreen") : undefined);
138
+ if (tuiMode !== "fullscreen") return 0;
139
+
140
+ const scrollbar = settings?.fullscreenScrollbar;
141
+ return scrollbar === "always" || scrollbar === "hidden" ? 0 : 1;
142
+ }
143
+
113
144
  export default function (pi: ExtensionAPI) {
114
145
  const state: FooterState = createInitialState(emptyGitStatus());
115
146
  const sessionLifecycle = new SessionLifecycle();
@@ -120,8 +151,8 @@ export default function (pi: ExtensionAPI) {
120
151
  let probePlan: { version: number; plan: ProjectProbePlan } | undefined;
121
152
  let activeCtx: ExtensionContext | undefined;
122
153
  let activeTheme: Theme | undefined;
123
- /** Pi's TUI, as seen by our footer or editor factory; needed to drop cached renders. */
124
- let activeTui: Pick<TUI, "invalidate" | "requestRender"> | undefined;
154
+ /** Pi's TUI, as seen by our footer or editor factory; needed to drop cached renders and inspect mode. */
155
+ let activeTui: ActiveTuiLike | undefined;
125
156
  let requestFooterRender: (() => void) | undefined;
126
157
  let syncFooterAnimation: (() => void) | undefined;
127
158
  let getActiveExtensionStatuses: () => ReadonlyMap<string, string> = () => new Map();
@@ -335,9 +366,10 @@ export default function (pi: ExtensionAPI) {
335
366
  // Host prototype method missing or changed: keep remaining surfaces & session startup intact.
336
367
  }
337
368
  };
369
+ const getTranscriptRightInset = () => transcriptRightInset(pi, activeTui);
338
370
  tryInstall(() => installSelectorBorderStyle(getActiveTheme, getCurrentConfig));
339
- tryInstall(() => installUserMessageStyle(getActiveTheme, getCurrentConfig));
340
- tryInstall(() => installToolExecutionStyle(getActiveTheme));
371
+ tryInstall(() => installUserMessageStyle(getActiveTheme, getCurrentConfig, getTranscriptRightInset));
372
+ tryInstall(() => installToolExecutionStyle(getActiveTheme, getTranscriptRightInset));
341
373
  cleanupPrototypePatches = () => {
342
374
  for (let i = disposers.length - 1; i >= 0; i -= 1) {
343
375
  try {
@@ -1,7 +1,7 @@
1
1
  import { type Theme, ToolExecutionComponent } from "@earendil-works/pi-coding-agent";
2
2
  import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
3
3
  import { type ColorMode, getColorMode, paintFg, type RGB } from "../shared/color";
4
- import { normalizeWidth, sameLines } from "../shared/tui-context";
4
+ import { normalizeWidth, resolveRightInset, sameLines } from "../shared/tui-context";
5
5
  import { renderSakuraFrameGradient, splitGraphemes } from "./gradient";
6
6
  import { installPrototypePatch } from "./prototype-patch-registry";
7
7
  import { safeThemeFg } from "./style";
@@ -59,7 +59,8 @@ const STATUS_RGB: Record<ToolStatus, RGB> = {
59
59
  ok: [174, 229, 197],
60
60
  error: [255, 143, 163],
61
61
  };
62
- const FRAME_RGB: RGB = [242, 167, 198];
62
+ // Right vertical rail matches the sky-blue (#9FD3F2) right end of the linear frame gradient.
63
+ const FRAME_RGB: RGB = [159, 211, 242];
63
64
  const LEFT_RAIL = "┃ ";
64
65
  const RIGHT_RAIL = "│";
65
66
  const LEFT_COLUMNS = 2; // visible width of LEFT_RAIL
@@ -278,7 +279,10 @@ export function mapCardMouseEvent<T extends MouseEventLike>(
278
279
  return { ...event, y, x, width: card.innerWidth, height: inner.length };
279
280
  }
280
281
 
281
- export function installToolExecutionStyle(getTheme?: () => Theme | undefined): Cleanup {
282
+ export function installToolExecutionStyle(
283
+ getTheme?: () => Theme | undefined,
284
+ getRightInset?: () => number,
285
+ ): Cleanup {
282
286
  const cards = new WeakMap<object, CardRender>();
283
287
  const captures = new WeakMap<object, CardMouseCapture>();
284
288
 
@@ -304,7 +308,9 @@ export function installToolExecutionStyle(getTheme?: () => Theme | undefined): C
304
308
  return Reflect.apply(predecessor, receiver, width === rawWidth ? args : [width, ...args.slice(1)]);
305
309
  }
306
310
 
307
- const innerWidth = width - RAIL_COLUMNS;
311
+ const rightInset = resolveRightInset(getRightInset, width, MIN_WIDTH);
312
+ const cardWidth = width - rightInset;
313
+ const innerWidth = cardWidth - RAIL_COLUMNS;
308
314
  const inner = Reflect.apply(predecessor, receiver, [innerWidth, ...args.slice(1)]);
309
315
  if (!Array.isArray(inner) || inner.length === 0) {
310
316
  cards.delete(receiver as object);
@@ -323,6 +329,7 @@ export function installToolExecutionStyle(getTheme?: () => Theme | undefined): C
323
329
  if (
324
330
  cached &&
325
331
  cached.width === width &&
332
+ cached.innerWidth === innerWidth &&
326
333
  cached.status === status &&
327
334
  cached.expanded === expanded &&
328
335
  cached.name === name &&
@@ -335,7 +342,7 @@ export function installToolExecutionStyle(getTheme?: () => Theme | undefined): C
335
342
  return cached.lines;
336
343
  }
337
344
 
338
- const card = buildCard(lines, width, status, name, stats, theme, colorMode);
345
+ const card = buildCard(lines, cardWidth, status, name, stats, theme, colorMode);
339
346
  cards.set(receiver as object, {
340
347
  width,
341
348
  innerWidth,
@@ -1,7 +1,7 @@
1
1
  import { type Theme, UserMessageComponent } from "@earendil-works/pi-coding-agent";
2
2
  import { visibleWidth } from "@earendil-works/pi-tui";
3
3
  import { getColorMode, paintFg, type RGB } from "../shared/color";
4
- import { normalizeWidth, sameLines } from "../shared/tui-context";
4
+ import { normalizeWidth, resolveRightInset, sameLines } from "../shared/tui-context";
5
5
  import type { PolishedTuiConfig } from "./config";
6
6
  import { renderSakuraFrameGradient } from "./gradient";
7
7
  import { installPrototypePatch } from "./prototype-patch-registry";
@@ -67,6 +67,7 @@ export function renderUserMessageCard(
67
67
  export function installUserMessageStyle(
68
68
  getTheme?: () => Theme | undefined,
69
69
  getConfig?: () => PolishedTuiConfig,
70
+ getRightInset?: () => number,
70
71
  ): Cleanup {
71
72
  const cards = new WeakMap<object, UserMessageCard>();
72
73
  return installPrototypePatch(
@@ -87,21 +88,26 @@ export function installUserMessageStyle(
87
88
  cards.delete(receiver as object);
88
89
  return Reflect.apply(predecessor, receiver, width === rawWidth ? args : [width, ...args.slice(1)]);
89
90
  }
91
+ const rightInset = resolveRightInset(getRightInset, width, MIN_WIDTH);
92
+ const cardWidth = width - rightInset;
90
93
  const config = getConfig?.();
91
94
  const rail = railFor(config);
92
- const inner = Reflect.apply(predecessor, receiver, [width - rail.columns, ...args.slice(1)]);
93
- if (!Array.isArray(inner) || inner.length === 0) return inner;
95
+ const inner = Reflect.apply(predecessor, receiver, [cardWidth - rail.columns, ...args.slice(1)]);
96
+ if (!Array.isArray(inner) || inner.length === 0) {
97
+ cards.delete(receiver as object);
98
+ return inner;
99
+ }
94
100
 
95
101
  const lines = inner as string[];
96
102
  const theme = config?.colorSources?.userMessages === "theme" ? getTheme?.() : undefined;
97
103
  // The brand frame stays gradient; colorSources.userMessages controls the rail only.
98
- const border = renderSakuraFrameGradient("─".repeat(width));
104
+ const border = renderSakuraFrameGradient("─".repeat(cardWidth));
99
105
  const paintedRail = rail.text
100
106
  ? theme
101
107
  ? safeThemeFg(theme, "accent", rail.text)
102
108
  : paintFg(RAIL_RGB, rail.text)
103
109
  : "";
104
- const chromeKey = `${paintedRail}\0${border}\0${getColorMode()}`;
110
+ const chromeKey = `${cardWidth}\0${paintedRail}\0${border}\0${getColorMode()}`;
105
111
  const cached = cards.get(receiver as object);
106
112
  if (
107
113
  cached &&
@@ -111,7 +117,7 @@ export function installUserMessageStyle(
111
117
  ) {
112
118
  return cached.lines;
113
119
  }
114
- const card = renderUserMessageCard(lines, width, paintedRail, border);
120
+ const card = renderUserMessageCard(lines, cardWidth, paintedRail, border);
115
121
  cards.set(receiver as object, { width, chromeKey, inner: lines, lines: card });
116
122
  return card;
117
123
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-sakura-cyberdeck",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "Lightweight Sakura Macaron visual pack for Pi: theme, cyberdeck header, macaron Zentui chrome, Claude-style shimmer, optional matrix rain.",
5
5
  "type": "module",
6
6
  "license": "MIT",