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

fix(pro:tree): tree content horizontal padding #1466

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/pro/tree/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
.@{tree-prefix} {
flex: 1;
height: 0;
padding: @pro-tree-content-vertical-spacing @pro-tree-content-horizontal-spacing;

&.@{tree-prefix}-blocked {
.@{tree-prefix}-node {
Copy link

Choose a reason for hiding this comment

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

with a brief code review

This code patch appears to add padding to the tree-prefix class. This should help improve its visual appeal by adding some spacing between elements. It also appears that this change is consistent with other elements that use the same classes.

However, it is important to ensure that this change does not negatively affect any existing features or functionality. To do this, a thorough testing should be performed to make sure that the padding does not cause any unexpected behaviour or bugs.

It is also recommended to check if this padding could be improved further. For example, is it possible to use a more flexible, adaptive padding? Could the padding be adjusted for different resolutions and devices? These are some of the questions that should be asked when doing a code review.

Expand Down
3 changes: 3 additions & 0 deletions packages/pro/tree/style/themes/default.variable.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
@pro-tree-header-wrapper-icon-font-size: @font-size-lg;
@pro-tree-header-wrapper-icon-hover-color: @color-primary;
@pro-tree-header-wrapper-height: 38px;
@pro-tree-content-horizontal-spacing: 12px;
@pro-tree-content-vertical-spacing: 0;

@pro-tree-divider-horizontal-spacing: @pro-tree-header-search-wrapper-horizontal-spacing;
@pro-tree-divider-vertical-spacing: 8px;
@pro-tree-node-padding: 0 0 0 8px;
Copy link

Choose a reason for hiding this comment

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

with the code review.

  1. The code patch adds three new variables: @pro-tree-content-horizontal-spacing, @pro-tree-content-vertical-spacing and @pro-tree-divider-vertical-spacing. These new variables are used to define the width of the tree content and the spacing between the nodes.

  2. The code patch is correct in that it does not contain any obvious bugs.

  3. For improvement, the code patch could use more descriptive names for the variables, such as @pro-tree-content-horizontal-gap, @pro-tree-content-vertical-gap, and @pro-tree-divider-vertical-gap, as this would make the purpose of each variable more explicit. Additionally, the code patch could also include comments to further explain the purpose of each variable.