@pi-kaush/pi-content-layout 0.1.7 → 0.1.9

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,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - Pad the submitted-prompt box with two columns on the right of the text so
6
+ it matches the two-column visual gap the quarter-block rail leaves on the
7
+ left; previously wrapped content sat one column off the right edge.
8
+
5
9
  - Reference semantic tokens for the remaining extension-colored elements:
6
10
  the intercom sender name rides `customMessageLabel`, the submitted-prompt
7
11
  rail rides `borderAccent`, and prompt surfaces paint with `userMessageBg`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-kaush/pi-content-layout",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
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/render.ts CHANGED
@@ -258,10 +258,14 @@ export function renderSubmittedUserLines(
258
258
  const { controls, content } = splitLeadingSemanticControls(line);
259
259
  const recolored = replaceBackground(content, surfaceBg);
260
260
  const rail = theme.fg(railColor, PROMPT_RAIL);
261
- // One extra leading space inside the body, so submitted text sits two
262
- // columns right of the rail instead of one.
261
+ // The rail glyph (▎) fills only the left quarter of its cell, so one
262
+ // column of left padding already reads as a two-column visual gap.
263
+ // Give the right edge two columns so both sides of the text read equal.
264
+ const leftPadding = " ".repeat(ACTIVE_SIDE_PADDING);
265
+ const rightPadding = " ".repeat(ACTIVE_SIDE_PADDING + 1);
266
+ const innerWidth = Math.max(1, bodyWidth - ACTIVE_SIDE_PADDING * 2 - 1);
263
267
  const body = paintBackground(
264
- ` ${fitLine(recolored, Math.max(1, bodyWidth - 1))}`,
268
+ `${leftPadding}${fitLine(recolored, innerWidth)}${rightPadding}`,
265
269
  bodyWidth,
266
270
  surfaceBg,
267
271
  );