@kud/gh-ink 0.65.1 → 0.66.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 CHANGED
@@ -263,6 +263,13 @@ type PrRowProps = {
263
263
  * number into the title.
264
264
  */
265
265
  numberCols?: number;
266
+ /**
267
+ * Whether the row draws its own `❯` gutter. A host that marks the selected
268
+ * stop itself, in a column further left, passes `false` — otherwise the
269
+ * selected row carries two cursors (`❯ ├─ ❯ …`). Hidden, the two columns go
270
+ * to the title rather than standing empty.
271
+ */
272
+ gutter?: boolean;
266
273
  };
267
274
  /**
268
275
  * The trailing block, in reading order: how contested, how big, how recent.
@@ -289,17 +296,18 @@ type TrailingShed = Partial<Record<(typeof TRAILING)[number], boolean>>;
289
296
  declare const trailingColumnsOf: (items: readonly GHItem[]) => TrailingColumns;
290
297
  /**
291
298
  * Width of the `#n` cell across these rows: the widest number plus a two-cell
292
- * gutter, left-aligned. Measured once by the list over the whole section, the
293
- * same move as `markerCols` and `trailingColumnsOf`, so the titles start on one
294
- * column and that column does not move as you scroll.
299
+ * gutter, left-aligned. The inbox measures it once over the rows of EVERY tab
300
+ * (`listColumnsOf`), the same move as `markerCols` and `trailingColumnsOf`, so
301
+ * the titles start on one column and that column moves neither as you scroll
302
+ * nor as you switch tabs. Measured per tab, it put `#1234`'s titles a column
303
+ * right of `#157`'s in the next tab, and every switch shifted the list.
295
304
  *
296
305
  * It replaced `padEnd(7)`, a constant that fitted the repos it was written
297
306
  * against and nothing else: `#31805` left a one-cell gutter where `#172` left
298
- * three, and a six-digit number would have run straight into its title. A
299
- * section of short numbers no longer pays for a long one it does not hold.
307
+ * three, and a six-digit number would have run straight into its title.
300
308
  */
301
309
  declare const numberColumnsOf: (items: readonly GHItem[]) => number;
302
- type LayoutInput = Pick<PrRowProps, "item" | "login" | "cols" | "prefix" | "uniformLabels" | "announcements" | "columns" | "shed" | "numberCols">;
310
+ type LayoutInput = Pick<PrRowProps, "item" | "login" | "cols" | "prefix" | "uniformLabels" | "announcements" | "columns" | "shed" | "numberCols" | "gutter">;
303
311
  /**
304
312
  * Which trailing columns the section has to give up, so that every row gives up
305
313
  * the same ones. Each row is laid out alone and the drops are unioned: if any
@@ -325,7 +333,7 @@ declare const sectionShedOf: (rows: readonly Pick<LayoutInput, "item" | "prefix"
325
333
  * arrival, merge and departure belongs to whoever owns the list, and reaches
326
334
  * the row as `icon`, `motion` and `announcements` after the decisions are made.
327
335
  */
328
- declare const PrRow: ({ item, active, login, cols, selectionBg, icon: iconOverride, prefix, uniformLabels, motion, announcements, columns, shed, numberCols, }: PrRowProps) => React.JSX.Element;
336
+ declare const PrRow: ({ item, active, login, cols, selectionBg, icon: iconOverride, prefix, uniformLabels, motion, announcements, columns, shed, numberCols, gutter, }: PrRowProps) => React.JSX.Element;
329
337
 
