@kud/gh-ink 0.63.0 → 0.64.0

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
@@ -1,7 +1,7 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { PrComments, PrHealthData, PrCheck, Health } from '@kud/gh';
3
3
  import { GHItem, AnyItem, Section, CiStatus, OriginSplit } from '@kud/gh-workflow';
4
- export { AnyItem, Band, CiStatus, GHDetail, GHItem, InboxConfig, Move, OriginSplit, PIN_MARK, RepoHeader, RepoProfile, Section, ShowLess, ShowMore, Standing, SubgroupHeader, TaskRow, bandOf, checkoutDirs, configureInbox, filterByOrigin, filterByRepos, filterBySearch, impliedLabels, inboxConfig, insertRepoHeaders, labelPriority, layoutGHItems, profileOf, relativeTime, repoPriority, resetInboxConfig, sortByRecency, sortItems, whoseMove } from '@kud/gh-workflow';
4
+ export { AnyItem, Band, CiStatus, GHDetail, GHItem, InboxConfig, Move, NEEDS_YOU_SECTION, NeedsYou, OriginSplit, PIN_MARK, RepoHeader, RepoProfile, Section, ShowLess, ShowMore, Standing, SubgroupHeader, TaskRow, bandOf, checkoutDirs, configureInbox, filterByOrigin, filterByRepos, filterBySearch, impliedLabels, inboxConfig, insertRepoHeaders, labelPriority, layoutGHItems, profileOf, relativeTime, repoPriority, resetInboxConfig, sortByRecency, sortItems, whoseMove } from '@kud/gh-workflow';
5
5
  import { StyledLine } from '@kud/ink-ui';
6
6
 
