-
Notifications
You must be signed in to change notification settings - Fork 937
Add getSelectedDomFragment
#4447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
🦋 Changeset detectedLatest commit: 39ebdd9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Claude finished @felixfeng33's task —— View job PR Review: getSelectedDomFragmentI've completed a thorough review of this PR. Here are my findings: Todo List:
SummaryThis PR refactors the DOM selection logic by extracting fragment construction into a new utility function Issues Found🔴 Missing ChangesetThe PR adds new functionality to the yarn changesetSelect 🔴 Missing Unit TestsThe new
🟡 Type Safety IssueIn domBlocks.forEach((node: any) => {Should be: domBlocks.forEach((node: Element) => {🟡 Potential Error Handling IssueThe function doesn't handle the case where 🟡 Empty Array ReturnLine 35 has return [];Positive Aspects✅ Good refactoring: Moving the fragment construction logic into a separate function improves code organization and reusability. ✅ Backwards compatibility: Keeping ✅ Consistent API: The new function returns the processed fragment directly, which is more intuitive than returning DOM nodes. ✅ Proper deprecation notice: The deprecation comment clearly indicates what to use instead. Recommendations
/**
* Get Slate nodes from the DOM selection as a fragment
* @param editor - The Slate editor instance
* @returns Array of Descendant nodes from the selection, or empty array if no valid selection
*/
Next StepsPlease address the missing changeset and unit tests before merging. The type improvements and documentation would also enhance code quality. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
/changeset |
|
Claude finished @felixfeng33's task —— View job Changeset Created ✅Todo List:
Summary:
The changeset documents:
No registry changes were detected, so no changelog.mdx update was needed. |
Co-authored-by: Felix Feng <felixfeng33@users.noreply.github.com>
Checklist
yarn typecheckyarn lint:fixyarn testyarn brlyarn changeset