@kud/gh-ink 0.75.1 → 0.75.2

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
@@ -196,7 +196,11 @@ declare const SidePanel: ({ sidebar, liveLabel, width, height, focused, cursor,
196
196
  type FocusSlot = {
197
197
  /** The mark in front of the row, accent by default. */
198
198
  mark?: string;
199
- /** The mark's colour. Defaults to the accent. */
199
+ /**
200
+ * The mark's colour in the list gutter (`focusCellFor`). Defaults to the
201
+ * accent. The ready row's pill takes its accent from its own
202
+ * `variant="accent"`, so this never reaches the pill.
203
+ */
200
204
  markColor?: string;
201
205
  /** What the row is a slot OF, in the host's words: `focus`, say. */
202
206
  label: string;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React2, { createContext, useState, useRef, useContext, useEffect, useCallback, useMemo } from 'react';
2
2
  import { useWindowSize, useInput, Text, Box } from 'ink';
3
- import { colors, ScrollView, TextInput, Pill, getIconMode, FooterHints, useAppKeys, LoadingScreen, StatusMessage, useFilterMode, useListCursor, CommandPalette, Tabs, ProgressBar, pillWidth } from '@kud/ink-ui';
3
+ import { colors, ScrollView, TextInput, Pill, getIconMode, FooterHints, useAppKeys, LoadingScreen, pillWidth, StatusMessage, useFilterMode, useListCursor, CommandPalette, Tabs, ProgressBar } from '@kud/ink-ui';
4
4
  import { isPassCheck, isFailCheck, isInconclusiveCheck, resolveThread, unresolveThread, replyToThread, rerunFailedRun, mergePr, reRequestReviewer, parseRef, formatRef, fetchItemNode } 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, refCandidates, resolveRef } from '@kud/gh-workflow';
@@ -1707,7 +1707,7 @@ var cells = (s) => [...s].length;
1707
1707
  var titleBudgetOf = (focus, label, width, jumpKey) => {
1708
1708
  const hint = jumpKey ? jumpKey : void 0;
1709
1709
  const mark = focus.mark ?? FOCUS_MARK;
1710
- const head = 2 + cells(mark) + 1 + cells(label) + 2 + (focus.marker ? cells(focus.marker) + 1 : 0) + cells(focus.ref) + 2;
1710
+ const head = 2 + pillWidth(`${mark} ${label}`) + 2 + (focus.marker ? cells(focus.marker) + 1 : 0) + cells(focus.ref) + 2;
1711
1711
  const hintCells = hint ? 3 + cells(hint) + 5 : 0;
1712
1712
  const tail = 3 + cells(focus.reason);
1713
1713
  const titleMax = width - head - tail - hintCells;
@@ -1747,8 +1747,8 @@ var FocusSlotLine = ({
1747
1747
  const { title, reason, hint } = titleBudgetOf(focus, label, width, jumpKey);
1748
1748
  return /* @__PURE__ */ jsxs(Box, { marginBottom: 1, children: [
1749
1749
  /* @__PURE__ */ jsx(Text, { children: " " }),
1750
- /* @__PURE__ */ jsx(Text, { color: focus.markColor ?? colors.accent, bold: true, children: `${mark} ` }),
1751
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: `${label} ` }),
1750
+ /* @__PURE__ */ jsx(Pill, { variant: "accent", tone: "tonal", children: `${mark} ${label}` }),
1751
+ /* @__PURE__ */ jsx(Text, { children: " " }),
1752
1752
  focus.marker ? /* @__PURE__ */ jsx(Text, { children: `${focus.marker} ` }) : null,
1753
1753
  /* @__PURE__ */ jsx(Text, { color: focusRefColor(focus), bold: true, children: `${focus.ref} ` }),
1754
1754
  /* @__PURE__ */ jsx(Text, { bold: true, children: title }),
@@ -4728,7 +4728,15 @@ var App = ({
4728
4728
  onSettled
4729
4729
  }) => {
4730
4730
  const { rows } = useWindowSize();
4731
- const [state, setState] = useState({ phase: "loading" });
4731
+ const [launchCache] = useState(() => cacheKey ? readCache(cacheKey) : null);
4732
+ const launchPainted = !!launchCache && launchCache.sections.length > 0;
4733
+ const [state, setState] = useState(
4734
+ () => launchPainted && launchCache ? {
4735
+ phase: "browse",
4736
+ sections: launchCache.sections,
4737
+ login: launchCache.login
4738
+ } : { phase: "loading" }
4739
+ );
4732
4740
  const browsePeel = useRef(null);
4733
4741
  const drillPeel = useRef(null);
4734
4742
  const [typing, setTyping] = useState(false);
@@ -4758,7 +4766,9 @@ var App = ({
4758
4766
  });
4759
4767
  const [pending, setPending] = useState(null);
4760
4768
  const [refreshing, setRefreshing] = useState(false);
4761
- const [fetchedAt, setFetchedAt] = useState(null);
4769
+ const [fetchedAt, setFetchedAt] = useState(
4770
+ launchPainted && launchCache ? launchCache.at : null
4771
+ );
4762
4772
  const [refreshError, setRefreshError] = useState(null);
4763
4773
  const [ciStatusState, setCiStatusState] = useState({
4764
4774
  kind: "loading"
@@ -4777,8 +4787,12 @@ var App = ({
4777
4787
  if (prev.kind !== "ready") return next;
4778
4788
  return stripSignature(prev.strip) === stripSignature(strip) ? prev : next;
4779
4789
  });
4780
- const displayedKey = useRef("");
4781
- const displayedSections = useRef([]);
4790
+ const displayedKey = useRef(
4791
+ launchPainted && launchCache ? signatureOf(launchCache.sections) : ""
4792
+ );
4793
+ const displayedSections = useRef(
4794
+ launchPainted && launchCache ? launchCache.sections : []
4795
+ );
4782
4796
  const [transients, setTransients] = useState(NO_TRANSIENTS);
4783
4797
  const transitTabs = useRef(/* @__PURE__ */ new Map());
4784
4798
  const [heldSince, setHeldSince] = useState(NO_HOLDS);
@@ -5043,21 +5057,7 @@ var App = ({
5043
5057
  setTimeout(() => applyOrRefresh(), 1500);
5044
5058
  };
5045
5059
  useEffect(() => {
5046
- const cached = cacheKey ? readCache(cacheKey) : null;
5047
- const painted = !!cached && cached.sections.length > 0;
5048
- if (painted && cached) {
5049
- displayedKey.current = signatureOf(cached.sections);
5050
- displayedSections.current = cached.sections;
5051
- setFetchedAt(cached.at);
5052
- if (cached.sidebar) setSidebar(cached.sidebar);
5053
- if (cached.focus !== void 0) setFocus(cached.focus);
5054
- setState({
5055
- phase: "browse",
5056
- sections: cached.sections,
5057
- login: cached.login
5058
- });
5059
- }
5060
- if (!painted || !isFresh(cached)) revalidate();
5060
+ if (!launchPainted || !isFresh(launchCache)) revalidate();
5061
5061
  }, []);
5062
5062
  useEffect(() => {
5063
5063
  if (!hasCiStatus || !ciFetcher) return;
@@ -5133,8 +5133,12 @@ var App = ({
5133
5133
  () => cacheKey ? readCache(cacheKey)?.budget ?? null : null
5134
5134
  );
5135
5135
  const [appliedSummary, setAppliedSummary] = useState("");
5136
- const [sidebar, setSidebar] = useState(void 0);
5137
- const [focus, setFocus] = useState(void 0);
5136
+ const [sidebar, setSidebar] = useState(
5137
+ launchPainted ? launchCache?.sidebar : void 0
5138
+ );
5139
+ const [focus, setFocus] = useState(
5140
+ launchPainted ? launchCache?.focus : void 0
5141
+ );
5138
5142
  const [skippedForBudget, setSkippedForBudget] = useState(false);
5139
5143
  const [mergedUrls, setMergedUrls] = useState([]);
5140
5144
  const [leavingUrls, setLeavingUrls] = useState([]);
@@ -5202,7 +5206,7 @@ var App = ({
5202
5206
  flexDirection: "column",
5203
5207
  minHeight: Math.max(
5204
5208
  5,
5205
- rows - 6 - (hasCiStatus ? 2 : 0) - (hasStrip ? 2 : 0) - (hasFocusSlot ? 2 : 0)
5209
+ rows - 5 - (hasCiStatus ? 2 : 0) - (hasStrip ? 2 : 0) - (hasFocusSlot ? 2 : 0)
5206
5210
  ),
5207
5211
  children: state.phase === "loading" ? /* @__PURE__ */ jsx(LoadingScreen, { label: `Fetching ${title}\u2026` }) : /* @__PURE__ */ jsx(
5208
5212
  NoRowsScreen,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/gh-ink",
3
- "version": "0.75.1",
3
+ "version": "0.75.2",
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",
@@ -44,7 +44,7 @@
44
44
  "access": "public"
45
45
  },
46
46
  "peerDependencies": {
47
- "@kud/ink-ui": ">=0.39.0 <1",
47
+ "@kud/ink-ui": ">=0.41.0 <1",
48
48
  "ink": ">=7",
49
49
  "react": ">=19"
50
50
  },
@@ -54,7 +54,7 @@
54
54
  "zx": "8.8.5"
55
55
  },
56
56
  "devDependencies": {
57
- "@kud/ink-ui": "0.39.0",
57
+ "@kud/ink-ui": "0.41.0",
58
58
  "@types/node": "22.20.1",
59
59
  "@types/react": "19.2.17",
60
60
  "ink": "7.1.0",