Browse and search a space's documents
A reader opens the directory of the space they are reading, sees every document as a tree, filters it by title and opens one.

As a reader, I want to see every document in the space I am reading and jump to one by name, so that anything in the space is one tap away.

Situation

I am reading a document and want something else from the same space. I may know its title, or I may just want to see what is there.

What I do

    Tap the list button in the bar of the document.

    Look through the tree in the Directory sheet.

    Type part of a title in "Search documents".

    Tap a row to open that document, or tap Close to stay where I was.

What I should see

    A sheet rises over the document, titled with the space's name. Until the name is known the title is "Directory".

    The first row is the space's home, named after the space, or "Home".

    Every public document of the space follows as a tree: children sit under their parent, indented one step per level, and siblings are in alphabetical order.

    The document I am reading has a checkmark in the brand colour.

    A search field with the placeholder "Search documents" stays above the list.

    Typing filters the rows by title as I type, ignoring capitals, and the matches are shown as a flat list.

    When nothing matches I read: Nothing matches “my words”.

    Tapping a row closes the sheet and opens that document in the reader in one step. Back from it returns to the document I started from.

    Tapping Close, or dragging the sheet down, dismisses it and leaves my page as it was.

    After I pick a document or tap Close, the search field is empty the next time I open the directory.

    While the list loads a spinner shows, and rows from a space I looked at before never appear under the new title.

    The directory belongs to the site of the document in front of me, including a site I opened by its address.

When something goes wrong

    If the list cannot be loaded, the sheet shows the reason, for example "Couldn't reach the server.", with "Retry". Tapping "Retry" asks for the list again. Close returns me to the document.

Not included

    Search looks at titles only, not at the text of documents, and only within this one space.

    The tree cannot be collapsed or expanded, and there is no pull to refresh inside the sheet. Pulling down on the document refreshes both.

    Private documents are not listed.

    The sheet shows titles only: no summaries, authors or dates (Directory row).

Trace

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

Directory sheet

The Directory sheet: bar, search field, tree, states and actions

Directory row

One row of the tree: indent, title, checkmark on the current document

Document and site home

The list button in the document bar that opens the sheet

Stacks, pushes and sheets

The directory is a sheet; picking a row closes it and pushes the document

Navigation bars and their actions

Close as the sheet's leading action and the inline title

Reading another site in place

The directory belongs to the site of the document in front

Lists

The inset-grouped list and rows that act

Every list in the app

The directory list in the table of lists

Every bar button

The Directory and Close bar buttons

States for every screen

Loading, failure and no-match strings of the directory

input, textarea, select and label

The search field with "Search documents"

list and section

The inset-grouped list and section

dialog

Sheet presentation

StatusLine

The failure line with Retry

Every symbol

The list, close and checkmark symbols

The five principles

Principle 3: one tap to anywhere in the space

What changed from the React Native app and why

The sheet replaces the predecessor's sidebar

Implementation

Page

Part it plays

Read: screens and components

DirectoryScreen: filter, rows, checkmark, testIds

Read: rows, directory and author pages

treeOrder and loadDirectory: the space as a tree with the home first

Read: root contract wiring

The directory route, dirQuery, dirUid, readCurrent, the directory resource and its actions

Read: sources and the refresh epoch

readDirectory

Read: API client and superjson decoder

The API client

Read: ids, refs and link targets

directoryHref and docHref for rows

Seed site read API

/api/Query with mode AllDescendants, /api/Account for the space name

Navigation and routes

The directory route and readDirOpen (back, then go)

Deep links and URL handling

readDirOpen scopes the row's href to the context server

Root declarations: Read and Discuss

dirQuery, dirUid, readCurrent, directory

State, refresh and stale-reply patterns

readEpoch feeds the directory; refresh directory for Retry

Contract UI tests

The directory test in read.test.contract

Bun unit tests

The tree-order test in markdown.test.ts

Code

File

What

read.contract L356-398

DirectoryScreen

read.contract L65-77

DirItem and DirPage shapes

read.contract L301-303

The Directory bar button on DocScreen

app.contract L31-31

route directory "/dir/:uid"

app.contract L92-104

dirQuery, dirUid, readCurrent and resource directory

app.contract L312-326

readDirRetry, readOpenDir, readDirSearch, readDirClose, readDirOpen

app.contract L757-758

The directory entry renders DirectoryScreen

src/read/load.ts L438-468

treeOrder

src/read/load.ts L470-496

loadDirectory

src/read/sources.ts L25-28

readDirectory source

Tests

File

What it checks

read.test.contract

the directory opens, search filters, and a row opens its document

src/read/__tests__/markdown.test.ts

directory is a tree: children follow their parent, deeper

src/read/__tests__/load.test.ts

refresh prevents late site config and directory responses from repopulating caches

Delivery

Delivered by #1470.

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 linkBrowse and search a space's documentsBrowse and search a space…
Citations 0Children & links 36

Loading child documents…

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

Related documents

Loading connections…