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 the forceUpdate after editor open and close #441

Merged
merged 1 commit into from
Sep 22, 2021
Merged

Conversation

mortalYoung
Copy link
Collaborator

简介

  • 优化 explorer forceUpdate 的问题

主要变更

  • 由于 editorService 的数据改变,并不会引起 explorer 的重新渲染,也就无法触发 collapse 组件重新计算位置,所以需要在 explorer 的 open 和 closeX 的方法之后,调用 explorer.forceUpdate 来触发重新渲染
  • 之前 forceUpdate 有的地方需要用户自行触发,有的地方在 subscribe 触发,有的在 service 触发,现在是整理一下,把所有的 forceUpdate 都在 service 中触发

@mortalYoung mortalYoung added the bug Something isn't working label Sep 22, 2021
@mortalYoung mortalYoung added this to the 0.9.0-beta.1 milestone Sep 22, 2021
@mortalYoung mortalYoung self-assigned this Sep 22, 2021
@codecov
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

Merging #441 (2b8f11d) into main (b76f372) will increase coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #441      +/-   ##
==========================================
+ Coverage   80.63%   80.76%   +0.12%     
==========================================
  Files         177      177              
  Lines        4907     4908       +1     
  Branches     1062     1062              
==========================================
+ Hits         3957     3964       +7     
+ Misses        941      935       -6     
  Partials        9        9              
Impacted Files Coverage Δ
src/controller/editor.tsx 14.87% <ø> (-0.58%) ⬇️
src/extensions/editorTree/index.ts 52.94% <ø> (+7.94%) ⬆️
...c/services/workbench/explorer/folderTreeService.ts 96.46% <ø> (-0.04%) ⬇️
src/react/component.ts 88.23% <100.00%> (+11.76%) ⬆️
src/services/workbench/editorService.ts 98.04% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b76f372...2b8f11d. Read the comment docs.

Copy link
Collaborator

@wewoor wewoor left a comment

Choose a reason for hiding this comment

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

+1

@wewoor wewoor merged commit 50e0de2 into main Sep 22, 2021
@wewoor wewoor deleted the fix/explorer branch September 22, 2021 12:22
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.

2 participants