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 |
|---|---|
The three share actions; a document shares its title and URL | |
Sharing as one of the app's action patterns | |
Share as the last trailing bar button of the document | |
The Share bar button, shown only when the page has a share URL | |
The order of the document bar's trailing actions | |
The shared link is the only place the site's address is visible | |
The bar button | |
The navigation bar that holds it | |
The share symbol | |
The "Share" label on a symbol-only button | |
The share sheet is the system's, not the app's |
Implementation
Page | Part it plays |
|---|---|
The shareDoc action and the Share button in DocScreen | |
shareUrl: the page's server, /hm/, the account and path of the resolved document | |
hmUrl, from which the share path is derived | |
DocScreen receives the page that carries shareUrl | |
The built-in share call | |
The /hm/ gateway form the shared URL uses, which the app can also read back | |
The site's /hm/<uid>/<path> web address | |
The redirect test in load.test.ts asserts shareUrl |
Code
File | What |
|---|---|
action shareDoc: share(title=page.title, url=page.shareUrl) | |
The Share bar button, present only when shareUrl is set | |
DocPage shape with shareUrl | |
shareUrl built from the page's server and the resolved ref | |
failedPage: a failed page has no shareUrl, so no Share button | |
hmUrl |
Tests
File | What it checks |
|---|---|
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