@kud/gh-ink 0.15.0 → 0.16.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.
Files changed (2) hide show
  1. package/dist/index.js +28 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1584,6 +1584,8 @@ var TRANSIT_LABEL = {
1584
1584
  out: "GONE",
1585
1585
  changed: "UPDATED"
1586
1586
  };
1587
+ var TAB_MARK = "\u25CF";
1588
+ var tabLabel = (label, marked, id) => marked.size === 0 ? label : `${marked.has(id) ? TAB_MARK : " "} ${label}`;
1587
1589
  var ItemRow = ({
1588
1590
  item,
1589
1591
  active,
@@ -1616,12 +1618,27 @@ var ItemRow = ({
1616
1618
  ] });
1617
1619
  if (item.kind === "task") {
1618
1620
  const note = item.note ?? "";
1619
- const titleMax2 = Math.max(20, COLS - item.key.length - note.length - 10);
1621
+ const transitIcon = !transient ? " " : transient === "out" ? TRANSIT_OUT_FRAMES[sparkFrame % TRANSIT_OUT_FRAMES.length] : transient === "in" ? TRANSIT_IN_FRAMES[sparkFrame % TRANSIT_IN_FRAMES.length] : "\u25C9";
1622
+ const transitLabel2 = transient ? TRANSIT_LABEL[transient] : "";
1623
+ const titleMax2 = Math.max(
1624
+ 20,
1625
+ COLS - item.key.length - note.length - transitLabel2.length - 12
1626
+ );
1620
1627
  return /* @__PURE__ */ jsxs(Box, { marginTop: gap ? 1 : 0, children: [
1621
1628
  /* @__PURE__ */ jsx(Text2, { color: "cyan", children: active ? "\u276F " : " " }),
1629
+ /* @__PURE__ */ jsx(Text2, { bold: true, color: transient ? TRANSIT_COLOUR[transient] : void 0, children: transitIcon + " " }),
1622
1630
  /* @__PURE__ */ jsx(Text2, { color: "#FF8700", bold: active, children: item.key + " " }),
1623
- /* @__PURE__ */ jsx(Text2, { bold: active, children: truncate(item.summary, titleMax2) }),
1624
- note ? /* @__PURE__ */ jsx(Text2, { dimColor: true, children: ` ${note}` }) : null
1631
+ /* @__PURE__ */ jsx(
1632
+ Text2,
1633
+ {
1634
+ bold: active || transient === "in",
1635
+ dimColor: transient === "out",
1636
+ strikethrough: transient === "out",
1637
+ children: truncate(item.summary, titleMax2)
1638
+ }
1639
+ ),
1640
+ note ? /* @__PURE__ */ jsx(Text2, { dimColor: true, children: ` ${note}` }) : null,
1641
+ transitLabel2 ? /* @__PURE__ */ jsx(Text2, { bold: true, color: TRANSIT_COLOUR[transient], children: " " + transitLabel2 }) : null
1625
1642
  ] });
1626
1643
  }
1627
1644
  const { glyph: healthIcon, color: healthColor2 } = healthDisplay[item.health];
@@ -2050,6 +2067,13 @@ var BrowseScreen = ({
2050
2067
  setFlash(msg);
2051
2068
  setTimeout(() => setFlash(null), 2e3);
2052
2069
  };
2070
+ const markedTabs = useMemo(() => {
2071
+ const out = /* @__PURE__ */ new Set();
2072
+ if (!transients?.size) return out;
2073
+ for (const s of localSections)
2074
+ if (s.items.some((item) => transientOf(transients, item))) out.add(s.id);
2075
+ return out;
2076
+ }, [localSections, transients]);
2053
2077
  const [sparkFrame, setSparkFrame] = useState(0);
2054
2078
  const sparkling = (mergedUrls?.length ?? 0) > 0 || !!transients?.size && section.items.some((item) => transientOf(transients, item));
2055
2079
  useEffect(() => {
@@ -2400,7 +2424,7 @@ var BrowseScreen = ({
2400
2424
  active: section.id,
2401
2425
  items: localSections.map((s) => ({
2402
2426
  value: s.id,
2403
- label: s.label,
2427
+ label: tabLabel(s.label, markedTabs, s.id),
2404
2428
  count: topLevelCount(s)
2405
2429
  }))
2406
2430
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/gh-ink",
3
- "version": "0.15.0",
3
+ "version": "0.16.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",