Terrain Viewer
Features

Saved Views

A view stored in your own AT Protocol account (Bluesky or any other server), behind a short link that anyone opens without signing in. Beta.

A saved view is the current view (camera, mode, sources, visualization settings) written as one public record in your own AT Protocol account, the kind of account Bluesky uses. The app has no server and keeps nothing: the record lives on your account's server, and the short link ?view=at/<account>/<id> tells any copy of the app where to read it.

It differs from a bookmark, which stays in one browser, and from the ordinary Share link, which carries the whole state in a long address. The same box can also save the view as a file in your own Dropbox or Google Drive, where the deployment is registered with them: see Cloud Storage.

The idea comes from Placemark, where Tom MacWright stores maps in the user's AT Protocol account from the browser alone: placemark/placemark#281.

Turn it on

The feature is in beta and off by default. Open Settings, find Saved views, short links (AT Protocol) and switch Beta on. The flag is local to the browser. Opening a ?view= link needs neither the flag nor an account.

Sign in

Open Share (in Download and Snapshot). The Save view fold has a Sign in with Bluesky button, and below it a field for any other account or server.

The Save view fold of the Share dialog, signed out: the Sign in with Bluesky button, then the Other server or handle field with Sign in and Views

Signed out. Views lists the saved views of the account typed in the field, with no sign-in. Where the deployment is registered with Dropbox or Google Drive, tabs above switch between them; otherwise there is no tab bar.

  1. Sign in with Bluesky: nothing to type. A window opens on Bluesky's own page, which shows the accounts you are already signed in to there, or its login form. Pick one and accept.
  2. For an account on another server, type in Other server or handle your handle (alice.example.com), a DID, or your server's address (pds.example.com or https://pds.example.com), then Sign in. The window opens on that account's server.
  3. The window closes by itself and the box shows who is signed in. The app tab never leaves the view you are on, and the app never sees your password.

If the browser blocks the window, the sign-in happens in the app tab instead: it leaves for the server and comes back to the view you left, with the Share dialog open. Closing the window halfway leaves the box waiting: press Cancel under it.

What the app asks for is narrow: creating, changing and deleting records of its own type (com.iconem.terrainviewer.view) and uploading pictures. It cannot read or write your posts, follows, likes or messages.

Any AT Protocol server works, not only Bluesky's: a self-hosted server, or another provider. An old server that does not know granular permissions may refuse the sign-in.

Save

Give the view a title (optional), keep or clear Include a picture of the map, and press Save view. The short link appears in green: click it to copy.

Saving does not post anything. The record is in a collection only this app uses, so it does not appear in your Bluesky feed, on your profile, or in anyone's timeline. It is public all the same: anyone who has its address can read it, and a repository browser such as pdsls.dev shows it under your account, like every record of an AT Protocol account.

What is stored, and where

WhereYour account's server (PDS), in the collection com.iconem.terrainviewer.view
WhatThe view's parameters as the address bar spells them, a title, the date, the mode, the host and build it was saved from, and the picture if you kept it
NeverAPI keys. The app keeps them in the browser's storage, not in the address, and a parameter named like a credential is dropped anyway
MaskedA key inside a source address (…?api_key=…) becomes a placeholder. The panel warns you: that source will not load for other people

The record keeps the mode it was saved in (Terrain, Historical, River REM), so the link opens in that mode whatever mode the visitor used last.

List, open, copy, delete

Signed in, the box lists your saved views, newest first, with their picture, title, date and mode.

The Save view box signed in: a title field, Save view, the picture switch, and a list of three saved views each with open, copy, post and delete buttons

Signed in (an example account): each saved view has Open, Copy link, Post and Delete

  • Open loads the view in this tab.
  • Copy link copies its short link.
  • Bluesky (the butterfly) opens Bluesky's composer with the title and the short link: see Share on Bluesky. Signed out, the lists of other accounts have it too.
  • Post with preview (the paper plane, your own views only) opens the post editor.
  • Delete asks once, in place, then removes the record and its picture from your server. The link then answers "This view no longer exists".

One row of the list asking Delete? with Delete and Keep buttons

Signed out, Views reads the list of any account whose handle you type. The list is public, so no sign-in is involved, and it has no Delete.

https://terrain-viewer.iconem.com/?view=at/<handle or DID>/<id> opens for everyone, signed in or not, beta flag or not. The app finds the account's server, reads the record, and replaces the short address with the full one. A view saved in a mode that has its own page gets its link there (/rem/?view=…, /historical/?view=…).

If the record was deleted, the account is gone, or its server does not answer, the app says which and opens on its default view.

Share on Bluesky

Two ways, side by side under a fresh link and in each row of the list:

