Skip to content

feat: command graphical add editing operations#506

Draft
xiaoxustudio wants to merge 5 commits intoOpenWebGAL:devfrom
xiaoxustudio:feat/command-editing
Draft

feat: command graphical add editing operations#506
xiaoxustudio wants to merge 5 commits intoOpenWebGAL:devfrom
xiaoxustudio:feat/command-editing

Conversation

@xiaoxustudio
Copy link
Copy Markdown
Member

@xiaoxustudio xiaoxustudio commented Nov 7, 2025

issue: #483

图形化编辑器增加选择状态
image

增加复制、粘贴操作(鼠标放置在已选择指令上)
image

(鼠标放置在其他指令上)
image

目前需要实现的需求:

  • 剪切板历史记录
  • 剪切板栈限制

我初步实现是这样,还需进一步讨论和修改。

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @xiaoxustudio, 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!

此拉取请求通过引入基本的编辑操作来增强图形化指令编辑器。用户现在可以选中单个指令,并执行复制、剪切和粘贴操作,这显著提高了编辑器管理指令序列的可用性和效率。

Highlights

  • 指令选择功能: 图形化编辑器新增了指令选择功能,允许用户选中单个指令进行操作。
  • 复制、剪切和粘贴操作: 在图形化编辑器中增加了指令的复制、剪切和粘贴操作,提升了编辑效率。
  • UI和状态管理: 引入了新的UI元素和逻辑来管理选中的指令和剪贴板历史,包括选择状态的视觉反馈和操作按钮。
  • 多语言支持: 更新了英文、日文和简体中文的本地化文件,以包含“剪切”、“取消选择”、“向上粘贴”、“向下粘贴”和“复制”等新术语。
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
Copy Markdown
Contributor

@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

这个 PR 为图形化编辑器增加了选择、复制、剪切和粘贴指令的功能,这是一个很棒的功能增强。代码实现很清晰,通过 EditorOpState 状态来管理剪贴板和选择状态的逻辑是合理的。

我发现了一些可以改进的地方,主要集中在 GraphicalEditor.tsx 文件中:

  • 状态类型定义不完整,可能导致潜在的 bug。
  • 剪贴板在取消选择时被清空,这可能不符合用户预期。
  • 向下粘贴和剪切操作的逻辑有小问题。
  • 一些 React 性能方面可以优化,例如使用 useCallback 和移除不稳定的嵌套组件。

我已经提出了一些具体的代码建议来解决这些问题。总体来说,这是一个很好的提交,稍作修改后会更加健壮。

Comment thread packages/origine2/src/pages/editor/GraphicalEditor/GraphicalEditor.tsx Outdated
Comment thread packages/origine2/src/pages/editor/GraphicalEditor/GraphicalEditor.tsx Outdated
Comment thread packages/origine2/src/pages/editor/GraphicalEditor/GraphicalEditor.tsx Outdated
Comment thread packages/origine2/src/pages/editor/GraphicalEditor/GraphicalEditor.tsx Outdated
@xiaoxustudio
Copy link
Copy Markdown
Member Author

xiaoxustudio commented Nov 7, 2025

剪切栈的存储也需要有个限制,目前我是取消选择后直接清空栈,也许需要一个特定时机来处理它。

需要考虑编写一个历史记录,让用户可以在任何情况下撤销和还原操作

也许我需要一些建议。

@xiaoxustudio xiaoxustudio marked this pull request as draft November 16, 2025 14:38
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.

1 participant