Skip to content

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

Closed

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

  1. added
    bugSomething isn't working
    triageIssue created from backlog triage
    on Oct 21, 2026
  2. utpalsinghdev commented on Oct 25, 2026

    @utpalsinghdev
    Contributor

    This looks like it was addressed in #1710 and #1718. #1710 saves comments separately for each document and keeps the root document’s comments when another document is open. #1718 also covers sending each document’s comments only once.

    I checked current main and ran the related draft, recovery, and feedback tests. All 38 passed. Is there any remaining case this issue is tracking?

  3. added 2 commits that reference this issue on Oct 28, 2026
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

    bugSomething isn't workingtriageIssue created from backlog triage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions