@kud/gh-ink 0.76.1 → 0.76.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
@@ -997,7 +997,8 @@ declare const ActionMenu: ({ item, actions, cursor, cols, }: {
997
997
  * Content columns the menu may take. The width is fixed from the longest
998
998
  * row and the title — see `menuWidthFor` — so it never
999
999
  * resizes as the cursor moves. A host beside a rail passes what the list
1000
- * has; everywhere else the frame's own width is the right answer.
1000
+ * has; everywhere else the frame's own width is the right answer, read live
1001
+ * rather than from the load-time sample — see `useFrameCols`.
1001
1002
  */
1002
1003
  cols?: number;
1003
1004
  }) => React.JSX.Element;
package/dist/index.js CHANGED
@@ -2358,6 +2358,7 @@ var FRAME_PAD_X = 1;
2358
2358
  var FRAME_CHROME_COLS = 2 + FRAME_PAD_X * 2;
2359
2359
  var COLS = (process.stdout.columns ?? 120) - FRAME_CHROME_COLS;
2360
2360
  var MODAL_CHROME_COLS = 2 + 1 * 2;
2361
+ var useFrameCols = () => useWindowSize().columns - FRAME_CHROME_COLS;
2361
2362
  var ROW_MAX_COLS = 140;
2362
2363
  var OVERLAY_BG = "#22222e";
2363
2364
  var SELECTION_BG = "#16161f";
