Keep reading another site in place
A reader who opens a document from another Seed site keeps reading that site, with its links, directory, authors and discussion, while their own server stays as it was.

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

Reading another site in place

The page that defines this behaviour: the reader follows the site of the document on top

Address entry and in-app reading

Address entry and in-app reading, where the context starts

Open site sheet

How a document from another site is opened

Document and site home

The document whose site becomes the context

Directory sheet

Lists the space on the context site

Author profile

Shows the profile as the context site knows it

Thread

Threads are read from and answered on the context site; Activity threads use the configured server

All comments

All comments come from the context site

Compose comment sheet

A comment is posted to the context site; "Commenting as" comes from the configured server

Moving between tabs and into the app

Activity into Read starts a configured-server context

Stacks, pushes and sheets

The context is the top document, so Back restores the previous one

DocDiscussionSlot

The discussion under the document follows the context

Honest state: loading, failure and empty

Data for another server is never shown as current; failure never falls back to home

The five principles

The server is managed now and then; reading must not change it

What changed from the React Native app and why

The predecessor required changing server to see another site

Implementation

Page

Part it plays

Deep links and URL handling

Reader context server and readScopedHref

Read: root contract wiring

readContextRef, readContextServer, readVisible and the resources that take the context

Read: loading pages, caches and embeds

linkServer: a web address is read from its own origin; the page records its server

Read: open a site by URL

Reading the page from the entered server

Read: ids, refs and link targets

linkTarget keeps same-site pages in the app relative to the page's server

Read: rows, directory and author pages

Directory and author pages loaded for the context server

Read: sources and the refresh epoch

Per-server epochs and caches

Discuss: root contract wiring

discussTargets, discussions, threads and discussPost use readContextServer

Discuss: posting a comment

A comment is published to the context server

Root declarations: Read and Discuss

The context derives, one line each

Navigation and routes

follow and readDirOpen rewrite hrefs onto the context server

Seed site read API

The same read endpoints, asked of another origin

Grants and capabilities

The network grants that let the reader reach other sites

Open site: implementation and evidence

The implementation note that introduced the reader context

Contract UI tests

open-site.test.contract and open-site-activity.test.contract

The local test server

The local server the Activity context test runs against

Mock notify service

The notify fixture with the thread scenario

Code

File

What

app.contract L19-20

readScopedHref: keeps document links on the visible reader's server

app.contract L93-105

readStack, readContextRef, readContextServer, readVisible and the directory and authors resources

app.contract L112-117

Discussion targets and resources scoped to readContextServer

app.contract L277-278

follow rewrites in-app document hrefs with readContextServer

app.contract L323-326

readDirOpen does the same for a directory row

app.contract L340-343

discussPost sends the comment to readContextServer

src/read/load.ts L294-314

linkServer and buildPage: a typed web address is read from its own server

src/read/load.ts L366-382

The page records its server and builds its share URL from it

src/read/ids.ts L109-118

linkTarget with the page's server

read.contract L440-443

ReadOpenReply: "Opening a URL is navigation, not a change to the account or the configured server."

Tests

File

What it checks

open-site.test.contract

open a typed Seed site URL in the native reader and return

open-site.test.contract

failed site loading exposes retry and never substitutes the default home

open-site-activity.test.contract

Activity thread fetch and reply use the configured server, not the covered document origin

src/read/__tests__/deep-links.test.ts

a typed site and gateway URL read from their own server, not the configured default

src/read/__tests__/deep-links.test.ts

an unreachable typed site reports failure on that server, never a default home

src/read/__tests__/deep-links.test.ts

links to the current server's site stay in the app; other hosts open outside

src/read/__tests__/load.test.ts

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

Attributes
Epic
Reading
name
Keep reading another site in place
Story
US-READ-06
Status
Shipped
summary
A reader who opens a document from another Seed site keeps reading that site, with its links, directory, authors and discussion, while their own server stays as it was.