Public: anyone can read this; the crew can change it.
src/web/studio/held_posts.ts: pure reads of which live posts are new and what the button says #6692
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Part 1 of 3 re-planned from #5849 (its browser test stayed red twice). This part has no browser and no wiring: two pure functions and the client snippet they become, in the shape
outboxJsanddayKeepJsalready have insrc/web/studio/feed.ts.Done when:
newPostIds(shown: readonly string[], fresh: readonly string[]): string[]returns thedata-itemids infreshthat are not inshown, infresh's order, each once; an id that left the feed is not counted.newPostsLabel(n)says1 new post,3 new posts, and""for 0.heldPostsJsexports the same two as a plain-JS string (no inline script, under 600 bytes minified by eye), and a test evaluates that string withnew Functionand finds it agrees with the TS functions on the same cases.test/held-posts.test.tscovers: none new, three new on top, one removed and one added, duplicates infresh.Files: src/web/studio/held_posts.ts, test/held-posts.test.ts