@techninja/clearstack 0.4.32 → 0.4.33

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.
Files changed (2) hide show
  1. package/lib/watch-ui.js +8 -3
  2. package/package.json +1 -1
package/lib/watch-ui.js CHANGED
@@ -7,6 +7,9 @@
7
7
 
8
8
  import { screen, statusBox, divider, logBox, getSpin, getCopyNote } from './watch-widgets.js';
9
9
 
10
+ /** @param {string} s @param {number} max @returns {string} */
11
+ const truncate = (s, max) => s.length > max ? s.slice(0, max - 1) + '…' : s;
12
+
10
13
  export { setQuit } from './watch-widgets.js';
11
14
  export { splitCandidates, extractViolations } from './watch-violations.js';
12
15
 
@@ -40,9 +43,11 @@ const rowLine = (r, w) => {
40
43
  const n = (r.label ?? r.name ?? r.key).padEnd(w);
41
44
  const isIdle = r.pass === false && r.keyBinding;
42
45
  const name = (!isIdle && r.pass === false) ? `{red-fg}${n}{/}` : n;
43
- const detail = isIdle
44
- ? `{grey-fg}${r.ranAt ? timeAgo(r.ranAt) : `press ${r.keyBinding} to run`}{/}`
45
- : (r.detail ? `{grey-fg}${r.detail}{/}` : '');
46
+ const maxDetail = Math.max(10, (screen.width ?? 80) - w - 8);
47
+ const rawDetail = isIdle
48
+ ? (r.ranAt ? timeAgo(r.ranAt) : `press ${r.keyBinding} to run`)
49
+ : (r.detail ?? '');
50
+ const detail = rawDetail ? `{grey-fg}${truncate(rawDetail, maxDetail)}{/}` : '';
46
51
  return ` ${rowIcon(r)} ${name} ${detail}`;
47
52
  };
48
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techninja/clearstack",
3
- "version": "0.4.32",
3
+ "version": "0.4.33",
4
4
  "type": "module",
5
5
  "description": "A no-build web component framework specification — scaffold, validate, and evolve spec-compliant projects",
6
6
  "bin": {