Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Phase 10: canvas (edgeless whiteboard), Check for Updates, and the road to 1.0.0

Status: built, from this plan as approved (with every recommendation: a Developer ID and notarization for 1.0, no Windows signing yet, the updater key in Doppler, pre-releases off on stable builds and a daily check that only notifies, and the name “Canvas”), on one branch and one PR, merged after #37. Where the build differs from the plan, it says so just below.

Changed from the plan

  • A shape’s text is one block, not a section of blocks (§1.2). A note’s text is plain text with line breaks, kept in its CanvasText block, typed and merged as page text is (two devices typing in one note both keep what they typed). There’s no bold or links inside notes yet.
  • Undo is the canvas’s own, a step per gesture kept by the UI (as the page editor’s history is), not Loro’s UndoManager.
  • 1,000 notes are about 260 KB, not 200: each is a shape, a block and its text (a page of 1,000 such paragraphs is about 120 KB). The test fails past 300 KB.
  • Not built: Present (stepping through frames), the minimap, Pencil hover, pasting a PNG beside the JSON on copy, the “Loose text” frame for text whose shape is gone (it isn’t shown), the counts in a version’s row and in the Updates feed (a version shows “2 added · 1 changed · 0 removed” above the board instead), the 5,000-shape frame test, and canvases inside published pages (a published canvas page shows its board; a canvas block in a published page shows nothing, as an inline database doesn’t). A page card on a published canvas says “Open page” and links to the page when it’s published too, rather than showing its title.
  • The frame list is a panel from the board’s “…” menu, not a strip at the right edge.
  • A frame is renamed by double-clicking it (a name prompt).
  • On phones the canvas’s title isn’t shown (the top bar has it), and the app’s tab bar stays under the canvas’s toolbar rather than stepping aside, so the board fills what’s between them.
  • Making a canvas needs a server at the app’s major.minor or newer: an older one refuses canvas documents, so New canvas says why instead of making one that can’t sync.
  • The updater’s public key is a file, crates/drusite-app/updater-key.pub, which build.rs builds into the app, not tauri.conf.json. A build without it offers the download instead of installing. Update bundles are made only in CI (--config turns createUpdaterArtifacts on), so a local build never needs the private key.
  • Links to the release page and the APK open through Drusite’s own plugin (the system browser on desktops, an ACTION_VIEW intent on Android, Safari on iOS), and only for https://github.com/pranavajk1/drusite/…. Tauri’s opener plugin pulls in crates cargo deny refuses as unmaintained.
  • The web app’s main bundle keeps its budget because the app is built as one chunk again (manualChunks): split up for the canvas, the pieces compressed 10 KB worse.
  • Linux’s idle RAM is close to its limit: 446–451 MiB measured on CI’s software-rendered runners against 450 (Phase 9 measured 443). The Mac and Windows figures are about 116 and 103 of 250.
  • The app builds run only for a release (a version tag) or when started by hand, never on pull requests; CI on a pull request is the Rust, UI, server and web-app checks.
  • The updater’s own test is partial: a desktop run started by hand builds and signs every update bundle with a throwaway key; installing one over an older app and relaunching is on the list of things only Pranava can check, on his own Mac, Windows and Linux machines.
  • More in each release (asked for after the plan): Linux gets an .rpm and an Arch package (.pkg.tar.zst, made from the .deb) beside the AppImage and .deb, and the .deb and .rpm update in the app too. Android gets an .aab for Google Play. iOS is built and uploaded to App Store Connect (TestFlight) once its keys are in Doppler (ios.yml). Releasing is merging a pull request that bumps the version: release.yml then builds everything, publishes the server image and Helm chart at that version, and makes the release and its tag. Nothing builds on other pushes to main or on pull requests. docs/releasing.md has what each release holds, every secret, and the Apple and Google Play setup.

The plan as approved

Two pieces of work, then a release checklist:

  1. Canvas: an infinite, zoomable board of sticky notes, text, shapes, connectors, freehand ink and frames, with pages on it and it inside pages. It’s a kind of page, so it syncs, merges, shares, keeps history and is searched like any other page.
  2. Check for Updates: Settings → About shows this app’s version and the server’s, and checks GitHub’s releases of pranavajk1/drusite. Desktops download, install and restart in the app; phones say there’s a new version and link to it.
  3. 1.0.0: what changes when the next tag is a stable release instead of an alpha.

As in every phase: design/DESIGN.md decides how it looks; everything behaves the same on macOS, Windows, Linux, iOS, Android and the browser, and where a platform can’t do something the app says so where you’d look for it. Nothing assumes a particular deployment or provider. Examples use made-up names (“Sam”, “Work”, “sam@example.com”).


0. What the code says today

