Links and previews

Any web address you save opens with a tap, and a saved link shows a small card with the page's title and picture. What gets fetched, by whom, and how to turn it off.

Checked against the running product on 6 min readMarkdown

On this page

If you save a web address anywhere in The Margin, you can open it from where you saved it. A link pasted into quick capture, typed into a card title, left in a shopping item or sent in a message is a link, not a string you have to select and copy.

Everywhere text you wrote is shown back to you:

  • captures in the Inbox
  • notes, in Read view and in the note list
  • card titles, descriptions and comments
  • checklist items, on cards and in standalone checklists
  • shopping items and their notes
  • an event's place and notes
  • chore descriptions and the notes left when one is sent back
  • the note on a debt
  • chat messages, and both sides of a conversation with Margin Intelligence

An address counts as a link when it starts with https:// or http://, starts with www., or is a plain domain with a common ending such as example.com/page. Email addresses open your mail app. The full stop or bracket that ends your sentence is left out of the link. Anything inside backticks is treated as code and left alone.

A link shows where it really goes. A link can be written with a label, and a label can say anything. If the label names one site and the address behind it belongs to another (a label reading paypal.com over an address at a different site, say), The Margin shows the real address instead of the label. An address with a username in front of the site name, such as https://[email protected], is not made into a link at all, because the part before the @ is not where it goes.

A link opens in a new browser tab on the web, and in your phone's browser from the installed app or the phone app.

Most of these sentences sit in something that already does a job when you press it: a card opens, a shopping item ticks, a checklist line starts editing. Pressing the link opens the link. Pressing anywhere else on the row does what the row always did.

In an editor your text stays text, so a click places the cursor. To follow a link without leaving the editor, hold Ctrl (or ⌘ on a Mac) and click it. That works in notes, card descriptions, comments and the journal.

Fields that are always a form, such as an event's place and notes, list the links they contain right under the field. The phone app does the same under a card's description.

Right-click a link on a computer, or press and hold it on a phone, to copy it. In the phone app, press and hold opens the share sheet, which has Copy in it.

Preview cards#

When an item is mainly a link, it shows a card: the site's name, the page's title, up to two lines of description and a small picture.

Two kinds of item cause a preview to be made:

  • a capture that is just an address
  • a note whose first line is an address

Two more show a preview that already exists, and never cause one:

  • a card with an address in its description (the first one)
  • a chat message with exactly one link

The difference is who can see the item. A stored preview, address included, syncs to every member of the workspace. Captures and notes are already visible to the whole workspace, so their previews tell nobody anything new. A chat thread is only seen by the people in it and a board only by its members, so a link in a direct message or on a restricted board never creates a preview. If the same address was already previewed from a capture or a note, the card shows there too.

In the notes list, a note that opens with a link shows the picture as a small thumbnail.

The picture is the one the page offers for sharing. If it has none, the card shows the site's icon, and if it has neither, the card has no picture. A page that gives no title and no description gets no card, because a card that only repeats the address adds nothing.

Everyone in a workspace sees the same preview. The first person to look at a capture or a note causes it to be made, and it then syncs to the others. Each workspace makes its own: a preview is never copied from, or checked against, another workspace.

What gets fetched, and what the site sees#

To make a preview, Margin's server reads the page once. Your device never contacts the site: the picture on the card is a small copy Margin made and stored with your data, not an image loaded from the site.

This means:

  • The site sees one request from Margin's server. It does not see your device, your address or your account.
  • The site does learn that someone saved its address. For a long, unguessable address (a private share link, for example) that request is the first time anyone other than you has visited it.
  • Margin sends no cookies and no sign-in with the request, so it only ever sees what a signed-out stranger would see.
  • A preview is kept for 30 days and then refreshed the next time someone looks at the item. A link that failed is not tried again for a few hours. A preview nobody has looked at for a week after it expired is deleted.
  • For each page Margin makes at most three requests: the page, and up to two tries at its picture.

What is never previewed#

Links in these still open. They never cause a fetch:

  • a chat message or a board card (see above)
  • a note behind a PIN, whether or not you have it unlocked
  • anything in your Vault
  • anything you have hidden from memory
  • anything in the "Try it now" sandbox

If an item like this contains a link that a capture or an ordinary note already has a preview for, that stored preview can still be shown. Nothing new is requested.

Fetching a page is the same as visiting it. Some links act the moment they are visited, and most of them work once: a sign-in link from an email, a link that confirms an address, a password reset, an invitation, an unsubscribe link. If Margin fetched one to draw a card, it would use the link up before you did.

So an address that looks like one of these gets no preview. That covers addresses with words such as token, verify, confirm, reset, unsubscribe, invite or callback next to a code, sign-in addresses that carry a long code, and any address with a long string of random-looking characters in it. The check leans toward caution, so now and then an ordinary page with a long code in its address (some shared playlists and documents) has no card. The link itself always opens when you press it.

Limits#

Each person can cause up to 300 new previews a day, and a workspace keeps up to 5,000. Past either, links still open and simply have no card until older previews expire. Nobody saving links by hand gets near these; they are there so the feature cannot be used to make Margin's server fetch pages in bulk.

Turning previews off#

Settings→Profile→Link previews on the web, or Settings→Data in the phone app. It applies to your account on every device. With it off, nothing is fetched on your behalf and the cards are hidden for you. Other people in a shared workspace keep their own setting.