Skip to content

refactor(builtinService): 侧边栏切换功能重构 #908

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ziscloud
Copy link

@ziscloud ziscloud commented May 3, 2025

Description

原来注册CommandQuickSideBarViewAction是依据ID_SIDE_BAR,这样是无法禁用CommandQuickSideBarViewAction的,但是在有些场景下是不需要这个action的。

通过添加quickToggleSideBarAction这个builtin module,使得通过经验builtin module达到禁用CommandQuickSideBarViewAction成为可能。

Changes

  • 将 ACTION_QUICK_CREATE_FOLDER常量添加到 const.ts 文件中
  • 在 extension.ts 中导入新的常量并更新相关动作映射
  • 修改 quickToggleSideBarAction.ts 中的 ID 引用,使用新常量替代原有值

ziscloud added 2 commits May 3, 2025 14:49
- 将 ACTION_QUICK_CREATE_FOLDER常量添加到 const.ts 文件中
- 在 extension.ts 中导入新的常量并更新相关动作映射
- 修改 quickToggleSideBarAction.ts 中的 ID 引用,使用新常量替代原有值

export class CommandQuickSideBarViewAction extends Action2 {
static readonly ID = ID_SIDE_BAR;
static readonly ID = constants.ACTION_QUICK_TOGGLE_SIDE_BAR;
Copy link
Collaborator

Choose a reason for hiding this comment

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

如果修改了这个 Action 的 ID,需要额外修改一下 Menu 里对应的,否则 keybinding 会获取失败。

大概在 https://github.com/DTStack/molecule/blob/main/src/services/builtinService/const.ts#L603-L604

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