Skip to main content

Module feed

Module feed 

Source
Expand description

A list of notes, newest first: the feed, and the notes on a profile.

A list is read in one of two ways, FeedMode: the notes that start a conversation, or those and the replies among them. Both are kept in order, so that changing the way is showing the other.

What a list shows only changes when its reader says so. Notes that turn up after it was first filled wait beside it, as Pending, until they are asked for.

flowchart TD
    page["A look at the relays brings the newest page"] --> fresh{"Any note the list doesn't have?"}
    fresh -->|"no"| nothing["Nothing waits"]
    fresh -->|"yes"| reach{"Does the page reach back to the list's newest note?"}
    reach -->|"yes, or the page was not full"| joined["They wait, joined to the list: shown, they go in above it"]
    reach -->|"no: more than a page turned up"| detached["They wait, detached: shown, the list starts over from them"]

A list has no holes: from its newest note to its oldest it has every note the relays gave. Notes that wait and don’t reach down to the list would leave one, so showing them starts the list over, and what is older comes back as it is scrolled to its end.

How this fits with looking for new notes on a timer is in crate::guide::flows.

Structs§

Feed
A feed’s notes, newest first, each note once.
Pending
The notes that turned up for a list after it was first filled: newer than its newest, or missing from among the others. They wait here until the reader asks for them, so that what is being read stays as it is.

Enums§

FeedMode
Which of a list’s notes are shown.
FeedPage
Which page of a feed was asked of the relays.

Constants§

PENDING_MAX 🔒
How many notes wait to be shown at the most. Past that the oldest are let go of: the applet runs for as long as the session does, and may be left alone for all of it. Showing them asks what was made of each, so it is not many more than are worth asking about at once.

Functions§

feed_order 🔒
The order of a feed: newest first, and by id among notes of the same second, so the order is the same however the notes arrived.
newest
The limit newest of notes, newest first, each note once.