@kud/gh-ink 0.76.0 → 0.76.1
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.d.ts +1 -1
- package/dist/index.js +29 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -995,7 +995,7 @@ declare const ActionMenu: ({ item, actions, cursor, cols, }: {
|
|
|
995
995
|
cursor: number;
|
|
996
996
|
/**
|
|
997
997
|
* Content columns the menu may take. The width is fixed from the longest
|
|
998
|
-
* row
|
|
998
|
+
* row and the title — see `menuWidthFor` — so it never
|
|
999
999
|
* resizes as the cursor moves. A host beside a rail passes what the list
|
|
1000
1000
|
* has; everywhere else the frame's own width is the right answer.
|
|
1001
1001
|
*/
|
package/dist/index.js
CHANGED
|
@@ -2829,6 +2829,8 @@ var buildActions = (item, login, showFlash, jiraBase, jiraKeyRe, jiraTransitions
|
|
|
2829
2829
|
actions.push(...closing);
|
|
2830
2830
|
return byGroup(actions);
|
|
2831
2831
|
};
|
|
2832
|
+
var TAB_STRIP_ROWS = 3;
|
|
2833
|
+
var FILTER_BAR_ROWS = 2;
|
|
2832
2834
|
var agoText = (ms) => {
|
|
2833
2835
|
const d = (Date.now() - ms) / 1e3;
|
|
2834
2836
|
if (d < 60) return "just now";
|
|
@@ -3188,6 +3190,13 @@ var useActionMenu = () => {
|
|
|
3188
3190
|
};
|
|
3189
3191
|
return { actions, cursor, open, close: () => setActions(null), handleKey };
|
|
3190
3192
|
};
|
|
3193
|
+
var TITLE_SLACK = 1;
|
|
3194
|
+
var MENU_MAX_WIDTH = 88;
|
|
3195
|
+
var menuWidthFor = (cols, contentWidth, titleWidth) => Math.min(
|
|
3196
|
+
Math.max(contentWidth + 4, titleWidth + 4, 40),
|
|
3197
|
+
MENU_MAX_WIDTH,
|
|
3198
|
+
Math.max(20, cols - 4)
|
|
3199
|
+
);
|
|
3191
3200
|
var ActionMenu = ({
|
|
3192
3201
|
item,
|
|
3193
3202
|
actions,
|
|
@@ -3209,19 +3218,16 @@ var ActionMenu = ({
|
|
|
3209
3218
|
]
|
|
3210
3219
|
)
|
|
3211
3220
|
);
|
|
3212
|
-
const width = Math.min(
|
|
3213
|
-
Math.max(contentWidth + 4, 40),
|
|
3214
|
-
56,
|
|
3215
|
-
Math.max(20, cols - 4)
|
|
3216
|
-
);
|
|
3217
|
-
const inner = Math.max(1, width - 4);
|
|
3218
3221
|
const confirming = isConfirmRows(actions);
|
|
3219
|
-
const isCloseRow = (row) => menuTone(row) === "error";
|
|
3220
3222
|
const number = item.kind === "pr" || item.kind === "issue" ? item.number : null;
|
|
3221
3223
|
const leadNum = item.kind === "task" ? item.key : number !== null ? `#${number}` : "";
|
|
3222
3224
|
const lead = leadNum ? `${leadNum} \xB7 ` : "";
|
|
3223
3225
|
const rest = confirming ? `Close #${number}?` : item.kind === "task" ? item.summary : item.kind === "pr" || item.kind === "issue" ? item.title : "";
|
|
3224
|
-
const
|
|
3226
|
+
const titleWidth = [...lead].length + [...rest].length + TITLE_SLACK;
|
|
3227
|
+
const width = menuWidthFor(cols, contentWidth, titleWidth);
|
|
3228
|
+
const inner = Math.max(1, width - 4);
|
|
3229
|
+
const restText = [...lead].length + [...rest].length + TITLE_SLACK <= inner ? rest : [...rest].slice(0, Math.max(0, inner - [...lead].length - 1 - TITLE_SLACK)).join("") + "\u2026";
|
|
3230
|
+
const isCloseRow = (row) => menuTone(row) === "error";
|
|
3225
3231
|
return /* @__PURE__ */ jsxs(
|
|
3226
3232
|
Box,
|
|
3227
3233
|
{
|
|
@@ -4600,7 +4606,21 @@ var BrowseScreen = ({
|
|
|
4600
4606
|
// and footer below, the body where the list was. Fixed to the list's
|
|
4601
4607
|
// own height so the frame holds still between browse and drill, and
|
|
4602
4608
|
// clipped rather than spilling past the footer on a long body.
|
|
4603
|
-
|
|
4609
|
+
//
|
|
4610
|
+
// Plus the rows the overlay hides: the tab strip and, when a filter
|
|
4611
|
+
// is on, its bar. `listHeight` already paid for both, so a band of
|
|
4612
|
+
// exactly `listHeight` left the frame three rows short of the
|
|
4613
|
+
// terminal under every drill and extension body, five with a filter
|
|
4614
|
+
// kept — the bottom border floating above the screen's edge.
|
|
4615
|
+
/* @__PURE__ */ jsx(
|
|
4616
|
+
Box,
|
|
4617
|
+
{
|
|
4618
|
+
flexDirection: "column",
|
|
4619
|
+
height: listHeight + TAB_STRIP_ROWS + (filterActive ? FILTER_BAR_ROWS : 0),
|
|
4620
|
+
overflow: "hidden",
|
|
4621
|
+
children: overlayBody
|
|
4622
|
+
}
|
|
4623
|
+
)
|
|
4604
4624
|
) : /* @__PURE__ */ jsxs(
|
|
4605
4625
|
Box,
|
|
4606
4626
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kud/gh-ink",
|
|
3
|
-
"version": "0.76.
|
|
3
|
+
"version": "0.76.1",
|
|
4
4
|
"description": "Ink components for rendering GitHub PR review comments and health — controlled, presentation-only, built on @kud/ink-ui and fed by @kud/gh.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|