pi-render-btw 0.6.4 → 0.6.6
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 +1 -1
- package/extensions/btw-transcript.test.ts +37 -0
- package/extensions/btw.ts +4 -7
- package/package.json +1 -1
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,41 @@ 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
|
+
});
|
|
89
|
+
|
|
90
|
+
it("shows the Ctrl+P Peek shortcut in the composer hints", () => {
|
|
91
|
+
const component = new BtwOverlayComponent(
|
|
92
|
+
tui,
|
|
93
|
+
theme,
|
|
94
|
+
keybindings,
|
|
95
|
+
() => [],
|
|
96
|
+
() => null,
|
|
97
|
+
() => "contextual",
|
|
98
|
+
() => {},
|
|
99
|
+
() => {},
|
|
100
|
+
() => {},
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
expect((component as any).hintsTextValue).toContain("Ctrl+P peek");
|
|
104
|
+
});
|
|
68
105
|
});
|
package/extensions/btw.ts
CHANGED
|
@@ -1456,7 +1456,7 @@ export class BtwOverlayComponent extends Container implements Focusable {
|
|
|
1456
1456
|
const status = this.getStatus() ?? "Ready. Enter submits; Escape dismisses without clearing.";
|
|
1457
1457
|
this.statusTextValue = status;
|
|
1458
1458
|
this.statusText.setText(this.statusTextValue);
|
|
1459
|
-
this.hintsTextValue = "Scroll wheel ↑↓ PgUp/PgDn · Enter · Alt+/ focus · Esc";
|
|
1459
|
+
this.hintsTextValue = "Scroll wheel ↑↓ PgUp/PgDn · Enter · Ctrl+P peek · Alt+/ focus · Esc";
|
|
1460
1460
|
this.hintsText.setText(this.hintsTextValue);
|
|
1461
1461
|
this.tui.requestRender();
|
|
1462
1462
|
}
|
|
@@ -1929,12 +1929,9 @@ export class BtwOverlayComponent extends Container implements Focusable {
|
|
|
1929
1929
|
return;
|
|
1930
1930
|
}
|
|
1931
1931
|
|
|
1932
|
-
//
|
|
1933
|
-
|
|
1934
|
-
|
|
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
|
}
|