pi-stereo-view 0.1.1 → 0.1.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
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2
4
+
5
+ - PgUp/PgDn and Pi's other keyboard scroll keys now move the active panel (marked with `●`) instead of always Activity. Pi's built-in history search follows the active panel too.
6
+ - `Ctrl+Alt+Up` or `Ctrl+Alt+Down` switches the active panel; press again to switch back.
7
+
3
8
  ## 0.1.1
4
9
 
5
10
  - Mouse wheel over Conversation or its header no longer scrolls Activity when Conversation is too short to scroll.
package/README.md CHANGED
@@ -128,6 +128,8 @@ The same controls are available without the mouse:
128
128
 
129
129
  `Ctrl+Alt+T` toggles split, `Ctrl+Alt+S` swaps panels, and `Ctrl+Alt+Left/Right` resizes Conversation along the current split direction.
130
130
 
131
+ Keyboard scrolling (`PgUp`/`PgDn` and Pi's other scroll keys) moves the active panel, marked with `●`. Clicking or scrolling a panel makes it active. `Ctrl+Alt+Up` or `Ctrl+Alt+Down` switches to the other panel; press either again to switch back.
132
+
131
133
  ## Settings and limits
132
134
 
133
135
  Your layout, panel order, sizes, zoom, split on/off and timestamp settings are saved automatically and restored next time.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-stereo-view",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "Keep Pi conversation separate from tool output and agent activity.",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -154,7 +154,7 @@ export default function transcript(pi: ExtensionAPI): void {
154
154
  if (action === "toggle" || action === "") toggle();
155
155
  else if (action === "settings") await openSettings(ctx);
156
156
  else if (action === "help") {
157
- ctx.ui.notify("pi-stereo-view icons: ▣ combined, ◫ split, ▤ rows, ▥ columns, ↕/↔ swap, ↗ expand, ↙ restore, ⌕ search, ≡ settings. Ctrl+F searches the active panel. Drag the ═ or ║ divider to resize.", "info");
157
+ ctx.ui.notify("pi-stereo-view icons: ▣ combined, ◫ split, ▤ rows, ▥ columns, ↕/↔ swap, ↗ expand, ↙ restore, ⌕ search, ≡ settings. Ctrl+F searches and PgUp/PgDn scroll the active panel; Ctrl+Alt+Up/Down switches it. Drag the ═ or ║ divider to resize.", "info");
158
158
  } else if (action === "swap") layout.swap();
159
159
  else if (action === "width" && /^\d+$/.test(target ?? "")) layout.setWidth(Number(target));
160
160
  else if (action === "height" && target === "auto") layout.setHeight(null);
@@ -173,6 +173,11 @@ export default function transcript(pi: ExtensionAPI): void {
173
173
  });
174
174
  pi.registerShortcut("ctrl+alt+t", { description: "Toggle split history", handler: async () => toggle() });
175
175
  pi.registerShortcut("ctrl+alt+s", { description: "Swap stereo-view panels", handler: async () => layout?.swap() });
176
+ for (const key of ["ctrl+alt+up", "ctrl+alt+down"] as const) {
177
+ pi.registerShortcut(key, { description: "Move keyboard scrolling to the other stereo-view panel", handler: async () => {
178
+ layout?.cyclePanel();
179
+ } });
180
+ }
176
181
  pi.registerShortcut("ctrl+alt+left", { description: "Shrink conversation along the split axis", handler: async () => {
177
182
  layout?.resize(-1);
178
183
  } });
package/src/layout.ts CHANGED
@@ -20,8 +20,10 @@ const MIN_ROWS = 4;
20
20
  const BUTTON_WIDTH = 5;
21
21
 
22
22
  class PanelScrollView extends ScrollView {
23
- constructor(component: Component, options: ScrollViewOptions, private readonly interact: () => void) {
23
+ constructor(component: Component, options: ScrollViewOptions, private readonly interact: () => void, active: () => boolean) {
24
24
  super(component, options);
25
+ // Pi sends keyboard scrolling and native search to the primary ScrollView; follow the active panel.
26
+ Object.defineProperty(this, "primary", { get: active });
25
27
  }
26
28
 
27
29
  override handleMouse(event: TuiMouseEvent): ReturnType<Container["handleMouse"]> {
@@ -185,8 +187,9 @@ export class TranscriptLayout {
185
187
  scrollbarTrackStyle: scroll.scrollbarTrackStyle,
186
188
  scrollbarThumbStyle: scroll.scrollbarThumbStyle,
187
189
  };
188
- this.activity = new PanelScrollView(activityDocument, { ...scrollOptions, primary: true }, () => this.activate("activity"));
189
- this.chat = new PanelScrollView(chatDocument, scrollOptions, () => this.activate("chat"));
190
+ this.activity = new PanelScrollView(activityDocument, scrollOptions, () => this.activate("activity"),
191
+ () => this.searchPane() === "activity");
192
+ this.chat = new PanelScrollView(chatDocument, scrollOptions, () => this.activate("chat"), () => this.searchPane() === "chat");
190
193
  let historyHeight = 0;
191
194
  const shown = ({ width, height }: { width: number; height: number }): boolean => {
192
195
  const previousHeight = historyHeight;
@@ -568,6 +571,13 @@ export class TranscriptLayout {
568
571
  this.changed();
569
572
  }
570
573
 
574
+ /** Cycle keyboard scrolling and search to the other panel. */
575
+ cyclePanel(): void {
576
+ const pane = this.searchPane();
577
+ if (!pane || this.preferences.zoom) return;
578
+ this.activate(pane === "chat" ? "activity" : "chat");
579
+ }
580
+
571
581
  /** Scroll one native pane without moving the other. */
572
582
  scroll(pane: Pane, lines: number): void {
573
583
  (pane === "chat" ? this.chat : this.activity)?.scrollBy(lines);