FactWhereWhat it means here
A page document is four root containers: body (one LoroText of every block’s text, each block starting with a marker), blocks, order, meta. Loro keeps containers a version doesn’t know about.drusite-crdt/src/lib.rs, page.rsA canvas can be a page document with extra root containers. Everything that reads a page’s text (search, Ask, MCP, Markdown, publish, history) keeps working.
A block can hold other blocks: a MeetingSection or Toggle’s children are the blocks after it, indented one deeper.drusite-model, meeting.rsEach shape’s text can be one section block with its paragraphs under it: rich text, split, join and merge exactly as in a page.
BlockKind::Database { database, view } shows a subpage of kind Database inside a page.drusite-model/src/lib.rsA canvas inside a page is the same shape: a Canvas block naming a subpage of kind Canvas.
PageKind is Page, Journal, Database; unknown kinds read as Page. meta.schema above SCHEMA_VERSION refuses to load with NewerSchema.drusite-model/src/journal.rs, page.rsAn older app would show a canvas as a page of loose text. Canvas documents get a higher meta.schema, so older apps (and older servers) refuse them cleanly, and the refusal can point at Check for Updates.
The sync protocol has DocKind::{Workspace, Page, Tree}, row-level security, restricted trees and compaction, all keyed on page documents.drusite-proto, drusite-server/src/syncA canvas rides as DocKind::Page. No protocol change, no new table.
There is no presence (live cursors) in sync.drusite-protoEdits on a canvas appear live, as on a page. Other people’s cursors don’t (§1.12).
The server already tells the app its version: Welcome.server_version is CARGO_PKG_VERSION.sync/connection.rs, messages.rs“Server is older/newer” needs no server change, only UI. A small unauthenticated GET /api/v1/version is added for the sign-in screen.
The app’s CSP allows connect-src ipc: only; all networking is Rust (reqwest behind net).tauri.conf.json, drusite-coreThe release check runs in Rust, not fetch.
One version everywhere: .github/scripts/version.sh fails CI unless Cargo.toml and tauri.conf.json agree, and the tag must match..github/scripts/version.sh“Bump app and server together” is already enforced; a cargo xtask bump makes it one command.
A v* tag runs image.yml (server image, Helm chart, cosign keyless) and android.yml, which creates the GitHub release (--prerelease when the tag has a -) with the APK and SHA256SUMS. No desktop builds in CI; Mac builds are local and ad-hoc signed..github/workflows/Desktop builds move into CI, and one job creates the release with every platform’s files and the updater manifest.
The web app is built into the server image.DockerfileThe web app’s version is always the server’s. It has nothing to update itself.
Main JS bundle budget: 185 KB brotli; wasm 2.15 MB. Core keystroke p95 0.5 ms; idle RAM 250 MB (450 on Linux CI).ui/scripts/compress.mjs, xtask/src/budgets.rsThe canvas is a separate, lazily loaded chunk with its own budget; new budgets for pan/zoom go in xtask and the web tests.
“Updates” already names Phase 9’s side panel (the feed of changes).lib/updates/The new section is About, its button Check for updates, and its toast “Drusite 1.0.1 is available”. Never “Updates”.

1. Canvas

1.1 What it is

A canvas is a page you draw on instead of type down: an endless surface you pan and zoom, holding sticky notes, text, shapes, connectors, ink, images, frames and page cards. It’s created from New page → Canvas, /canvas inside a page (which makes a canvas subpage and shows it in the page), or the sidebar’s “+” menu. In the tree it has the presentation icon unless it’s given its own. It has a title, an icon, a cover and properties like any page; its body is the board.

The UI calls it Canvas. (Notion has no equivalent; AFFiNE calls it “edgeless”, Excalidraw and FigJam “whiteboard”.)

1.2 The data model in Loro

A canvas is a page document (meta.kind-free; the kind is in the workspace tree, as for databases) with two more root containers and a higher schema:

  • meta.schema = CANVAS_SCHEMA (today’s SCHEMA_VERSION + 1). Apps and servers before Phase 10 refuse the document with NewerSchema.

  • shapes (map): one LoroMap per shape, keyed by its ShapeId (a UUID, like BlockId). Each holds plain values only:

    KeyValueNotes
    typenote, text, rect, ellipse, diamond, triangle, line, connector, ink, frame, image, page
    at[x, y] (f64, canvas units = CSS px at 100%)One value, so a concurrent move never mixes one device’s x with another’s y. Relative to the frame when frame is set.
    size[w, h]One value, as at.
    rotradiansOmitted when 0.
    zfractional index (string)Stacking order. “Bring to front” writes one key. Ties sort by ShapeId.
    frameShapeIdThe frame it’s in; one level only (frames don’t nest).
    groupgroup IDShapes sharing it select and move together.
    style{fill, stroke, width, dash, font, align, arrowStart, arrowEnd, route}Colours are palette names (yellow, blue…), never hex, so dark mode and the design tokens decide the paint.
    textBlockIdThe section block holding its text (below). Notes, text, shapes’ labels.
    from, to{shape, anchor: [u, v]} or {at: [x, y]}Connector ends: a point on a shape (0–1 across its box) or a free point. Each end also keeps fallback: [x, y], the last place it was drawn, for when its shape is deleted.
    inkbinaryFreehand points, written once when the stroke ends (below).
    blob, name, mimeAn image, in the workspace’s attachment store, as BlockKind::Attachment.
    pagePageIdA page card.
    namestringA frame’s name.
    lockedboolCan’t be selected by a click (only from the frame list or Select all).
  • Text lives in the page’s own blocks. A shape with text owns one block of the new kind BlockKind::CanvasText { shape } (no text of its own, like MeetingSection); its paragraphs are the blocks after it, indented one deeper. So text in a note is real rich text, typed with the same ProseMirror schema, merged by the same body Loro text, never lost to a merge, and is what search, Ask, MCP, history and Markdown export read with no new code. Deleting a shape deletes its section and its paragraphs in the same commit.

  • Ink (freehand) is stored as one binary value per stroke: points quantised to 1/8 px, delta-encoded as zig-zag varints, with pressure as one byte per point. A 300-point stroke is about 1 KB. Strokes are written once, on pointer-up, and never edited point by point; erasing deletes a stroke. Points are simplified (Ramer–Douglas–Peucker at 0.5 px of screen) before they’re written. This keeps a page full of handwriting from bloating the oplog, which history keeps forever (Phase 9).

  • Viewport state isn’t stored in the document. Where you are and how far you’re zoomed is kept per device per canvas in the store, like a page’s scroll.

The new Rust lives in drusite-crdt/src/canvas.rs (Canvas wraps a Page and adds the shape operations), with types in drusite-model/src/canvas.rs and Core API commands in drusite-core. Geometry that has to agree everywhere (connector routing, hit testing for the eraser, the SVG the server renders) is in a small Rust module shared by the core, the WebAssembly build and the server.

1.3 How it syncs and merges

A canvas syncs exactly as a page: DocKind::Page, the same update log, snapshots, compaction, row-level security and restricted trees. What merges how:

Concurrent editsResult
Two people move (or resize) the same shapeLast writer wins for at (or size), whole. The shape is never torn between the two.
One moves a shape, the other recolours itBoth apply: different keys.
Both type in the same noteMerged as page text is: nothing typed is lost.
One deletes a shape, the other edits itDelete wins; the other’s edit is gone with the shape. (Someone deleted it; “nothing typed is lost to a merge” still holds.)
One deletes a shape a connector is attached toThe connector stays, its end at fallback. It shows as a free end and can be reattached.
Two “bring to front” at onceBoth get a new top z; ties sort by ShapeId, so every device shows the same order.
One moves a frame, the other moves a shape inside itBoth apply, because children are positioned relative to the frame.
One moves a shape into a frame, the other deletes the frameThe frame’s children are deleted with it on the deleting device; the moved shape arrives after and is put back on the board at its last absolute position (the core repairs a frame that points nowhere on load).
One groups shapes, the other groups an overlapping setLast writer wins per shape’s group.

Every gesture is one commit: moving 100 selected shapes, pasting 30, deleting a frame and its children. Other devices see it whole or not at all. While dragging, the app moves the shapes on screen without writing; it writes the positions every 250 ms (so others see the drag) and at the end, and Loro’s 10-second merge folds these into one change. Undo is Loro’s UndoManager on the canvas document, local to the device, one step per gesture; ⌘Z inside a note’s text undoes typing, as on a page.

Repairs on load (never written back unless the next edit touches the shape): a shape whose text block is gone shows no text; a text section whose shape is gone is shown in a “Loose text” frame at the board’s origin rather than dropped; a frame that points at nothing is ignored.

1.4 Notion compatibility

It doesn’t apply in either direction. Notion has no canvas or whiteboard, and its export and API have nothing to import. What a canvas does with the formats Drusite already speaks:

  • Markdown export and the Markdown folder write a canvas as Canvas title.md: front matter drusite: canvas and readonly: true, then its text in reading order (each frame an H2 in left- to-right, top-to-bottom order, then shapes outside frames; each note or text a paragraph group). The folder doesn’t write edits from that file back: a note’s position can’t be expressed in Markdown, and a merge that guessed would move things. Editing the file shows “This file is a canvas’s text; edit the canvas in Drusite” in the bridge’s status.
  • Export from the canvas’s “…” menu: SVG and PNG (whole board, a frame, or the selection), at 1×/2×.
  • Notion import of a page that links to a Notion whiteboard-like embed (Miro, FigJam, Whimsical) keeps it as a link, as today.
  • Importing Excalidraw or tldraw files is a cheap later addition, not in this phase.

1.5 Canvas in a page, and pages in a canvas

A canvas in a page is a block, BlockKind::Canvas { canvas: PageId, frame: Option<ShapeId>, height: u16 }, exactly like an inline database:

  • /canvas makes a new canvas as a subpage and puts the block where you typed. Pasting a canvas’s link, or dragging a canvas from the sidebar into a page, makes a block for an existing one.
  • The block shows a live preview: the whole board fitted (or the chosen frame), drawn by the same renderer, read-only, updating as the canvas changes. Its height defaults to 360 px and drags from 200 to 1200 px (height). Wheel and two-finger gestures over it scroll the page, not the preview, so a canvas never traps the scroll.
  • Hovering shows Open (full screen) and a frame picker (“Whole canvas”, or one of its frames). Clicking or tapping the preview opens the canvas, zoomed to what the preview showed.
  • If the reader can’t see the canvas (it’s private to someone else, §1.11), the block shows the same “You don’t have access to this page” card a linked restricted page does.

