Choose which Seed server I read from
A person picks the Seed server the app reads from and publishes to: a preset, a typed address, or one saved earlier.

As a reader, I want to choose the Seed server the app talks to, so that I open my own site first and my comments and profile go where I expect.

Situation

The app starts on hyper.media. My team runs its own Seed site, or I am testing against dev.hyper.media. I know the address. I am on the Me tab.

What I do

    Under "Connections", tap "Server".

    Tap "hyper.media" or "dev.hyper.media", or

    Type an address under "Another server" and tap "Connect", or

    Tap a server under "Saved servers".

    Go back and open the Read tab.

What I should see

    The "Server" row on Me shows the host in use, for example "hyper.media".

    The Server screen lists "hyper.media" with "The public Seed network" and "dev.hyper.media" with "For testing". The one in use has a checkmark.

    Tapping a preset switches at once, with a light tap from the phone.

    "Another server" has a field hinting "example.com", a "Connect" button, and the note "The server is checked before it is used."

    "Connect" is disabled while the field is empty and reads "Checking…" while the server is checked.

    I can type just a host. The app adds https and keeps only the site address, not the page.

    When the check passes, the field empties, the server gets the checkmark, and it appears under "Saved servers" with its host and full address.

    Saved servers are still there after I reopen the app, and so is my choice.

    Swiping a saved server removes it. The note says "Swipe a server to remove it. Removing the one in use returns to hyper.media."

    Back in Read, the home of the chosen server opens. Names, comments and profile edits use that server from now on.

When something goes wrong

    A malformed address shows, in red, "Invalid URL. Enter a valid server address." I correct it and tap "Connect" again. The server in use does not change.

    A site that is not a Seed site shows "This server has no registered site."

    A server that does not answer shows "Failed to connect: " and the reason. I check the address or my connection and try again.

Not included

    This is not the agent server, which is chosen separately. See Choose my agent server.

    Reading one other site does not need a change here. See Open a Seed site by URL.

    There is one server for the whole app, not one per identity.

    The messages "This server has no registered site." and "Failed to connect" have no automated test. See Contract UI tests.

Trace

Story US-ID-08, 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

Server

The radio list, saved servers and the Another server form

Me

The Server row under Connections with the host in use

Document and site home

The site home that follows the chosen server

Agent server sheet

The separate agent server sheet this is not

Server rows

Preset, custom and saved server rows with the checkmark

input, textarea, select and label

The URL field with capitals and correction off

button

Connect and its Checking… state

Forms and inputs

Hint in the footer, error in the same place in red

Every form

Lists this form with every message

Lists

Radio rows and swipe to remove

Refresh, haptics and progress

The selection haptic on picking a server

States for every screen

Checking, bad address, not a Seed site, unreachable, connected

Names, not identifiers

Hosts as labels, full addresses as secondary text

What changed from the React Native app and why

Saved servers carried over from the earlier app

Honest state: loading, failure and empty

A typed server is checked before it is used

Roles, headings and labels

Radio group and radio roles on the rows

Implementation

Page

Part it plays

Me: identities and servers

Orientation and the shared server state

Me: screens and components

MeServerScreen and the server actions

Me: sources and import logic

meCheckServer, parseServerUrl and the request deadline

Seed site read API

The /hm/api/config check and what the server is then used for

The root contract (app.contract)

server is persisted root state passed to every package

Root declarations: Me, Profile, Crypto and Vault

meServerDraft, meServers and meServerChecked

State, refresh and stale-reply patterns

How resources re-ask when the server changes

Read: sources and the refresh epoch

Read follows the server through its sources

Navigation and routes

The server route

Grants and capabilities

Network grants that allow any https server

Contract UI tests

The UI tests for presets, bad addresses and saved servers

The local test server

The local server that answers /hm/api/config in tests

Bun unit tests

Unit tests for address parsing

Code

File

What

me.contract L316-373

MeServerScreen

me.contract L101-108

Server row on Me

me.contract L41

meHost

app.contract L76

server, persisted, default https://hyper.media

app.contract L214-218

meServerDraft and meServers

app.contract L226

meServerChecked then meAfterServer

app.contract L645-666

mePickServer, meEditServer, meConnect, meAfterServer, meForgetServer

app.contract L877-878

view wiring for the server route

src/me/logic.ts L43-59

parseServerUrl

src/me/sources.ts L120-133

meCheckServer

src/me/sources.ts L23-29

fetchJson with the transport deadline

Tests

File

What it checks

me.test.contract

me: the chosen server persists across a relaunch

me.test.contract

me: a bad server address is refused

me.test.contract

me: a custom server is checked against its /hm/api/config before it is used

me.test.contract

me: a connected custom server is saved, picked again, kept across a relaunch and swiped away

me.test.contract

me: empty state offers create and import

src/me/__tests__/logic.test.ts

parseServerUrl: adds https and keeps the origin; invalid; credentials and nonhierarchical schemes cannot silently select another host

src/me/__tests__/sources.test.ts

Me server and profile reads give Exact native transport their requested deadlines

Delivery

Delivered by #1470.

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

Unsubscribe anytime