Skip to content

fix: custom components are not destroyed after being closed#3036

Merged
MMhunter merged 3 commits into
opensumi:mainfrom
xkaede:fixes-custom-component-not-destroy
Sep 8, 2023
Merged

fix: custom components are not destroyed after being closed#3036
MMhunter merged 3 commits into
opensumi:mainfrom
xkaede:fixes-custom-component-not-destroy

Conversation

@xkaede
Copy link
Copy Markdown
Contributor

@xkaede xkaede commented Sep 4, 2023

Types

  • 🐛 Bug Fixes

详情参见:#3034 (comment)
添加了component-editor-view.tsx文件用于复现。确认没有问题后。我来删除这个文件。
复现步骤:
1、新建文件“test.cmp”、"test.txt"
2、打开文件“test.cmp”,关闭“test.cmp”。控制台输出1(未修复前不会输出。)
3、打开文件“test.cmp”、"test.txt",保持“test.cmp”为当前Tab,关闭“test.cmp”。控制台输出1(未修复前会正确输出。)
4、打开文件“test.cmp”、"test.txt",保持“test.txt”为当前Tab,关闭“test.cmp”。控制台输出1(未修复前不会输出。)

Background or solution

🤖 Generated by Copilot at d66d41e

  • Add and register a custom editor component for .cmp files (link, link, link)
  • Update the editor group logic to clear and notify the active components when the body or tab changes (link, link)

Changelog

🤖 Generated by Copilot at d66d41e

This pull request enhances the editor service to support custom editor components and adds an example of such a component for .cmp files. It also fixes some issues with the editor component lifecycle when switching editor groups or tabs.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Sep 4, 2023

CLA assistant check
All committers have signed the CLA.

@opensumi opensumi Bot added the 🐞 bug Something isn't working label Sep 4, 2023
@erha19 erha19 requested a review from MMhunter September 5, 2023 01:38
@erha19
Copy link
Copy Markdown
Member

erha19 commented Sep 5, 2023

@MMhunter 看一下这个 PR,我看着没啥问题

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 5, 2023

Codecov Report

Patch coverage is 100.00% of modified lines.

Files Changed Coverage
...ges/editor/src/browser/workbench-editor.service.ts 100.00%

📢 Thoughts on this report? Let us know!.

Comment thread packages/editor/src/browser/workbench-editor.service.ts Outdated
Comment thread packages/editor/src/browser/editor.view.tsx
@xkaede
Copy link
Copy Markdown
Contributor Author

xkaede commented Sep 7, 2023

@MMhunter 已调整

@MMhunter
Copy link
Copy Markdown
Contributor

MMhunter commented Sep 8, 2023

LGTM

@MMhunter MMhunter merged commit 9e55668 into opensumi:main Sep 8, 2023
@bytemain
Copy link
Copy Markdown
Member

/backport to v2.26

@opensumi
Copy link
Copy Markdown
Contributor

opensumi Bot commented Sep 11, 2023

Backporting to v2.26 branch is started.
Please see: https://github.com/opensumi/actions/actions/workflows/backport-pr.yml

@xkaede xkaede deleted the fixes-custom-component-not-destroy branch October 7, 2023 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants