@pi-kaush/pi-content-layout 0.1.2 → 0.1.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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - Move user-run `!` bash block styling to `@pi-kaush/pi-tool-call-markers`,
6
+ which now owns every execution row (tools, grouping, subagents, thinking
7
+ labels, and bash blocks). This package narrows to the transcript surface:
8
+ message insets, system-text and status-rule alignment, the editor surface,
9
+ and the submitted-prompt shell for user messages. One spacing contract with
10
+ markers remains: bash blocks align at this package's message inset.
11
+
5
12
  - Pad submitted message text two columns right of the accent rail (one extra leading space inside the body) for more breathing room in the chat log.
6
13
  - Paint the active editor surface and submitted message body with a fixed
7
14
  `#071312` background (`PROMPT_SURFACE_BG`) instead of the theme's `selectedBg`
package/README.md CHANGED
@@ -19,6 +19,20 @@ Submitted prompt
19
19
 
20
20
  Assistant and submitted-message content keep the two-column outer inset. The active prompt intentionally ignores that inset: its darker background fills the terminal width, with no rail, one extra layout column on each side of Pi's configured editor padding, and one background-colored row above and below the content. Real scroll indicators replace the corresponding padding row when needed. The submitted prompt remains unchanged: it keeps Pi's message padding and the thin rail outside its darker body. Autocomplete stays outside the active surface.
21
21
 
22
+ ## Scope boundary
23
+
24
+ This package owns the transcript **surface**: the message inset, system-text
25
+ and status-rule alignment, the editor surface, and the submitted-prompt
26
+ shell for user messages. It deliberately never renders tool execution rows
27
+ today: collapsed tool calls, grouping, subagent plans, thinking labels, and
28
+ user-run `!` bash blocks all live in `@pi-kaush/pi-tool-call-markers` (which
29
+ also owns the rail shell those blocks use).
30
+
31
+ The one cross-package contract is spacing: `!` blocks align with message
32
+ text at this package's message inset, so `pi-tool-call-markers` mirrors
33
+ `contentInset` for its bash blocks (see its `src/bash-block.ts`). Change
34
+ indentation in both packages together.
35
+
22
36
  ## Install
23
37
 
24
38
  ```json
@@ -34,8 +48,9 @@ The package is not published while its version is `0.0.0`; use the repository pa
34
48
  The active editor surface and submitted message body paint with a fixed
35
49
  near-black `#071312` background (`PROMPT_SURFACE_BG`) so both user-input
36
50
  surfaces stay identical; the theme's `selectedBg` token continues to serve
37
- selections and dialogs. The extension consumes two theme tokens: `accent`
38
- for the submitted-prompt rail and `muted` for the editor scroll hints.
51
+ selections and dialogs. The extension consumes theme tokens for its rails and hints: `accent`
52
+ for the submitted-prompt rail, `muted` for the editor scroll hints, and
53
+ `bashMode` / `error` / `warning` / `dim` for the user-bash rail.
39
54
 
40
55
  Themes control colors, while this extension controls width and component
41
56
  shape; a theme cannot provide the layout itself.
@@ -49,7 +64,7 @@ Pi does not currently expose public renderers for native user and assistant mess
49
64
  For the complete visual system, combine this package with:
50
65
 
51
66
  - `@pi-kaush/pi-footer-minimal` for matching footer inset and footer working state; and
52
- - `@pi-kaush/pi-tool-call-markers` for unboxed tool rows, subagent plans, and thinking markers.
67
+ - `@pi-kaush/pi-tool-call-markers` for unboxed tool rows, subagent plans, thinking markers, and user-run `!` bash blocks.
53
68
 
54
69
  ## License
55
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-kaush/pi-content-layout",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Inset Pi's conversation surface and style active and submitted prompts as matching blocks.",
5
5
  "license": "MIT",
6
6
  "author": "Kaushik Gopal",
package/src/index.ts CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  type EditorTheme,
12
12
  Loader,
13
13
  type TUI,
14
+ visibleWidth,
14
15
  } from "@earendil-works/pi-tui";
15
16
  import {
16
17
  chatContainerHooks,
package/src/render.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Theme } from "@earendil-works/pi-coding-agent";
1
+ import type { Theme, ThemeColor } from "@earendil-works/pi-coding-agent";
2
2
  import type { EditorComponent } from "@earendil-works/pi-tui";
3
3
  import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
4
4
 
@@ -196,6 +196,7 @@ export function renderSubmittedUserLines(
196
196
  width: number,
197
197
  theme: Theme,
198
198
  inset = contentInset(width),
199
+ railColor: ThemeColor = "accent",
199
200
  ): string[] {
200
201
  const blockWidth = width - inset * 2;
201
202
  if (inset === 0 || blockWidth <= visibleWidth(PROMPT_RAIL)) {
@@ -207,7 +208,7 @@ export function renderSubmittedUserLines(
207
208
  return lines.map((line) => {
208
209
  const { controls, content } = splitLeadingSemanticControls(line);
209
210
  const recolored = replaceBackground(content, PROMPT_SURFACE_BG);
210
- const rail = theme.fg("accent", PROMPT_RAIL);
211
+ const rail = theme.fg(railColor, PROMPT_RAIL);
211
212
  // One extra leading space inside the body, so submitted text sits two
212
213
  // columns right of the rail instead of one.
213
214
  const body = paintBackground(