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

feat: Break long menu items into multiple lines #7665

Merged
merged 1 commit into from
Jan 8, 2025
Merged

Conversation

lan-yonghui
Copy link
Member

No description provided.

Copy link

f2c-ci-robot bot commented Jan 8, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

overflow-wrap: break-word;
line-height: normal;
}

.sidebar-container {
position: relative;
display: flex;
Copy link
Member

Choose a reason for hiding this comment

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

The code you provided seems mostly clean and clear. However, here's a concise feedback with suggestions:

Code Changes and Suggestions

1. Adding class to Sidebar Menu

  • Description: You've added a class custom-menu to the sidebar menu, which is good for styling specific components easily.
<el-submenu v-for="(menuItem, index) in routerMenus" :key="`sub${index}`" style="margin-left: 24px;"
             :show-timeout="300"
             :hide-timeout="300"
             :active-name="'submenu' + (activeIndex === index ? ' active' : '')"
             :background-color="#fff"
             text-align="center"
             ref="submenusRef"
             show-icon
-            popper-class="popper-dropdown"
+            popper-class="popper-dropdown custom-popup-style"
             :collapse-transition="false"
             :unique-opened="true"
             @select="handleMenuClick"
+            class="custom-menu"
>

Suggestion: Added additional styles related to truncation and line-height inside .custom-menu .el-menu-item.

.custom-popup-style {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: normal !important;
}

2. Styling Suggestion

  • Problem: The default styling of the .elm-menu-item can often lead to truncated content. It might be more appropriate to allow items to wrap rather than truncate them.
.el-menu-item {
    /* ... existing styles ... */
}

.custom-menu .el-menu-item {
  word-break: break-all; /* To allow long lines to wrap instead of being cut off */
}

Summary

Overall, the changes are straightforward and maintain the functionality of the menu component. Adding a class specifically for the menu item is useful for customization purposes. Additionally, allowing line breaks in menu items could improve readability when dealing with longer texts.

Copy link

sonarqubecloud bot commented Jan 8, 2025

Copy link
Member

@wanghe-fit2cloud wanghe-fit2cloud left a comment

Choose a reason for hiding this comment

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

/lgtm

@wanghe-fit2cloud
Copy link
Member

/approve

Copy link

f2c-ci-robot bot commented Jan 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wanghe-fit2cloud

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved label Jan 8, 2025
@f2c-ci-robot f2c-ci-robot bot merged commit 8d69da7 into dev Jan 8, 2025
6 checks passed
@f2c-ci-robot f2c-ci-robot bot deleted the pr@dev@feat_menu branch January 8, 2025 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants