Skip to content

prevent AI in-editor input from disappearing on rejection#10206

Merged
Light2Dark merged 5 commits into
mainfrom
sham/fix-ai-input-disappear
Jul 17, 2026
Merged

prevent AI in-editor input from disappearing on rejection#10206
Light2Dark merged 5 commits into
mainfrom
sham/fix-ai-input-disappear

Conversation

@Light2Dark

@Light2Dark Light2Dark commented Jul 17, 2026

Copy link
Copy Markdown
Member

📝 Summary

Screen.Recording.2026-07-17.at.5.23.21.PM.mov

Addresses #9788 (comment)

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (optional).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.

Copilot AI review requested due to automatic review settings July 17, 2026 09:25
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jul 17, 2026 12:24pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

  • handleAcceptCompletion no longer calls onClose(), 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();
  };

Comment thread frontend/src/components/editor/ai/ai-completion-editor.tsx

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread frontend/src/components/editor/ai/ai-completion-editor.tsx
Comment thread frontend/src/components/editor/ai/ai-completion-editor.tsx

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread frontend/src/components/editor/ai/ai-completion-editor.tsx
@Light2Dark
Light2Dark merged commit 5eb4152 into main Jul 17, 2026
30 checks passed
@Light2Dark
Light2Dark deleted the sham/fix-ai-input-disappear branch July 17, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants