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
If the page cannot be loaded I see the reason, for example "Couldn't reach the server.", with "Retry". Tapping "Retry" asks again and the page appears. See Refresh a page and recover from a failed load.
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 |
|---|---|
The screen where reading happens: bar, header, blocks, states | |
The Read component family | |
Draws every block of the body: text, heading, table, code, math, image, button, media | |
Summary, author faces and names, date | |
The 28 point author faces in the byline | |
Markdown text, selectable paragraphs and code | |
Images in the body and the symbols on media rows | |
Button blocks and media rows are links | |
The scrolling body | |
The plain list that scrolls the reading column | |
A calm column of type with actions in the bar | |
type.reading, type.code and the heading sizes | |
Each text style of the reader mapped to Dynamic Type | |
The 40rem reading width, image height limit and block paddings | |
Label, secondary and brand roles used by blocks | |
Dynamic Type, the level 1 title, image labels | |
The code box and the media row surfaces | |
The empty page line "This page is empty." |
Implementation
Page | Part it plays |
|---|---|
The read package | |
DocScreen, DocBlockView, the DocPage and DocBlock shapes, readAgo and authorNames | |
Flattens the block tree into rows and renders annotated text as Markdown | |
Fetches the document and builds the page: title, summary, authors, date, blocks | |
Media URLs for images and files, short ids for unnamed authors | |
The API client and superjson decoding | |
readDocs | |
The doc route, the docs resource and the DocScreen props | |
/api/Resource, /api/Account, /api/ResourceMetadata and the image endpoint | |
docs and the readTick minute clock behind relative dates | |
The minute clock views read for "2 days ago" | |
Avatar, type tokens and the reading conventions | |
markup="markdown", user-select and the image element | |
The type.reading and type.code tokens | |
markdown.test.ts and edge-cases.test.ts | |
read.test.contract | |
Math as raw text, media as link rows, dropped annotations, no editing |
Code
File | What |
|---|---|
DocScreen | |
DocBlockView: one block of a document | |
Summary, byline, empty line and the block loop | |
readAgo, readWhen and authorNames | |
Avatar | |
The doc entry renders DocScreen with its ref | |
readTick and the readClock minute task | |
blocksToRows | |
inlineMarkdown | |
tableMarkdown | |
buildPage | |
mediaUrl | |
Decodes the site API reply envelope |
Tests
File | What it checks |
|---|---|
the site home loads with its title and blocks | |
a document's date shows (absolute when it is newer than the test clock) | |
block and inline conversion against real documents: headings, list markers, tables, images, code, quotes, Slots | |
crossing and nested marks, escaping of plain text, safe link destinations | |
the API decodes SuperJSON dates, bigint, undefined and binary without dropping plain JSON support |
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime