Skip to content

Conversation

@financialvice
Copy link

Adds helpers to read comment positions and anchored text without reimplementing selection logic.\n\nTests: pnpm -C packages/superdoc test -- comments-store.test.js

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c8b2427e4

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +97 to +101
if (!commentOrId) return null;
if (typeof commentOrId === 'object') {
return commentOrId.commentId ?? commentOrId.importedId ?? null;
}
return commentOrId;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve importedId to internal id for position lookup

When callers pass an importedId (which getComment accepts elsewhere in this store), getCommentPosition uses it directly as the lookup key. But comment positions are keyed by the threadId derived from commentId when present (see collectCommentPositions in packages/super-editor/src/core/presentation-editor/utils/CommentPositionCollection.ts), so imported comments where commentId != importedId (e.g., commentId: 'comment-1', importedId: 'import-1') will return null and getCommentAnchoredText/getCommentAnchorData won’t work for importedId inputs. Consider resolving IDs through getComment and then using comment.commentId ?? comment.importedId so importedId inputs still map to the stored positions.

Useful? React with 👍 / 👎.

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