Share a document
A reader shares the document they are reading through the iPhone share sheet, as a web link anyone can open.

As a reader, I want to send the document I am reading to someone else, so that they can open it too, with or without Seed.

Situation

I am reading a document in the Read tab and want to pass it on by message, mail, or by copying its link.

What I do

    Tap the Share button, the last button in the document's bar.

    Choose where to send it in the iPhone share sheet.

    Send, or close the sheet to go back to reading.

What I should see

    A Share button sits at the end of the bar on the home and on every opened document, once the page has loaded.

    The button is announced as "Share" to assistive technology.

    Tapping it opens the iPhone's own share sheet over the page.

    The sheet carries the document's title and a link to it.

    The link is a web address that starts with the site the page was read from, followed by "/hm/", the account ID and the page's path. It opens in any browser.

    A document I read from another site shares that site's address, not my own server's.

    A document that has moved shares the address of its new place.

    The link points to the document as a whole and to its latest version.

    Closing the share sheet returns me to the same place in the page.

    Sharing needs no identity and sends nothing to a server.

When something goes wrong

    A page that is still loading, or failed to load, has no Share button. I tap "Retry" on the failure, and the button appears once the page shows.

Not included

    The shared link is the long form with the account ID, not the site's short address for the page (for example "https://hyper.media/hm/z6Mk…/glossary", not "https://hyper.media/glossary").

    I cannot share an hm:// link, a link to one paragraph, or a link to a specific version (Share, copy and open).

    There is no separate "Copy link" in the app. Copying is what the share sheet offers.

    An author's profile, the directory, and a comment or thread cannot be shared.

    No test taps the Share button. Only the link itself is checked (Read: screens and components).

Trace

Story US-READ-11, 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

Share, copy and open

The three share actions; a document shares its title and URL

Buttons and actions

Sharing as one of the app's action patterns

Every bar button

Share as the last trailing bar button of the document

Document and site home

The Share bar button, shown only when the page has a share URL

Navigation bars and their actions

The order of the document bar's trailing actions

Reading another site in place

The shared link is the only place the site's address is visible

button

The bar button

header, footer and nav

The navigation bar that holds it

Every symbol

The share symbol

Roles, headings and labels

The "Share" label on a symbol-only button

Leave it unsaid: the platform draws the chrome

The share sheet is the system's, not the app's

Implementation

Page

Part it plays

Read: screens and components

The shareDoc action and the Share button in DocScreen

Read: loading pages, caches and embeds

shareUrl: the page's server, /hm/, the account and path of the resolved document

Read: ids, refs and link targets

hmUrl, from which the share path is derived

Read: root contract wiring

DocScreen receives the page that carries shareUrl

Contract views and built-in calls

The built-in share call

Deep links and URL handling

The /hm/ gateway form the shared URL uses, which the app can also read back

Seed site read API

The site's /hm/<uid>/<path> web address

Bun unit tests

The redirect test in load.test.ts asserts shareUrl

Code

File

What

read.contract L291-292

action shareDoc: share(title=page.title, url=page.shareUrl)

read.contract L309-311

The Share bar button, present only when shareUrl is set

read.contract L48-63

DocPage shape with shareUrl

src/read/load.ts L381-381

shareUrl built from the page's server and the resolved ref

src/read/load.ts L385-406

failedPage: a failed page has no shareUrl, so no Share button

src/read/ids.ts L93-96

hmUrl

Tests

File

What it checks

src/read/__tests__/load.test.ts

redirected documents use the destination for children, discussion and sharing

Delivery

Delivered by #1470.

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

Unsubscribe anytime

Comments