@xynogen/pix-ask 0.2.13 → 0.2.14

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": "@xynogen/pix-ask",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "Pi tool — structured questionnaire UI (ask_user)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -523,6 +523,8 @@ export class AskQuestionnaire extends Container {
523
523
  let footer: string[] = [];
524
524
 
525
525
  const row = (content: string): string => truncateToWidth(content, width, "");
526
+ const guide = (key: string, action: string) => t.fg("text", key) + t.fg("dim", ` ${action}`);
527
+ const guideSep = t.fg("dim", " • ");
526
528
 
527
529
  // Tab bar — rendered as the framed top edge (frameLines `top`).
528
530
  let top: string | undefined;
@@ -558,7 +560,17 @@ export class AskQuestionnaire extends Container {
558
560
  .render(width)
559
561
  .map((line) => truncateToWidth(line, width, "")),
560
562
  );
561
- footer = [row(dim(t)("PgUp/PgDn inspect • enter submit • esc back • ctrl+c cancel"))];
563
+ footer = [
564
+ row(
565
+ guide("PgUp/PgDn", "inspect") +
566
+ guideSep +
567
+ guide("enter", "submit") +
568
+ guideSep +
569
+ guide("esc", "back") +
570
+ guideSep +
571
+ guide("ctrl+c", "cancel"),
572
+ ),
573
+ ];
562
574
  return this.frame(mw, header, body, footer, top);
563
575
  }
564
576
 
@@ -588,11 +600,15 @@ export class AskQuestionnaire extends Container {
588
600
  }
589
601
 
590
602
  // Footer hints
591
- const navHint = this.params.questions.length > 1 ? "↑↓ nav • ←→ question" : "↑↓ nav";
592
- const hintParts = isMulti
593
- ? [`${navHint} • space toggle • enter commit • esc clear`, "ctrl+c cancel"]
594
- : [`${navHint} type filter • enter select • esc clear`, "ctrl+c cancel"];
595
- footer = [row(dim(t)(`${hintParts.join(" • ")} • PgUp/PgDn inspect`))];
603
+ const hints: Array<[string, string]> = [["↑↓", "nav"]];
604
+ if (this.params.questions.length > 1) hints.push(["←→", "question"]);
605
+ if (isMulti) {
606
+ hints.push(["space", "toggle"], ["enter", "commit"]);
607
+ } else {
608
+ hints.push(["type", "filter"], ["enter", "select"]);
609
+ }
610
+ hints.push(["esc", "clear"], ["ctrl+c", "cancel"], ["PgUp/PgDn", "inspect"]);
611
+ footer = [row(hints.map(([key, action]) => guide(key, action)).join(guideSep))];
596
612
 
597
613
  return this.frame(mw, header, body, footer, top);
598
614
  }
@@ -610,9 +626,9 @@ export class AskQuestionnaire extends Container {
610
626
  width: outerWidth,
611
627
  maxHeight: terminalModalHeight(this.tui.terminal.rows),
612
628
  minHeight: MIN_MODAL_HEIGHT,
613
- header,
629
+ header: [...header, ""],
614
630
  body,
615
- footer,
631
+ footer: ["", ...footer],
616
632
  bodyOffset: this.pager.bodyOffset,
617
633
  selectedBodyRange:
618
634
  this.selectedOptionRows === undefined