function composeJournal
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.

A block ends once it holds 12 tiles, at the next row that starts empty and that no tall tile reaches into. The tile opening the next block is made a feature, or a wide without an image, which always fits a row that starts empty. The layout depends only on the ranking, so when the next page appends dumps that rank lower, only the last block changes.

Parameters

dumps: Dump[]

Return Type

Usage

import { composeJournal } from "src/utils/feed/journalLayout.ts";