A page in a canvas is a page shape, a page card:

  • Drag a page from the sidebar onto the board, paste its link, or use the toolbar’s Page tool to pick one (or make a new one).
  • The card shows the page’s icon, title and its first blocks, read-only, cut off at the card’s height with a fade. Cards load their page only when on screen and zoomed in past 40%; below that they draw as title only. Double-click (double-tap) opens the page in the side peek on desktop and full screen on phones.
  • A database shows as a card with its title and row count. A canvas on a canvas shows its preview.
  • A card for a page the reader can’t see draws as a grey “No access” card with no title.

Images dropped or pasted on the board become image shapes in the attachment store, as image blocks are.

1.6 Tools

One toolbar, floating at the bottom centre on desktop (--bg-elevated, --shadow-md, radius 12) and a bottom bar on phones (§1.9). Every tool has a key; the key list is in the “?” menu.

ToolKeyWhat it does
SelectVClick to select, drag to move, shift-click to add, drag on empty board for a marquee. Handles resize (shift keeps the ratio) and rotate. Snaps to other shapes’ edges and centres within 6 screen px, with pink guides; hold ⌘ (Ctrl) to not snap.
HandH, or hold SpaceDrag to pan.
Sticky noteNClick to place a 200×200 note in the last colour used (yellow first) and start typing. Tab in a selected note makes the next one beside it. Notes grow taller as their text does.
TextTClick to type free text; drag to set a width it wraps at.
ShapeR (rectangle), O (ellipse), D (diamond), then the menu for triangleDrag to draw; click for a 160×100 default. Typing with a shape selected writes its label.
ConnectorADrag from a shape (its four side anchors light up) to another; the line follows both as they move. Straight or elbow (right angles, routed around the two ends’ boxes), and arrowheads at either end. A connector can have a label.
LineLA free line or arrow not tied to shapes.
PenPFreehand ink, pressure-sensitive with a pen. Three widths, the palette’s colours, and a highlighter (40% opacity, drawn under other shapes).
EraserEDeletes whole strokes (and lines) it touches. Not a pixel eraser.
FrameFDrag to make a named area. Shapes dropped in it move with it. Frames list in the Frames panel, the canvas’s outline (§1.10).
Page—Places a page card (§1.5).
Image—Picks a file.

With something selected, a style bar floats above it: colour (the eight palette colours), fill (none, light, solid), stroke width and dash, font size (S/M/L/XL) and alignment for text, arrowheads and route for connectors, and “…” (bring forward/back, group, lock, duplicate, copy as PNG, delete). Copy and paste work between canvases and between devices as JSON on the clipboard (with a PNG beside it for other apps); pasting plain text makes notes, one per paragraph.

Zoom: 10%–800%. ⌘+ / ⌘− / ⌘0 (100%) / ⇧1 (fit all) / ⇧2 (fit selection). The zoom level and a minimap toggle sit bottom-right.

1.7 Drawing it, and the performance budgets

How it’s drawn: one <canvas> (2D) for everything that isn’t text (shapes, connectors, ink, frames’ borders, selection), redrawn on demand; and one DOM layer of the text (notes, labels, page cards) as absolutely positioned elements inside a single container with a CSS transform. Pan and zoom change that one transform and redraw the canvas; nothing re-lays out. Only shapes in view (plus a screen’s margin) have DOM or are drawn: a uniform-grid spatial index in TS finds them. While a pinch or wheel zoom is in progress the text layer scales with the transform and is re-rendered crisp when the gesture settles (150 ms). The note being edited is a ProseMirror editor restricted to its section’s blocks, reusing the page editor’s schema and binding.

The canvas UI is its own chunk, loaded when a canvas or a canvas block first appears, so the main bundle’s budget holds.

Budgets, checked in CI (desktop via cargo xtask budgets, browser via the web tests in Chromium), changed only by editing xtask/src/budgets.rs or compress.mjs:

WhatBudget
Pan and pinch-zoom a board of 1,000 shapes + 300 ink strokes (half with text)p95 frame ≤ 16.7 ms (60 fps) on CI; the target on a 120 Hz Mac or iPad is 8.3 ms, measured by hand, not gated
The same at 5,000 shapesp95 frame ≤ 33 ms (30 fps): it must degrade, not fall over
Open that 1,000-shape canvasfirst full paint ≤ 300 ms after the document is loaded
Core: move 100 selected shapes (one commit and its update)p95 ≤ 2 ms
Core: add one notep95 ≤ 0.5 ms (as a keystroke)
Document size: 1,000 notes with a sentence each≤ 200 KB snapshot
Document size: one 300-point stroke≤ 1.5 KB
RAM: open the 1,000-shape canvas≤ 60 MB over the idle budget
Download: the canvas chunk≤ 45 KB brotli; main bundle unchanged at 185 KB

