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

chore: optimize menuaction list renderer #2775

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

Aaaaash
Copy link
Member

@Aaaaash Aaaaash commented Jun 6, 2023

Types

  • 🐛 Bug Fixes

Background or solution

before

image

after

image

原有的 menulist 的渲染逻辑中,是将所有 menunodes 包括分割线循环渲染出来,而对于没有子菜单项的则会渲染为空,但实际上由于原本菜单项间插入的分割线,导致这种情况下,即使菜单没有被渲染,但菜单的分割线也会被渲染出来,出现连续的两条分割线

优化方式是跳过每次循环对分割线的处理,而是在渲染菜单项时判断下一个菜单项是否为分割线,与菜单项一起渲染

🤖 Generated by Copilot at b097c57

  • Simplify the rendering of menu items and submenus by avoiding unnecessary dividers (link, link)
  • Format the code of the MenuActionGroup component to improve readability and consistency (link)

Changelog

🤖 Generated by Copilot at b097c57

This pull request enhances the appearance and usability of the menu actions component in the core-browser package. It adjusts the logic for adding dividers between menu items and submenus based on the MenuActionGroup data source.

@Aaaaash Aaaaash force-pushed the chore/optimize-context-menu-renderer branch from b097c57 to 081161b Compare June 6, 2023 02:43
@Aaaaash
Copy link
Member Author

Aaaaash commented Jun 6, 2023

/next

@opensumi
Copy link
Contributor

opensumi bot commented Jun 6, 2023

🎉 PR Next version 2.24.6-next-1686019879.0 publish successful! You can install this version via npm install package@2.24.6-next-1686019879.0

2.24.6-next-1686019879.0

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01 ⚠️

Comparison is base (a7d5605) 57.75% compared to head (081161b) 57.75%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2775      +/-   ##
==========================================
- Coverage   57.75%   57.75%   -0.01%     
==========================================
  Files        1330     1330              
  Lines       83682    83682              
  Branches    17396    17396              
==========================================
- Hits        48333    48330       -3     
- Misses      32128    32131       +3     
  Partials     3221     3221              
Flag Coverage Δ
jsdom 52.76% <ø> (ø)
node 16.78% <ø> (-0.01%) ⬇️

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

see 1 file with indirect coverage changes

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

@Aaaaash Aaaaash merged commit 3a7d168 into main Jun 6, 2023
13 checks passed
@Aaaaash Aaaaash deleted the chore/optimize-context-menu-renderer branch June 6, 2023 07:24
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.

None yet

2 participants