@kud/gh-ink 0.31.0 → 0.32.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.
package/dist/index.d.ts CHANGED
@@ -124,6 +124,22 @@ type GHItem = {
124
124
  * never about the PR. Left unset, the section id decides as before.
125
125
  */
126
126
  standing?: Standing;
127
+ /**
128
+ * A turn the viewer has claimed BY HAND, outranking everything inferred.
129
+ *
130
+ * The inference below is good and still gets things wrong in one direction it
131
+ * cannot see: a row can be genuinely yours while every signal says otherwise —
132
+ * nothing red, no unresolved thread, nobody waiting on a word from you — and
133
+ * no amount of reading the PR harder will discover it. That knowledge lives
134
+ * with the viewer, so this is the field where they put it.
135
+ *
136
+ * It is a PIN, not a correction: it applies whether or not the row was already
137
+ * yours, which is why it does not pair with an opposite. The other direction —
138
+ * "no reply is owed for this particular comment" — is a fact about one event
139
+ * and belongs where the events are read, not here; a host expresses it by
140
+ * handing back a `lastActor` that no longer claims a turn.
141
+ */
142
+ pinned?: boolean;
127
143
  indent: boolean;
128
144
  };
129
145
  type TaskRow = {
@@ -240,7 +256,7 @@ declare const sortItems: (items: GHItem[]) => GHItem[];
240
256
  declare const sortByRecency: (items: GHItem[]) => GHItem[];
241
257
  declare const insertRepoHeaders: (items: GHItem[]) => AnyItem[];
242
258
  type Standing = "authored" | "queued" | "spoken";
243
- declare const whoseMove: (health: Health, sectionId: string, standing?: Standing, theySpokeLast?: boolean) => "you" | "them";
259
+ declare const whoseMove: (health: Health, sectionId: string, standing?: Standing, theySpokeLast?: boolean, pinned?: boolean) => "you" | "them";
244
260
  declare const layoutGHItems: (items: GHItem[], sectionId: string, login?: string) => AnyItem[];
245
261
  /**
246
262
  * A two-way repo split, when a host has one. `undefined` — the ordinary case —
package/dist/index.js CHANGED
@@ -838,6 +838,10 @@ var checksSentence = (d) => {
838
838
  return `Checks: ${parts.join(", ")}.`;
839
839
  };
840
840
  var turnSentences = (item, login) => {
841
+ if (item.pinned)
842
+ return [
843
+ "You pinned this (!). It stays under Your move until you unpin it, whatever else the row says."
844
+ ];
841
845
  if (!item.lastActor) return ["Nothing has been said on it yet."];
842
846
  const d = item.detail;
843
847
  const when = d?.lastEventAt ? `${relativeTime(d.lastEventAt)} ago` : "earlier";
@@ -937,8 +941,9 @@ var YOURS = {
937
941
  queued: ["waiting", "pending", "threads", "approved"],
938
942
  spoken: ["threads"]
939
943
  };
940
- var whoseMove = (health, sectionId, standing, theySpokeLast) => {
944
+ var whoseMove = (health, sectionId, standing, theySpokeLast, pinned) => {
941
945
  const position = standing ?? STANDING[sectionId] ?? "queued";
946
+ if (pinned) return "you";
942
947
  if (theySpokeLast && position === "authored") return "you";
943
948
  return YOURS[position].includes(health) ? "you" : "them";
944
949
  };
@@ -956,7 +961,8 @@ var layoutGHItems = (items, sectionId, login) => {
956
961
  i.health,
957
962
  sectionId,
958
963
  i.standing,
959
- !!login && !!i.lastActor && i.lastActor !== login
964
+ !!login && !!i.lastActor && i.lastActor !== login,
965
+ i.pinned
960
966
  ) === side
961
967
  )
962
968
  }));
@@ -1845,7 +1851,7 @@ var ItemRow = ({
1845
1851
  const icon = merged ? MERGED_FRAMES[sparkFrame % MERGED_FRAMES.length] : transient === "out" ? TRANSIT_OUT_FRAMES[sparkFrame % TRANSIT_OUT_FRAMES.length] : transient === "in" ? TRANSIT_IN_FRAMES[sparkFrame % TRANSIT_IN_FRAMES.length] : healthIcon;
1846
1852
  const color = merged ? MERGED_COLOUR : transient ? TRANSIT_COLOUR[transient] : healthColor2;
1847
1853
  const spokeLast = !!login && !!item.lastActor && item.lastActor === login;
1848
- const [turnIcon, turnColor] = !login || !item.lastActor ? [" ", "white"] : spokeLast ? ["\u2192", "#888888"] : ["\u2190", "#FF8700"];
1854
+ const [turnIcon, turnColor] = item.pinned ? ["!", "#FF8700"] : !login || !item.lastActor ? [" ", "white"] : spokeLast ? ["\u2192", "#888888"] : ["\u2190", "#FF8700"];
1849
1855
  const numStr = `#${item.number}`.padEnd(7);
1850
1856
  const showAuthor = !!item.author && item.author !== login;
1851
1857
  const unresolvedLabel = item.unresolved > 0 ? `\uF086 ${item.unresolved}` : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/gh-ink",
3
- "version": "0.31.0",
3
+ "version": "0.32.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",
@@ -48,7 +48,7 @@
48
48
  "react": ">=19"
49
49
  },
50
50
  "dependencies": {
51
- "@kud/gh": "0.8.0",
51
+ "@kud/gh": "0.9.0",
52
52
  "@kud/ink-ui": "0.14.0",
53
53
  "zx": "8.8.5"
54
54
  },