1.8 Mouse, trackpad, touch and pen

All input is Pointer Events, with touch-action: none on the board.

  • Trackpad: two-finger scroll pans; pinch zooms (it arrives as ⌘-wheel). Mouse: wheel pans, ⌘/Ctrl-wheel zooms, middle-drag pans.
  • Touch: two fingers always pan and pinch-zoom, whatever the tool. One finger uses the tool; with Select, one finger on empty board pans (a marquee is long-press then drag). Long-press a shape for its menu. Double-tap empty board with Select to make a note.
  • Pen (Apple Pencil, Android stylus, Windows pen): the pen draws with Pen, whatever tool was chosen for fingers, and pressure sets the width. Once a pen has been used on this device, “Fingers pan, pen draws” turns on (palm rejection: touches while the pen is down are ignored); it’s a switch in the toolbar’s “…”, per device. Pencil hover (iPadOS), where WebKit reports it, shows a dot where the ink will land.
  • Edge swipes are left to the system: no gesture starts in the outer 16 px on phones, so Android’s back gesture and iOS’s swipe still work.

1.9 Phones (≤ 700 px)

  • The canvas is full screen under the top bar (title, sync dot, “…”); the tab bar steps aside.
  • Bottom toolbar: Select, Hand, Note, Pen, Shape, “+” (Text, Connector, Frame, Page, Image), 44 px targets, padded by env(safe-area-inset-bottom). The style bar is a bottom sheet.
  • Editing a note’s text zooms so the note sits above the keyboard (visualViewport) and shows the phone formatting toolbar; done returns to where you were.
  • Phones are full editors, but the design targets reading, notes and ink there; precise layout work is for bigger screens. A tablet (> 700 px) gets the desktop layout with touch targets.

1.10 Keyboard, screen readers, the frame list

  • The board is a region labelled with the canvas’s title. Tab moves through shapes in reading order (frames left to right, top to bottom; inside each, top to bottom); the focused shape is selected and scrolled into view. Enter edits its text, arrows move it 1 px (Shift: 10 px), Delete removes it, Esc leaves.
  • A hidden list mirrors the board for screen readers: each item is “Sticky note, yellow: <text>”, “Connector from <a> to <b>”, “Frame <name>, 6 items”.
  • Frames panel (the canvas’s version of Phase 9’s outline): the right-edge strip and its card list frames instead of headings; clicking one zooms to it. On phones it’s in “…” → Frames. “Present” steps through frames full screen with ←/→ (or swipes).
  • Reduced motion turns off zoom animations.

1.11 History, sharing, guests and private pages (Phase 9)

A canvas is a page, so Phase 9 applies as it is:

  • Version history: the list, grouping, named versions and restore all work unchanged (restore is fork_at and a new edit). The selected version is drawn as a read-only board at that version, fitted to what changed: added shapes outlined in --accent, changed ones in --warning, deleted ones as 40% ghosts in --danger, and text changes highlighted inside notes as on a page. The row’s summary says what changed: “Added 3 notes · moved 12 shapes · 4 strokes”.
  • Updates & analytics: edits appear in the feed as “Sam edited Canvas” with the same counts (no excerpts of ink). Views count as page views.
  • Workspaces, private pages, guests: a canvas can be moved to Private, shared with a guest or a member, and is subject to their role. A viewer pans, zooms, opens page cards and follows links, but can’t change anything; the toolbar shows only Hand and Frames.
  • Access is checked per document, as always: a page card or canvas block for a page the reader can’t see is a “No access” card (§1.5). Putting a private page on a shared canvas never shares the page.
  • Publish to web (Phase 5): a published canvas is rendered by the server as a static SVG of the board (text as HTML in foreignObject), in a page that scrolls and zooms with the browser’s own controls. No JavaScript, as for published pages. Page cards on it link to the page if that page is published too, and are titles only otherwise. “Include subpages” covers cards’ pages as it covers subpages.
  • Agents (MCP) read a canvas’s text through the existing page tools. Writing shapes from an agent isn’t in this phase.
  • Search and Ask find text in notes and shapes; opening a result zooms to the shape and flashes it.

1.12 Not in this phase

Live cursors and selections of other people (needs presence in the sync protocol); comments on shapes; nested frames; pixel erasing; templates; mind-map layout; Excalidraw/tldraw import; an agent tool that writes shapes. Each is a later, separate piece.


2. Check for Updates

2.1 Where it is

Settings → About, a new section at the end of the nav, in a new group Drusite (desktop) or the last inset group (phones). It shows:

  • Drusite 1.0.0 (the app), the channel (Stable or Pre-releases), and the platform (“macOS, Apple silicon”).
  • Server: the signed-in server’s address and version, and whether they match (§2.6).
  • Check for updates, a button; below it, the result.
  • Check automatically, a switch (§2.5), and Get pre-releases, a switch (§2.4).
  • Links: Release notes (GitHub), Source code, Licence (AGPL-3.0-or-later).

On the web the section shows “Drusite 1.0.0, served by your server” and the server’s address. There’s nothing to check: the web app updates when the server does.

