@juicesharp/rpiv-ask-user-question 0.12.6 → 0.12.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-ask-user-question",
3
- "version": "0.12.6",
3
+ "version": "0.12.7",
4
4
  "description": "Pi extension: lets the model ask you a clarifying question with structured options instead of guessing",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -1,5 +1,5 @@
1
1
  import type { Component } from "@mariozechner/pi-tui";
2
- import { visibleWidth, wrapTextWithAnsi } from "@mariozechner/pi-tui";
2
+ import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@mariozechner/pi-tui";
3
3
 
4
4
  export interface WrappingSelectItem {
5
5
  label: string;
@@ -127,7 +127,7 @@ export class WrappingSelect implements Component {
127
127
  const contentWidth = Math.max(WrappingSelect.MIN_CONTENT_WIDTH, width - visibleWidth(rowPrefix));
128
128
 
129
129
  if (this.shouldRenderAsInlineInput(item, isActive)) {
130
- return [this.renderInlineInputRow(rowPrefix)];
130
+ return [this.renderInlineInputRow(rowPrefix, width)];
131
131
  }
132
132
 
133
133
  return [
@@ -147,8 +147,9 @@ export class WrappingSelect implements Component {
147
147
  return !!item.isOther && isActive;
148
148
  }
149
149
 
150
- private renderInlineInputRow(rowPrefix: string): string {
151
- return this.theme.selectedText(`${rowPrefix}${this.inputBuffer}${WrappingSelect.INPUT_CURSOR}`);
150
+ private renderInlineInputRow(rowPrefix: string, width: number): string {
151
+ const raw = `${rowPrefix}${this.inputBuffer}${WrappingSelect.INPUT_CURSOR}`;
152
+ return truncateToWidth(this.theme.selectedText(raw), width, "");
152
153
  }
153
154
 
154
155
  private renderLabelBlock(