fix(editor): time issues of comment initialization (#13031)

#### PR Dependency Tree


* **PR #13031** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added the ability to filter comments by their resolution status
(resolved, unresolved, or all) when viewing or managing comments.

* **Refactor**
* Improved the way commented text is identified and retrieved, resulting
in more reliable comment selection and filtering.
* Enhanced comment retrieval to support asynchronous data loading,
ensuring up-to-date comment information.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
L-Sun
2025-07-04 16:19:00 +08:00
committed by GitHub
parent a485ad5c45
commit eb56adea46
7 changed files with 111 additions and 68 deletions

View File

@@ -15,7 +15,10 @@ export interface CommentProvider {
addComment: (selections: BaseSelection[]) => void;
resolveComment: (id: CommentId) => void;
highlightComment: (id: CommentId | null) => void;
getComments: () => CommentId[];
getComments: (
type: 'resolved' | 'unresolved' | 'all'
) => Promise<CommentId[]> | CommentId[];
onCommentAdded: (
callback: (id: CommentId, selections: BaseSelection[]) => void