这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Sunwood-ai-labs
Copy link
Owner

Summary

  • ensure the canvas preview scales to the available space without being clipped
  • automatically assign newly uploaded visual assets to grid cells and keep the active cell in sync
  • portal dropdown menus so the export menu is no longer hidden behind the project summary

Testing

  • npm run lint (fails: next not found in PATH in this environment)

https://chatgpt.com/codex/tasks/task_e_68fe1eaedf30832cabdff527ff3d3832

@Sunwood-ai-labs Sunwood-ai-labs merged commit 5a33470 into main Oct 26, 2025
0 of 4 checks passed
@gemini-code-assist
Copy link

Summary of Changes

Hello @Sunwood-ai-labs, 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 significantly enhances the user experience by improving the responsiveness of the canvas preview, streamlining the asset management workflow with automatic placement, and resolving UI layering issues with dropdown menus. These changes ensure a more fluid and intuitive interaction with the application's core features, making the interface more robust and user-friendly.

Highlights

  • Responsive Canvas Preview: The canvas preview now dynamically scales to fit available space without clipping, using a ResizeObserver to adapt to container size changes and maintain its aspect ratio.
  • Automated Asset Placement: Newly uploaded visual assets are automatically assigned to available grid cells. The system also updates the active cell to the one where the asset was newly placed, streamlining the workflow.
  • Improved Dropdown Menus: Dropdown menus are now rendered using React Portals, preventing them from being clipped or hidden by parent elements, specifically addressing issues like the export menu being obscured.
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.

@Sunwood-ai-labs Sunwood-ai-labs deleted the codex/fix-preview-display-and-image-insertion-bugs branch October 26, 2025 13:19
@github-actions
Copy link

There is a problem with the Gemini CLI PR review. Please check the action logs for details.

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 several valuable UI improvements. The canvas preview scaling has been fixed to correctly fit within its container, which is a great enhancement. Dropdown menus are now correctly rendered in portals to avoid being clipped by other elements. The feature to automatically place uploaded assets is a nice productivity boost. My review focuses on this new auto-placement logic, where I found a critical issue that prevents it from working correctly with multiple files. I've also included a suggestion to improve code maintainability. The other changes look solid.


visualAssets.forEach((asset) => {
const state = useProjectStore.getState();
const cellIndex = determineTargetCell(state.project, state.activeCell);

Choose a reason for hiding this comment

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

critical

There's a logical error here that prevents the auto-assignment of multiple assets from working correctly. By passing state.activeCell to determineTargetCell, and since setActiveCell is also called within the loop, every asset in visualAssets will be assigned to the same cell, overwriting the previous one. This results in only the last asset being placed on the grid.

To fix this, you should call determineTargetCell without the activeCell argument. This will allow it to find the next available empty cell in each iteration of the loop.

Suggested change
const cellIndex = determineTargetCell(state.project, state.activeCell);
const cellIndex = determineTargetCell(state.project);

}

function autoAssignAssetsToCells(assets: Asset[]) {
const visualAssets = assets.filter((asset) => asset.type === "image" || asset.type === "logo" || asset.type === "video");

Choose a reason for hiding this comment

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

medium

For better readability and maintainability, you can define an array of visual asset types and use Array.prototype.includes() to check if the asset type is one of them. This makes it easier to add or remove types in the future.

Suggested change
const visualAssets = assets.filter((asset) => asset.type === "image" || asset.type === "logo" || asset.type === "video");
const visualAssets = assets.filter((asset) => ["image", "logo", "video"].includes(asset.type));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants