@kud/gh-ink 0.44.5 → 0.45.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 +17 -8
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -746,6 +746,7 @@ var invalidateCache = (key) => {
746
746
  var MARK_SEP = "\0";
747
747
  var markKey = (sectionId, rowKey) => `${sectionId}${MARK_SEP}${rowKey}`;
748
748
  var rowKeyOfMark = (mark) => mark.slice(mark.indexOf(MARK_SEP) + 1);
749
+ var sectionIdOfMark = (mark) => mark.slice(0, mark.indexOf(MARK_SEP));
749
750
  var keyOf = (item) => {
750
751
  if (item.kind === "pr" || item.kind === "issue") return item.url;
751
752
  if (item.kind === "task") {
@@ -822,8 +823,12 @@ var diffSections = (prev, next) => {
822
823
  const boardAfter = rowsOf(after);
823
824
  const transients = /* @__PURE__ */ new Map();
824
825
  const leaving = [];
826
+ const sampled = new Set(
827
+ next.concat(prev).filter((s) => s.sampled).map((s) => s.id)
828
+ );
829
+ const isSampled = (mark) => sampled.has(sectionIdOfMark(mark));
825
830
  for (const [mark] of after)
826
- if (!before.has(mark))
831
+ if (!before.has(mark) && !isSampled(mark))
827
832
  transients.set(
828
833
  mark,
829
834
  boardBefore.has(rowKeyOfMark(mark)) ? "moved-in" : "in"
@@ -831,10 +836,11 @@ var diffSections = (prev, next) => {
831
836
  for (const [mark, was] of before) {
832
837
  const now = after.get(mark);
833
838
  if (!now) {
834
- transients.set(
835
- mark,
836
- boardAfter.has(rowKeyOfMark(mark)) ? "moved-out" : "out"
837
- );
839
+ if (!isSampled(mark))
840
+ transients.set(
841
+ mark,
842
+ boardAfter.has(rowKeyOfMark(mark)) ? "moved-out" : "out"
843
+ );
838
844
  leaving.push(was);
839
845
  } else if (renderedState(was.item) !== renderedState(now.item)) {
840
846
  transients.set(mark, "changed");
@@ -845,12 +851,15 @@ var diffSections = (prev, next) => {
845
851
  const changedRows = /* @__PURE__ */ new Set();
846
852
  for (const [mark, kind] of transients)
847
853
  if (kind === "changed") changedRows.add(rowKeyOfMark(mark));
854
+ const onlySampled = (sections) => sections.size > 0 && [...sections].every((id) => sampled.has(id));
848
855
  for (const [key, sections] of boardAfter) {
849
856
  const had = boardBefore.get(key);
850
- if (!had) added += 1;
851
- else if (!sameSections(had, sections)) changedRows.add(key);
857
+ if (!had) {
858
+ if (!onlySampled(sections)) added += 1;
859
+ } else if (!sameSections(had, sections)) changedRows.add(key);
852
860
  }
853
- for (const key of boardBefore.keys()) if (!boardAfter.has(key)) removed += 1;
861
+ for (const [key, sections] of boardBefore)
862
+ if (!boardAfter.has(key) && !onlySampled(sections)) removed += 1;
854
863
  return {
855
864
  transients,
856
865
  union: spliceBack(next, leaving),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/gh-ink",
3
- "version": "0.44.5",
3
+ "version": "0.45.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,10 +48,10 @@
48
48
  "react": ">=19"
49
49
  },
50
50
  "dependencies": {
51
- "@kud/gh": "0.11.0",
51
+ "@kud/gh": "0.12.0",
52
52
  "@kud/ink-ui": "0.22.0",
53
53
  "zx": "8.8.5",
54
- "@kud/gh-workflow": "0.2.1"
54
+ "@kud/gh-workflow": "0.3.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/node": "22.20.1",