feat(ProLayout): 多级子菜单展开指示与层级边线#9577
Conversation
Co-authored-by: 陈帅 <wasd2144@hotmail.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request enhances the navigation menu by adding a submenu arrow icon and a vertical indicator line for nested submenus. It refactors the submenu title structure to use specific class names and applies CSS transitions for the arrow's rotation. Feedback points out that the new elements are not handled in the collapsed sidebar state, which could lead to layout issues. Additionally, there is a concern that the added padding on nested lists might cause inconsistent indentation when combined with existing depth-based styles.
| [`${c}-submenu-title-text`]: { | ||
| flex: 1, | ||
| minWidth: 0, | ||
| display: 'flex', | ||
| flexDirection: 'row', | ||
| alignItems: 'center', | ||
| gap: v('itemGap'), | ||
| }, |
| [`${c}-submenu-children[data-pro-layout-nav-submenu-children]:not([data-depth="0"])`]: | ||
| { | ||
| marginInlineStart: 4, | ||
| paddingInlineStart: 10, | ||
| borderInlineStart: `1px solid ${v('colorDivider')}`, | ||
| }, |
Summary
*-submenu-title-textand append aDownOutlinedarrow in*-submenu-arrow; rotate 180° when open (*-submenu-arrow--open) for inline and popup submenu title buttons.ul.*-submenu-children) getdata-pro-layout-nav-submenu-childrenanddata-depth={depth}; fordepth > 0, add left inset +border-inline-startusing--pro-layout-nav-color-dividerso second/third levels read as nested.> *flex rule that would break the two-child structure.Testing
pnpm exec vitest run tests/layout/index.test.tsx