Skip to content

feat: optimize editor updateContent logic#2097

Merged
erha19 merged 1 commit into
mainfrom
feat/optimze-editor-logview
Dec 21, 2022
Merged

feat: optimize editor updateContent logic#2097
erha19 merged 1 commit into
mainfrom
feat/optimze-editor-logview

Conversation

@life2015
Copy link
Copy Markdown
Member

Types

优化文件差量修改时Monaco编辑器的响应逻辑。

  • 🎉 New Features

Background or solution

OpenSumi在查看日志文件这一类文件末尾会一直增加新文本的场景时,每次末尾文本的增加都会导致Monaco编辑器的全部刷新,进而造成整个编辑器的Log日志高亮闪烁。

因此需要在日志刷新写到编辑器之前增加一个diff逻辑,来保证这类在文件末尾不断新增的文本的日志场景能有不错的阅读体验,避免全局的编辑器闪烁。

视频演示:

Before:

default.mp4

After:

default.mp4

Changelog

  • feat: optimize editor updateContent logic

@github-actions github-actions Bot added the 🎨 feature feature required label Dec 19, 2022
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 19, 2022

Codecov Report

Base: 57.75% // Head: 57.73% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (6213c36) compared to base (006d593).
Patch coverage: 10.52% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2097      +/-   ##
==========================================
- Coverage   57.75%   57.73%   -0.03%     
==========================================
  Files        1291     1291              
  Lines       81118    81154      +36     
  Branches    16931    16938       +7     
==========================================
+ Hits        46848    46852       +4     
- Misses      31152    31184      +32     
  Partials     3118     3118              
Flag Coverage Δ
jsdom 52.52% <10.52%> (-0.02%) ⬇️
node 16.90% <10.52%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...tor/src/browser/doc-model/editor-document-model.ts 56.07% <10.52%> (-5.68%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@erha19 erha19 added this to the 2.22 milestone Dec 21, 2022
@erha19 erha19 merged commit b27162e into main Dec 21, 2022
@erha19 erha19 deleted the feat/optimze-editor-logview branch December 21, 2022 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎨 feature feature required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants