pi-render-btw 0.6.2 → 0.6.4

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
@@ -114,7 +114,7 @@ pi install /path/to/pi-render-btw
114
114
  ### `/btw:peek`
115
115
 
116
116
  - switches the BTW overlay into Peek mode for the current side thread
117
- - `p` also enters Peek mode when the BTW composer is empty
117
+ - `Ctrl+P` enters Peek mode from the BTW composer, even when it contains a draft
118
118
  - `j/k` scroll one message, `J/K` jump to the next/previous message, and `g/G` go to the top/bottom
119
119
  - `/` searches with smartcase; `n/N` moves between matches
120
120
  - `t` toggles tool messages
@@ -46,4 +46,23 @@ describe("BTW transcript message layout", () => {
46
46
  expect(lines[0]).toBe(" Assistant ");
47
47
  expect(lines[1].startsWith(" Response")).toBe(true);
48
48
  });
49
+
50
+ it("opens Peek with Ctrl+P even when the composer contains a draft", () => {
51
+ const component = new BtwOverlayComponent(
52
+ tui,
53
+ theme,
54
+ keybindings,
55
+ () => [],
56
+ () => null,
57
+ () => "contextual",
58
+ () => {},
59
+ () => {},
60
+ () => {},
61
+ );
62
+
63
+ component.setDraft("draft prompt");
64
+ component.handleInput("\x10"); // Ctrl+P
65
+
66
+ expect((component as any).peekState.active).toBe(true);
67
+ });
49
68
  });
package/extensions/btw.ts CHANGED
@@ -1335,8 +1335,8 @@ export class BtwOverlayComponent extends Container implements Focusable {
1335
1335
  return;
1336
1336
  }
1337
1337
 
1338
- // Chat mode: 'p' with empty input enters peek mode
1339
- if ((data === "p" || data === "P") && this.input.getValue().length === 0) {
1338
+ // Chat mode: Ctrl+P enters Peek mode without consuming the draft.
1339
+ if (matchesKey(data, Key.ctrl("p"))) {
1340
1340
  this.enterPeekMode();
1341
1341
  return;
1342
1342
  }
@@ -1929,8 +1929,12 @@ export class BtwOverlayComponent extends Container implements Focusable {
1929
1929
  return;
1930
1930
  }
1931
1931
 
1932
- // Enter or Escape → exit peek mode
1933
- if (data === "\r" || data === "\n" || data === "\x1b" || data === "\x03") {
1932
+ // q/Ctrl+C close BTW; Enter/Escape return to the BTW composer.
1933
+ if (data === "q" || data === "\x03") {
1934
+ this.onDismissCallback();
1935
+ return;
1936
+ }
1937
+ if (data === "\r" || data === "\n" || data === "\x1b") {
1934
1938
  this.exitPeekMode();
1935
1939
  return;
1936
1940
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-render-btw",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "A pi extension for parallel side conversations with /btw — with markdown rendering in the floating window",
5
5
  "type": "module",
6
6
  "license": "MIT",