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 |
|---|---|
The Directory sheet: bar, search field, tree, states and actions | |
One row of the tree: indent, title, checkmark on the current document | |
The list button in the document bar that opens the sheet | |
The directory is a sheet; picking a row closes it and pushes the document | |
Close as the sheet's leading action and the inline title | |
The directory belongs to the site of the document in front | |
The inset-grouped list and rows that act | |
The directory list in the table of lists | |
The Directory and Close bar buttons | |
Loading, failure and no-match strings of the directory | |
The search field with "Search documents" | |
The inset-grouped list and section | |
Sheet presentation | |
The failure line with Retry | |
The list, close and checkmark symbols | |
Principle 3: one tap to anywhere in the space | |
The sheet replaces the predecessor's sidebar |
Implementation
Page | Part it plays |
|---|---|
DirectoryScreen: filter, rows, checkmark, testIds | |
treeOrder and loadDirectory: the space as a tree with the home first | |
The directory route, dirQuery, dirUid, readCurrent, the directory resource and its actions | |
readDirectory | |
The API client | |
directoryHref and docHref for rows | |
/api/Query with mode AllDescendants, /api/Account for the space name | |
The directory route and readDirOpen (back, then go) | |
readDirOpen scopes the row's href to the context server | |
dirQuery, dirUid, readCurrent, directory | |
readEpoch feeds the directory; refresh directory for Retry | |
The directory test in read.test.contract | |
The tree-order test in markdown.test.ts |
Code
File | What |
|---|---|
DirectoryScreen | |
DirItem and DirPage shapes | |
The Directory bar button on DocScreen | |
route directory "/dir/:uid" | |
dirQuery, dirUid, readCurrent and resource directory | |
readDirRetry, readOpenDir, readDirSearch, readDirClose, readDirOpen | |
The directory entry renders DirectoryScreen | |
treeOrder | |
loadDirectory | |
readDirectory source |
Tests
File | What it checks |
|---|---|
the directory opens, search filters, and a row opens its document | |
directory is a tree: children follow their parent, deeper | |
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