7
7
  type CommentsPanelProps = {
@@ -250,6 +250,12 @@ type PrRowProps = {
250
250
  columns?: TrailingColumns;
251
251
  /** Trailing columns the section has given up — see `sectionShedOf`. */
252
252
  shed?: TrailingShed;
253
+ /**
254
+ * Width of the number cell across the section — see `numberColumnsOf`.
255
+ * Absent, the row measures itself, which aligns nothing but never runs the
256
+ * number into the title.
257
+ */
258
+ numberCols?: number;
253
259
  };
254
260
  /**
255
261
  * The trailing block, in reading order: how contested, how big, how recent.
@@ -274,7 +280,19 @@ type TrailingShed = Partial<Record<(typeof TRAILING)[number], boolean>>;
274
280
  * would not.
275
281
  */
276
282
  declare const trailingColumnsOf: (items: readonly GHItem[]) => TrailingColumns;
277
- type LayoutInput = Pick<PrRowProps, "item" | "login" | "cols" | "prefix" | "uniformLabels" | "announcements" | "columns" | "shed">;
283
+ /**
284
+ * Width of the `#n` cell across these rows: the widest number plus a two-cell
285
+ * gutter, left-aligned. Measured once by the list over the whole section, the
286
+ * same move as `markerCols` and `trailingColumnsOf`, so the titles start on one
287
+ * column and that column does not move as you scroll.
288
+ *
289
+ * It replaced `padEnd(7)`, a constant that fitted the repos it was written
290
+ * against and nothing else: `#31805` left a one-cell gutter where `#172` left
291
+ * three, and a six-digit number would have run straight into its title. A
292
+ * section of short numbers no longer pays for a long one it does not hold.
293
+ */
294
+ declare const numberColumnsOf: (items: readonly GHItem[]) => number;
295
+ type LayoutInput = Pick<PrRowProps, "item" | "login" | "cols" | "prefix" | "uniformLabels" | "announcements" | "columns" | "shed" | "numberCols">;
278
296
  /**
279
297
  * Which trailing columns the section has to give up, so that every row gives up
280
298
  * the same ones. Each row is laid out alone and the drops are unioned: if any
@@ -300,7 +318,7 @@ declare const sectionShedOf: (rows: readonly Pick<LayoutInput, "item" | "prefix"
300
318
  * arrival, merge and departure belongs to whoever owns the list, and reaches
301
319
  * the row as `icon`, `motion` and `announcements` after the decisions are made.
302
320
  */
303
- declare const PrRow: ({ item, active, login, cols, icon: iconOverride, prefix, uniformLabels, motion, announcements, columns, shed, }: PrRowProps) => React.JSX.Element;
321
+ declare const PrRow: ({ item, active, login, cols, icon: iconOverride, prefix, uniformLabels, motion, announcements, columns, shed, numberCols, }: PrRowProps) => React.JSX.Element;
304
322
 
305
323
  /**
306
324
  * One state per thing, from a closed set the strip knows how to draw. The host
@@ -792,4 +810,4 @@ declare const matchesFilter: (repo: string, filter: RepoFilter) => boolean;
792
810
  */
793
811
  declare const parsePatterns: (value: string) => string[];
794
812
 
795
- export { type Action, ActionMenu, App, COLS, CiStatusLine, type CiStatusState, type Command, CommentsPanel, type CommentsPanelProps, type DetailContext, type ExplainSection, type ExtensionTarget, HealthPanel, type HealthPanelProps, type InboxBudget, type InboxExtension, type JiraTransition, type LiveLabel, MIN_SIDEBAR_COLS, PrRow, type PrRowProps, type Rails, type RepoFilter, type RowAnnouncement, type RowMotion, SIDEBAR_COLS, type SettledResult, SidePanel, type Sidebar, type SidebarRow, type StatusStrip, StatusStripLine, type StripItem, type StripState, type StripStatusState, type TrailingColumns, type TrailingShed, ageLabel, budgetNotice, buildActions, buildCheckoutCmd, clipboard, counts, drillCmd, explainGhAction, explainItem, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, itermRun, jumpToRepo, jumpToRepoPane, matchesFilter, maxViewStart, moveCursor, openInTab, parsePatterns, railCapacity, railHeights, railRowsOf, railWidth, railsOf, readCache, renderMarkdown, reposInSections, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, sectionShedOf, signatureOf, stripGlyph, stripLayout, stripSignature, toCiStatusState, trailingColumnsOf, truncate, useActionMenu, windowCount, withHeaders, withoutItem, workCount, writeCache };
813
+ export { type Action, ActionMenu, App, COLS, CiStatusLine, type CiStatusState, type Command, CommentsPanel, type CommentsPanelProps, type DetailContext, type ExplainSection, type ExtensionTarget, HealthPanel, type HealthPanelProps, type InboxBudget, type InboxExtension, type JiraTransition, type LiveLabel, MIN_SIDEBAR_COLS, PrRow, type PrRowProps, type Rails, type RepoFilter, type RowAnnouncement, type RowMotion, SIDEBAR_COLS, type SettledResult, SidePanel, type Sidebar, type SidebarRow, type StatusStrip, StatusStripLine, type StripItem, type StripState, type StripStatusState, type TrailingColumns, type TrailingShed, ageLabel, budgetNotice, buildActions, buildCheckoutCmd, clipboard, counts, drillCmd, explainGhAction, explainItem, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, itermRun, jumpToRepo, jumpToRepoPane, matchesFilter, maxViewStart, moveCursor, numberColumnsOf, openInTab, parsePatterns, railCapacity, railHeights, railRowsOf, railWidth, railsOf, readCache, renderMarkdown, reposInSections, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, sectionShedOf, signatureOf, stripGlyph, stripLayout, stripSignature, toCiStatusState, trailingColumnsOf, truncate, useActionMenu, windowCount, withHeaders, withoutItem, workCount, writeCache };
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { colors, ScrollView, TextInput, Pill, useAppKeys, LoadingScreen, StatusM
4
4
  import { isPassCheck, isFailCheck, isInconclusiveCheck, resolveThread, unresolveThread, replyToThread, rerunFailedRun, mergePr, reRequestReviewer } from '@kud/gh';
5
5
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
6
6
  import { PIN_MARK, sizeOf, sizePartsOf, depthOf, impliedLabels, labelPriority, checkoutDirs, profileOf, inboxConfig, relativeTime, filterBySearch, filterByRepos, filterByOrigin } from '@kud/gh-workflow';
7
- export { PIN_MARK, bandOf, checkoutDirs, configureInbox, filterByOrigin, filterByRepos, filterBySearch, impliedLabels, inboxConfig, insertRepoHeaders, labelPriority, layoutGHItems, profileOf, relativeTime, repoPriority, resetInboxConfig, sortByRecency, sortItems, whoseMove } from '@kud/gh-workflow';
7
+ export { NEEDS_YOU_SECTION, PIN_MARK, bandOf, checkoutDirs, configureInbox, filterByOrigin, filterByRepos, filterBySearch, impliedLabels, inboxConfig, insertRepoHeaders, labelPriority, layoutGHItems, profileOf, relativeTime, repoPriority, resetInboxConfig, sortByRecency, sortItems, whoseMove } from '@kud/gh-workflow';
8
8
  import { $ } from 'zx';
9
9
  import { spawn } from 'child_process';
10
10
  import { readFileSync, mkdirSync, writeFileSync, existsSync, readdirSync, statSync, watch, rmSync } from 'fs';
@@ -849,6 +849,7 @@ var trailingColumnsOf = (items) => items.reduce(
849
849
  }),
850
850
  { threads: 0, size: 0, age: 0 }
851
851
  );
