Skip to content

Conversation

@Overu
Copy link
Collaborator

@Overu Overu commented Dec 2, 2025

Closed #2528

@gemini-code-assist
Copy link

Summary of Changes

Hello @Overu, 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 refines the user experience for importing content from Scratch by introducing a clear distinction between importing full Scratch projects and importing only assets. This is achieved through dedicated UI elements, specific icons, and corresponding updates to the internal logic and messaging, making the import process more intuitive and less ambiguous for users.

Highlights

  • UI Separation for Scratch Imports: The user interface now clearly distinguishes between importing entire Scratch projects and importing individual assets from Scratch files, providing separate menu items for each action.
  • Dedicated Icons for Import Options: New and updated SVG icons have been introduced to visually represent the distinct functionalities for importing Scratch projects and importing Scratch assets.
  • Refactored Import Logic: The underlying event handlers and associated messages have been refactored to align with the new UI separation, ensuring correct functionality for both Scratch project and asset imports.
  • Improved Editor Mode Icons: The icons for 'Default Mode' and 'Map Edit Mode' in the editor's navigation bar have been updated and renamed for better clarity and consistency.
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 effectively separates the user actions for importing a full Scratch project versus importing only assets from a Scratch project. This is a great improvement for user experience clarity. The changes include new UI menu items, new icons, and refactoring of component logic to support the separated functionalities. The code is well-structured, and the new naming for variables and functions greatly improves readability. I have a couple of minor suggestions to further improve code structure and UI consistency.

Comment on lines 34 to 37
</UIMenuGroup>
<UIMenuGroup :disabled="project == null">

Choose a reason for hiding this comment

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

medium

These two UIMenuGroup components have the same :disabled condition. They could be merged into a single group for better readability and to remove an unnecessary separator in the menu. The export action can be part of the same group as the import actions.

@xgopilot
Copy link
Contributor

xgopilot bot commented Dec 2, 2025

Code Review Summary

Comprehensive review completed using specialized agents. Overall, this PR is well-implemented with clean separation of concerns between importing full Scratch projects and importing assets only.

✅ Approved Areas

Code Quality: Clean implementation following Vue 3 best practices
Performance: Efficient icon loading and excellent concurrent asset import pattern
Security: PR changes are secure (see note below about related functionality)

💡 Suggestions

1. Minor improvement (EditorNavbar.vue:8)
The radar description could be more explicit about the two Scratch import options:

desc: 'Hover to see project options (create/open/publish/unpublish/remove project, import/export project file, import Scratch project file, import assets from Scratch, etc.)'

2. Typo in related file (not in this PR)
LoadFromScratch.vue:167 has a typo: "Assets imprted" should be "Assets imported". This should be fixed in a separate PR.

3. Security hardening opportunity (not in this PR)
The Scratch import feature in scratch.ts doesn't validate asset names from uploaded files. Consider adding validation to prevent path traversal and special character issues in a follow-up security PR.

Comment on lines 13 to 14
if (file.size > maxFileSize) {
throw new DefaultException({ en: 'File too large. Maximum size is 32MB', zh: '文件太大,最大支持 32MB' })
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

这里处理 #2497 (comment) 提到的问题

@nighca nighca merged commit e8ccea3 into goplus:dev Dec 4, 2025
5 checks passed
<UIMenuItem class="import-scratch" @click="handleImportFromScratch">
<template #icon><img :src="importScratchSvg" /></template>
<span class="item-text">
{{ $t({ en: 'Import Scratch project file', zh: '导入 Scratch 项目文件' }) }}
Copy link
Collaborator

@nighca nighca Dec 5, 2025

Choose a reason for hiding this comment

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

刚刚看测试环境这边的功能,想到文案规范的事情,我建了个 issue #2560

@Overu 你调整 beta tag 样式的时候可以顺便处理下这个?可以先只处理 Navbar 的

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.

import scratch project into xbuilder

2 participants