@jsenv/navi 0.29.58 → 0.29.59

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.
@@ -56347,6 +56347,11 @@ const useListScrollSync = ({
56347
56347
  virtual.holdPending = scrolledWanted !== "start" && scrolledWanted !== undefined;
56348
56348
  const total = virtual.totalSignal.peek();
56349
56349
  if (total <= renderBudget) {
56350
+ // The whole collection is what the list draws: wherever in it the list is
56351
+ // held, the window is already its place. Nowhere to move to means nothing
56352
+ // to wait for — a hold left standing here is a list that never asks for
56353
+ // anything again.
56354
+ virtual.holdPending = false;
56350
56355
  return;
56351
56356
  }
56352
56357
  const half = Math.floor(renderBudget / 2);
@@ -56367,6 +56372,9 @@ const useListScrollSync = ({
56367
56372
  }
56368
56373
  }
56369
56374
  if (wantedStart === null) {
56375
+ // Held on a row nobody can place yet: the window frames the start, which
56376
+ // is not where the list is going. The hold stands until the row comes
56377
+ // back — the run asks for it by name (see useRequestMissing).
56370
56378
  return;
56371
56379
  }
56372
56380
  if (wantedStart < 0) {
@@ -58984,7 +58992,22 @@ const useItemStore = ({
58984
58992
  // anchored on the row at its top — a source paginating by cursor gets a
58985
58993
  // row to count from, and the reading position is what must survive.
58986
58994
  const revalidating = staleRef.current;
58987
- if (revalidating) {
58995
+ // The list is held on a row nothing on screen leads to: the rows it holds
58996
+ // do not contain it, so no window it could draw will ever bring it. Only
58997
+ // asking for it by name does.
58998
+ const wanted = virtual.scrolled;
58999
+ const askingAroundWantedRow = revalidating &&
59000
+ // Only while the hold stands: once the user has taken the list over,
59001
+ // the reading position is where they are, not where it opened.
59002
+ virtual.holdPending && wanted && typeof wanted === "object" && wanted.id !== undefined && virtual.locateRow(wanted.id) === null;
59003
+ if (askingAroundWantedRow) {
59004
+ around = wanted.id;
59005
+ // Where it stood when it was written down is enough to frame the ask;
59006
+ // the answer says where it really landed.
59007
+ const from = typeof wanted.index === "number" ? wanted.index - Math.floor(budget / 2) : 0;
59008
+ start = from < 0 ? 0 : from;
59009
+ end = start + budget - 1;
59010
+ } else if (revalidating) {
58988
59011
  start = windowFrom;
58989
59012
  end = windowTo - 1;
58990
59013
  if (end < start) {
@@ -59025,7 +59048,9 @@ const useItemStore = ({
59025
59048
  if (start === -1) {
59026
59049
  return;
59027
59050
  }
59028
- if (virtual.holdPending && pages.count !== undefined) {
59051
+ if (virtual.holdPending && pages.count !== undefined && !askingAroundWantedRow) {
59052
+ // The one ask a hold lets through: the row the list is held on is
59053
+ // what would lift the hold, and nothing else is going to bring it.
59029
59054
  return;
59030
59055
  }
59031
59056
  const request = requestRef.current;