symbiot 0.49.1 → 0.50.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/watch.mjs CHANGED
@@ -254,8 +254,9 @@ function watchBoard(hours = 24, now = Date.now()) {
254
254
  const cards = d.watches.map((w) => {
255
255
  const recent = d.news.filter((n) => n.watch === w.id && n.ts >= since && unseen(n, w)), k = kindOf(w.url), count = recent.filter((n) => needsYou(n, w)).length;
256
256
  const b = d.briefs.find((x) => x.watch === w.id && x.ts >= since && unseen(x, w));
257
+ const past = d.news.filter((n) => n.watch === w.id && n.ts >= since && !unseen(n, w)).slice(0, 12).map((n) => ({ id: n.id, ts: n.ts, name: n.name, text: n.text, seen: true }));
257
258
  return { ...view(w), source: sourceOf(w.url), count, label: k ? `${count} ${k[count === 1 ? 0 : 1]}` : `${count} new`,
258
- items: markNews(recent.slice(0, 8), [w]).map((n) => ({ ...n, need: needsYou(n, w) })), ...(b ? { brief: { text: b.text, ts: b.ts, count: b.count } } : {}), ...(w.chat && w.chat.length ? { chat: w.chat } : {}) };
259
+ items: markNews(recent.slice(0, 8), [w]).map((n) => ({ ...n, need: needsYou(n, w) })), past, ...(b ? { brief: { text: b.text, ts: b.ts, count: b.count } } : {}), ...(w.chat && w.chat.length ? { chat: w.chat } : {}) };
259
260
  });
260
261
  return { hours, total: cards.reduce((s, c) => s + c.count, 0), cards, brief: briefOn() };
261
262
  }