Phase B (items 1-6) of docs/AFFINE.md.
Properties: workspaces define custom page properties (text, number,
checkbox, date, select, multi-select, person, link) in the new
workspace_properties collection; pages keep their values in
pages.properties, checked against each property's type. The Info panel
under the title shows tags, custom and built-in properties, following
each property's visibility; the Info side panel shows them all, with the
page's collections and the journal. Settings gains Page properties and
Tags sections.
Tags: coloured, per workspace (tags collection, pages.tags); create from
the picker, rename, recolour, merge and delete. Search filters by tag.
All docs: GET /workspaces/{id}/docs lists the pages the caller can open
with their properties, narrowed by space, tag, collection or filter
rules evaluated on the server. The view shows a list, grid or cards,
groups and orders by any property, picks the properties shown, and acts
on several pages at once (tag, move, trash, collect).
Collections (page_collections): saved rules plus pages added or taken
out by hand, private to their creator until shared with the workspace,
listed in the sidebar.
Journals: one page per person and day in a private journal space
(spaces.journal_owner) that workspace admins do not see into, made on
first use. A week strip marks days with pages, new days can start from
a template, and dates in read mode open that day's journal.
The migration and schema snapshot, OpenAPI spec and generated Go, TS and
Dart types are updated (the Dart generator learns untyped values), the
mobile editor bundle is rebuilt, the new strings are translated into all
five languages, and the user guide covers the new features.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign-in:
- Google, GitHub, Microsoft and any OpenID Connect provider, set up in the
admin panel (secrets are write-only). PocketBase talks to the provider,
and docwell-server keeps the state and PKCE verifier. Accounts a
provider creates follow the sign-up switch and the domain list; refused
ones are removed again.
- Two-step sign-in with an authenticator app (TOTP), set up under "Your
account", with ten single-use recovery codes. After any first factor
(password, email code, provider) the session is held behind a
five-minute challenge: five tries, each code works once. Turning it off
needs a code. Managers can reset it for someone who lost their phone.
Both the web app and the admin panel ask for the code.
Integrations:
- Personal API tokens ("dw_…") that act as their owner, read-only or
read-write, with optional expiry. Only a hash is stored, and the token is
shown once. Tokens cannot manage tokens or two-step sign-in. Admins see
and can revoke their organization's tokens.
- Workspace webhooks for page, comment and space events. Deliveries are
HMAC-SHA256 signed and retried (10 s, 1 min, 5 min), with a 30-day log
and a test button. Loopback and link-local addresses are refused
(DOCWELL_WEBHOOKS_ALLOW_LOCAL is for development).
Audit log: sign-ins (including failures and second steps, filed under the
account's organization) and every successful change request, by route and
path ids, never bodies. Superadmins see everything and org admins their
organization. It is searchable and exportable as CSV in the admin panel's
new Security page, and kept for DOCWELL_AUDIT_RETENTION_DAYS (365).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comments are now threads: replies hang off a thread's first comment,
which alone points at text and can be resolved. Authors can edit their
own comments, and anyone who can comment can react with an emoji.
Resolved threads stop lighting text in the editor and fold away in the
panel. Comments can @mention people.
People watch the pages they create or comment on, and can watch or mute
a page from its menu. Muting is remembered. The inbox collects comments
on watched pages, replies in your threads, mentions (in comments and in
page text), pages shared with you and resolved threads. It shows an
unread badge in the sidebar, polled every minute, and links straight to
the thread. Nobody hears about their own actions or about pages they
cannot open, and a notification hides its text once access is lost.
Unread notifications are emailed as a digest every few minutes unless
the person turns that off. Read ones are pruned after 90 days. The jobs
registry can now run jobs on a timer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pages can now be shared with people and groups beyond their space, and
restricted so that only those grants count. A grant covers the page and
everything under it. Space admins always keep access, and an editor who
restricts a page keeps editor through a grant of their own.
Sharing a page with someone from the organization who is outside the
workspace adds them as a guest. Anyone else gets a guest invite that
carries the page grant, which is made when they accept. Guests see a
"limited" space holding only the pages shared with them.
The page tree, breadcrumbs, search, favorites, recents, trash and import
all follow the page role. Public links skip restricted subtrees. Grants
are cleaned up when a member leaves or a group is deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Editor:
- "/" opens a filterable block menu (text, headings, lists, quote, code,
divider, and image or file upload when the host can store files).
- Selecting text shows a formatting toolbar (bold, italic, strike, code,
link) and, for anyone who may comment, a Comment button.
- "@" finds people in the page's workspace; the mention node is always in
the schema so documents with mentions open in every client.
- The popups are plain DOM in the design system's slash-menu style, so
the framework-free mobile bridge keeps building and can use them.
- Menu words come from the host; the web app passes English or Polish.
Inline comments (basic): commenters cannot edit the document, so a
comment's anchor is a pair of Yjs relative positions stored with the
comment rather than a mark in the text. Highlights follow local edits by
mapping and are re-resolved when comments change or remote edits arrive.
Pages get a comments panel (side column, or a bottom sheet on narrow
screens). Authors and space admins can delete comments.
Server: comments collection and endpoints, and a people lookup any
workspace member may use for mentions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Workspace admins create groups of members, and space admins grant a role
to a whole group. A member's space role is now the highest of their own
grant and their groups' grants. Leaving a workspace drops its group
memberships, and deleting a group removes its space grants (they are not
a real relation, so PocketBase cannot cascade them).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Managers invite people into their organization and workspace admins into
their workspace; the email links to a new /invite page that creates the
account (or attaches an existing one without an organization) and adds the
workspace membership. Invites bypass the signup rules, store only a token
hash, expire after seven days, and return the link so it can be passed on
when mail is not configured. Inviting someone already in the organization
adds them to the workspace directly.
Magic links reuse PocketBase's email OTP: the email now carries a link to
/magic-link next to the code, and the admin settings gain a switch for it.
Managers can also send a user a password-reset email.
The dev proxies read DOCWELL_DEV_API so a dev server can target another
docwell-server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Superadmins can now change signup rules (on/off and the domain allow-list)
and branding at runtime; the environment variables only seed the defaults.
Mail and S3 storage settings pass through to PocketBase's own settings, and
docwell-server sends its own emails through a PocketBase hook so there is a
single SMTP configuration. The boot hook no longer wipes SMTP settings that
were not set from the environment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repository basics:
- CONTRIBUTING.md and CODE_OF_CONDUCT.md (Contributor Covenant 2.1)
- SPDX AGPL-3.0-or-later headers on all hand-written sources, checked in CI
- golangci-lint (shared .golangci.yml), ESLint and Prettier, all run in CI
API codegen from api/openapi.yaml (npm run generate, drift fails CI):
- Go types via oapi-codegen in Server/internal/api
- a contract test that the router and the spec list the same routes
- Dart models via Phone-App/tool/generate_api.dart; the app uses them
Spike: shared Tiptap editor in a Flutter WebView (ADR-4)
- @docwell/editor-bridge builds the editor into one HTML page with a
versioned JSON protocol; Phone-App hosts it with webview_flutter and a
native toolbar. Integration test passes on an Android API 35 emulator.
- flutter_inappwebview dropped: its Android plugin fails on AGP 9.
Spike: Wails v3 desktop (ADR-11)
- system tray, docwell:// deep links (page and space only) with
single-instance hand-off, and the built-in updater with a required
ed25519 signing key. Verified on Windows.
- regenerated build assets register the scheme and drop template
placeholders.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spaces and pages:
- Spaces inside workspaces, open or private, with admin/editor/commenter/viewer
roles that cascade from the workspace role (rules in internal/access)
- Page tree per space with fractional position keys, move with cycle checks,
trash that hides whole subtrees, restore and permanent delete
- OpenAPI, TypeScript client, and web app sidebar tree with drag-and-drop,
page, space, trash and space settings views (EN + PL)
Design system:
- Tokens, type scale, radii and shadows from the design kit in
@docwell/ui/theme.css; Inter, Source Serif 4 and JetBrains Mono bundled
- Vue ports of Button, TextField, Badge, Callout, Icon, Breadcrumbs,
SlashMenu and PageTreeItem, plus Logo; favicons and web manifest
- Web app and admin panel restyled on the new tokens, in light and dark
Also: fix the Vite dev server crashing on /config.json, and stop tracking
the local Design/ and docs/ folders.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same model as DriverVault, with organizations above workspaces:
- users get a role (user, admin, superadmin) and at most one
organization; existing instance admins become superadmins
- rights cascade: superadmins own everything, org admins own their
organization's workspaces, others get their workspace role
(owner > admin > member > guest) while they stay in the org
- nobody grants a role above their own, acts on someone ranked above
them, or changes their own role; rules live in internal/access as
pure, tested functions
- self-service organizations: an org-less user creates one and becomes
its admin; the last admin can delete it and is demoted
- endpoints for users, orgs, workspaces and members; token cache is
dropped when a user's rights change
- admin panel: Users and Organizations pages scoped to the caller
- web app: organization page, workspace list, workspace settings with
member management (EN/PL)
- fix: organization name missing after login/refresh, and stale tokens
redirecting public pages to sign-in
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>