@wierdbytes/pi-facelift 0.3.1 → 0.3.2

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.2
4
+
5
+ - **Change**: `bash` tool titles always render the full command, even
6
+ in collapsed view. Previously the multi-line command string was
7
+ sliced at 80 chars (with a trailing `…`) before being split into
8
+ sub-tree continuation rows, which clobbered the second line of
9
+ short multi-step commands like
10
+ `tmux kill-session -t poc 2>/dev/null\nrm -f /Users/.../poc/long-path`.
11
+ Per-line right-truncation inside `frameTop` is unchanged — lines
12
+ that genuinely overflow the terminal width are still clipped — so
13
+ the only behavior change is that long commands no longer hide
14
+ content behind the expand toggle.
15
+
3
16
  ## 0.3.1
4
17
 
5
18
  - **Fix**: `read` bodies rendered as plain uncolored text whenever
@@ -72,21 +72,24 @@ function loadBashTool() {
72
72
  }
73
73
 
74
74
  describe("bash renderCall expansion", () => {
75
- it("truncates long commands when collapsed", () => {
76
- const bashTool = loadBashTool();
77
- const command = `printf '${"x".repeat(120)}'`;
75
+ it("shows the full command even when collapsed (no length-based truncation)", () => {
76
+ withStdoutColumns(200, () => {
77
+ const bashTool = loadBashTool();
78
+ // 120-char command fits inside a 200-col frame, so the only previous
79
+ // reason it would have been clipped was the old 80-char compact cap.
80
+ const command = `printf '${"x".repeat(120)}'`;
78
81
 
79
- const rendered = bashTool.renderCall({ command }, mockTheme, {
80
- lastComponent: new MockText(),
81
- isError: false,
82
- state: {},
83
- expanded: false,
84
- invalidate: () => {},
85
- });
82
+ const rendered = bashTool.renderCall({ command }, mockTheme, {
83
+ lastComponent: new MockText(),
84
+ isError: false,
85
+ state: {},
86
+ expanded: false,
87
+ invalidate: () => {},
88
+ });
86
89
 
87
- expect(rendered.getText()).toContain("bash");
88
- expect(rendered.getText()).toContain("…");
89
- expect(rendered.getText()).not.toContain(command);
90
+ expect(rendered.getText()).toContain("bash");
91
+ expect(rendered.getText()).toContain(command);
92
+ });
90
93
  });
91
94
 
92
95
  it("shows the full command when expanded", () => {
package/index.ts CHANGED
@@ -1214,7 +1214,6 @@ export default function piFaceliftExtension(pi: PiFaceliftApi, deps?: PiFacelift
1214
1214
  state.endedAt = undefined;
1215
1215
  }
1216
1216
  const timeout = args.timeout ? ` ${theme.fg("muted", `(${args.timeout}s timeout)`)}` : "";
1217
- const displayCmd = ctx.expanded || cmd.length <= 80 ? cmd : `${cmd.slice(0, 77)}…`;
1218
1217
 
1219
1218
  // Multi-line bash commands (shell line continuations with `\`, here-docs,
1220
1219
  // or embedded newlines) need each line wrapped in the accent color
@@ -1222,7 +1221,12 @@ export default function piFaceliftExtension(pi: PiFaceliftApi, deps?: PiFacelift
1222
1221
  // whitespace on continuation lines is dropped — the sub-tree connector
1223
1222
  // already provides visual indentation, so the user's heredoc indent
1224
1223
  // would just push content right and misalign the tree.
1225
- const cmdLines = displayCmd.split("\n");
1224
+ //
1225
+ // The full command is always rendered in the title — no length-based
1226
+ // truncation in compact mode. `frameTop` still right-truncates any
1227
+ // individual line that exceeds the frame width, which is a separate
1228
+ // (display-fit) concern from hiding command content.
1229
+ const cmdLines = cmd.split("\n");
1226
1230
  const firstCmd = cmdLines[0];
1227
1231
  const restCmd = cmdLines.slice(1).map((line) => line.replace(/^\s+/, ""));
1228
1232
  const firstTitle = `${theme.fg("toolTitle", theme.bold("bash"))} ${theme.fg("accent", firstCmd)}${timeout}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wierdbytes/pi-facelift",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Cosmetic facelift for built-in pi tool output — open-right rounded frames, syntax-highlighted reads, status-aware bash summaries, find/grep.",
5
5
  "type": "module",
6
6
  "files": [