2.2 Finding the latest release

One Rust function, drusite_core::release::latest(channel) (feature net), used by every platform:

  • GET https://api.github.com/repos/pranavajk1/drusite/releases?per_page=20 with Accept: application/vnd.github+json and a generic User-Agent: Drusite/<version>. No token, no account, nothing about the user or their notes. GitHub’s limit for unauthenticated calls (60 an hour per address) is far above one check a day.
  • Drafts are skipped. Pre-releases are skipped unless the channel is Pre-releases. Releases whose tag isn’t v<semver> are skipped. The highest version wins (semver order, so 1.0.0 beats 1.0.0-rc.2, which beats 1.0.0-alpha.7), not the newest date.
  • It returns the version, its notes (Markdown), its page URL, and its assets (name, URL, size). ETag is kept, so a repeat check that finds nothing new costs GitHub nothing.
  • The repository is a build-time constant (DRUSITE_RELEASES_REPO, default pranavajk1/drusite), so a fork that ships its own builds points its apps at its own releases.

Results: Up to date (“Drusite 1.0.0 is the latest version”); Update available (“Drusite 1.0.1 is available”, the first 12 lines of its notes and “Full release notes”); Couldn’t check (“GitHub couldn’t be reached. Check again later”, with the error in a details line). Offline, the button says so instead of trying.

2.3 Installing: what really happens on each platform

macOS, Windows, Linux (AppImage): Install and restart.

  • The app uses tauri-plugin-updater. Each desktop release carries the platform’s update bundle (Drusite.app.tar.gz, the NSIS setup.exe, the .AppImage), each with a minisign signature (.sig), and one manifest, latest.json, listing them. The app points the updater at the latest.json of the release §2.2 chose, so channels work without a second manifest.
  • The updater downloads the bundle (progress in the button: “Downloading… 40%”), checks its signature against the public key compiled into the app, and refuses anything else (“This update isn’t signed by Drusite’s release key, so it wasn’t installed”). Then the core flushes the store and the sync queue, and the app installs and relaunches. On Windows the NSIS installer runs in passive mode (a progress bar, no questions). After the restart, Settings → About says “Updated to 1.0.1”.
  • macOS and Gatekeeper, honestly (the app isn’t notarized today):
    • First install, from a browser download, is quarantined. With today’s ad-hoc signature, macOS 15+ blocks it until you go to System Settings → Privacy & Security → Open Anyway. In-app updates can’t fix this; only a Developer ID signature and notarization can.
    • In-app updates are downloaded by the app itself, not a browser, so they aren’t quarantined and Gatekeeper doesn’t stop them. The updater replaces the .app and relaunches. (To be confirmed on a real Mac during the build; if Gatekeeper does assess it, the app falls back to “Download” below.)
    • But ad-hoc signatures change with every build, and macOS ties Keychain access and microphone/screen-recording permission to the signature. So after each update, macOS asks again for the Keychain item (the store’s key) and for the meeting recorder’s permissions. That’s tolerable for alphas and wrong for 1.0.
    • Recommended: a Developer ID certificate and notarization (Apple Developer Program, $99 a year). CI signs with Developer ID and notarizes with notarytool, staples the ticket, and then: first install opens without warnings, updates install and relaunch silently, and Keychain and permissions survive updates. §2.7 says how the certificate is kept.
    • Without it, the plan still ships the updater, and the About section says on macOS: “After updating, macOS may ask again for Keychain and microphone access, because this build isn’t signed with an Apple Developer ID.” (A cheaper half-step, a self-signed code-signing certificate kept as a CI secret, would make the signature stable across updates so the prompts stop, but first install stays blocked as now.)
  • Windows: the installer isn’t code-signed. First install gets SmartScreen’s “Windows protected your PC” → More info → Run anyway. In-app updates aren’t downloaded by a browser, so they carry no Mark of the Web and SmartScreen doesn’t prompt. Signing (Azure Trusted Signing, about $10 a month) would remove the first-install warning; not recommended for 1.0.
  • Linux: the AppImage updates in place, as above. The .deb can’t self-update; on a .deb install the button becomes Download (the new .deb), with “Install it with your package manager”. Flatpak and other packages are out of scope.
  • A portable or read-only install (the app can’t write where it lives, say in /Applications without permission, or a mounted DMG) gets “Drusite can’t update itself here. Move it to Applications, or download the update” with Download.

Android: Download opens the release’s APK asset (drusite-1.0.1-arm64.apk) in the system’s browser/downloader, which installs it with the usual “allow installs from this source” prompt; Release page opens the GitHub page. A line says “Using Obtainium? It updates Drusite for you.” An in-app APK installer (REQUEST_INSTALL_PACKAGES) isn’t in this phase: it’s an extra permission for something the browser already does.

iOS: there’s no build of Drusite to install outside the App Store or TestFlight, so iOS shows “Drusite 1.0.1 is available” with Release notes, and nothing to download. (If a TestFlight or App Store build ever exists, this becomes a link there.)

Web: nothing (§2.1).

2.4 Stable and pre-releases

  • A tag with a pre-release part (v1.1.0-beta.1) is a GitHub pre-release; a tag without one is a stable release, as android.yml already decides.
  • Get pre-releases is off by default on stable builds and on by default on pre-release builds, so someone running an alpha keeps getting alphas until they turn it off. It’s per device.
  • Turning it off on a pre-release build means “the next stable release that’s higher than this one”: an alpha of 1.1 won’t offer 1.0.3.
  • Nothing ever downgrades. A version lower than or equal to this one is never offered.

2.5 Checking on launch

Check automatically, on by default, with the description “Once a day, Drusite asks GitHub whether there’s a newer version. Nothing about you or your notes is sent.” When on, the app checks 10 s after launch if the last check was more than 24 hours ago, and then once a day while running. If there’s an update, a toast says “Drusite 1.0.1 is available” with View (opens About) and dismiss. Dismissing it skips that version for automatic checks (not for the button). It never downloads or installs without a click. Off, the app never contacts GitHub unless you press the button.

2.6 The server’s version against the app’s

The app already gets server_version in Welcome; About shows it, and the comparison uses major.minor (patch releases are always compatible):

CaseWhat About saysElsewhere
Same major.minor“Up to date with your server”Nothing.
Server older“Your server runs 1.0.2, older than this app. Some features need its admin to update it.”Features that need the newer server say so where they are (below).
Server newer“Your server runs 1.2.0. Update this app to get everything it offers.” with Check for updatesNothing.
Protocol differs(already handled: sync refuses with its message)

New unauthenticated route GET /api/v1/version → {"version": "1.0.0", "protocol": 1}, so the sign-in form can say “This server runs Drusite 0.1.0-alpha.7, which is older than this app” before signing in.

Features gated on the server’s version: making a canvas needs a 1.0 server (older servers refuse canvas documents, §1.2), so on an older server New page → Canvas is disabled with “Your server needs Drusite 1.0 for canvases”. The reverse case, an app too old for a document, shows the NewerSchema refusal as “This page needs a newer version of Drusite” with Check for updates.

2.7 Keys: what Pranava makes, where it lives, what an agent never touches

There are up to two secrets, both made by Pranava on his own machine and stored in Doppler alongside the Android keystore (the one repository secret, DOPPLER_TOKEN, already reads that config). An agent never generates, sees, copies, holds or approves them, and never answers a Keychain or OS prompt for them.

The updater signing key (required):

  1. On his Mac: npx tauri signer generate -w ~/.tauri/drusite-updater.key, with a strong password (from his password manager). It writes the private key and drusite-updater.key.pub.
  2. Add to Doppler: TAURI_SIGNING_PRIVATE_KEY (the private key file’s contents) and TAURI_SIGNING_PRIVATE_KEY_PASSWORD.
  3. Keep an offline backup of the private key and its password (password manager plus one offline copy). If it’s lost, installed apps can never update in place again: everyone would have to download a new build by hand once, with a new public key.
  4. Give the agent the public key (the .pub file’s one line). It goes in tauri.conf.json under plugins.updater.pubkey, committed. That’s the only part of the key in the repository.

The release workflow fetches the private key from Doppler only in the desktop build jobs on v* tags, masks it, and deletes the temporary copy at the end, as android.yml does with the keystore. Pull requests build unsigned update bundles (or none), never with the key.

The Apple Developer ID (if he chooses §2.3’s recommendation):

  1. Join the Apple Developer Program; in Xcode or the developer site, create a Developer ID Application certificate; export it with its private key as a .p12 with a password.
  2. Create an App Store Connect API key (Users and Access → Integrations, role Developer) for notarization: the .p8 file, its Key ID and Issuer ID.
  3. Add to Doppler: APPLE_CERTIFICATE (the .p12, base64), APPLE_CERTIFICATE_PASSWORD, APPLE_SIGNING_IDENTITY (“Developer ID Application: … (TEAMID)”), APPLE_API_KEY (the .p8, base64), APPLE_API_KEY_ID, APPLE_API_ISSUER.
  4. The macOS job imports the certificate into a temporary keychain that it deletes at the end, and Tauri’s bundler signs and notarizes with those variables.

2.8 Release builds: one release, every platform

