clave docs

Drafts and slots

A draft is a version of the site that the owner can look at before it goes live.

A draft is unlisted and it is noindex.

Its forms work. A message sent on a draft is a draft message: it is kept apart from the live site's, it is mailed to the site's owner only with [Draft] in the subject, and it uses none of the live form's limits.

Slots

A site has one draft slot, slot 1. It keeps one draft address, and each new draft replaces the one before it.

A slot can own a branch: refs/heads/slot-1. No slot owns a branch by default. The first write with that slot starts one. A read with a slot reads the site, because looking is not starting.

Approval

A draft reaches the public when somebody publishes it: the agent, after the owner says yes in the chat, or a person on the draft's review page in the app. Publishing a draft moves the slot's branch into main.

Publishing needs approval

The owner can turn on Publishing needs approval for a site, on its Settings tab in the app. Then no agent and no API token puts the site live: every publish, activate and restore answers needs_approval (409). The agent makes a draft and sends the owner its review_url. The owner, or somebody who works on the site, compares the draft with the live site on that page and publishes it there. A restore is done on the site's versions page.

Only the owner changes the setting, and only in the app. It is off for a new site. The app's home page lists the drafts that wait for an answer only for sites where it is on.

Then Clave builds the approved commit again for the live site. A draft is built with its own address and its own posts, so the live site cannot use its bytes. The source is the same, so the pages are the same. A draft that has no source commit (a build from a laptop) goes live as it is.

main never takes a conflict marker. A slot's branch can, because there is no working copy here to hold a half-done merge.

Posts on a draft

The posts repository has a slot line too: refs/heads/slot-1. The draft shows the posts on that line. The live site shows the posts on main.

A post marked draft: true stays off the live site, and a draft shows it.

Discard

Discarding a draft takes it offline and removes the slot's branch. The slot keeps its address and its store. A slot that holds work needs a confirmation before it is discarded. That is the one destructive act here.

Archiving a site takes its draft offline too, and keeps the slot. The next draft after the site comes back answers at the same address.

Draft data in the app

The Enquiries, Mail and Files tabs of a site show the live data first. The Live | Draft control above each list shows the draft's. The counts on the tabs and the account's inbox are live only, so test data never asks for attention.

The site's page has two controls on the draft, each with a confirmation: