Lays out the "journal" tab of the index page: it ranks the loaded dumps by hotScore, gives each a tile size in a 4-column mosaic, and cuts the mosaic into blocks. JournalFeed renders the blocks.

Functions

f
composeJournal(dumps: Dump[]): JournalBlock[]

Sorts dumps by hotScore and lays them out as a mosaic whose rows all close, cut into blocks. JournalFeed calls it on every change of the feed.

f
hasQuote(dump: Dump): boolean

Checks whether dump has a non-blank note, which JournalCard shows as a pull-quote when the dump has no image.

f
hasThumbnail(dump: Dump): boolean

Checks whether dump has an image to show: an uploaded thumbnail, an image, video or audio file, or a link preview's thumbnail. Only such dumps get the large tiles, and JournalCard shows them as image tiles.

Interfaces

I
JournalBlock

Returned by composeJournal. JournalFeed renders each block as its own grid, with a rule between two blocks.

Type Aliases

T
JournalShape = "feature" | "wide" | "tall" | "square"

The grid span of a tile, which JournalCard turns into a CSS class. A feature spans 2×2 cells, a wide 2×1, a tall 1×2 and a square 1×1. Whether the tile shows an image, a quote or text depends on the dump alone.