Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve editor actions #234

Merged
merged 4 commits into from
Jul 15, 2021
Merged

fix: improve editor actions #234

merged 4 commits into from
Jul 15, 2021

Conversation

mortalYoung
Copy link
Collaborator

简介

  • 修复无法添加 editor actions 的问题
  • 修复无法 update 已存在的 actions 的问题
  • 重构了 editor actions 的逻辑

主要变更

  • 优化 fix: improve unreasonable design #232 中新增的 updateGroupActions 函数命名的问题,容易引起歧义, 把 updateGroupActions 改成了 setDefaultActions
  • 新增 updateActions 方法,用于更新指定 group 的 actions
  • ellipsis 的图标放到 builtIn 方法返回里面去,而不是在 action.tsx 中写死
  • actions 的类型优化,支持通过 place 来定义 action 放的位置是外部还是 ellipsis 里面,并且设置了外部最大 icon 个数。多出来的 icon 会放到 ellipsis 里面,即使这些 icon 设置了 place 的话。
  • 移除了 actions 的 onClickContextMenu 方法,新增 onClickActions 方法,考虑的是复用 contextMenu 的话语义化不够清晰
  • 优化了 actions 的 hover 和 disabled 的样式

@mortalYoung mortalYoung requested a review from mumiao July 14, 2021 10:19
@wewoor wewoor added the enhancement New feature or request label Jul 14, 2021
@wewoor wewoor added this to the 0.9.0-alpha.4 milestone Jul 14, 2021
src/model/workbench/editor.ts Outdated Show resolved Hide resolved
src/workbench/editor/action.tsx Show resolved Hide resolved
src/workbench/editor/action.tsx Outdated Show resolved Hide resolved
src/workbench/editor/action.tsx Outdated Show resolved Hide resolved
src/workbench/editor/action.tsx Outdated Show resolved Hide resolved
src/workbench/editor/action.tsx Outdated Show resolved Hide resolved
@mumiao mumiao merged commit 443d4da into main Jul 15, 2021
@mumiao mumiao deleted the fix/editor-actions branch July 15, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants