As a reader, I want to keep reading a site I opened by its address as if I were on it, so that I can explore another site without changing which server is mine.
Situation
My server is set in Me, and my notifications and home come from it. I have opened a document from a different Seed site, by typing its address into Open site or by following a web link to it. Now I want to look around that site.
What I do
Open a document from another site.
Tap links in it, open its directory, tap an author, and read its discussion.
Tap Back until I am on my own site's page again.
What I should see
The document is read from the site whose address I opened, never from my own server.
Links I tap inside it open from that same site.
The Directory button lists that site's documents, not my site's.
An author's profile shows what that site knows about the person.
The discussion under the document, its threads and "All comments" come from that site.
A comment I post there is sent to that site.
My server in Me is unchanged, and the Read tab's first page is still my own home.
When I go Back to a page from my own site, the directory, authors and discussion are my site's again, with nothing to reset.
A thread I open from Activity is read from, and answered on, my own server even while another site's document is underneath. Back returns to that document with its site intact.
A shared link from such a page carries that site's address.
When something goes wrong
If the other site cannot be reached, the page is titled "Document" and says "Couldn't reach the server." with "Retry". My own home is never shown in its place. I tap "Retry", or Back to return to the page I came from.
Not included
The page does not show which site I am on. I can only tell from the content, or from the link Share produces (Reading another site in place).
The name shown as "Commenting as" comes from my own server's profile, which the other site may not know.
An hm:// link opened from outside the app is read from my own server, not from the site I was last reading.
There is no list of sites I have visited and no way to bookmark one (Current limits and known gaps).
Trace
Story US-READ-06, 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 page that defines this behaviour: the reader follows the site of the document on top | |
Address entry and in-app reading, where the context starts | |
How a document from another site is opened | |
The document whose site becomes the context | |
Lists the space on the context site | |
Shows the profile as the context site knows it | |
Threads are read from and answered on the context site; Activity threads use the configured server | |
All comments come from the context site | |
A comment is posted to the context site; "Commenting as" comes from the configured server | |
Activity into Read starts a configured-server context | |
The context is the top document, so Back restores the previous one | |
The discussion under the document follows the context | |
Data for another server is never shown as current; failure never falls back to home | |
The server is managed now and then; reading must not change it | |
The predecessor required changing server to see another site |
Implementation
Page | Part it plays |
|---|---|
Reader context server and readScopedHref | |
readContextRef, readContextServer, readVisible and the resources that take the context | |
linkServer: a web address is read from its own origin; the page records its server | |
Reading the page from the entered server | |
linkTarget keeps same-site pages in the app relative to the page's server | |
Directory and author pages loaded for the context server | |
Per-server epochs and caches | |
discussTargets, discussions, threads and discussPost use readContextServer | |
A comment is published to the context server | |
The context derives, one line each | |
follow and readDirOpen rewrite hrefs onto the context server | |
The same read endpoints, asked of another origin | |
The network grants that let the reader reach other sites | |
The implementation note that introduced the reader context | |
open-site.test.contract and open-site-activity.test.contract | |
The local server the Activity context test runs against | |
The notify fixture with the thread scenario |
Code
File | What |
|---|---|
readScopedHref: keeps document links on the visible reader's server | |
readStack, readContextRef, readContextServer, readVisible and the directory and authors resources | |
Discussion targets and resources scoped to readContextServer | |
follow rewrites in-app document hrefs with readContextServer | |
readDirOpen does the same for a directory row | |
discussPost sends the comment to readContextServer | |
linkServer and buildPage: a typed web address is read from its own server | |
The page records its server and builds its share URL from it | |
linkTarget with the page's server | |
ReadOpenReply: "Opening a URL is navigation, not a change to the account or the configured server." |
Tests
File | What it checks |
|---|---|
open a typed Seed site URL in the native reader and return | |
failed site loading exposes retry and never substitutes the default home | |
Activity thread fetch and reply use the configured server, not the covered document origin | |
a typed site and gateway URL read from their own server, not the configured default | |
an unreachable typed site reports failure on that server, never a default home | |
links to the current server's site stay in the app; other hosts open outside | |
refresh epochs are tracked independently for each server |
Delivery
Delivered by #1484.
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime