@v1nvn/statusline 0.30.4 → 0.30.5
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/README.md +7 -7
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/render.mjs +9 -3
- package/dist/render.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ offers the picker in chat, and writes the pick.
|
|
|
22
22
|
In a terminal outside Claude Code — the wizard, the terminal guide:
|
|
23
23
|
|
|
24
24
|
```sh
|
|
25
|
-
npx -y @v1nvn/statusline@0.30.
|
|
25
|
+
npx -y @v1nvn/statusline@0.30.5 configure
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
Pass one stacks the five theme bars: `j/k` focus · `w` width · enter picks.
|
|
@@ -44,12 +44,12 @@ another home instead of `$HOME`.
|
|
|
44
44
|
| `restore` | both keys back to their pre-lab values from `backup.json`, then deletes the lab data — `--dry-run` prints the plan; `--force` splices over a key changed after the takeover |
|
|
45
45
|
|
|
46
46
|
```sh
|
|
47
|
-
npx -y @v1nvn/statusline@0.30.
|
|
48
|
-
npx -y @v1nvn/statusline@0.30.
|
|
49
|
-
npx -y @v1nvn/statusline@0.30.
|
|
50
|
-
npx -y @v1nvn/statusline@0.30.
|
|
51
|
-
npx -y @v1nvn/statusline@0.30.
|
|
52
|
-
npx -y @v1nvn/statusline@0.30.
|
|
47
|
+
npx -y @v1nvn/statusline@0.30.5 preview --theme rich --plain # chat-safe sketch, nothing written
|
|
48
|
+
npx -y @v1nvn/statusline@0.30.5 configure --theme rich # the write — live on the next paint
|
|
49
|
+
npx -y @v1nvn/statusline@0.30.5 configure --theme rich --bar percent # one swap on top of the theme
|
|
50
|
+
npx -y @v1nvn/statusline@0.30.5 catalog --themes
|
|
51
|
+
npx -y @v1nvn/statusline@0.30.5 status
|
|
52
|
+
npx -y @v1nvn/statusline@0.30.5 restore
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
## Develop
|
package/dist/index.js
CHANGED
|
@@ -503,6 +503,11 @@ function fmtFixed(x, d) {
|
|
|
503
503
|
function pad2(n) {
|
|
504
504
|
return String(n).padStart(2, "0");
|
|
505
505
|
}
|
|
506
|
+
function fmtDuration(minutes) {
|
|
507
|
+
if (minutes < 60) return `${minutes}m`;
|
|
508
|
+
if (minutes < 1440) return `${Math.trunc(minutes / 60)}h${pad2(minutes % 60)}m`;
|
|
509
|
+
return `${Math.trunc(minutes / 1440)}d${pad2(Math.trunc(minutes / 60) % 24)}h`;
|
|
510
|
+
}
|
|
506
511
|
function fmtK(n, d) {
|
|
507
512
|
return `${fmtFixed(n / 1e3, d)}k`;
|
|
508
513
|
}
|
|
@@ -814,11 +819,12 @@ function costBurn(input) {
|
|
|
814
819
|
return out;
|
|
815
820
|
}
|
|
816
821
|
function durationClock({ row }) {
|
|
817
|
-
return
|
|
822
|
+
return fmtDuration(trunc(row.durationMs / 6e4));
|
|
818
823
|
}
|
|
819
824
|
function durationHours({ row }) {
|
|
820
825
|
const m = trunc(row.durationMs / 6e4);
|
|
821
|
-
return `${trunc(m / 60)}h${pad2(m % 60)}m`;
|
|
826
|
+
if (m < 1440) return `${trunc(m / 60)}h${pad2(m % 60)}m`;
|
|
827
|
+
return `${trunc(m / 1440)}d${pad2(trunc(m / 60) % 24)}h${pad2(m % 60)}m`;
|
|
822
828
|
}
|
|
823
829
|
function linesDiffstat({ row }) {
|
|
824
830
|
if (row.la <= 0 && row.lr <= 0) return "";
|
|
@@ -1326,7 +1332,7 @@ function catalog(options) {
|
|
|
1326
1332
|
//#region src/cli.ts
|
|
1327
1333
|
var VERSION = {
|
|
1328
1334
|
name: "@v1nvn/statusline",
|
|
1329
|
-
version: "0.30.
|
|
1335
|
+
version: "0.30.5",
|
|
1330
1336
|
description: "Browse statusline variants and configure the live status line and agent panel — the statusline CLI behind the statusline plugin.",
|
|
1331
1337
|
type: "module",
|
|
1332
1338
|
bin: "dist/index.js",
|
|
@@ -1934,7 +1940,7 @@ function duration(startText, now) {
|
|
|
1934
1940
|
const seconds = start > MS_THRESHOLD ? Math.trunc(start / 1e3) : start;
|
|
1935
1941
|
const elapsed = Math.trunc(now) - seconds;
|
|
1936
1942
|
if (elapsed < 0) return "";
|
|
1937
|
-
return
|
|
1943
|
+
return fmtDuration(Math.trunc(elapsed / 60));
|
|
1938
1944
|
}
|
|
1939
1945
|
function rowFormats(fields, now) {
|
|
1940
1946
|
const tokens = intValue(fields.tokens) ?? 0;
|