@polycode-projects/the-mechanical-code-talker 5.0.29 → 5.0.31

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.
@@ -331,6 +331,8 @@ const SEED_BYTES = ${Number(seedBytes) || 0};
331
331
  if (!feed.items.length) { emptyEl.hidden = false; setTile("tileFeedItems", 0, "nothing yet"); return; }
332
332
  emptyEl.hidden = true;
333
333
  for (const item of feed.items) {
334
+ // One yield per card keeps the page clickable while a long feed renders.
335
+ await new Promise((resolve) => setTimeout(resolve, 0));
334
336
  const card = document.createElement("div");
335
337
  card.className = "item";
336
338
  const seedTag = feed.seedFallback ? '<span class="seedtag">from the seed graph — start to poll live sources</span>' : "";
@@ -39,7 +39,7 @@
39
39
 
40
40
  import { normFactTerm, normFactPredicate, factIdFor, sha256Bytes } from "../domain/hash.mjs";
41
41
  import {
42
- newsWindowRows, scoreHubs, subgraphAround, renderNewsParagraph, buildNewsItems, evictNewsFacts,
42
+ newsWindowRows, scoreHubs, subgraphAround, buildTermAdjacency, renderNewsParagraph, buildNewsItems, evictNewsFacts,
43
43
  } from "../domain/news-feed.mjs";
44
44
  import {
45
45
  createTermLedger, bumpTerms, rankedTerms, markTerm, groundedSweep, ledgerPayload, ledgerFromPayload,
@@ -293,8 +293,9 @@ function collectItemSources(subgraphRows, sourcesByFactId) {
293
293
  * buildNewsItems's own, already-pinned window contract. */
294
294
  function assembleNewsItems(rows, windowRows, { now, limit, sourcesByFactId }) {
295
295
  const hubs = scoreHubs(rows, windowRows, { limit });
296
+ const adjacency = buildTermAdjacency(rows);
296
297
  const items = hubs.map(({ term, changed }) => {
297
- const subgraphRows = subgraphAround(rows, term);
298
+ const subgraphRows = subgraphAround(rows, term, { adjacency });
298
299
  const factIds = subgraphRows.map((r) => r.id).sort();
299
300
  return {
300
301
  id: `news-feed:${sha256HexPrefix(`${term}\0${factIds.join(",")}`, 8)}`,