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(tree-menu): [tree-menu] updata tree-menu xdesign #2123

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

wuyiping0628
Copy link
Collaborator

@wuyiping0628 wuyiping0628 commented Sep 13, 2024

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Updated placeholder text in the <tiny-tree-menu> component to provide clearer instructions for users.
    • Introduced a new styling class demo-tree-menu for enhanced visual presentation.
  • Styling Improvements

    • Increased the height of the <tiny-tree-menu> component from 300px to 320px for better usability.
    • Enhanced overall styling and layout of the tree menu component, including background color and icon size adjustments.
  • Bug Fixes

    • Adjusted localization for the tree menu component to improve clarity in the Chinese language setting.

@wuyiping0628 wuyiping0628 added the documentation Improvements or additions to documentation label Sep 13, 2024
@github-actions github-actions bot added enhancement New feature or request and removed documentation Improvements or additions to documentation labels Sep 13, 2024
Copy link

coderabbitai bot commented Sep 13, 2024

Walkthrough

This pull request implements updates to the <tiny-tree-menu> component across multiple files, primarily focusing on enhancing the placeholder text for the search input and making styling adjustments. The placeholder text has been changed to improve user clarity, while various styling modifications, including the addition of a new class and height adjustments, have been applied to ensure a consistent visual presentation.

Changes

File Change Summary
examples/sites/demos/pc/app/tree-menu/basic-usage-composition-api.vue Updated placeholder text from "请输入内容进行筛选" to "输入关键字搜索".
examples/sites/demos/pc/app/tree-menu/basic-usage.vue Updated placeholder text from "请输入内容进行筛选" to "输入关键字搜索".
examples/sites/demos/pc/app/tree-menu/clearable.spec.ts Updated test file to reflect new placeholder text.
examples/sites/demos/pc/app/tree-menu/default-expand-all-composition-api.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/default-expand-all.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/default-expanded-keys-composition-api.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/default-expanded-keys-highlight-composition-api.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/default-expanded-keys-highlight.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/default-expanded-keys.vue Added class="demo-tree-menu", moved closing tag for readability, and removed unused Button component.
examples/sites/demos/pc/app/tree-menu/expand-on-click-node-composition-api.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/expand-on-click-node.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/props-composition-api.vue Added class attribute and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/show-checkbox-composition-api.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/show-checkbox.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/show-filter-composition-api.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/show-filter.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/show-number-composition-api.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/show-number.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/text-ellipsis-composition-api.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
examples/sites/demos/pc/app/tree-menu/text-ellipsis.vue Added class="demo-tree-menu" and increased height from 300px to 320px.
packages/theme/src/tree-menu/index.less Enhanced styling with new background color and adjustments to toggle button icon size.
packages/theme/src/tree-menu/vars.less Adjusted CSS variables for width, node height, and margins.
packages/vue-locale/src/lang/zh-CN.ts Updated placeholder text from "请输入内容进行筛选" to "输入关键字搜索".

Possibly related issues

Possibly related PRs

Suggested labels

enhancement

Poem

🐇 In the forest where trees sway,
A menu now shines bright today.
With keywords clear, the search is neat,
A demo class makes it all complete!
So hop along, let’s find our way,
In this tree menu, come what may! 🌳✨

Tip

OpenAI O1 model for chat
  • We have deployed OpenAI's latest O1 model for chat.
  • OpenAI claims that this model has superior reasoning capabilities than their GPT-4o model.
  • Please share any feedback with us in the discussions post.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 37f275f and 874e4dd.

Files selected for processing (23)
  • examples/sites/demos/pc/app/tree-menu/basic-usage-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/tree-menu/basic-usage.vue (1 hunks)
  • examples/sites/demos/pc/app/tree-menu/clearable.spec.ts (1 hunks)
  • examples/sites/demos/pc/app/tree-menu/default-expand-all-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/default-expand-all.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/default-expanded-keys-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/default-expanded-keys-highlight-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/default-expanded-keys-highlight.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/default-expanded-keys.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/expand-on-click-node-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/expand-on-click-node.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/props-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/show-checkbox-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/show-checkbox.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/show-filter-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/show-filter.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/show-number-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/show-number.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/text-ellipsis-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/tree-menu/text-ellipsis.vue (2 hunks)
  • packages/theme/src/tree-menu/index.less (5 hunks)
  • packages/theme/src/tree-menu/vars.less (2 hunks)
  • packages/vue-locale/src/lang/zh-CN.ts (1 hunks)
Files skipped from review due to trivial changes (15)
  • examples/sites/demos/pc/app/tree-menu/basic-usage-composition-api.vue
  • examples/sites/demos/pc/app/tree-menu/basic-usage.vue
  • examples/sites/demos/pc/app/tree-menu/default-expand-all-composition-api.vue
  • examples/sites/demos/pc/app/tree-menu/default-expand-all.vue
  • examples/sites/demos/pc/app/tree-menu/default-expanded-keys-composition-api.vue
  • examples/sites/demos/pc/app/tree-menu/default-expanded-keys-highlight.vue
  • examples/sites/demos/pc/app/tree-menu/default-expanded-keys.vue
  • examples/sites/demos/pc/app/tree-menu/expand-on-click-node-composition-api.vue
  • examples/sites/demos/pc/app/tree-menu/expand-on-click-node.vue
  • examples/sites/demos/pc/app/tree-menu/props-composition-api.vue
  • examples/sites/demos/pc/app/tree-menu/show-checkbox-composition-api.vue
  • examples/sites/demos/pc/app/tree-menu/show-checkbox.vue
  • examples/sites/demos/pc/app/tree-menu/show-filter-composition-api.vue
  • examples/sites/demos/pc/app/tree-menu/show-filter.vue
  • examples/sites/demos/pc/app/tree-menu/show-number-composition-api.vue
