Read a document
A reader opens a document and reads its title, summary, byline and every kind of content in one comfortable column on a phone.

As a reader, I want to open a document and read it comfortably on my phone, so that I can follow my spaces away from my desk.

Situation

I am in the Read tab with a document in front of me: my site's home, or a page I reached through a link, the directory or a notification. I only want to read. I do not need an identity.

What I do

    Open a document.

    Read the title, the summary and who wrote it.

    Scroll through the body.

    Press and hold a paragraph or a code sample to select and copy text.

    Tap the row of a video, file or web embed to open it.

What I should see

    The title is large at the top. A page with no name of its own is titled with the last part of its address.

    The summary, when there is one, is the first line under the title.

    The byline shows up to five author pictures, their names, and when the page last changed: "now", "5 min. ago", "3 hr. ago", "2 days ago", and the date once it is a week old.

    Headings are bold and larger than the text, in two sizes.

    Bulleted lists show "•", numbered lists show "1.", "2.", and nested blocks are indented.

    Quotes carry a line down their left edge.

    Bold, italic, strikethrough and inline code appear inside the text.

    Code sits in a grey box with its language named above it, and long lines wrap.

    Tables appear as tables. Images fill the width of the column, with their caption beneath.

    A button appears as a pill in the brand colour with its name, or "Open".

    A video, file or web embed appears as a row with a symbol, its name and "Video", "File" or its address.

    The text stays in a centred column of comfortable width on any screen size, and follows my text size setting.

    A document with no content says "This page is empty."

When something goes wrong

Not included

    Math is shown as its source text in a code box, not typeset (Current limits and known gaps).

    Videos, files and web embeds do not play or preview in the page. Their row opens them.

    Underline, text colour and text size set by the author are not shown.

    I cannot create or edit a document in the app.

    I cannot see earlier versions of a document or search inside it.

Trace

Story US-READ-02, 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

The screen where reading happens: bar, header, blocks, states

Read components

The Read component family

DocBlockView

Draws every block of the body: text, heading, table, code, math, image, button, media

Document header and byline

Summary, author faces and names, date

Avatar

The 28 point author faces in the byline

text

Markdown text, selectable paragraphs and code

image and symbols

Images in the body and the symbols on media rows

link

Button blocks and media rows are links

scroll

The scrolling body

list and section

The plain list that scrolls the reading column

Reading first

A calm column of type with actions in the bar

Typography

type.reading, type.code and the heading sizes

Text styles in use

Each text style of the reader mapped to Dynamic Type

Sizes, reading width and touch targets

The 40rem reading width, image height limit and block paddings

Color and tokens

Label, secondary and brand roles used by blocks

Accessibility

Dynamic Type, the level 1 title, image labels

Cards and panels

The code box and the media row surfaces

Loading, failure and empty states

The empty page line "This page is empty."

Implementation

Page

Part it plays

Read: documents

The read package

Read: screens and components

DocScreen, DocBlockView, the DocPage and DocBlock shapes, readAgo and authorNames

Read: blocks to rows and inline Markdown

Flattens the block tree into rows and renders annotated text as Markdown

Read: loading pages, caches and embeds

Fetches the document and builds the page: title, summary, authors, date, blocks

Read: ids, refs and link targets

Media URLs for images and files, short ids for unnamed authors

Read: API client and superjson decoder

The API client and superjson decoding

Read: sources and the refresh epoch

readDocs

Read: root contract wiring

The doc route, the docs resource and the DocScreen props

Seed site read API

/api/Resource, /api/Account, /api/ResourceMetadata and the image endpoint

Root declarations: Read and Discuss

docs and the readTick minute clock behind relative dates

State, refresh and stale-reply patterns

The minute clock views read for "2 days ago"

Shared components and visual design

Avatar, type tokens and the reading conventions

Contract views and built-in calls

markup="markdown", user-select and the image element

Tamber design tokens

The type.reading and type.code tokens

Bun unit tests

markdown.test.ts and edge-cases.test.ts

Contract UI tests

read.test.contract

Current limits and known gaps

Math as raw text, media as link rows, dropped annotations, no editing

Code

File

What

read.contract L270-354

DocScreen

read.contract L181-253

DocBlockView: one block of a document

read.contract L321-345

Summary, byline, empty line and the block loop

read.contract L93-96

readAgo, readWhen and authorNames

ui.contract L6-21

Avatar

app.contract L752-753

The doc entry renders DocScreen with its ref

app.contract L87-91

readTick and the readClock minute task

src/read/markdown.ts L289-388

blocksToRows

src/read/markdown.ts L136-200

inlineMarkdown

src/read/markdown.ts L258-281

tableMarkdown

src/read/load.ts L302-383

buildPage

src/read/ids.ts L126-134

mediaUrl

src/read/superjson.ts

Decodes the site API reply envelope

Tests

File

What it checks

read.test.contract

the site home loads with its title and blocks

read.test.contract

a document's date shows (absolute when it is newer than the test clock)

src/read/__tests__/markdown.test.ts

block and inline conversion against real documents: headings, list markers, tables, images, code, quotes, Slots

src/read/__tests__/edge-cases.test.ts

crossing and nested marks, escaping of plain text, safe link destinations

src/read/__tests__/client.test.ts

the API decodes SuperJSON dates, bigint, undefined and binary without dropping plain JSON support

Delivery

Delivered by #1470, #1474.

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

Unsubscribe anytime

Connections0
Linked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkRead a documentRead a document
Citations 0Children & links 42

Loading child documents…

Connections show where other documents or comments link to this document.

Related documents

Loading connections…