@kud/gh-ink 0.51.2 → 0.52.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
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
2
2
  import { PrComments, PrHealthData, PrCheck, Health } from '@kud/gh';
3
3
  import { StyledLine } from '@kud/ink-ui';
4
4
  import { AnyItem, Section, CiStatus, GHItem, OriginSplit } from '@kud/gh-workflow';
5
- export { AnyItem, CiStatus, GHDetail, GHItem, InboxConfig, Move, OriginSplit, PIN_MARK, RepoHeader, RepoProfile, Section, ShowLess, ShowMore, Standing, SubgroupHeader, TaskRow, checkoutDirs, configureInbox, filterByOrigin, filterByRepos, filterBySearch, inboxConfig, insertRepoHeaders, labelPriority, layoutGHItems, profileOf, relativeTime, repoPriority, resetInboxConfig, sortByRecency, sortItems, whoseMove } from '@kud/gh-workflow';
5
+ export { AnyItem, CiStatus, GHDetail, GHItem, InboxConfig, Move, OriginSplit, PIN_MARK, RepoHeader, RepoProfile, Section, ShowLess, ShowMore, Standing, SubgroupHeader, TaskRow, checkoutDirs, configureInbox, filterByOrigin, filterByRepos, filterBySearch, impliedLabels, inboxConfig, insertRepoHeaders, labelPriority, layoutGHItems, profileOf, relativeTime, repoPriority, resetInboxConfig, sortByRecency, sortItems, whoseMove } from '@kud/gh-workflow';
6
6
 
