Skip to content

Add annotation subject and review-state support - #788

Open
bobsingor wants to merge 7 commits into
mainfrom
feature/comments
Open

Add annotation subject and review-state support#788
bobsingor wants to merge 7 commits into
mainfrom
feature/comments

Conversation

@bobsingor

Copy link
Copy Markdown
Contributor

Adds /Subj to annotation DTOs, drafts, and patches and reads/writes it across annotation base fields. Text annotations now support ISO 32000 review-state /State and /StateModel, including lowercase canonicalization for standard values, passthrough for custom models/states, and faithful null-vs-absent handling. The patch also marks these fields as appearance-inert and adds conformance coverage for round-trips, invalid drafts, null-clears, and custom state models.

Adds `/Subj` to annotation DTOs, drafts, and patches and reads/writes it across annotation base fields. Text annotations now support ISO 32000 review-state `/State` and `/StateModel`, including lowercase canonicalization for standard values, passthrough for custom models/states, and faithful `null`-vs-absent handling. The patch also marks these fields as appearance-inert and adds conformance coverage for round-trips, invalid drafts, null-clears, and custom state models.
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cloudpdf-com Ready Ready Preview Aug 29, 2026 10:03pm
embed-pdf-snippet Error Error Aug 29, 2026 10:03pm
embed-pdf-viewer-react-mui Error Error Aug 29, 2026 10:03pm
embed-pdf-viewer-svelte-tailwind Error Error Aug 29, 2026 10:03pm
embed-pdf-viewer-vue-vuetify Error Error Aug 29, 2026 10:03pm
embed-pdf-website Ready Ready Preview Aug 29, 2026 10:03pm

Request Review

Adds a doc-level annotationsVersion pin for immutable whole-document annotation snapshots, using manifest refresh/retry on stale 404s and carrying auditHead through bulk reads. This also updates the server schema/migrations, exposes versioned bulk/page annotation reads, emits stream.desynced on full-refresh gaps, and adds comment-thread composition and conformance coverage.
This change adds whole-document annotation hydration via listRawAll, tracks hydration status, and replays remote events during the hydration window to avoid stale snapshots and delete resurrection. It also handles desync recovery by rehydrating on stream.desynced and reloads affected pages for page-level events.

A shared conversation-plane filter is introduced so replies and review-state annotations are kept in the model but never painted, hit-tested, marquee-selected, or counted in page appearance epochs. The capability and reducer now expose hydration state, while the effects layer routes remote streams through the hydration-aware delivery path.
Track every state annotation in a thread by adding statusRefs to CommentThreadReview and populating it in computeReview; update core tests. Introduce the CommentsApi surface and supporting types (CommentPermissions, ThreadDeleteResult) in the annotation plugin and implement a memoized threads index plus verbs (threads, thread, reply, edit, setStatus, setMarked, remove, removeThread, permissionsFor). Wire comments into AnnotationCapability and extend tests/harness for multi-page layout and session identity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Expose per-record collab authorization mirrors used for UI gating: add security.allowsAnnotationCreate/Mutation/GroupAssignment to core DocumentSecurityService and implement them for cloud and local services. Surface ScopeGuard.canCollab/canSetGroup helpers and wire CloudDocumentSecurityService to use raw scope, identity and PDF bits. Update annotation plugin to consult these per-record checks (create vs target-owner) and adjust grouping/ungrouping logic. Add unit tests for cloud and engine-local mirrors and a small stub-worker fix for annotation list RPC parity. Mirrors are for UI gating only; engine/server still enforce access.
This change exposes comment thread APIs and types for the React runtime, adds thread enrichment that joins live page labels/indexes, and updates the Chrome viewer with a comments panel, locale strings, and retry/error/loading states. It also adds coverage for page movement and deleted-page fallback behavior and bumps the generated wasm32 version.
This patch aligns the viewer API around content-space naming (`contentToView`, `viewToContent`, `toPixels`/`fromPixels`) and updates page context, stage, selection, and geometry code to use the new names consistently. It also adds the headless coordinate docs, makes `RevealOptions.rect` accept nullable inputs for comment-thread sources, and enriches comment threads with `contentRect` for camera jumps. The comment sidebar gains type metadata, locale strings, and improved card behavior so annotations are easier to identify and navigate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant