Context
Per the #47 resolution, Document.content is a read-only mirror of Yjs state, maintained exclusively by Hocuspocus sync (server/src/lib/dbPersistence.ts). REST never writes it. This issue tracks the consumer features that justify keeping the mirror (Option A).
Features
-
Full-text document search — search documents by content and title.
- Candidate: Postgres
tsvector generated column on Document.content + GIN index; weight title higher than content.
- Endpoint:
GET /document/search?q=... scoped to docs the user owns/collaborates on.
-
Document previews — content snippets in dashboard cards / list views (first N lines), sourced from the mirror without touching Yjs state.
-
Export & download — download a document as:
- Markdown (
.md) — direct from content
- PDF — render markdown → HTML → PDF server-side or client-side print pipeline
Constraints
Context
Per the #47 resolution,
Document.contentis a read-only mirror of Yjs state, maintained exclusively by Hocuspocus sync (server/src/lib/dbPersistence.ts). REST never writes it. This issue tracks the consumer features that justify keeping the mirror (Option A).Features
Full-text document search — search documents by content and title.
tsvectorgenerated column onDocument.content+ GIN index; weight title higher than content.GET /document/search?q=...scoped to docs the user owns/collaborates on.Document previews — content snippets in dashboard cards / list views (first N lines), sourced from the mirror without touching Yjs state.
Export & download — download a document as:
.md) — direct fromcontentConstraints
content; none may introduce a new writer (that's how Document.content has two competing writers: Yjs persistence vs REST autosave #47 happened).YjsDocumentState), not directcontentwrites.