pi-petrroll 0.3.0 → 0.3.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
@@ -128,8 +128,10 @@ Pi's totals include all entries in the session file, including abandoned branche
128
128
 
129
129
  Marks where your prompts and the assistant's replies start on the scrollbar at the right of Pi's fullscreen transcript, like an editor's overview ruler:
130
130
 
131
- - **Prompts**: `━` in the theme's accent color. A prompt under the thumb shows as an accent `█`.
132
- - **Replies** (assistant text): `─` in the text color. Replies under the thumb are not shown separately.
131
+ - **Prompts**: `━` in the theme's accent color.
132
+ - **Replies** (assistant text): `─` in the text color.
133
+
134
+ Under the thumb, a mark crosses it as `╋` (accent for prompts, the thumb color for replies), so the thumb keeps its width. While you drag the scrollbar, Pi shows a solid `█` thumb. Prompts then recolor it to accent, and reply marks are hidden.
133
135
 
134
136
  Each mark sits at its proportional position in the transcript, so dragging or scrolling the thumb onto a mark brings that message into view. Prompts win when both fall on the same row. Tool output, thinking-only, and tool-call-only assistant turns are not marked.
135
137
 
@@ -44,8 +44,13 @@ export function createMarkStyles(theme: ThemeLike): MarkStyles {
44
44
  const color = (kind: MarkKind) => (kind === "prompt" ? "accent" : "text");
45
45
  return {
46
46
  track: (kind) => theme.fg(color(kind), kind === "prompt" ? "━" : "─"),
47
- // Pi's thumb already uses the text color, so only prompts stand out on it.
48
- thumb: (kind, glyph) => (kind === "prompt" ? theme.fg("accent", "█") : undefined),
47
+ // Keep the thumb's width: the idle thumb "┃" becomes a heavy cross "╋" (the same tick as on the
48
+ // track, crossing the thumb); the active block thumb "█" cannot carry a tick, so only prompts
49
+ // recolor it. Replies stay in Pi's thumb color so the thumb never changes width or vanishes.
50
+ thumb: (kind, glyph, piThumb) => {
51
+ const cell = glyph === "┃" ? "╋" : glyph;
52
+ return kind === "prompt" ? theme.fg("accent", cell) : piThumb(cell);
53
+ },
49
54
  };
50
55
  }
51
56
 
@@ -16,8 +16,11 @@ const ZONE_START = /^(?:\x1b\]133;[BC](?:\x07|\x1b\\))*\x1b\]133;A(?:\x07|\x1b\\
16
16
  export interface MarkStyles {
17
17
  /** Track cell (outside the thumb) for a row containing a mark. */
18
18
  track(kind: MarkKind): string;
19
- /** Thumb cell for a row containing a mark; receives Pi's thumb glyph. Return undefined to keep Pi's thumb. */
20
- thumb(kind: MarkKind, glyph: string): string | undefined;
19
+ /**
20
+ * Thumb cell for a row containing a mark; receives Pi's thumb glyph and Pi's thumb styler.
21
+ * Return undefined to keep Pi's thumb unchanged.
22
+ */
23
+ thumb(kind: MarkKind, glyph: string, piThumb: (text: string) => string): string | undefined;
21
24
  }
22
25
 
23
26
  /** Minimal structural view of `@earendil-works/pi-tui`'s ScrollView that this module relies on. */
@@ -115,7 +118,7 @@ export function attachScrollbarMarks(view: ScrollViewLike, options: AttachOption
115
118
  };
116
119
  view.scrollbarThumbStyle = (text) => {
117
120
  const kind = track[row++];
118
- return (kind && options.styles.thumb(kind, text)) ?? originalThumb(text);
121
+ return (kind && options.styles.thumb(kind, text, originalThumb)) ?? originalThumb(text);
119
122
  };
120
123
 
121
124
  let restored = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-petrroll",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Small, focused Pi extensions by petrroll: switch projects, track external costs, and mark prompts on the scrollbar.",
5
5
  "type": "module",
6
6
  "license": "MIT",