Open in Bluesky (the default)Post with preview
Sign-in to this appnoneyour account, signed in
Permissionnoneone more: creating a post, asked on the first click
The post's cardBluesky's, built from the site's page: the site's (or the mode's) generic previewthis view's own title and picture
Who publishesyou, in Bluesky's composerthe app, after you press Post

Open in Bluesky opens https://bsky.app/intent/compose?text=… in a new tab, the text being the view's title then its short link. A post holds 300 graphemes (characters as you see them, an emoji with modifiers counting once): the title is cut, ending in "…", so the link always fits whole. You edit the text and publish in Bluesky itself, signed in there. The same intent is the Bluesky button of the dialog's share buttons, for any share link, saved view or not.

Post with preview (optional)

A saved view can also be published by the app as a Bluesky post whose card shows the view's own title and picture. A post carries its card itself, so this is the one place where a short link shows the view's picture.

The post editor: the text with the link, the card with the view's picture, a note about the extra permission, and the Allow posting button

The editor opens first; the text is yours to change

  • Post with preview… (next to a fresh link, or the paper plane in the list) opens an editor. Nothing is published until you press Post there.
  • Posting needs one more permission than saving: creating a post, and nothing else. The first time, Allow posting… opens a window on your server to accept it; the editor stays open behind it (when the window is blocked, the tab goes to the server and the editor comes back on return). People who only save views, or share through Open in Bluesky, are never asked for it. The editor offers the intent instead as long as the permission is missing.
  • To go back to the narrow permission, sign out and sign in again.

The Post step has not been run against a real account yet: the request for the wider permission was checked against Bluesky's server, the publication itself was not.

Limits of a client with no server

The app signs in from the browser alone, as a "public client". That has costs, stated plainly:

  • A sign-in lasts two weeks. Bluesky's server gives a browser-only client a session of at most two weeks, against months for an app with its own server. After that, sign in again. Saved views and their links are not affected.
  • The sign-in keys sit in the browser's storage. Any script running on the page could read them. The narrow permission bounds the damage: records of this app's own type, and pictures.
  • A link needs its author's server. If that server is down, or the account is deleted or deactivated, the link does not open. Nothing is cached on our side, because there is no "our side".
  • No picture preview for a short link. A chat or social network that unfurls a link reads the page's HTML without running scripts, and this site is static: every ?view= link shows the site's general preview (or the mode's, for /rem/ and /historical/), not the view's picture. No static route can change that: a page per view would have to be built and deployed for each save. The exception is Post with preview above (an Open in Bluesky post shows the generic preview too). Showing the view's own picture everywhere would take one small server-side piece (a single route that reads the record and answers with the right tags), which the app does not have.
  • A record is public and copies may outlive it. Deleting removes it from your server; relays or archives that read it earlier may keep their copy.

For developers

Files. lib/view-sharing.ts is the one door the app goes through. lib/atproto-view.ts has no dependency: the reference parser, the record builder, the public reads (getRecord, listRecords, plain fetch), the post record, the client's identity. lib/atproto-oauth.ts is the only importer of @atcute/oauth-browser-client and is loaded on demand. The panel is components/TerrainControlPanel/SavedViewPanel.tsx. lib/bluesky-intent.ts (no dependency, tested by node scripts/test-lib.mjs lib/bluesky-intent.test.ts) builds the compose intent and its 300-grapheme cut, for the panel and for the share buttons. src/main.tsx settles a ?view= link and the sign-in's return before React starts.

Client metadata. An AT Protocol OAuth client is identified by the https address of a JSON file, and its redirect address must be on the same host. So each deployed host has its own static file, public/atproto/<host>.json, and the page picks the one named after its hostname. A new host needs a file and an entry in OAUTH_CLIENT_HOSTS; a test compares the files with what the code describes. The file's scope declares the most the app may ever ask for (saving, plus creating a post); each sign-in requests a subset, and the server grants what was requested. Bluesky's server refuses a scope the file does not declare.

Development. The protocol has a built-in loopback client for development: its id is http://localhost?redirect_uri=…&scope=… and the redirect must be an IP literal. The page therefore has to be open on http://127.0.0.1:<port>, not http://localhost:<port> (the session is stored per origin). Start Vite with --host 127.0.0.1.

The record.

{
  "$type": "com.iconem.terrainviewer.view",
  "title": "Mississippi meanders, height above the river",
  "createdAt": "2026-11-27T10:12:00.000Z",
  "schemaVersion": 1,
  "appVersion": "18217e2",
  "site": "terrain-viewer.iconem.com",
  "params": { "appMode": "rem", "lat": "33.1467", "lng": "-91.1258", "zoom": "10.5" },
  "thumbnail": { "$type": "blob", "ref": { "$link": "bafkrei…" }, "mimeType": "image/jpeg", "size": 151234 }
}

params is the query string key by key, values as strings (the AT Protocol data model has no floats, and the URL spelling is what the app already reads); a repeated key is a list. appMode is always present in records written since 2026-11-27. Credential-named keys are dropped and credentials inside values masked, on write and again on read. The thumbnail is a JPEG of at most 1200 px.

Sign in without a handle, in a popup. Sign in with Bluesky starts the authorization at Bluesky's entryway (https://bsky.social, the library's pds target) with no login_hint, so Bluesky's page asks who signs in; the account is the session's sub, and its handle is resolved afterwards. Bluesky's server accepts such a pushed request from the deployed client ids (checked 2026-11-29: a request_uri comes back). The window is opened synchronously on the click (an about:blank popup, navigated once the pushed request returns), or browsers block it. The redirect address is the same / for the popup and the app tab, so the metadata files did not change: the localStorage entry written when the sign-in starts carries a popup id, and the page that receives the callback with that id is the popup. It finishes the sign-in, posts the result on a BroadcastChannel (the account entry's storage event is the second path; the library's own session store already syncs across tabs), and closes itself instead of starting the app. window.opener and popup.closed are of no use: Bluesky's authorization page sends Cross-Origin-Opener-Policy: same-origin, which severs the popup from the opener. Hence the Cancel link while the box waits.

Sign-out. Sign out revokes the session's token at the account's server and deletes the keys from the browser.

Tests. node scripts/test-lib.mjs lib/atproto-view.test.ts lib/mode-share-url.test.ts (offline, recorded fixture).

On this page