pi-odd-worktree 3.11.2 → 3.12.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.
@@ -1197,6 +1197,22 @@ function createIssuesView(options = {}) {
1197
1197
  });
1198
1198
  }
1199
1199
 
1200
+ // S10a (cross-bucket): every bucket stores its OWN copy of a row, so one write
1201
+ // that closed an issue closed it in every bucket that lists it. Marking only
1202
+ // the bucket on screen left the others painting the pre-write row — and the
1203
+ // pre-write count that row honored — until the reader happened to visit them.
1204
+ // The row keeps its new state where each bucket stores it, so the open-only
1205
+ // filter and every count follow it at once, and `invalidateLoadedPages` still
1206
+ // makes the next visit read GitHub's own answer.
1207
+ function markIssueStateEverywhere(number, nextState) {
1208
+ pages.forEach((page) => {
1209
+ if (!Array.isArray(page.issues)) return;
1210
+ page.issues.forEach((row) => {
1211
+ if (numOf(row) === number) row.state = nextState;
1212
+ });
1213
+ });
1214
+ }
1215
+
1200
1216
  // S21 (T17): a save that changed the VIEWER's own assignment changed which
1201
1217
  // bucket holds the issue, and the answer says so (`self`). Only `assigned`
1202
1218
  // moves: `mine` is authorship and `involved` excludes the viewer's own
@@ -2350,10 +2366,11 @@ function createIssuesView(options = {}) {
2350
2366
  result = { ok: false, error: (err && err.message) || 'action failed' };
2351
2367
  }
2352
2368
  settleSave(result, () => {
2353
- // S10a: the list is open-only, so a closed issue leaves it at once. The
2354
- // row keeps its new state where it is stored, and the open-only filter
2355
- // and every count follow it.
2356
- row.state = 'closed';
2369
+ // S10a: the list is open-only, so a closed issue leaves EVERY bucket that
2370
+ // lists it at once — not only the one on screen. The row keeps its new
2371
+ // state where it is stored, and the open-only filter and every count
2372
+ // follow it.
2373
+ markIssueStateEverywhere(number, 'closed');
2357
2374
  const cached = details.get(number);
2358
2375
  if (cached && cached.issue) cached.issue = { ...cached.issue, state: 'closed' };
2359
2376
  state.mode = 'list';