pi-render-btw 0.6.3 → 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 +1 -1
- package/extensions/btw-transcript.test.ts +19 -0
- package/extensions/btw.ts +2 -2
- package/package.json +1 -1
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
|
-
- `
|
|
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:
|
|
1339
|
-
if ((data
|
|
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
|
}
|