Today android.yml creates the GitHub release. With desktop builds that would race, so:

  • release.yml (new), on v* tags only: calls the Android build (android.yml becomes reusable with workflow_call, and keeps its pull-request check) and the new desktop build, then one Release job that
    • downloads every artifact;
    • writes latest.json from the desktop jobs’ .sig files (.github/scripts/latest-json.sh: version, notes, publish date, and darwin-aarch64, darwin-x86_64, windows-x86_64, linux-x86_64 URLs and signatures);
    • writes one SHA256SUMS over everything;
    • runs gh release create --verify-tag, with --prerelease for a tag with -, and --latest otherwise, attaching all of it.
  • desktop.yml (new, reusable, also run on pull requests that touch crates/drusite-app, ui or the workflow, without signing): a matrix of
    • macos-latest: universal-apple-darwin (Apple silicon and Intel in one app; minimum macOS 12.3 as today), .dmg plus the updater’s .app.tar.gz and .sig, signed and notarized when the Apple secrets exist, ad-hoc otherwise;
    • windows-latest: NSIS -setup.exe and its .sig;
    • ubuntu-22.04 (the oldest glibc we support, for the AppImage’s reach): .AppImage and .sig, and .deb. bundle.createUpdaterArtifacts: true in tauri.conf.json makes the update bundles.
  • image.yml is unchanged except §3’s tags.
  • Asset names: Drusite-1.0.0-macos-universal.dmg, Drusite-1.0.0-macos-universal.app.tar.gz, Drusite-1.0.0-windows-x64-setup.exe, Drusite-1.0.0-linux-x86_64.AppImage, drusite_1.0.0_amd64.deb, drusite-1.0.0-arm64.apk, latest.json, SHA256SUMS.

2.9 Versioning

Keep one version for everything (app on every platform, server, web app, Helm chart’s appVersion), bumped together on every release. New: cargo xtask bump <version> writes it to Cargo.toml’s [workspace.package], crates/drusite-app/tauri.conf.json and Cargo.lock, runs version.sh, and prints the tag command. Android’s versionCode stays 1000 + run number (always increasing). From 1.0: a patch release never changes the sync protocol or the server’s database in a way an app one minor version behind can’t handle; that’s what §2.6’s major.minor rule promises.

2.10 Tests

  • release::latest against recorded GitHub responses: channels, drafts, odd tags, semver order, never downgrading, ETag, errors.
  • Updater: a CI job builds two versions of the desktop app, signs them with a throwaway test key generated in the job (never the real one), serves the second from localhost, and checks the first updates to it and relaunches (macOS and Linux; Windows if the runner allows the installer). A bundle signed with another key must be refused.
  • UI: the About section’s states (up to date, available, downloading, failed, server older/newer, web) in the memory-core browser tests.
  • Real apps during the build: Mac debug build, Android emulator, iOS simulator and web, as every phase.

3. Release checklist for 1.0.0

Pranava decides when; this is what the cut takes.

  1. Merged: #37 (Phase 9) and this phase, CI green on every platform.
  2. Secrets in Doppler: the updater key (§2.7, required); the Apple Developer ID and API key (if chosen). A dry run: workflow_dispatch of release.yml on a v1.0.0-rc.1 tag, as a pre-release, installs on a Mac, Windows and Linux machine, and an rc.2 updates it in place.
  3. Bump: cargo xtask bump 1.0.0 → Cargo.toml, tauri.conf.json, Cargo.lock say 1.0.0; deploy/helm/drusite/Chart.yaml version: 1.0.0, appVersion: "1.0.0" (the workflow still sets both from the tag when it packages).
  4. Docs: README’s status line (it still says Phase 2 and “nothing here is a usable app yet”), install instructions per platform including the first-install Gatekeeper/SmartScreen steps, a CHANGELOG.md starting at 1.0.0, deploy/ docs pinning :1.0.0 instead of :main.
  5. Stable, not pre-release: the tag is v1.0.0 (no -), so release.yml creates a normal release with --latest. Stable builds default to the Stable channel; alpha users keep pre-releases on until they switch it off (one line in the notes says how). Obtainium users can turn off “Include prereleases”.
  6. Workflow changes for stable:
    • image.yml: add type=semver,pattern={{major}} (gives :1), and latest only for stable tags (docker/metadata-action’s latest=auto already skips pre-releases; check the output). :main stays the moving development tag.
    • android.yml: stops creating the release itself (now release.yml’s job); the APK and checks unchanged.
    • desktop.yml: signing and notarization required on tags (a missing secret fails the release, as Android’s keystore does).
  7. Mac signature change: if 1.0 is the first Developer ID build, alpha users’ Keychain item was made under the ad-hoc signature; the first launch of 1.0 asks once to allow it. Say so in the notes.
  8. Tag: git tag -s v1.0.0 -m "Drusite 1.0.0" and push it (signed, over HTTPS). Then check the release page has every asset, latest.json verifies, cosign verify passes for the image and chart, and an alpha.7 desktop app offers 1.0.0.

4. Decisions for Pranava

One recommendation each.

  1. Apple Developer ID and notarization ($99/year) for 1.0. Recommend yes: without it, every first install on a Mac goes through “Open Anyway”, and every update re-asks for Keychain and microphone access.
  2. Windows code signing. Recommend not for 1.0: SmartScreen warns once on first install; updates aren’t affected. Revisit if Windows users complain.
  3. Where the updater key lives: Doppler, next to the Android keystore, with an offline backup that only you hold. Recommend yes. You run tauri signer generate; the agent only gets the public key.
  4. Channels and the launch check: pre-releases off on stable builds and on for alpha builds; check once a day on launch, on by default, notify only (never auto-install). Recommend as written.
  5. The name: “Canvas” in the UI. Recommend “Canvas” (short, and not tied to one app’s vocabulary); “Whiteboard” is the alternative.