pi-render-btw 0.6.4 → 0.6.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/README.md CHANGED
@@ -119,7 +119,7 @@ pi install /path/to/pi-render-btw
119
119
  - `/` searches with smartcase; `n/N` moves between matches
120
120
  - `t` toggles tool messages
121
121
  - `M` copies the selected message; `o` opens it read-only in nvim
122
- - `Esc` returns to the BTW composer
122
+ - `Esc`, `q`, or `Ctrl+C` returns to the BTW composer; press `Esc` again in the composer to dismiss BTW
123
123
 
124
124
  ### `/btw:clear`
125
125
 
@@ -65,4 +65,25 @@ describe("BTW transcript message layout", () => {
65
65
 
66
66
  expect((component as any).peekState.active).toBe(true);
67
67
  });
68
+
69
+ it("returns to BTW without dismissing it when q exits Peek", () => {
70
+ let dismissed = 0;
71
+ const component = new BtwOverlayComponent(
72
+ tui,
73
+ theme,
74
+ keybindings,
75
+ () => [],
76
+ () => null,
77
+ () => "contextual",
78
+ () => {},
79
+ () => { dismissed++; },
80
+ () => {},
81
+ );
82
+
83
+ component.handleInput("\x10"); // Ctrl+P
84
+ component.handleInput("q");
85
+
86
+ expect((component as any).peekState.active).toBe(false);
87
+ expect(dismissed).toBe(0);
88
+ });
68
89
  });
package/extensions/btw.ts CHANGED
@@ -1929,12 +1929,9 @@ export class BtwOverlayComponent extends Container implements Focusable {
1929
1929
  return;
1930
1930
  }
1931
1931
 
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") {
1932
+ // Leaving Peek always returns to the BTW composer. The composer itself
1933
+ // remains responsible for dismissing the BTW overlay.
1934
+ if (data === "q" || data === "\x03" || data === "\r" || data === "\n" || data === "\x1b") {
1938
1935
  this.exitPeekMode();
1939
1936
  return;
1940
1937
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-render-btw",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
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",