@@ -2854,6 +2855,7 @@ var InboxHeader = ({
2854
2855
  appliedSummary,
2855
2856
  fetchedAt
2856
2857
  }) => {
2858
+ const frameCols = useFrameCols();
2857
2859
  const total = sections.reduce((n, s) => n + workCount(s), 0);
2858
2860
  const countSeg = loading ? " loading\u2026 " : quiet ? " " : ` ${String(total).padStart(3)} item${total !== 1 ? "s" : ""} \xB7 `;
2859
2861
  const userSeg = loading || quiet ? "" : `@${login} `;
@@ -2863,7 +2865,7 @@ var InboxHeader = ({
2863
2865
  const statusSeg = statusText ? statusText + " " : "";
2864
2866
  const fill = Math.max(
2865
2867
  4,
2866
- COLS - brand.length - countSeg.length - userSeg.length - workLabel.length - budgetSeg.length - statusSeg.length
2868
+ frameCols - brand.length - countSeg.length - userSeg.length - workLabel.length - budgetSeg.length - statusSeg.length
2867
2869
  );
2868
2870
  return /* @__PURE__ */ jsxs(Box, { marginBottom: 1, children: [
2869
2871
  /* @__PURE__ */ jsx(Text3, { color: colors.accent, bold: true, children: brand }),
@@ -3002,7 +3004,7 @@ var ItemRow = ({
3002
3004
  prefix = "",
3003
3005
  parent,
3004
3006
  sparkFrame = 0,
3005
- cols = COLS,
3007
+ cols,
3006
3008
  markerCols = 0,
3007
3009
  uniformLabels = [],
3008
3010
  columns,
@@ -3201,8 +3203,9 @@ var ActionMenu = ({
3201
3203
  item,
3202
3204
  actions,
3203
3205
  cursor,
3204
- cols = COLS
3206
+ cols
3205
3207
  }) => {
3208
+ const frameCols = useFrameCols();
3206
3209
  const showIcons = getIconMode() === "nerd" && actions.some((row) => !isMenuGap(row) && row.icon !== void 0);
3207
3210
  const keyWidth = Math.max(
3208
3211
  0,
@@ -3224,7 +3227,7 @@ var ActionMenu = ({
3224
3227
  const lead = leadNum ? `${leadNum} \xB7 ` : "";
3225
3228
  const rest = confirming ? `Close #${number}?` : item.kind === "task" ? item.summary : item.kind === "pr" || item.kind === "issue" ? item.title : "";
3226
3229
  const titleWidth = [...lead].length + [...rest].length + TITLE_SLACK;
3227
- const width = menuWidthFor(cols, contentWidth, titleWidth);
3230
+ const width = menuWidthFor(cols ?? frameCols, contentWidth, titleWidth);
3228
3231
  const inner = Math.max(1, width - 4);
3229
3232
  const restText = [...lead].length + [...rest].length + TITLE_SLACK <= inner ? rest : [...rest].slice(0, Math.max(0, inner - [...lead].length - 1 - TITLE_SLACK)).join("") + "\u2026";
3230
3233
  const isCloseRow = (row) => menuTone(row) === "error";
@@ -3467,26 +3470,29 @@ var HelpModal = ({
3467
3470
  }
3468
3471
  );
3469
3472
  };
3470
- var ExplainModal = ({ item, login }) => /* @__PURE__ */ jsxs(
3471
- Box,
3472
- {
3473
- flexDirection: "column",
3474
- borderStyle: "round",
3475
- borderColor: colors.info,
3476
- backgroundColor: OVERLAY_BG,
3477
- paddingX: 1,
3478
- width: Math.min(COLS, 78),
3479
- children: [
3480
- /* @__PURE__ */ jsx(Text3, { color: colors.accent, bold: true, children: `#${item.number} \xB7 ${item.repo}` }),
3481
- /* @__PURE__ */ jsx(Text3, { children: item.title }),
3482
- explainItem(item, login).map((section) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
3483
- /* @__PURE__ */ jsx(Text3, { bold: true, dimColor: true, children: section.heading }),
3484
- section.lines.map((line, i) => /* @__PURE__ */ jsx(Text3, { children: " " + line }, i))
3485
- ] }, section.heading)),
3486
- /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(Text3, { dimColor: true, children: "esc \xB7 e close" }) })
3487
- ]
3488
- }
3489
- );
3473
+ var ExplainModal = ({ item, login }) => {
3474
+ const frameCols = useFrameCols();
3475
+ return /* @__PURE__ */ jsxs(
3476
+ Box,
3477
+ {
3478
+ flexDirection: "column",
3479
+ borderStyle: "round",
3480
+ borderColor: colors.info,
3481
+ backgroundColor: OVERLAY_BG,
3482
+ paddingX: 1,
3483
+ width: Math.min(frameCols, 78),
3484
+ children: [
3485
+ /* @__PURE__ */ jsx(Text3, { color: colors.accent, bold: true, children: `#${item.number} \xB7 ${item.repo}` }),
3486
+ /* @__PURE__ */ jsx(Text3, { children: item.title }),
3487
+ explainItem(item, login).map((section) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
3488
+ /* @__PURE__ */ jsx(Text3, { bold: true, dimColor: true, children: section.heading }),
3489
+ section.lines.map((line, i) => /* @__PURE__ */ jsx(Text3, { children: " " + line }, i))
3490
+ ] }, section.heading)),
3491
+ /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(Text3, { dimColor: true, children: "esc \xB7 e close" }) })
3492
+ ]
3493
+ }
3494
+ );
3495
+ };
3490
3496
  var RepoPicker = ({
3491
3497
  repos,
3492
3498
  selected,
@@ -3587,6 +3593,7 @@ var BrowseScreen = ({
3587
3593
  onRestore
3588
3594
  }) => {
3589
3595
  const { rows } = useWindowSize();
3596
+ const frameCols = useFrameCols();
3590
3597
  const applyWork = (secs) => origin ? filterByOrigin(secs, origin.show, origin.match, login) : secs;
3591
3598
  const initialSections = applyWork(sections);
3592
3599
  const [localSections, setLocalSections] = useState(initialSections);
@@ -3756,8 +3763,8 @@ var BrowseScreen = ({
3756
3763
  useEffect(() => {
3757
3764
  onTyping?.(searchInput || palette !== null);
3758
3765
  }, [searchInput, palette, onTyping]);
3759
- const railCols = railWidth(COLS);
3760
- const listCols = showRail ? COLS - railCols : COLS;
3766
+ const railCols = railWidth(frameCols);
3767
+ const listCols = showRail ? frameCols - railCols : frameCols;
3761
3768
  const { trailingColumns, numberCols } = listColumnsOf(localSections);
3762
3769
  const rowCols = Math.min(listCols, ROW_MAX_COLS);
3763
3770
  const trailingShed = sectionShedOf(
@@ -4531,7 +4538,7 @@ var BrowseScreen = ({
4531
4538
  {
4532
4539
  strip: stripState.kind === "ready" ? stripState.strip : void 0,
4533
4540
  label: stripLabel,
4534
- width: COLS
4541
+ width: frameCols
4535
4542
  }
4536
4543
  ) : null,
4537
4544
  reserveFocusRow ? /* @__PURE__ */ jsx(
@@ -4540,7 +4547,7 @@ var BrowseScreen = ({
4540
4547
  focus,
4541
4548
  label: focusLabel,
4542
4549
  empty: focusEmpty,
4543
- width: COLS,
4550
+ width: frameCols,
4544
4551
  jumpKey: FOCUS_JUMP_KEY
4545
4552
  }
4546
4553
  ) : null,
@@ -4552,7 +4559,7 @@ var BrowseScreen = ({
4552
4559
  Tabs,
4553
4560
  {
4554
4561
  active: section.id,
4555
- width: COLS,
4562
+ width: frameCols,
4556
4563
  items: localSections.map((s) => ({
4557
4564
  value: s.id,
4558
4565
  label: s.label,
@@ -4768,6 +4775,7 @@ var App = ({
4768
4775
  onSettled
4769
4776
  }) => {
4770
4777
  const { rows } = useWindowSize();
4778
+ const frameCols = useFrameCols();
4771
4779
  const [launchCache] = useState(() => cacheKey ? readCache(cacheKey) : null);
4772
4780
  const launchPainted = !!launchCache && launchCache.sections.length > 0;
4773
4781
  const [state, setState] = useState(
@@ -5228,7 +5236,7 @@ var App = ({
5228
5236
  {
5229
5237
  strip: stripState.kind === "ready" ? stripState.strip : void 0,
5230
5238
  label: stripLabel,
5231
- width: COLS
5239
+ width: frameCols
5232
5240
  }
5233
5241
  ) : null,
5234
5242
  hasFocusSlot ? /* @__PURE__ */ jsx(
@@ -5237,7 +5245,7 @@ var App = ({
5237
5245
  focus: void 0,
5238
5246
  label: focusLabel,
5239
5247
  empty: focusEmpty,
5240
- width: COLS
5248
+ width: frameCols
5241
5249
  }
5242
5250
  ) : null,
5243
5251
  /* @__PURE__ */ jsx(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/gh-ink",
3
- "version": "0.76.1",
3
+ "version": "0.76.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",