Skip to content

fix(core): allocate comment ids per document - #3206

Queued
jan-kubica wants to merge 1 commit into
mainfrom
fix/per-document-comment-ids
Queued

jan-kubica wants to merge 1 commit into
mainfrom
fix/per-document-comment-ids

Conversation

@jan-kubica

Copy link
Copy Markdown
Contributor
  • createCommentIdAllocator() returns an allocator with its own state; the module-level counter and allocateCommentId/seedCommentIdAbove are removed.
  • The headless reviewer owns its document's allocator (a fork copies it); seeding reserves every annotation id the document holds, so a wrap past the maximum never reuses one.
  • createReply takes the document's allocator, and reply paragraph ids derive from the comment ids instead of a random source.
  • The React and Vue comment flows allocate per loaded document.
  • Tests on both engines: the same edits to the same document save the same parts whatever the process allocated before, including up to the maximum; allocator and reply properties updated.

@jan-kubica
jan-kubica enabled auto-merge November 20, 2026 19:35
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: stella/folio
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: b5bcbff
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4f75976b-ec4c-4679-8a06-eb8b7203636f
Commits

Reviewing files that changed from the base of the PR and between b5bcbff and 869f74e.

Files selected for processing: 16

  • .changeset/per-document-comment-ids.md
  • packages/agents/src/bridges/editor-ref.ts
  • packages/core/src/ai-edits/commentIdAllocation.test.ts
  • packages/core/src/ai-edits/commentIdsPerDocument.test.ts
  • packages/core/src/ai-edits/headless.ts
  • packages/core/src/docx/commentReplyThreads.test.ts
  • packages/core/src/docx/replyToComment.ts
  • packages/core/src/prosemirror/commentIdAllocator.test.ts
  • packages/core/src/prosemirror/commentIdAllocator.ts
  • packages/core/src/prosemirror/plugins/revisionIds.ts
  • packages/react/src/components/DocxEditor.tsx
  • packages/react/src/components/commentsHelpers.test.ts
  • packages/react/src/components/commentsHelpers.ts
  • packages/react/src/components/useFolioComments.test.tsx
  • packages/react/src/components/useFolioComments.ts
  • packages/vue/src/composables/useCommentManagement.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-20T19:41:25.236361Z 19e1583 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jan-kubica
jan-kubica force-pushed the fix/per-document-comment-ids branch from 19e1583 to 869f74e Compare November 20, 2026 19:57
@jan-kubica
jan-kubica added this pull request to the merge queue Nov 20, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
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