@@ -84,23 +84,24 @@ export function getPrependOffer(
8484
8585/**
8686 * The new posts pill for the posts a view's prepends staged above the reader
87- * (see `usePostFeedPrepend`). It stays up apart from staging: reading a staged
88- * page unstages it, but leaves the pill up.
87+ * (see `usePostFeedPrepend`). It keeps its own time, apart from staging:
88+ * reading a staged page unstages it, so the next prepend goes above it, but
89+ * the pill stays up until the reader reaches the true top.
8990 *
90- * It goes up on an offer, once the page offered renders: a page a restore or a
91- * real return staged, or offered since. While it's up, every page staged
92- * above later joins it, whatever staged it. Each page is known by the `since`
93- * it was fetched from, so a page that replaces one, fetched from the same
94- * place, stays in it with however many posts it has. The pill counts the
91+ * It goes up on an offer (see `StagedPage`), once the offered page renders.
92+ * While it's up, every page staged later joins it, whatever staged it. It
93+ * knows its pages by the `since` each was fetched from, so a page that
94+ * replaces one, fetched from the same place, takes its place. It counts the
9595 * posts on its pages that still render (see {@link getPrependOffer}). Its
96- * faces are the first {@link FACE_LIMIT} whenever a page joins, and after that
97- * only drop out , as a deletion, a mute or a block can take a post away and a
96+ * faces are the first {@link FACE_LIMIT} as each page joins, and only drop out
97+ * after that , as a deletion, a mute or a block can take a post away and a
9898 * label can make an avatar unsafe.
9999 *
100100 * It comes down when the reader reaches the true top (`dismiss`), when they
101101 * press it, and once none of its posts render, as when a refresh replaces the
102- * feed. Each offer puts it up once. It shows only while the view is active,
103- * which includes a view that prepended in the background becoming active.
102+ * feed. It goes up at most once for each staged page, however often that's
103+ * offered. It shows only while the view is active, which includes a view that
104+ * prepended in the background becoming active.
104105 *
105106 * Pressing it scrolls up to the top, without fetching. Already at the top,
106107 * where there's no scroll to report reaching it, `onRead` reads the page.
@@ -145,6 +146,7 @@ export function usePrependPill({
145146 const top = pages ?. [ 0 ]
146147 // A page's rows render after it commits, which may be after it's staged.
147148 const page = staged && top ?. fetchedAt === staged . fetchedAt ? top : undefined
149+ // An offered page puts it up, and while it's up, any staged page joins it.
148150 const takesIn =
149151 enabled &&
150152 page !== undefined &&
@@ -167,6 +169,7 @@ export function usePrependPill({
167169 : undefined ,
168170 } )
169171 } else if ( offer && ! live . count ) {
172+ // None of its posts render any more, as once a refresh replaces them.
170173 setPill ( { takenAt} )
171174 }
172175
0 commit comments