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:
- 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.
- 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.
- 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).
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.
useAnnotationDraftis 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 inuseLinkedDoc's in-memory cache (packages/ui/hooks/useLinkedDoc.ts~618). Consequences, reproduced in a real browser:packages/ui/hooks/useAnnotationDraft.ts~406), so a reload after that navigation loses every comment made in the session.getDocAnnotationsonly includes the stash whensourceFilePathis 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).