Skip to content

Conversation

@Col0ring
Copy link
Collaborator

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2025

🦋 Changeset detected

Latest commit: e58779e

The changes in this PR will be included in the next version bump.

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

@gemini-code-assist
Copy link

Summary of Changes

Hello @Col0ring, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the WebSandbox component by introducing a new custom event, facilitating bidirectional communication between the sandbox's frontend JavaScript and the Python backend. This allows for more flexible and dynamic interactions within applications utilizing the sandbox. Additionally, a bug in the MultimodalInput component's drag-and-drop functionality has been resolved, improving its reliability. The changes are fully documented and include a practical example.

Highlights

  • Custom Event for WebSandbox: Introduced a new custom event for the WebSandbox component, allowing JavaScript code within the sandbox to dispatch events that can be handled by Python callbacks. This is achieved by exposing a window.dispatch function in the sandbox iframe.
  • MultimodalInput Drop Container Fix: Corrected the getDropContainer logic in the MultimodalInput component to properly handle the fullscreenDrop configuration, ensuring the drop container is correctly set or unset.
  • Documentation and Demo: Updated both English and Chinese documentation for WebSandbox to detail the new custom event, and added a new Python demo to illustrate its usage.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new custom event for the WebSandbox component, allowing communication from the sandboxed environment back to the Python backend, and also fixes an issue with the drop container in the MultimodalInput component. The changes look good and the new feature is well-documented with a demo. I've found one minor issue in the documentation which I've commented on.

| `pro.WebSandbox.compile_success(fn, ···)` | Triggered when Sandbox compilation succeeds. |
| `pro.WebSandbox.compile_error(fn, ···)` | Triggered when Sandbox compilation fails. |
| `pro.WebSandbox.render_error(fn, ···)` | Triggered when Sandbox rendering throws an error. |
| `pro.WebSandbox.render_error(fn, ···)` | Triggered when Sandbox rendering throws an error. |

Choose a reason for hiding this comment

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

medium

This line appears to be a duplicate of the line above, listing the pro.WebSandbox.render_error event twice. It should be removed to avoid confusion.

@Col0ring Col0ring changed the title feat: add custom event to allow sending notifications from sandbox to Python & fix drop container of MulimodalInput feat(WebSandbox): add custom event to allow sending notifications from sandbox to Python Nov 20, 2025
@Col0ring Col0ring merged commit 5371a56 into main Nov 20, 2025
2 checks passed
@Col0ring Col0ring deleted the dev branch November 20, 2025 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants