@vincemakes/kiso-tui-cells 0.1.41 → 0.2.0
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/dist/approval-panel.js +11 -4
- package/package.json +1 -1
package/dist/approval-panel.js
CHANGED
|
@@ -55,11 +55,18 @@ function panelOptionsRow(view, sel, W) {
|
|
|
55
55
|
if (view.flavor === "simple")
|
|
56
56
|
return `${o1} ${o3}`;
|
|
57
57
|
// the option-2 span: " 2 Yes, don't ask again for <name>" — the
|
|
58
|
-
// fixed part is 45 (the 1/3 options + the separators +
|
|
59
|
-
// prefix); the name cuts to W−46 + "…".
|
|
58
|
+
// fixed part is 45 (the gutter + the 1/3 options + the separators +
|
|
59
|
+
// the 28-cell prefix); the name cuts to W−46 + "…". The "…" needs
|
|
60
|
+
// its own cell, so the span fits only when W − 46 ≥ 1; below that
|
|
61
|
+
// (W < 47 — incl. the 0.1.42 release-smoke's 40-col winch) the span
|
|
62
|
+
// DROPS: the rule name is the cuttable span, the 1/3 options are
|
|
63
|
+
// the semantics — the approval decision must survive a narrow
|
|
64
|
+
// winch, and invariant ① must never fire on the options row.
|
|
65
|
+
if (W < 47)
|
|
66
|
+
return cutLine(`${o1} ${o3}`, Math.max(1, W - 2));
|
|
60
67
|
const name = escapeTerminal(view.name);
|
|
61
|
-
const budget =
|
|
62
|
-
const shown = visibleWidth(name) >
|
|
68
|
+
const budget = W - 46;
|
|
69
|
+
const shown = visibleWidth(name) > W - 45 ? `${widthCut(name, budget)}…` : name;
|
|
63
70
|
const o2 = sel === 2 ? `${p.bold} 2 Yes, don't ask again for ${shown}${p.reset}` : ` 2 Yes, don't ask again for ${shown}`;
|
|
64
71
|
return `${o1} ${o2} ${o3}`;
|
|
65
72
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-tui-cells",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "kiso tui-cells — the components cell renderer (components, diff, width, the render slice). Zero runtime dependencies: input is data, output is bytes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|