oficina / docs Public

Clone
git clone https://amadan.net/oficina/docs

Plain git — no account needed to clone.

Download

Download this file

1# Immediate native documents
2
3New reserves an account-bound window and opens a local untitled replica. The
4initial paragraph and first editable generation are ready before the text view
5is exposed; no server request blocks the editor. Attachment preserves the
6window ID, text view, replica, generations, and selection.
7
8The draft owns a UUID creation token. POST /documents accepts creation_token;
9migration 0008 adds a nullable token with a unique (owner_id, creation_token)
10index. Creation and lookup run under the writer transaction. Replays return the
11existing document and never overwrite a later title. The token is not authority:
12creation still requires membership and derives its owner from the session.
13
14Drafts count as unsaved before initialization. Save/close awaits creation and
15queued content/title writes; failure retains the draft and token for retry.
16Discard changes the epoch so late responses cannot attach or upload discarded
17content. A server may already have created an empty document before cancellation.
18Local draft state is held in memory with the existing close/quit guards.
19
20Double-clicking the title or File > Rename document opens the same title input.
21The model owns that buffer so Save/close also commits it; Escape cancels it.
22Titles over 1024 UTF-8 bytes remain editable with an error. Rename uses the
23existing document write authorization inside the authenticated, CSRF-protected
24POST /d/{sqid}/title route. Pending titles survive capability refreshes.
25
26Deploy the backend migration/routes before publishing the native client. Older
27servers do not provide idempotent creation. Tests are documented in
28smoke/document-window/README.md. Design and implementation reviewed by GPT-6 Astra.
29