852
+ var numberColumnsOf = (items) => items.reduce((w, item) => Math.max(w, cellsOf(`#${item.number}`)), 0) + 2;
852
853
  var sectionShedOf = (rows, context) => rows.reduce((shed, row) => {
853
854
  const { givingUp } = layoutOf({ ...context, ...row });
854
855
  return {
@@ -865,9 +866,11 @@ var layoutOf = ({
865
866
  uniformLabels = [],
866
867
  announcements = [],
867
868
  columns,
868
- shed = {}
869
+ shed = {},
870
+ numberCols
869
871
  }) => {
870
- const numStr = `#${item.number}`.padEnd(7);
872
+ const numCols = numberCols ?? numberColumnsOf([item]);
873
+ const numStr = `#${item.number}`.padEnd(numCols);
871
874
  const showAuthor = !!item.author && item.author !== login;
872
875
  const sizeParts = sizePartsOf(item);
873
876
  const unresolvedLabel = threadsLabelOf(item);
@@ -911,7 +914,7 @@ var layoutOf = ({
911
914
  const author = showAuthor && !givingUp.author ? ` by ${item.author}`.length : 0;
912
915
  const pills = announcements.reduce((w, a) => w + 2 + a.label.length, 0);
913
916
  const cell = labelCell();
914
- return 2 + prefix.length + 2 + 2 + 7 + (cell ? 2 + cell.length + 1 : 0) + (givingUp.repo ? 0 : repoLabel.length) + author + block + pills + pillCaps + 4;
917
+ return 2 + prefix.length + 2 + 2 + numCols + (cell ? 2 + cell.length + 1 : 0) + (givingUp.repo ? 0 : repoLabel.length) + author + block + pills + pillCaps + 4;
915
918
  };
916
919
  const MIN_TITLE = 24;
917
920
  for (const give of [
@@ -953,7 +956,8 @@ var PrRow = ({
953
956
  motion,
954
957
  announcements = [],
955
958
  columns,
956
- shed
959
+ shed,
960
+ numberCols
957
961
  }) => {
958
962
  const backdropped = useBackdropped();
959
963
  const { glyph: healthIcon, color: healthColor2 } = displayFor(item.health);
@@ -983,7 +987,8 @@ var PrRow = ({
983
987
  uniformLabels,
984
988
  announcements,
985
989
  columns,
986
- shed
990
+ shed,
991
+ numberCols
987
992
  });
988
993
  return /* @__PURE__ */ jsxs(Box, { width: cols, children: [
989
994
  /* @__PURE__ */ jsx(Text3, { color: colors.info, children: active ? "\u276F " : " " }),
@@ -997,7 +1002,10 @@ var PrRow = ({
997
1002
  bold: active || motion === "arriving",
998
1003
  dimColor: motion === "departing" || motion === "withdrawn",
999
1004
  strikethrough: motion === "withdrawn",
1000
- children: truncate(item.title, titleMax) + " "
1005
+ children: truncate(
1006
+ item.needsYou?.decision ? item.needsYou.decision : item.title,
1007
+ titleMax
1008
+ ) + " "
1001
1009
  }
1002
1010
  ),
1003
1011
  labelLabel ? /* @__PURE__ */ jsx(Text3, { color: colors.secondary, children: labelLabel + " " }) : null,
@@ -1820,6 +1828,7 @@ var FRAME_PAD_X = 1;
1820
1828
  var FRAME_CHROME_COLS = 2 + FRAME_PAD_X * 2;
1821
1829
  var COLS = (process.stdout.columns ?? 120) - FRAME_CHROME_COLS;
1822
1830
  var MODAL_CHROME_COLS = 2 + 1 * 2;
1831
+ var ROW_MAX_COLS = 140;
1823
1832
  var OVERLAY_BG = "#22222e";
1824
1833
  var workCount = (s) => {
1825
1834
  let n = 0;
@@ -1994,7 +2003,10 @@ var buildActions = (item, login, showFlash, jiraBase, jiraKeyRe, jiraTransitions
1994
2003
  (e) => {
1995
2004
  showFlash(`\u2717 #${item.number}: ${explainGhAction(e)}`);
1996
2005
  onRefresh?.();
1997
- ext?.onSettled?.(item, { ok: false, reason: firstLine(e) });
2006
+ ext?.onSettled?.(item, {
2007
+ ok: false,
2008
+ reason: firstLine(e)
2009
+ });
1998
2010
  }
1999
2011
  );
2000
2012
  }
@@ -2076,7 +2088,10 @@ var buildActions = (item, login, showFlash, jiraBase, jiraKeyRe, jiraTransitions
2076
2088
  (e) => {
2077
2089
  showFlash(`\u2717 Close failed \u2014 restoring #${item.number}`);
2078
2090
  onRefresh?.();
2079
- ext?.onSettled?.(item, { ok: false, reason: firstLine(e) });
2091
+ ext?.onSettled?.(item, {
2092
+ ok: false,
2093
+ reason: firstLine(e)
2094
+ });
2080
2095
  }
2081
2096
  );
2082
2097
  }
@@ -2132,7 +2147,10 @@ var buildActions = (item, login, showFlash, jiraBase, jiraKeyRe, jiraTransitions
2132
2147
  (e) => {
2133
2148
  showFlash(`\u2717 Close failed \u2014 restoring #${item.number}`);
2134
2149
  onRefresh?.();
2135
- ext?.onSettled?.(item, { ok: false, reason: firstLine(e) });
2150
+ ext?.onSettled?.(item, {
2151
+ ok: false,
2152
+ reason: firstLine(e)
2153
+ });
2136
2154
  }
2137
2155
  );
2138
2156
  }
@@ -2351,7 +2369,8 @@ var ItemRow = ({
2351
2369
  markerCols = 0,
2352
2370
  uniformLabels = [],
2353
2371
  columns,
2354
- shed
2372
+ shed,
2373
+ numberCols
2355
2374
  }) => {
2356
2375
  const backdropped = useBackdropped();
2357
2376
  const transient = leaving ? "out" : refreshMark;
@@ -2444,6 +2463,7 @@ var ItemRow = ({
2444
2463
  uniformLabels,
2445
2464
  columns,
2446
2465
  shed,
2466
+ numberCols,
2447
2467
  icon,
2448
2468
  motion,
2449
2469
  announcements
@@ -2967,11 +2987,19 @@ var BrowseScreen = ({
2967
2987
  const railCols = railWidth(COLS);
2968
2988
  const listCols = showRail ? COLS - railCols : COLS;
2969
2989
  const trailingColumns = trailingColumnsOf(labelBearing);
2990
+ const numberCols = numberColumnsOf(labelBearing);
2991
+ const rowCols = Math.min(listCols, ROW_MAX_COLS);
2970
2992
  const trailingShed = sectionShedOf(
2971
2993
  section.items.flatMap(
2972
2994
  (item, i) => item.kind === "pr" || item.kind === "issue" ? [{ item, prefix: treePrefix(section.items, i) }] : []
2973
2995
  ),
2974
- { login, cols: listCols, uniformLabels, columns: trailingColumns }
2996
+ {
2997
+ login,
2998
+ cols: rowCols,
2999
+ uniformLabels,
3000
+ columns: trailingColumns,
3001
+ numberCols
3002
+ }
2975
3003
  );
2976
3004
  const [sparkFrame, setSparkFrame] = useState(0);
2977
3005
  const sparkling = (mergedUrls?.length ?? 0) > 0 || (leavingUrls?.length ?? 0) > 0 || // Any MARKED TAB, not just rows on screen. The scope used to be this tab's
@@ -3667,11 +3695,12 @@ var BrowseScreen = ({
3667
3695
  prefix: treePrefix(section.items, viewStart + i),
3668
3696
  parent: item.kind === "task" && depthOf(section.items[viewStart + i + 1]) > depthOf(item),
3669
3697
  sparkFrame,
3670
- cols: listCols,
3698
+ cols: item.kind === "pr" || item.kind === "issue" ? rowCols : listCols,
3671
3699
  markerCols,
3672
3700
  uniformLabels,
3673
3701
  columns: trailingColumns,
3674
3702
  shed: trailingShed,
3703
+ numberCols,
3675
3704
  gap: i > 0 && gapsAbove(section.items, viewStart + i)
3676
3705
  },
3677
3706
  `${viewStart + i}:${rowKey(item)}`
@@ -4260,4 +4289,4 @@ var matchesFilter = (repo, filter) => {
4260
4289
  };
4261
4290
  var parsePatterns = (value) => value.split(",").map((p) => p.trim()).filter(Boolean);
4262
4291
 
4263
- export { ActionMenu, App, COLS, CiStatusLine, CommentsPanel, HealthPanel, MIN_SIDEBAR_COLS, PrRow, SIDEBAR_COLS, SidePanel, StatusStripLine, ageLabel, budgetNotice, buildActions, buildCheckoutCmd, clipboard, counts, drillCmd, explainGhAction, explainItem, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, itermRun, jumpToRepo, jumpToRepoPane, matchesFilter, maxViewStart, moveCursor, openInTab, parsePatterns, railCapacity, railHeights, railRowsOf, railWidth, railsOf, readCache, renderMarkdown, reposInSections, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, sectionShedOf, signatureOf, stripGlyph, stripLayout, stripSignature, toCiStatusState, trailingColumnsOf, truncate, useActionMenu, windowCount, withHeaders, withoutItem, workCount, writeCache };
4292
+ export { ActionMenu, App, COLS, CiStatusLine, CommentsPanel, HealthPanel, MIN_SIDEBAR_COLS, PrRow, SIDEBAR_COLS, SidePanel, StatusStripLine, ageLabel, budgetNotice, buildActions, buildCheckoutCmd, clipboard, counts, drillCmd, explainGhAction, explainItem, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, itermRun, jumpToRepo, jumpToRepoPane, matchesFilter, maxViewStart, moveCursor, numberColumnsOf, openInTab, parsePatterns, railCapacity, railHeights, railRowsOf, railWidth, railsOf, readCache, renderMarkdown, reposInSections, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, sectionShedOf, signatureOf, stripGlyph, stripLayout, stripSignature, toCiStatusState, trailingColumnsOf, truncate, useActionMenu, windowCount, withHeaders, withoutItem, workCount, writeCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/gh-ink",
3
- "version": "0.63.0",
3
+ "version": "0.64.0",
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",
@@ -48,8 +48,8 @@
48
48
  "react": ">=19"
49
49
  },
50
50
  "dependencies": {
51
- "@kud/gh": "0.18.0",
52
- "@kud/gh-workflow": "0.13.1",
51
+ "@kud/gh": "0.19.0",
52
+ "@kud/gh-workflow": "0.14.0",
53
53
  "@kud/ink-ui": "0.31.0",
54
54
  "zx": "8.8.5"
55
55
  },