330
338
  /**
331
339
  * One state per thing, from a closed set the strip knows how to draw. The host
package/dist/index.js CHANGED
@@ -867,7 +867,8 @@ var layoutOf = ({
867
867
  announcements = [],
868
868
  columns,
869
869
  shed = {},
870
- numberCols
870
+ numberCols,
871
+ gutter = true
871
872
  }) => {
872
873
  const numCols = numberCols ?? numberColumnsOf([item]);
873
874
  const numStr = `#${item.number}`.padEnd(numCols);
@@ -914,7 +915,7 @@ var layoutOf = ({
914
915
  const author = showAuthor && !givingUp.author ? ` by ${item.author}`.length : 0;
915
916
  const pills = announcements.reduce((w, a) => w + 2 + a.label.length, 0);
916
917
  const cell = labelCell();
917
- return 2 + prefix.length + 2 + 2 + numCols + (cell ? 2 + cell.length + 1 : 0) + (givingUp.repo ? 0 : repoLabel.length) + author + block + pills + pillCaps + 4;
918
+ return (gutter ? 2 : 0) + prefix.length + 2 + 2 + numCols + (cell ? 2 + cell.length + 1 : 0) + (givingUp.repo ? 0 : repoLabel.length) + author + block + pills + pillCaps + 4;
918
919
  };
919
920
  const MIN_TITLE = 24;
920
921
  for (const give of [
@@ -958,7 +959,8 @@ var PrRow = ({
958
959
  announcements = [],
959
960
  columns,
960
961
  shed,
961
- numberCols
962
+ numberCols,
963
+ gutter = true
962
964
  }) => {
963
965
  const backdropped = useBackdropped();
964
966
  const { glyph: healthIcon, color: healthColor2 } = displayFor(item.health);
@@ -989,13 +991,14 @@ var PrRow = ({
989
991
  announcements,
990
992
  columns,
991
993
  shed,
992
- numberCols
994
+ numberCols,
995
+ gutter
993
996
  });
994
997
  return (
995
998
  // The wash paints every cell of the fixed-width row — an Ink Box's
996
999
  // background covers its full measure, not just the inked cells.
997
1000
  /* @__PURE__ */ jsxs(Box, { width: cols, backgroundColor: selectionBg, children: [
998
- /* @__PURE__ */ jsx(Text3, { color: colors.info, children: active ? "\u276F " : " " }),
1001
+ gutter ? /* @__PURE__ */ jsx(Text3, { color: colors.info, children: active ? "\u276F " : " " }) : null,
999
1002
  /* @__PURE__ */ jsx(Text3, { dimColor: true, children: prefix }),
1000
1003
  /* @__PURE__ */ jsx(Text3, { color, bold: true, children: icon + " " }),
1001
1004
  /* @__PURE__ */ jsx(Text3, { color: turnColor, bold: turnIcon === "\u2190", children: turnIcon + " " }),
@@ -1528,6 +1531,13 @@ var reposInSections = (sections) => [
1528
1531
  sections.flatMap((s) => s.items).filter((i) => i.kind === "pr" || i.kind === "issue").map((i) => i.repo)
1529
1532
  )
1530
1533
  ].sort();
1534
+ var listColumnsOf = (sections) => {
1535
+ const rows = sections.flatMap((s) => s.items).filter((i) => i.kind === "pr" || i.kind === "issue");
1536
+ return {
1537
+ numberCols: numberColumnsOf(rows),
1538
+ trailingColumns: trailingColumnsOf(rows)
1539
+ };
1540
+ };
1531
1541
  var moveCursor = (items, current, dir) => {
1532
1542
  const next = current + dir;
1533
1543
  if (next < 0 || next >= items.length) return current;
@@ -2009,6 +2019,7 @@ var buildActions = (item, login, showFlash, jiraBase, jiraKeyRe, jiraTransitions
2009
2019
  return base;
2010
2020
  }
2011
2021
  const actions = drillAction ? [drillAction, open, copyUrl] : [open, copyUrl];
2022
+ const closing = [];
2012
2023
  actions.push({
2013
2024
  label: "Copy repo name",
2014
2025
  hint: "r",
@@ -2158,7 +2169,7 @@ var buildActions = (item, login, showFlash, jiraBase, jiraKeyRe, jiraTransitions
2158
2169
  });
2159
2170
  }
2160
2171
  }
2161
- actions.push({
2172
+ closing.push({
2162
2173
  label: "Close PR",
2163
2174
  hint: "",
2164
2175
  run: () => {
@@ -2190,7 +2201,7 @@ var buildActions = (item, login, showFlash, jiraBase, jiraKeyRe, jiraTransitions
2190
2201
  ]
2191
2202
  });
2192
2203
  if (item.branch) {
2193
- actions.push({
2204
+ closing.push({
2194
2205
  label: "Close PR + Delete branch",
2195
2206
  hint: "",
2196
2207
  run: () => {
@@ -2227,6 +2238,7 @@ var buildActions = (item, login, showFlash, jiraBase, jiraKeyRe, jiraTransitions
2227
2238
  showFlash
2228
2239
  })
2229
2240
  });
2241
+ actions.push(...closing);
2230
2242
  return actions;
2231
2243
  };
2232
2244
  var agoText = (ms) => {
@@ -3020,8 +3032,7 @@ var BrowseScreen = ({
3020
3032
  }, [searchInput, palette, onTyping]);
3021
3033
  const railCols = railWidth(COLS);
3022
3034
  const listCols = showRail ? COLS - railCols : COLS;
3023
- const trailingColumns = trailingColumnsOf(labelBearing);
3024
- const numberCols = numberColumnsOf(labelBearing);
3035
+ const { trailingColumns, numberCols } = listColumnsOf(localSections);
3025
3036
  const rowCols = Math.min(listCols, ROW_MAX_COLS);
3026
3037
  const trailingShed = sectionShedOf(
3027
3038
  section.items.flatMap(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/gh-ink",
3
- "version": "0.65.1",
3
+ "version": "0.66.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",
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@kud/gh": "0.19.0",
52
52
  "@kud/gh-workflow": "0.14.0",
53
- "@kud/ink-ui": "0.31.0",
53
+ "@kud/ink-ui": "0.33.0",
54
54
  "zx": "8.8.5"
55
55
  },
56
56
  "devDependencies": {