7
7
  type CommentsPanelProps = {
8
8
  repo: string;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React2, { createContext, useState, useRef, useEffect, useMemo, useContext } from 'react';
2
- import { useWindowSize, useInput, Text, Box } from 'ink';
2
+ import { useWindowSize, useInput, Text, Box, useApp } from 'ink';
3
3
  import { colors, ScrollView, TextInput, LoadingScreen, StatusMessage, FooterHints, useListCursor, Tabs, pillWidth, Pill } from '@kud/ink-ui';
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';
@@ -8,8 +8,8 @@ import { spawn } from 'child_process';
8
8
  import { readFileSync, mkdirSync, writeFileSync, existsSync, readdirSync, statSync, watch, rmSync } from 'fs';
9
9
  import { join, dirname, basename } from 'path';
10
10
  import { homedir } from 'os';
11
- import { depthOf, checkoutDirs, profileOf, inboxConfig, relativeTime, filterBySearch, filterByRepos, filterByOrigin, PIN_MARK, sizeOf, sizePartsOf, labelPriority } from '@kud/gh-workflow';
12
- export { PIN_MARK, checkoutDirs, configureInbox, filterByOrigin, filterByRepos, filterBySearch, inboxConfig, insertRepoHeaders, labelPriority, layoutGHItems, profileOf, relativeTime, repoPriority, resetInboxConfig, sortByRecency, sortItems, whoseMove } from '@kud/gh-workflow';
11
+ import { depthOf, checkoutDirs, profileOf, inboxConfig, relativeTime, filterBySearch, filterByRepos, filterByOrigin, PIN_MARK, sizeOf, sizePartsOf, impliedLabels, labelPriority } from '@kud/gh-workflow';
12
+ export { PIN_MARK, checkoutDirs, configureInbox, filterByOrigin, filterByRepos, filterBySearch, impliedLabels, inboxConfig, insertRepoHeaders, labelPriority, layoutGHItems, profileOf, relativeTime, repoPriority, resetInboxConfig, sortByRecency, sortItems, whoseMove } from '@kud/gh-workflow';
13
13
 
14
14
  // src/components/comments-panel.tsx
15
15
  var ENTITIES = {
@@ -1925,7 +1925,7 @@ var ItemRow = ({
1925
1925
  const icon = merged ? MERGED_FRAMES[sparkFrame % MERGED_FRAMES.length] : transient && isDeparture(transient) ? TRANSIT_OUT_FRAMES[rampAt(TRANSIT_OUT_FRAMES.length)] : transient && isArrival(transient) ? TRANSIT_IN_FRAMES[rampAt(TRANSIT_IN_FRAMES.length)] : healthIcon;
1926
1926
  const color = merged ? MERGED_COLOUR : transient ? TRANSIT_COLOUR[transient] : healthColor2;
1927
1927
  const spokeLast = !!login && !!item.lastActor && item.lastActor === login;
1928
- const [turnIcon, turnColor] = item.pinned ? [PIN_MARK, "#FF8700"] : !login || !item.lastActor ? [" ", "white"] : spokeLast ? ["\u2192", "#888888"] : ["\u2190", "#FF8700"];
1928
+ const [turnIcon, turnColor] = item.pinned ? [PIN_MARK, "#FF8700"] : !login || !item.lastActor ? [" ", "white"] : spokeLast ? ["\u2192", colors.secondary] : ["\u2190", "#FF8700"];
1929
1929
  const numStr = `#${item.number}`.padEnd(7);
1930
1930
  const showAuthor = !!item.author && item.author !== login;
1931
1931
  const sizeLabel = sizeOf(item);
@@ -1935,7 +1935,8 @@ var ItemRow = ({
1935
1935
  const mergedLabel = merged ? "merged" : "";
1936
1936
  const pillCaps = [mergedLabel, farewellLabel].filter(Boolean).length * 2;
1937
1937
  const repoLabel = depthOf(item) > 0 ? item.repo : "";
1938
- const labelNames = [...item.labels ?? []].sort((a, b) => labelPriority(a) - labelPriority(b) || a.localeCompare(b)).slice(0, 2);
1938
+ const implied = impliedLabels(item.repo);
1939
+ const labelNames = (item.labels ?? []).filter((l) => !implied.includes(l)).sort((a, b) => labelPriority(a) - labelPriority(b) || a.localeCompare(b)).slice(0, 2);
1939
1940
  const givingUp = {
1940
1941
  author: false,
1941
1942
  size: false,
@@ -2003,7 +2004,7 @@ var ItemRow = ({
2003
2004
  children: truncate2(item.title, titleMax) + " "
2004
2005
  }
2005
2006
  ),
2006
- labelLabel ? /* @__PURE__ */ jsx(Text3, { dimColor: true, children: labelLabel + " " }) : null,
2007
+ labelLabel ? /* @__PURE__ */ jsx(Text3, { color: colors.secondary, children: labelLabel + " " }) : null,
2007
2008
  repoLabel && !givingUp.repo ? /* @__PURE__ */ jsx(Text3, { dimColor: true, children: repoLabel }) : null,
2008
2009
  sizeParts && !givingUp.size ? /* @__PURE__ */ jsxs(Text3, { children: [
2009
2010
  " ",
@@ -2011,7 +2012,7 @@ var ItemRow = ({
2011
2012
  " ",
2012
2013
  /* @__PURE__ */ jsx(Text3, { color: colors.error, children: sizeParts.removed })
2013
2014
  ] }) : null,
2014
- unresolvedLabel && !givingUp.threads ? /* @__PURE__ */ jsx(Text3, { bold: !spokeLast, color: spokeLast ? "#888888" : "#FF8700", children: " " + unresolvedLabel }) : null,
2015
+ unresolvedLabel && !givingUp.threads ? /* @__PURE__ */ jsx(Text3, { bold: !spokeLast, color: spokeLast ? colors.secondary : "#FF8700", children: " " + unresolvedLabel }) : null,
2015
2016
  showAuthor && !givingUp.author ? /* @__PURE__ */ jsx(Text3, { dimColor: true, italic: true, children: " by " + item.author }) : null,
2016
2017
  ageLabel && !givingUp.age ? /* @__PURE__ */ jsx(Text3, { dimColor: true, children: " " + ageLabel }) : null,
2017
2018
  mergedLabel && !backdropped ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -2082,7 +2083,7 @@ var ActionMenu = ({
2082
2083
  };
2083
2084
  var TURN_LEGEND = [
2084
2085
  ["\u2190", "#FF8700", "They spoke last \xB7 your turn"],
2085
- ["\u2192", "#888888", "You spoke last \xB7 waiting on them"]
2086
+ ["\u2192", colors.secondary, "You spoke last \xB7 waiting on them"]
2086
2087
  ];
2087
2088
  var CELL_GUTTER = 2;
2088
2089
  var COL_GAP = 3;
@@ -2366,6 +2367,7 @@ var BrowseScreen = ({
2366
2367
  sidebar
2367
2368
  }) => {
2368
2369
  const { rows } = useWindowSize();
2370
+ const { exit } = useApp();
2369
2371
  const applyWork = (secs) => origin ? filterByOrigin(secs, origin.show, origin.match, login) : secs;
2370
2372
  const initialSections = applyWork(sections);
2371
2373
  const [localSections, setLocalSections] = useState(initialSections);
@@ -2696,7 +2698,7 @@ var BrowseScreen = ({
2696
2698
  setTabIdx(
2697
2699
  (i) => (i + (key.shift ? -1 : 1) + localSections.length) % localSections.length
2698
2700
  );
2699
- if (input === "q") process.exit(0);
2701
+ if (input === "q") exit();
2700
2702
  if (input === "r") {
2701
2703
  onRefresh?.();
2702
2704
  return;
@@ -3131,8 +3133,9 @@ var NoRowsScreen = ({
3131
3133
  detail,
3132
3134
  onRetry
3133
3135
  }) => {
3136
+ const { exit } = useApp();
3134
3137
  useInput((input) => {
3135
- if (input === "q") process.exit(0);
3138
+ if (input === "q") exit();
3136
3139
  if (input === "r") onRetry();
3137
3140
  });
3138
3141
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/gh-ink",
3
- "version": "0.51.2",
3
+ "version": "0.52.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",
@@ -49,8 +49,8 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@kud/gh": "0.16.0",
52
- "@kud/gh-workflow": "0.9.0",
53
- "@kud/ink-ui": "0.25.0",
52
+ "@kud/gh-workflow": "0.11.0",
53
+ "@kud/ink-ui": "0.28.2",
54
54
  "zx": "8.8.5"
55
55
  },
56
56
  "devDependencies": {