See the documents under and inside a document
A reader sees the documents that belong to the page they are on: the child documents under it, the documents embedded in it, and the lists and card grids its author placed in it.

As a reader, I want to see the documents that sit under a page and the ones its author placed inside it, so that I can tell what else is here and open it.

Situation

I am reading a document that is a hub: it has child documents, shows other documents as cards, or contains lists of documents.

What I do

    Scroll through the body and look at the cards and lists in it.

    Scroll past the body to "In this space".

    Tap any card or row to open that document.

What I should see

    After the body, a panel headed "In this space" lists the child documents of this page that the body does not already link to or embed.

    The panel is absent when there are no such children, or when the body already contains a list of this page's own children.

    Each row shows a picture when the document has one, its title, up to two lines of summary, up to three author names with "+N" for the rest, when it last changed, and a comment count when known.

    A document embedded in the body appears as a card with a coloured left edge: cover picture, a document symbol, title, summary, and the authors' faces and names.

    When only one paragraph of a document is embedded, the card shows that paragraph's text.

    A list placed by the author appears either as rows or as cards, as the author chose.

    Cards show a cover, title, summary, overlapping author faces, date and comment count. On a phone they stack one per line.

    When the author asked for a banner, the first card is full width with a taller picture and larger title.

    A list with nothing in it says "No documents yet."

    Private documents never appear in these lists.

When something goes wrong

    A list that fails to load shows "Couldn't load this list." in its place, and a card whose document is missing shows "This document is not available." The rest of the page still reads. I pull down on the page to try again.

    If the child documents cannot be fetched, the whole page shows the reason with "Retry", so I am never shown a page that wrongly looks childless.

Not included

    An embedded document is shown as a summary card, not with its full content in place (DocBlockView: embed and query blocks).

    A list shows at most 50 documents unless its author set another number, with no way to load more (Current limits and known gaps).

    A failed list has no Retry of its own.

    The number of columns an author chose is followed only when it is one. Otherwise the width of the screen decides.

    Rows show a comment count only when the list already carried it, so a missing count can mean none or unknown.

Trace

Story US-READ-08, status Shipped. These links are kept in step with the traceability matrix and with the "User stories" section of every page listed here.

Design

Page

Part it plays

Document and site home

Where "In this space", embed cards and query blocks appear

DocBlockView: embed and query blocks

The embed card, the card grid, the row list and their empty and failed lines

DocCard

A query result as a card, with the banner variant

DocItemRow

A document row: thumbnail, title, summary, authors, date, comments

FacePile

Overlapping author faces on cards and embeds

CommentCount

The comment count on rows and cards, absent at zero

DocBlockView

The block view that hosts embed and query kinds

Avatar

The faces in the face pile

Cards and panels

When a card is used; the "In this space" panel

Every card surface

The embed card, query card and child panel surfaces

Lists

Painted row lists inside the reading column

Every list in the app

The child list and query lists in the table of lists

Loading, failure and empty states

Quiet failure lines inside a readable page

Reading first

Children and discussion come after the content

Names, not identifiers

Authors as faces and names on rows and cards

Sizes, reading width and touch targets

Thumbnail, cover and card sizes

Implementation

Page

Part it plays

Read: loading pages, caches and embeds

embedCard, queryItems, childItems and how they are joined into the page

Read: rows, directory and author pages

itemOf: a listing result becomes a row with authors and counts

Read: blocks to rows and inline Markdown

Embed and Query blocks become rows; referencedRefs and hasQueryTargetingSelf

Read: screens and components

DocItemRow, DocCard, FacePile, CommentCount and the children panel in DocScreen

Read: ids, refs and link targets

In-app hrefs and image URLs for rows and cards

Read: API client and superjson decoder

The API client

Read: sources and the refresh epoch

readDocs

Read: root contract wiring

The docs resource that carries blocks and children

Seed site read API

/api/Query (Children), /api/QueryBlock, /api/Resource, /api/Account

Root declarations: Read and Discuss

docs; readNow and readUtc provided to rows and cards

Contract UI tests

The embed, card grid and child row tests; the three live-home child-0 baseline failures

Bun unit tests

cards.test.ts, markdown.test.ts, load.test.ts

Current limits and known gaps

Query blocks default to 50 results

Code

File

What

read.contract L346-352

The "In this space" panel in DocScreen

read.contract L208-244

Embed card and query block (card grid, banner, rows, empty line) in DocBlockView

read.contract L124-149

DocItemRow

read.contract L151-178

DocCard

read.contract L99-122

FacePile and CommentCount

src/read/load.ts L228-257

embedCard

src/read/load.ts L259-277

queryItems and childItems

src/read/load.ts L143-160

itemOf

src/read/load.ts L333-365

buildPage: embeds, queries, children and authors loaded together, with the fallback lines

src/read/markdown.ts L334-347

Embed and Query blocks become rows, recorded as pending

src/read/markdown.ts L403-441

referencedRefs and hasQueryTargetingSelf

app.contract L735-742

provide: readNow and readUtc for row and card dates

Tests

File

What it checks

read.test.contract

a child document pushes and Back returns home

read.test.contract

an embed renders as a card and a query lists documents

read.test.contract

a Card query renders a card grid with face piles

read.test.contract

document rows name their authors

src/read/__tests__/cards.test.ts

author face piles, comment counts, query style, columns and banner, names and counts from the listing with no extra requests

src/read/__tests__/markdown.test.ts

embeds and queries are recorded for the loader

src/read/__tests__/markdown.test.ts

content refs and self-targeting queries

src/read/__tests__/markdown.test.ts

query results become rows

src/read/__tests__/load.test.ts

a failed child listing is a retryable error rather than a cached empty document

Delivery

Delivered by #1470.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime