@kud/gh-cockpit 0.4.16 → 0.4.17
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/index.js +29 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -97,6 +97,28 @@ var fetchBody = async (kind, repo, number) => {
|
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
+
|
|
101
|
+
// src/views/pr-summary.ts
|
|
102
|
+
var DIVIDER = " \xB7 ";
|
|
103
|
+
var sizeOf = (data) => data.additions === void 0 || data.deletions === void 0 ? null : `+${data.additions} -${data.deletions}`;
|
|
104
|
+
var summaryOf = (item, data, cols) => {
|
|
105
|
+
const size = data ? sizeOf(data) : null;
|
|
106
|
+
const files = data?.changedFiles === void 0 ? null : `${data.changedFiles} ${data.changedFiles === 1 ? "file" : "files"}`;
|
|
107
|
+
const base = data?.baseRefName;
|
|
108
|
+
const author = item.author ? item.author : null;
|
|
109
|
+
const opened = item.age ? `opened ${item.age} ago` : null;
|
|
110
|
+
const branches = base ? item.branch ? `${item.branch} \u2192 ${base}` : `\u2192 ${base}` : item.branch ?? null;
|
|
111
|
+
const parts = (branch) => [files, branch, author, opened].filter((p) => !!p);
|
|
112
|
+
const full = parts(branches);
|
|
113
|
+
const line = (ps) => ps.join(DIVIDER);
|
|
114
|
+
const width = (ps) => (size ? size.length + DIVIDER.length : 0) + line(ps).length;
|
|
115
|
+
const draft = item.health === "draft";
|
|
116
|
+
const prefix = draft ? `~ draft${DIVIDER}` : "";
|
|
117
|
+
if (width(full) + prefix.length <= cols)
|
|
118
|
+
return { size, rest: prefix + line(full) };
|
|
119
|
+
const shortened = parts(base ? `\u2192 ${base}` : null);
|
|
120
|
+
return { size, rest: prefix + line(shortened) };
|
|
121
|
+
};
|
|
100
122
|
var jobIdOf = (url) => url?.match(/\/job\/(\d+)/)?.[1] ?? null;
|
|
101
123
|
var stripTimestamp = (line) => line.replace(/^\d{4}-\d\d-\d\dT[\d:.]+Z\s?/, "").replace(/\s+$/, "");
|
|
102
124
|
var colorFor = (clean) => {
|
|
@@ -349,6 +371,7 @@ var PrView = ({
|
|
|
349
371
|
`pr-health-${item.repo}-${item.number}`,
|
|
350
372
|
() => fetchHealth(item.repo, item.number)
|
|
351
373
|
);
|
|
374
|
+
const summary = summaryOf(item, health.data, process.stdout.columns ?? 80);
|
|
352
375
|
const checkLabel = (c) => c.workflowName ? `${c.workflowName} / ${c.context ?? c.name}` : c.context ?? c.name ?? "";
|
|
353
376
|
const onOpenCheck = (c) => {
|
|
354
377
|
const url = c.detailsUrl ?? c.targetUrl ?? "";
|
|
@@ -487,7 +510,12 @@ var PrView = ({
|
|
|
487
510
|
subtitle: item.title,
|
|
488
511
|
hints,
|
|
489
512
|
children: [
|
|
490
|
-
|
|
513
|
+
summary.size || summary.rest ? /* @__PURE__ */ jsxs(Box, { children: [
|
|
514
|
+
summary.size ? /* @__PURE__ */ jsx(Text, { children: summary.size }) : null,
|
|
515
|
+
summary.size && summary.rest ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: " \xB7 " }) : null,
|
|
516
|
+
summary.rest ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: summary.rest }) : null
|
|
517
|
+
] }) : null,
|
|
518
|
+
/* @__PURE__ */ jsx(Box, { marginBottom: 1, marginTop: 1, children: /* @__PURE__ */ jsx(Tabs, { active: tab, items: tabItems }) }),
|
|
491
519
|
menu.actions ? /* @__PURE__ */ jsx(ActionMenu, { item, actions: menu.actions, cursor: menu.cursor }) : tab === "health" ? /* @__PURE__ */ jsx(
|
|
492
520
|
HealthPanel,
|
|
493
521
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kud/gh-cockpit",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.17",
|
|
4
4
|
"description": "A configurable GitHub cockpit for the terminal — your PRs, reviews and issues in one Ink TUI, grouped by whose move it is.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"react": ">=19"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@kud/gh": "0.12.
|
|
57
|
-
"@kud/gh-ink": "0.45.
|
|
56
|
+
"@kud/gh": "0.12.3",
|
|
57
|
+
"@kud/gh-ink": "0.45.8",
|
|
58
58
|
"@kud/ink-ui": "0.22.0",
|
|
59
59
|
"zx": "8.8.5",
|
|
60
|
-
"@kud/gh-workflow": "0.3.
|
|
60
|
+
"@kud/gh-workflow": "0.3.3"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/node": "22.20.1",
|