Phase D of docs/AFFINE.md (ADR-14).
The canvas lives in the page's Y.Doc next to its text, in
ydoc.getMap("surface"): one Y.Map per element, each field its own entry so
concurrent edits merge. The page's text is a note on the canvas bound to
the same "default" fragment, so typing on the canvas is typing in the page.
Canvas edits have their own undo history through a Y.UndoManager.
- New package @docwell/canvas: viewport with pan, zoom and pinch;
selection, marquee, snapping, resize and rotate; notes, text, shapes
(plain or scribbled), connectors (straight, curve, elbow, with arrowheads
and labels), pen and eraser, frames, groups, pictures, embeds and link
cards, and mind maps (right, left or both sides; Tab, Enter, arrows).
A style bar over the selection; the last style per kind is the default.
- Presentation through frames, stickers and templates, PNG and SVG export.
- Page/Edgeless switch in the header, ?mode= in page and share links, a
per-page default (pages.default_mode) and a per-device default for new
pages; share links show the canvas read-only.
- Server: yrs writes the canvas into the document JSON as "surface",
adds its text to search, and writes it back on restores and templates.
- Phone: the bridge draws the canvas read-only (protocol 3) and the page
screen has a canvas button.
Strings are translated into all five languages and the user guide covers
edgeless mode.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 KiB
Workspaces, spaces and pages
How content is organized
- An organization is a company or team. Everyone belongs to at most one.
- A workspace belongs to an organization and holds spaces. Switch workspaces at the top of the sidebar.
- A space groups pages, for example per team or project. It is open (every workspace member can open it) or private (only the people and groups added to it).
- Pages nest inside each other. Drag them in the sidebar to reorder or move them.
Writing
Pages save as you type, and everyone with the page open sees changes and cursors live.
| To | Do this |
|---|---|
| Insert a heading, list, to-do list, table, callout, quote, code block, divider, image or file | Type / and pick from the menu (keep typing to filter); headings 4–6 are under Other headings |
| Start a to-do list | Type [] at the start of a line |
| Format text, colour or highlight it, align it, or add a link | Select it and use the toolbar that appears |
| Move, duplicate, turn into another kind, or delete a block | Point at it and drag the ⠿ grip in the margin, or click the grip for a menu |
| Change a table | Click in it for the table toolbar; drag the grips on a row's left edge or a column's top edge to move it (or Ctrl+Alt+arrow keys) |
| Copy a link to a block | Ctrl+Shift+C in the desktop app, or the link button in the margin or the toolbar |
| Headings by keyboard | Ctrl+Shift+1 to 6, and Ctrl+Shift+0 for plain text |
| Mention someone | Type @ and their name |
| Show another page inside this one | Type ![[ and pick it, or use /Synced page; it stays up to date as that page changes, and Fold shrinks it to its title |
| Open a page beside this one | Alt+click (Option+click on a Mac) any link to it, or choose Open beside in the ⋯ menu |
| Go back or forward | Ctrl+[ and Ctrl+] (⌘[ and ⌘] on a Mac) |
| Add an image or file | Paste or drop it, or use /image, /file or the paperclip in the header |
| Undo | Ctrl+Z (your own changes only) |
| Fold the sidebar | Ctrl+/ |
History in the page header lists saved versions; you can view any of them and restore it. Restoring keeps the current text as a version too.
A synced page is read-only where it is shown: open it to edit it. People who cannot open that page see only its title. Account → Editor sets, for this device, the text size, whether new pages start full width or titled with today's date, whether properties and the pages that link here show, and line numbers in code blocks.
Databases
A database is a block that holds records: type /database to add one, or select a list and press Ctrl+G (or
choose Group as database in the list's ⠿ menu) to turn each item into a record. Everyone with the page open edits
it together, and Ctrl+Z undoes database changes like any other.
- Properties are the columns: title, text, number, checkbox, select, multi-select, date, progress, link, attachment, member, created time and created by. Click a column's name to rename it, change its type (values are converted), sort or filter by it, hide it, move it, or insert another next to it. Drag its edge to resize it, or its name to move it.
- Cells: click a cell and type, or press Enter to edit it; arrow keys and Tab move between cells, Delete clears them and Shift+arrows select several. Copy and paste work with spreadsheets: paste a block of cells and new records are added as needed.
- Views sit in tabs above the records, each with its own filters, sorts, grouping and visible properties: a table, a kanban board grouped by a select, checkbox or member property (drag cards between columns), and a calendar that places records on a date property (drag them to another day). Click the active tab to rename, duplicate, change or delete the view; which view you look at is yours alone.
- Records as pages: Open on a record, or a click on a card, opens it beside the page, with its properties on top and room to write below. The link button there, or Copy link to record when you right-click a row, copies a link that opens the page with that record open; it works for anyone who can open the page. On a public link, the same buttons copy a link to the record on that public page.
- CSV: the ⋯ menu exports the current view as a CSV file, or adds records from one; an empty database takes the file's columns and guesses their types.
In the mobile app, tap a cell to edit it and press and hold a record for its menu; the back button closes an open record. To drag a record with a finger, drag a row by its ⠿ grip, a board card by the ⠿ grip in its corner, or a calendar entry by the entry itself. The formatting bar acts on an open record's notes while you are writing in them. Columns are moved with Move left and Move right in their menu.
Exports (Markdown, HTML, PDF, Word) show a database as a table of its first view's columns. Search lists a matching record on its own, under the page that holds it, and opens it there. On a public link or in History, databases are read-only.
Edgeless mode (canvas)
Every page can also be shown as a whiteboard. The two buttons next to the page's title in the header switch between
Page and Edgeless; the page's text becomes a note on an endless canvas, and typing in that note is typing in the
page. To have a page open as a canvas for everyone, choose Open as canvas for everyone in the page's ⋯ menu; a link
with ?mode=edgeless (or ?mode=page) opens one view either way. Account settings → Editor can make new pages
start as canvases.
- Tools sit at the bottom: select (V), hand (H), note (N), text (T), shape (S: square, rounded rectangle, ellipse, diamond or triangle, drawn plain or scribbled), connector (C: straight, curved or elbowed, stuck to what it joins), pen (P), eraser (E), frame (F), mind map (M), picture (I), link (L), and stickers and templates.
- Moving around: scroll to pan, Ctrl+scroll or pinch to zoom, hold Space or the middle button to drag the view. Ctrl+= and Ctrl+- zoom, Alt+0 goes to 100%, Alt+1 fits everything and Alt+2 fits the selection.
- Editing: click to select, Shift+click or drag a box for more; drag to move (edges line up with what is nearby; hold Alt to stop that), drag the corners to resize and the round handle to turn. Double-click a shape, text, frame title or line to type in it, and a note to write in it. The bar above the selection changes colours, line styles, arrowheads, fonts and order. Ctrl+G groups, Ctrl+Shift+G ungroups, Ctrl+D duplicates, Ctrl+Z undoes, and copy and paste work between canvases. The style you pick last for a kind of element is what the next one gets.
- Mind maps: pick a node and press Tab for a branch, Enter for a sibling, the arrow keys to move and Delete to remove one. The bar above the map lays it out to the right, to the left or on both sides.
- Frames carry what is inside them when they move. Present (in the tools, or the ⋯ menu) shows the frames one after another, full screen; the arrow keys step and Escape ends.
- Export: the ⋯ menu saves the canvas as a PNG or SVG picture.
Readers of a public link see the canvas read-only, and so does the mobile app: the canvas button in its title bar switches between the text and the canvas. The canvas's text (shapes, notes, frames, mind maps) is found by search, and History brings an old canvas back with the text.
Comments
Select text and choose Comment to start a discussion; the text stays highlighted and the comment appears in the Comments panel. People with the commenter role can comment without being able to edit. Authors and space admins can delete comments.
The Inbox lists your notifications. Under its settings you choose whether they also come by email, and which kinds (mentions, comments, replies, resolved threads, shared pages, reminders).
Finding things
Press Ctrl+K (⌘K on a Mac) or click Search in the sidebar. With nothing typed it shows the pages you visited last; type to search titles and text in every space you can open. The filters narrow results by space, tag, author or date. Star a page (☆ in the header) to keep it under Favorites in the sidebar.
Properties, tags and collections
Under each page title, Properties shows the page's tags, the workspace's custom properties (text, number, checkbox, date, select, multi-select, person and link) and when the page was created and changed. Info in the page header opens the same list in a side panel with every property, including hidden ones. Anyone who works in the workspace can add properties there, or in Settings → Page properties, where you can also order them, choose when they show under the title and edit select choices. Settings → Tags renames, recolours, merges and deletes tags.
All docs in the sidebar lists every page you can open, as a list, a grid or cards. Group and order the list by any property, pick which properties show, and filter it with rules (for example "Status is Done" or "changed in the last 7 days"). Tick pages to tag, move, trash or collect them at once. Save as collection keeps the filter as a collection in the sidebar. A collection holds the pages its rules match, plus pages added by hand from its list or from the page's Info panel. Collections are yours until you share them with the workspace.
Journal
Journal in the sidebar opens today's page in your journal: one page per day, kept in a private Journal space that only you see, workspace admins included. The week strip above a journal page jumps between days; a dot marks days that already have a page. In read mode, clicking a date in any page opens that day's journal. Pick the page new journal pages start from in the Info panel, under Journal; any page marked as a template can be used.
Sharing
Share in the page header shows who can open the page through its space and copies the page's link. Editors can turn on a public link: anyone with it can read the page (and, if you choose, the pages inside it) without an account. Readers can copy links to its blocks and database records from there, and those links open on the public page too. Turning it off makes the link stop working at once. Pages in the trash are never shown through a link.
Import and export
- Export: the ⋯ menu in the page header saves the page as Markdown, HTML, PDF or Word. PDFs are A4, with a bookmark per heading and the page's images. Word files keep headings, lists, to-dos, callouts, tables, colours and the page's images, and import back into Docwell as they were. Draw.io and Excalidraw diagrams become a link to their file, and Mermaid charts show their source.
- Import: Import on a space's page list creates a page per Markdown (
.md,.txt), HTML or Word (.docx) file. A leading# Heading, or the Word document's title, becomes the page title. Word headings, lists, quotes, tables, alignment, colours, links and images are kept. Up to 20 files at once. - From Notion: in Notion, choose Settings → Export, pick Markdown & CSV or HTML and include subpages and
files. Import the
.zipyou get (up to 100 MB, 2000 pages) as it is. Docwell rebuilds the page tree, keeps links between the pages, and stores images and files as attachments. Each database becomes a page with a database block of its rows, with guessed property types, and the row pages under it. Tables in pages come in as tables; callouts and to-do lists are kept. - To Notion: export the page as Word or Markdown, then import that file with Import in Notion's sidebar.
Trash
Move to trash hides a page and everything inside it. Restore it from the space's Trash. Space admins can delete pages there for good.