Skip to content

Annotation draft only persists the open document; other documents' comments are lost on reload in folder and linked-doc sessions #1545

Description

@backnotprop

Found during the v0.27.15 release QA (pre-existing, not introduced in 0.27.15, but more visible now that #1532 and #1533 make cross-document annotating routine).

What happens. useAnnotationDraft is fed only the active document's annotation list (packages/editor/App.tsx ~2427, allAnnotations). Annotations on every other document in a folder or linked-doc session live only in useLinkedDoc's in-memory cache (packages/ui/hooks/useLinkedDoc.ts ~618). Consequences, reproduced in a real browser:

  1. Navigating to a document with no annotations tombstones the persisted draft outright (the empty-set branch in packages/ui/hooks/useAnnotationDraft.ts ~406), so a reload after that navigation loses every comment made in the session.
  2. Reloading while a linked doc is open offers only that doc's comments in Draft Recovered, and restoring attributes them to the plan/root document as Unanchored cards.
  3. The plan's own comments are also missing from Export and share links while a linked doc is open (getDocAnnotations only includes the stash when sourceFilePath is set, which is annotate-only).

Related, same root: the active document's feedback is exported twice when a linked or folder document is open at submit time (gate finding G2).

Fix direction. Make the draft transport carry every document's annotations (keyed by path, with the root document keyed explicitly), restore per document, and stop the empty-set tombstone when other documents still hold annotations. Needs a draft schema bump with a read-side migration for existing drafts. Proposed for 0.27.16.

Evidence: release-gate reports under the QA scratch (G1/G2 traces, s12-trace.js, s9-crossdoc.js).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions