pi-render-btw 0.6.20 → 0.6.21
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 +5 -0
- package/extensions/btw-transcript.test.ts +21 -0
- package/extensions/btw.ts +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.21 — 2026-11-24
|
|
4
|
+
|
|
5
|
+
- Fix BTW overlay clipping at host widths below 24 columns by laying out the frame at the actual host width instead of expanding first and truncating the completed frame afterward.
|
|
6
|
+
- Preserve the selected transcript `▎`, scrollbar rail, and right border in narrow overlays.
|
|
7
|
+
|
|
3
8
|
## 0.6.20 — 2026-11-23
|
|
4
9
|
|
|
5
10
|
- Make the BTW transcript's `▎` a persistent selected-block rail: the newest block starts selected, click any block to move focus, and hover no longer moves it.
|
|
@@ -21,6 +21,8 @@ const tui = {
|
|
|
21
21
|
stop: () => {},
|
|
22
22
|
} as any;
|
|
23
23
|
|
|
24
|
+
const visibleText = (value: string): string => value.replace(/\x1b\[[0-9;?]*[ -/]*[@-~]/g, "");
|
|
25
|
+
|
|
24
26
|
function transcriptLines(entries: unknown[]): string[] {
|
|
25
27
|
const component = new BtwOverlayComponent(
|
|
26
28
|
tui,
|
|
@@ -54,6 +56,25 @@ describe("BTW transcript message layout", () => {
|
|
|
54
56
|
expect(lines[1].startsWith("▎ Response")).toBe(true);
|
|
55
57
|
});
|
|
56
58
|
|
|
59
|
+
it("keeps the selected transcript frame intact at narrow host widths", () => {
|
|
60
|
+
const component = new BtwOverlayComponent(
|
|
61
|
+
tui,
|
|
62
|
+
theme,
|
|
63
|
+
keybindings,
|
|
64
|
+
() => [{ id: 1, turnId: 1, type: "assistant-text", text: "123456789012345", streaming: false }] as any,
|
|
65
|
+
() => null,
|
|
66
|
+
() => "contextual",
|
|
67
|
+
() => {},
|
|
68
|
+
() => {},
|
|
69
|
+
() => {},
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const lines = component.render(20).map(visibleText);
|
|
73
|
+
|
|
74
|
+
expect(lines[0]).toBe(`┌${"─".repeat(18)}┐`);
|
|
75
|
+
expect(lines.find((line) => line.includes("1234567890123"))?.endsWith("│")).toBe(true);
|
|
76
|
+
});
|
|
77
|
+
|
|
57
78
|
it("opens Peek with Ctrl+P even when the composer contains a draft", () => {
|
|
58
79
|
const component = new BtwOverlayComponent(
|
|
59
80
|
tui,
|
package/extensions/btw.ts
CHANGED
|
@@ -2171,8 +2171,10 @@ export class BtwOverlayComponent extends Container implements Focusable {
|
|
|
2171
2171
|
}
|
|
2172
2172
|
|
|
2173
2173
|
override render(width: number): string[] {
|
|
2174
|
-
|
|
2175
|
-
|
|
2174
|
+
// Layout must use the host's real width. Expanding to a cosmetic minimum
|
|
2175
|
+
// and truncating afterward drops the rightmost transcript cells.
|
|
2176
|
+
const dialogWidth = Math.max(3, width);
|
|
2177
|
+
const innerWidth = Math.max(1, dialogWidth - 2);
|
|
2176
2178
|
this.lastRenderWidth = dialogWidth;
|
|
2177
2179
|
|
|
2178
2180
|
// Tool Output is a read-only view over the currently focused live tool.
|
package/package.json
CHANGED