-
Notifications
You must be signed in to change notification settings - Fork 931
Add rejectAISuggestions #4697
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
Add rejectAISuggestions #4697
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
🦋 Changeset detectedLatest commit: 16c62fb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 GitHub.
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
|
Claude finished @felixfeng33's task —— View job Code Review CompleteI've reviewed your PR that adds Review Todo List
🚨 Critical Issues1. Missing Changeset (Required)The changeset-bot correctly identified that this PR modifies the yarn changeset
# Select @platejs/ai
# Choose "patch" for this change
# Describe: "Add rejectAISuggestions utility and refactor acceptAISuggestions"2. Missing Test CoverageNeither the existing
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
plate/packages/ai/src/react/ai-chat/transforms/insertBelowAIChat.ts
Lines 10 to 49 in 5c42cf5
| import { acceptSuggestions } from './acceptAIChat'; | |
| import { createFormattedBlocks } from './replaceSelectionAIChat'; | |
| export const insertBelowAIChat = ( | |
| editor: PlateEditor, | |
| sourceEditor: SlateEditor, | |
| { format = 'single' }: { format?: 'all' | 'none' | 'single' } = {} | |
| ) => { | |
| const { toolName } = editor.getOptions(AIChatPlugin); | |
| if (toolName === 'generate') | |
| return insertBelowGenerate(editor, sourceEditor, { format }); | |
| const selectedBlocks = editor | |
| .getApi(BlockSelectionPlugin) | |
| .blockSelection.getNodes(); | |
| const selectedIds = editor.getOptions(BlockSelectionPlugin).selectedIds; | |
| editor.getTransforms(AIPlugin).ai.undo(); | |
| const insertBlocksAndSelect = | |
| editor.getTransforms(BlockSelectionPlugin).blockSelection | |
| .insertBlocksAndSelect; | |
| if (!selectedIds || selectedIds.size === 0) return; | |
| const lastBlock = selectedBlocks.at(-1); | |
| if (!lastBlock) return; | |
| const nextPath = PathApi.next(lastBlock[1]); | |
| const nodes = selectedBlocks.map((block) => block[0]); | |
| insertBlocksAndSelect(nodes, { | |
| at: nextPath, | |
| insertedCallback: () => { | |
| withAIBatch(editor, () => { | |
| acceptSuggestions(editor); |
The commit moved the suggestion acceptance logic into utils/acceptAISuggestions.ts and removed the acceptSuggestions export from acceptAIChat.ts, but insertBelowAIChat still imports and calls acceptSuggestions. After this change the module no longer exists, so this file will fail to compile with a missing export error. insertBelowAIChat should import acceptAISuggestions (or a new reject helper) from the utils barrel and invoke that instead.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@claude /changeset |
|
Claude finished @felixfeng33's task —— View job Changeset Created ✅I've created the changeset file for your PR that adds Todo List:
SummaryCreated
The changeset-bot should now recognize the changeset and update its comment accordingly. |
|
Claude finished @felixfeng33's task —— View job Changeset created successfully ✓Todo List
Created changeset |
Co-authored-by: Felix Feng <[email protected]>
Co-authored-by: Felix Feng <[email protected]>
b2a2666 to
b17c354
Compare
Checklist
yarn typecheckyarn lint:fixyarn testyarn brlyarn changeset