@kud/gh-ink 0.38.0 → 0.38.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
@@ -61,16 +61,15 @@ type Sidebar = {
61
61
  */
62
62
  declare const SIDEBAR_COLS = 30;
63
63
  /**
64
- * A right-hand rail of initiatives, standing beside the list.
64
+ * How many rows fit in `height` — one fewer than would physically fit whenever
65
+ * that means anything is left over, to buy the line that says so.
65
66
  *
66
- * Two lines per row rather than one, because both halves are load-bearing and
67
- * neither survives the other being cut: a key with no words cannot be read at a
68
- * glance, and words with no key cannot be opened. Thirty columns is not enough
69
- * for both on one line, so they stack.
70
- *
71
- * Presentational, like every other row renderer here — it takes no keyboard and
72
- * holds no cursor. Whether the rail is shown at all is the host's state.
67
+ * Computed rather than left to the layout, because the layout's answer is to CUT,
68
+ * silently. A roadmap quietly missing its last three initiatives looks exactly
69
+ * like a roadmap that has none, and the whole reason the rail exists is that an
70
+ * initiative with nothing moving on it was invisible.
73
71
  */
72
+ declare const railCapacity: (height: number, rows: number) => number;
74
73
  declare const SidePanel: ({ sidebar, height, }: {
75
74
  sidebar: Sidebar;
76
75
  height?: number;
@@ -676,4 +675,4 @@ declare const matchesFilter: (repo: string, filter: RepoFilter) => boolean;
676
675
  */
677
676
  declare const parsePatterns: (value: string) => string[];
678
677
 
679
- export { type Action, ActionMenu, type AnyItem, App, COLS, type CiStatus, CiStatusLine, type CiStatusState, CommentsPanel, type CommentsPanelProps, type DetailContext, type ExplainSection, type ExtensionTarget, type GHDetail, type GHItem, HealthPanel, type HealthPanelProps, type InboxBudget, type InboxConfig, type InboxExtension, type JiraTransition, type OriginSplit, PIN_MARK, type RepoFilter, type RepoHeader, type RepoProfile, SIDEBAR_COLS, type Section, type ShowLess, type ShowMore, SidePanel, type Sidebar, type SidebarRow, type Standing, type SubgroupHeader, type TaskRow, budgetNotice, buildActions, buildCheckoutCmd, checkoutDirs, clipboard, configureInbox, drillCmd, explainGhAction, explainItem, filterByOrigin, filterByRepos, filterBySearch, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, inboxConfig, insertRepoHeaders, itermRun, jumpToRepo, jumpToRepoPane, layoutGHItems, matchesFilter, maxViewStart, moveCursor, openInTab, parsePatterns, profileOf, readCache, relativeTime, renderMarkdown, repoPriority, reposInSections, resetInboxConfig, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, signatureOf, sortByRecency, sortItems, toCiStatusState, topLevelCount, truncate, useActionMenu, whoseMove, windowCount, withHeaders, withoutItem, writeCache };
678
+ export { type Action, ActionMenu, type AnyItem, App, COLS, type CiStatus, CiStatusLine, type CiStatusState, CommentsPanel, type CommentsPanelProps, type DetailContext, type ExplainSection, type ExtensionTarget, type GHDetail, type GHItem, HealthPanel, type HealthPanelProps, type InboxBudget, type InboxConfig, type InboxExtension, type JiraTransition, type OriginSplit, PIN_MARK, type RepoFilter, type RepoHeader, type RepoProfile, SIDEBAR_COLS, type Section, type ShowLess, type ShowMore, SidePanel, type Sidebar, type SidebarRow, type Standing, type SubgroupHeader, type TaskRow, budgetNotice, buildActions, buildCheckoutCmd, checkoutDirs, clipboard, configureInbox, drillCmd, explainGhAction, explainItem, filterByOrigin, filterByRepos, filterBySearch, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, inboxConfig, insertRepoHeaders, itermRun, jumpToRepo, jumpToRepoPane, layoutGHItems, matchesFilter, maxViewStart, moveCursor, openInTab, parsePatterns, profileOf, railCapacity, readCache, relativeTime, renderMarkdown, repoPriority, reposInSections, resetInboxConfig, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, signatureOf, sortByRecency, sortItems, toCiStatusState, topLevelCount, truncate, useActionMenu, whoseMove, windowCount, withHeaders, withoutItem, writeCache };
package/dist/index.js CHANGED
@@ -588,32 +588,43 @@ var SIDEBAR_COLS = 30;
588
588
  var GUTTER = 1;
589
589
  var CONTENT = SIDEBAR_COLS - GUTTER;
590
590
  var truncate = (text, max) => [...text].length <= max ? text : [...text].slice(0, Math.max(0, max - 1)).join("") + "\u2026";
591
+ var ROW_LINES = 3;
592
+ var HEADING_LINES = 2;
593
+ var railCapacity = (height, rows) => {
594
+ const fits = Math.max(0, Math.floor((height - HEADING_LINES) / ROW_LINES));
595
+ return fits >= rows ? rows : Math.max(0, fits - 1);
596
+ };
591
597
  var SidePanel = ({
592
598
  sidebar,
593
599
  height
594
- }) => /* @__PURE__ */ jsxs(
595
- Box,
596
- {
597
- flexDirection: "column",
598
- width: SIDEBAR_COLS,
599
- flexShrink: 0,
600
- height,
601
- children: [
602
- /* @__PURE__ */ jsxs(Box, { marginBottom: 1, paddingLeft: GUTTER, children: [
603
- /* @__PURE__ */ jsx(Text, { color: ACCENT, bold: true, children: "\xBB " }),
604
- /* @__PURE__ */ jsx(Text, { bold: true, children: sidebar.title })
605
- ] }),
606
- sidebar.rows.length === 0 ? /* @__PURE__ */ jsx(Box, { paddingLeft: GUTTER + 2, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: "nothing open" }) }) : sidebar.rows.map((row) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
607
- /* @__PURE__ */ jsxs(Box, { paddingLeft: GUTTER, children: [
608
- /* @__PURE__ */ jsx(Text, { color: ACCENT, bold: true, children: row.wantsYou ? "\u2190 " : " " }),
609
- /* @__PURE__ */ jsx(Text, { color: ACCENT, children: row.key }),
610
- row.live !== void 0 ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: ` ${row.live} live` }) : null
600
+ }) => {
601
+ const shown = height === void 0 ? sidebar.rows : sidebar.rows.slice(0, railCapacity(height, sidebar.rows.length));
602
+ const hidden = sidebar.rows.length - shown.length;
603
+ return /* @__PURE__ */ jsxs(
604
+ Box,
605
+ {
606
+ flexDirection: "column",
607
+ width: SIDEBAR_COLS,
608
+ flexShrink: 0,
609
+ height,
610
+ children: [
611
+ /* @__PURE__ */ jsxs(Box, { marginBottom: 1, paddingLeft: GUTTER, children: [
612
+ /* @__PURE__ */ jsx(Text, { color: ACCENT, bold: true, children: "\xBB " }),
613
+ /* @__PURE__ */ jsx(Text, { bold: true, children: sidebar.title })
611
614
  ] }),
612
- /* @__PURE__ */ jsx(Box, { paddingLeft: GUTTER + 2, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: truncate(row.label, CONTENT - 2) }) })
613
- ] }, row.key))
614
- ]
615
- }
616
- );
615
+ sidebar.rows.length === 0 ? /* @__PURE__ */ jsx(Box, { paddingLeft: GUTTER + 2, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: "nothing open" }) }) : shown.map((row) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
616
+ /* @__PURE__ */ jsxs(Box, { paddingLeft: GUTTER, children: [
617
+ /* @__PURE__ */ jsx(Text, { color: ACCENT, bold: true, children: row.wantsYou ? "\u2190 " : " " }),
618
+ /* @__PURE__ */ jsx(Text, { color: ACCENT, children: row.key }),
619
+ row.live !== void 0 ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: ` ${row.live} live` }) : null
620
+ ] }),
621
+ /* @__PURE__ */ jsx(Box, { paddingLeft: GUTTER + 2, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: truncate(row.label, CONTENT - 2) }) })
622
+ ] }, row.key)),
623
+ hidden > 0 ? /* @__PURE__ */ jsx(Box, { paddingLeft: GUTTER + 2, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: `+${hidden} more` }) }) : null
624
+ ]
625
+ }
626
+ );
627
+ };
617
628
  var healthDisplay = {
618
629
  none: { glyph: " ", color: colors.muted },
619
630
  draft: { glyph: "~", color: colors.muted },
@@ -3439,4 +3450,4 @@ var matchesFilter = (repo, filter) => {
3439
3450
  };
3440
3451
  var parsePatterns = (value) => value.split(",").map((p) => p.trim()).filter(Boolean);
3441
3452
 
3442
- export { ActionMenu, App, COLS, CiStatusLine, CommentsPanel, HealthPanel, PIN_MARK, SIDEBAR_COLS, SidePanel, budgetNotice, buildActions, buildCheckoutCmd, checkoutDirs, clipboard, configureInbox, drillCmd, explainGhAction, explainItem, filterByOrigin, filterByRepos, filterBySearch, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, inboxConfig, insertRepoHeaders, itermRun, jumpToRepo, jumpToRepoPane, layoutGHItems, matchesFilter, maxViewStart, moveCursor, openInTab, parsePatterns, profileOf, readCache, relativeTime, renderMarkdown, repoPriority, reposInSections, resetInboxConfig, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, signatureOf, sortByRecency, sortItems, toCiStatusState, topLevelCount, truncate2 as truncate, useActionMenu, whoseMove, windowCount, withHeaders, withoutItem, writeCache };
3453
+ export { ActionMenu, App, COLS, CiStatusLine, CommentsPanel, HealthPanel, PIN_MARK, SIDEBAR_COLS, SidePanel, budgetNotice, buildActions, buildCheckoutCmd, checkoutDirs, clipboard, configureInbox, drillCmd, explainGhAction, explainItem, filterByOrigin, filterByRepos, filterBySearch, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, inboxConfig, insertRepoHeaders, itermRun, jumpToRepo, jumpToRepoPane, layoutGHItems, matchesFilter, maxViewStart, moveCursor, openInTab, parsePatterns, profileOf, railCapacity, readCache, relativeTime, renderMarkdown, repoPriority, reposInSections, resetInboxConfig, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, signatureOf, sortByRecency, sortItems, toCiStatusState, topLevelCount, truncate2 as truncate, useActionMenu, whoseMove, windowCount, withHeaders, withoutItem, writeCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/gh-ink",
3
- "version": "0.38.0",
3
+ "version": "0.38.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",