chore: optimize menuaction list renderer #2775
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Types
Background or solution
before
after
原有的 menulist 的渲染逻辑中,是将所有 menunodes 包括分割线循环渲染出来,而对于没有子菜单项的则会渲染为空,但实际上由于原本菜单项间插入的分割线,导致这种情况下,即使菜单没有被渲染,但菜单的分割线也会被渲染出来,出现连续的两条分割线
优化方式是跳过每次循环对分割线的处理,而是在渲染菜单项时判断下一个菜单项是否为分割线,与菜单项一起渲染
🤖 Generated by Copilot at b097c57
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.