Pages, addresses and links
Every comment belongs to one page at one address. The address is where it was left, such as staging.acme.com; the page is which page there, such as /pricing.
Addresses
Each address keeps its own comments and its own layers, even when one key covers them all. A client's comments on staging stay on staging, and production starts clean.
| Where the page is | Its address |
|---|---|
acme.com and www.acme.com | acme.com: one address, www. is dropped |
staging.acme.com | staging.acme.com, apart from production |
uat.acme.com | uat.acme.com, apart from both |
3f9c2a1b.acme.pages.dev, 7d01e4c2.acme.pages.dev | *.acme.pages.dev: every one-off deploy of the project shares one address, so comments carry over from one preview to the next. Vercel's and Netlify's one-off deploy addresses work the same way. |
localhost:5173 | localhost:5173, with its port: another app on :3000 is another address. These comments are kept in the project folder. |
- A layer belongs to the address it was made on. Public layers and the site's default Public layer are listed only at their own address.
- Connected AI apps see the address of each comment, and can be asked for one: “what is still open on staging?” See Connect AI apps.
Pages
At an address, comments are kept per page, and by default a page is its path: /pricing and /pricing?tab=annual&utm_source=x are the same page and show the same comments.
- A hash is part of the page only when it is a route. An app that routes by hash, with addresses like
/app/#/docs, gets each route as its own page. A hash that points to a place on the page, like/pricing#plans, is ignored. - Query parameters count only when you name them. A site that routes by
?page=or?product=names them indata-page-params. - One page in several languages is one page. When a page lists its translations with
<link rel="alternate" hreflang="…">tags, as most multilingual sites do for search engines,/pl/aboutand/aboutshow the same comments. That holds for sites that send each reader to their own language, so a reviewer reading in Polish sees the pins left in English. Comments are kept under thex-defaultversion. Translations at another address, such asexample.pl, keep their own comments.
The side panel shows comments from every page of the layer at this address, and a comment on another page opens that page with the comment showing.
Deep links
The script reads two query parameters on your pages and removes them from the address bar as soon as it has read them, using history.replaceState. A refresh does not reopen the comment, and a copied URL does not carry someone else's notification.
| Parameter | Meaning |
|---|---|
sl-comment | A comment id. Once comments have loaded, if the comment is on the current page it is scrolled into view, about a third of the way down the viewport, and opened. If it is not on this page or the reader cannot see it, nothing happens. |
sl-layer | A layer id, or public for the site's default layer. Selects that layer before comments load, so an invitation or a shared link to one layer does not land on another. A visitor who needs an account to see the layer is asked to log in first. |
Notification emails and the dashboard build these links for you. They go before a hash route, so /app/?sl-comment=…#/docs still lands on the right route. Query parameters were chosen over the hash because the hash is the one part of a URL a single-page app is likely to route on, and an unknown query parameter is ignored by every router. Your own application should not use these two names.
Comment links
Every comment also has a short link, sharedlayers.com/c/…, which opens its page with the comment showing. Copy it with Copy link in the ⋯ menu at the top of the thread. Emails, Slack messages and Jira or ClickUp issues use it too, and pasted in Slack it shows a preview.