prevent AI in-editor input from disappearing on rejection#10206
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR adjusts the frontend AI completion UIs to avoid losing the in-editor prompt when a user rejects an AI suggestion, enabling iterative prompt refinement instead of exiting the AI flow.
Changes:
- Update in-cell AI completion rejection to stop generation, clear the suggestion, and keep the prompt available for refinement.
- Update “Add cell with AI” flows to keep focus in the prompt after rejection, and refactor close handling into a shared helper.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/src/components/editor/ai/ai-completion-editor.tsx | Changes reject behavior to stop/clear completion and refocus the prompt instead of closing the AI editor. |
| frontend/src/components/editor/ai/add-cell-with-ai.tsx | Keeps prompt focused after rejection; refactors close logic; changes accept behavior to clear input instead of closing. |
Comments suppressed due to low confidence (1)
frontend/src/components/editor/ai/add-cell-with-ai.tsx:230
handleAcceptCompletionno longer callsonClose(), which changes the UX from “accept then close the Add Cell with AI panel” to leaving it open (and keeping any attachments state alive). If the intent is only to keep the prompt open on rejection, consider restoring the previous close-on-accept behavior (or update the PR description to call out this behavior change).
const handleAcceptCompletion = () => {
clearStagedCells();
onClose();
};
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
📝 Summary
Screen.Recording.2026-07-17.at.5.23.21.PM.mov
Addresses #9788 (comment)
📋 Pre-Review Checklist
✅ Merge Checklist