Additional comments not posted (30)
examples/sites/demos/pc/app/tree-menu/clearable.spec.ts (2)

11-11: LGTM!

The code change aligns with the updated placeholder text for the search box.


17-17: LGTM!

The code change aligns with the updated placeholder text for retrieving the input value from the search box.

packages/theme/src/tree-menu/vars.less (6)

15-15: LGTM!

The change reduces the width of the tree menu component as intended. The syntax is correct and the value is valid.


17-17: LGTM!

The change sets the tree menu node height to a fixed value of 30px as intended. The syntax is correct and the value is valid.


18-19: LGTM!

The change introduces a new variable to set the bottom margin of tree menu nodes as intended. The syntax is correct and the value is valid.


43-43: LGTM!

The change sets the tree menu border top color to a fixed value of #f0f0f0 as intended. The syntax is correct and the value is valid.


45-45: LGTM!

The change sets the tree menu left padding to a fixed value of 16px as intended. The syntax is correct and the value is valid.


51-51: LGTM!

The change increases the tree menu top padding by using a larger size variable as intended. The syntax is correct and the value is valid.

examples/sites/demos/pc/app/tree-menu/default-expanded-keys-highlight-composition-api.vue (2)

5-5: LGTM!

Adding a custom class to the component is a good practice for applying specific styles or functionality. The class name demo-tree-menu follows the BEM naming convention and is descriptive.


132-133: LGTM!

Increasing the height of the tree menu component can improve the visibility of menu items or accommodate additional content. The change is made within a scoped style block, ensuring that it only affects the specific component instance. Setting the overflow property to auto will add a scrollbar if needed, maintaining a consistent component size.

examples/sites/demos/pc/app/tree-menu/text-ellipsis-composition-api.vue (4)

4-4: LGTM!

The addition of the demo-tree-menu class to the <tiny-tree-menu> component is a good way to target the component for styling without affecting other instances of the component.


7-7: Looks good!

The demo-tree-menu class has been consistently added to both instances of the <tiny-tree-menu> component, which is great for maintaining a uniform design.


172-172: Styling looks good!

The CSS rule correctly targets the .tiny-tree class within the demo-tree-menu class using the ::v-deep combinator, which is the recommended way to target child components in Vue.


173-173: The height change looks good!

The height of the .tiny-tree component has been increased from 300px to 320px, which may affect how the tree menu accommodates content overflow. Please verify that the visual presentation is as intended.

examples/sites/demos/pc/app/tree-menu/show-number.vue (2)

3-3: LGTM!

The addition of the demo-tree-menu class to the <tiny-tree-menu> component is a good practice. The class name follows the BEM naming convention and is descriptive, indicating that it's a demo of the tree menu component.


136-137: LGTM!

The increase in height of the .tiny-tree class from 300px to 320px is a minor change that may affect the visual presentation of the tree menu by providing additional space for its contents. The overflow property remains set to auto, ensuring that any excess content will still be scrollable. The change does not affect the core functionality of the component.

examples/sites/demos/pc/app/tree-menu/text-ellipsis.vue (3)

4-4: LGTM!

The addition of the class attribute and the usage of the ellipsis attribute are correct and follow best practices.


7-7: LGTM!

The addition of the class attribute and the usage of the wrap attribute are correct and follow best practices.


184-185: LGTM!

Increasing the height of the tree menu can improve the visual presentation and usability. The change is properly scoped to the component.

packages/theme/src/tree-menu/index.less (10)

28-28: LGTM!

Adding a white background color to the tree menu component improves its visual clarity.


49-49: LGTM!

Adjusting the font size of the toggle button's icon to 16px ensures better alignment with the overall design.


130-132: LGTM!

Adding margin, relative positioning, and a max-width to the input prefix class enhances the visual separation and positioning of the input element within the tree menu.


134-141: LGTM!

Adding a pseudo-element to the input prefix class that creates a top border enhances the visual separation of the input element.


146-146: LGTM!

Adding padding-top to the tree prefix class improves the spacing and usability of the tree component.


148-151: LGTM!

Setting a custom scrollbar width and margin for the tree prefix class improves the aesthetics and usability of the tree component.


165-167: LGTM!

Increasing the font size of the expand icon in the tree node prefix class to 16px improves its visibility and alignment with the overall design.


174-174: LGTM!

Adding a bottom margin to the content of the tree node prefix class helps in spacing out the nodes more effectively.


236-237: LGTM!

Adding styles for the current tree node improves the visual feedback for the user by highlighting the currently selected node.


237-245: LGTM!

Adding a pseudo-element to the current tree node that creates a left border enhances the visual indication of the current node. Setting the height of the pseudo-element to 32px provides a consistent visual structure.

packages/vue-locale/src/lang/zh-CN.ts (1)

587-587: LGTM!

The placeholder text change for the tree menu component is an improvement. It provides a clearer and more concise directive to the user, shifting the focus from general filtering to keyword-based searching. This enhances the user experience.

await page.locator('#clearable').getByRole('textbox', { name: '请输入内容进行筛选' }).click()
await page.locator('#clearable').getByRole('textbox', { name: '请输入内容进行筛选' }).fill('123')
await page.locator('#clearable').getByRole('textbox', { name: '输入关键字搜索' }).click()
await page.locator('#clearable').getByRole('textbox', { name: '输入关键字搜索' }).click()
Copy link

Choose a reason for hiding this comment

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

Remove the duplicate click action.

This line is a duplicate of the previous click action on the search box at line 11. Please remove this line to avoid redundant actions in the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant