Reading another site in place
How the Read tab follows the site of the document being read, for links, directory, authors and comments, without changing the configured server.

The app has one configured server, chosen in Me. A person can still read a document from any other Seed site, by typing its address or following a link. While they do, the Read tab behaves as if it were on that site. This page describes that behaviour, which the code calls the reader context.

The idea

The contract states it in one comment above the Open site screen: "Opening a URL is navigation, not a change to the account or the configured server." (source). Visiting a site is like visiting a web page. It should not rewire the app.

What follows the site being read

The context is the document on top of the Read stack. The site it was loaded from decides:

Part

Behaviour

Source

Links in the page, child rows, embed cards

Open on the same site

follow, readScopedHref

Directory sheet

Lists that site's space, and its rows open on that site

resource, readDirOpen

Author profiles

Loaded from that site

resource

Discussion, threads, all comments

Loaded from that site

resources

A comment or reply you post

Sent to that site

discussPost

Share

Shares the page's address on the site it was loaded from

shareDoc

What does not change

    The Server row in Me and the Server screen.

    The Read tab's root: the home document of the configured server.

    The Activity inbox, which asks the configured server for the current identity's notifications.

    The current identity. You comment on the other site as the same person.

Back restores the context

Because the context is "the document on top", it changes as the stack changes, with nothing to reset.

flowchart LR home["Home document on hyper.media"] -->|"Open site: other.example"| other["Document on other.example"] other -->|"link in the page"| other2["Another document on other.example"] other2 -->|"Back"| other other -->|"Back"| home

Push a document from another site and the directory button shows that site. Go Back and it shows the first site again. The test "open a typed Seed site URL in the native reader and return" in open-site.test.contract checks the round trip.

A thread opened from Activity

An activity row opens its thread in Read (Moving between tabs and into the app). Notifications come from the configured server, so that thread must be read and answered there, even if the Read tab was showing another site. A thread that arrives from Activity therefore starts a context of its own on the configured server. Back from it returns to the covered document and to that document's site (source).

The test in open-site-activity.test.contract walks this path: open a document on one site, open an Activity thread, reply (the reply goes to the configured server), go Back, and the first document is still there with its own context.

Failure never falls back to home

An address that is not a valid link stays in the sheet with an error under the field. A valid address that cannot be reached opens the document screen in its failure state, titled "Document", with "Retry", and Back returns to the page before. In neither case does the app quietly show the configured server's home instead (test "failed site loading exposes retry and never substitutes the default home"). See Honest state.

Why it is designed this way

    Reading first. Following a link should cost one tap and no decision. Asking "switch server?" would interrupt reading (Reading first).

    Identity is separate from place. The server in Me decides where your notifications and home come from. It is one of the things managed "now and then" (The five principles), so reading must not change it as a side effect.

    The predecessor made the server the first decision. The React Native app opened on a server form, and seeing another site meant changing server (what changed; the second half is inferred from its single ServerSelect entry point).

Trade-offs

    The screen does not say which site you are on. The document shows its title, summary and byline, and no host name. The only places the address is visible are the Open site field as you type it and the shared link (verified in the document screen's contract; the consequence is inferred).

    "Commenting as" may differ from what the other site knows. The compose sheet shows your name from the configured server's profile.

    One context at a time. The context is the top document, so a directory or thread always belongs to the page in front, never to a page further down the stack.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Attributes
name
Reading another site in place
summary
How the Read tab follows the site of the document being read, for links, directory, authors and comments, without changing the configured server.