Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(dropdown,actionMenu): [dropdown,action-menu] Adapt to Dropdown an… #1967

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

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

MomoPoppy
Copy link
Collaborator

@MomoPoppy MomoPoppy commented Aug 21, 2024

…d Actimenu SMB Theme

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

    • Introduced a new customizable spacing property for the action menu component.
    • Added dynamic visibility toggling for dropdown arrow indicator.
    • Enhanced dropdown items with customizable visual effects.
  • Improvements

    • Adjusted styling for action menu and dropdown components, improving layout and hover effects.
    • Updated icon representations and spacing configurations for better visual coherence.
  • Bug Fixes

    • Improved conditional rendering in action menu to prevent unnecessary visual elements when options are limited.
  • Documentation

    • Expanded documentation to reflect new properties and customizable options in dropdown items.

Copy link

coderabbitai bot commented Aug 21, 2024

Warning

Rate limit exceeded

@MomoPoppy has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 0 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 76b930e and 07a3b4b.

Walkthrough

The recent changes enhance the user interface and interactivity of various components, particularly action menus and dropdowns. Key adjustments include spacing modifications, dynamic visibility toggles, and improved styling for hover states. These refinements aim to provide a more cohesive user experience, allowing for better customization and visual clarity across the application.

Changes

Files Change Summary
examples/sites/demos/.../icon-composition-api.vue, examples/sites/demos/.../icon.vue Adjusted spacing in tiny-action-menu from 12px to 8px, updated icons, and added new CSS styles for hover effects.
examples/sites/demos/.../spacing-composition-api.vue, examples/sites/demos/.../spacing.vue Changed the spacing attribute of tiny-action-menu from "10px" to "8px".
examples/sites/demos/.../show-icon-composition-api.vue, examples/sites/demos/.../show-icon.vue Modified class name for tiny-dropdown from custom-icon to only-icon with new styles for SVG icons.
examples/sites/demos/.../visible-arrow-composition-api.vue, examples/sites/demos/.../visible-arrow.vue Introduced a toggle for arrow visibility in dropdowns with reactive data binding and updated component structure.
packages/design/smb/src/action-menu/index.ts Added spacing property with a default value of 8px to the export object.
packages/renderless/src/action-menu/... Updated computedSpacing to incorporate designConfig for more flexible spacing logic.
packages/theme/src/... Enhanced styling rules for action menus and dropdowns, adding new CSS variables for hover colors and margins.
packages/vue/src/... Introduced a new effect property for dropdown items, allowing customizable visual effects in tooltips.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Dropdown
    participant MenuItem

    User->>Dropdown: Hover over dropdown
    Dropdown->>MenuItem: Highlight item with hover effect
    User->>MenuItem: Click on item
    MenuItem->>Dropdown: Trigger action based on selection
Loading

🐰 In the fields where bunnies play,
New menus hop in a cheerful way.
Spacings tight, icons bright,
Hovering dreams take delightful flight!
With toggles and styles, our joy is clear,
Hopping along, we dance with cheer! 🌼✨


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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 963b5f1 and 76b930e.

Files selected for processing (27)
  • examples/sites/demos/pc/app/action-menu/icon-composition-api.vue (3 hunks)
  • examples/sites/demos/pc/app/action-menu/icon.vue (4 hunks)
  • examples/sites/demos/pc/app/action-menu/spacing-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/action-menu/spacing.spec.ts (1 hunks)
  • examples/sites/demos/pc/app/action-menu/spacing.vue (1 hunks)
  • examples/sites/demos/pc/app/dropdown/show-icon-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/dropdown/show-icon.vue (2 hunks)
  • examples/sites/demos/pc/app/dropdown/visible-arrow-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/dropdown/visible-arrow.vue (1 hunks)
  • packages/design/smb/src/action-menu/index.ts (1 hunks)
  • packages/renderless/src/action-menu/index.ts (1 hunks)
  • packages/renderless/src/action-menu/vue.ts (2 hunks)
  • packages/theme/src/action-menu/index.less (1 hunks)
  • packages/theme/src/action-menu/smb-theme.js (1 hunks)
  • packages/theme/src/action-menu/vars.less (2 hunks)
  • packages/theme/src/dropdown-item/aurora-theme.js (1 hunks)
  • packages/theme/src/dropdown-item/smb-theme.js (2 hunks)
  • packages/theme/src/dropdown-menu/aurora-theme.js (1 hunks)
  • packages/theme/src/dropdown-menu/index.less (3 hunks)
  • packages/theme/src/dropdown-menu/vars.less (1 hunks)
  • packages/theme/src/dropdown/aurora-theme.js (1 hunks)
  • packages/theme/src/dropdown/index.less (1 hunks)
  • packages/theme/src/dropdown/smb-theme.js (1 hunks)
  • packages/theme/src/dropdown/vars.less (1 hunks)
  • packages/vue/src/action-menu/src/pc.vue (1 hunks)
  • packages/vue/src/dropdown-item/src/index.ts (1 hunks)
  • packages/vue/src/dropdown-item/src/pc.vue (2 hunks)
Files skipped from review due to trivial changes (2)
  • examples/sites/demos/pc/app/action-menu/spacing-composition-api.vue
  • examples/sites/demos/pc/app/action-menu/spacing.vue
Additional comments not posted (33)
packages/design/smb/src/action-menu/index.ts (1)

2-4: LGTM! The addition of spacing enhances layout flexibility.

The introduction of the spacing property in the props object allows for better control over the component's layout.

packages/theme/src/dropdown-menu/aurora-theme.js (1)

9-10: LGTM! New properties enhance dropdown arrow styling.

The addition of 'ti-dropdown-menu-arrow-margin-top' and 'ti-dropdown-menu-arrow-margin-bottom' improves the layout flexibility for dropdown arrows.

examples/sites/demos/pc/app/action-menu/spacing.spec.ts (1)

13-14: LGTM! Test updates align with new spacing defaults.

The margin expectations for the tenPXSpacing element have been updated to reflect the new default spacing value of 8px.

packages/theme/src/dropdown-item/aurora-theme.js (1)

3-3: LGTM! Font size change promotes consistency.

The use of var(--ti-common-font-size-base) for 'ti-dropdown-item-font-size' enhances flexibility and consistency in font sizing across the application.

packages/theme/src/dropdown/aurora-theme.js (1)

13-13: LGTM! New property enhances suffix icon styling.

The addition of 'ti-dropdown-suffix-icon-margin-vertical' provides more control over the vertical spacing of suffix icons in dropdown components.

examples/sites/demos/pc/app/dropdown/visible-arrow-composition-api.vue (1)

2-24: Enhancement approved: Dynamic arrow visibility.

The changes effectively enhance the dropdown component by allowing dynamic control over the arrow's visibility using a toggle switch. This improves user interactivity and customization.

packages/theme/src/action-menu/smb-theme.js (1)

6-12: Styling adjustments approved: Lighter action menu design.

The changes to font weight and icon dimensions contribute to a more compact and visually appealing action menu design. This aligns with the SMB Theme objectives.

examples/sites/demos/pc/app/dropdown/visible-arrow.vue (1)

2-32: Enhancement approved: Dynamic arrow visibility in dropdown.

The modifications allow users to toggle the arrow visibility dynamically, enhancing interactivity and user experience. The implementation is well-structured.

packages/theme/src/dropdown/smb-theme.js (1)

18-19: Styling enhancement approved: Improved dropdown layout control.

The introduction of line height and icon margin properties enhances the dropdown's styling flexibility, aligning with the SMB Theme objectives.

packages/theme/src/dropdown-item/smb-theme.js (1)

Line range hint 11-24: Styling refinement approved: Enhanced dropdown item interaction.

The updates to hover states and icon colors improve the dropdown item's visual styling and interaction feedback, aligning with the SMB Theme objectives.

examples/sites/demos/pc/app/dropdown/show-icon-composition-api.vue (2)

17-17: Ensure consistent usage of the only-icon class.

The introduction of the only-icon class is a good enhancement for scenarios where only an icon is needed. Ensure that this class is consistently used across similar components for uniformity.


50-59: CSS styles for only-icon class are well-defined.

The CSS styles for the only-icon class ensure that the SVG icon maintains a consistent fill color. This is a good practice for maintaining visual consistency.

examples/sites/demos/pc/app/dropdown/show-icon.vue (2)

17-17: Class name change to only-icon improves clarity.

Changing the class name to only-icon clearly indicates the intended use of the dropdown to display only an icon. Ensure that this change is reflected in related documentation or usage guides.


57-66: CSS styles for only-icon class are appropriate.

The CSS styles for the only-icon class ensure that the SVG icon maintains a consistent fill color, enhancing visual consistency.

packages/renderless/src/action-menu/vue.ts (2)

35-35: Addition of designConfig parameter enhances flexibility.

The introduction of the designConfig parameter allows the function to accommodate design-related configurations, improving its flexibility and adaptability.


55-55: Ensure designConfig is correctly passed to computedSpacing.

The designConfig parameter is now part of the computedSpacing function call. Verify that designConfig is correctly initialized and passed in all relevant contexts.

examples/sites/demos/pc/app/action-menu/icon-composition-api.vue (2)

9-9: Spacing adjustment to 8px improves layout.

The change in spacing to 8px for the tiny-action-menu component may affect the visual layout. Ensure that this change aligns with the overall design guidelines.


25-30: Icon change to IconPreChecked for "远程登陆" is appropriate.

The change in the icon for "远程登陆" to IconPreChecked may reflect a shift in design or functionality. Verify that this change is consistent with the intended design semantics.

packages/vue/src/dropdown-item/src/index.ts (1)

88-90: New effect property enhances customization.

The addition of the effect property with a default value of 'light' allows for greater customization of the dropdown item's visual effect. Ensure that this property is documented and utilized where necessary.

examples/sites/demos/pc/app/action-menu/icon.vue (3)

9-9: Verify spacing consistency with SMB Theme.

The spacing has been changed from 12px to 8px. Ensure this aligns with the SMB Theme's design guidelines.


Line range hint 20-31: Icon update approved.

The icon has been updated from iconWebPlus to IconPreChecked, which enhances the visual consistency.


79-104: New styles approved. Verify consistency.

The new styles improve the visual presentation of the action menu. Ensure they are consistent with the overall theme and do not conflict with existing styles.

packages/renderless/src/action-menu/index.ts (1)

29-37: Enhancement to computedSpacing approved. Verify designConfig usage.

The addition of designConfig allows for more flexible spacing configuration. Ensure that designConfig is properly defined and used across the application.

packages/theme/src/dropdown-menu/vars.less (1)

43-45: CSS variable update approved.

The use of a common spacing variable for arrow margins improves consistency and maintainability.

packages/theme/src/action-menu/vars.less (2)

39-39: Hover icon color variable addition approved.

The new variable for hover icon color enhances visual consistency.


49-49: SVG margin top variable update approved.

The update to use a common spacing variable improves flexibility and maintainability.

packages/theme/src/dropdown/vars.less (1)

71-71: Dropdown suffix icon margin variable addition approved.

The new variable allows for more precise control over icon spacing, enhancing layout consistency.

packages/vue/src/dropdown-item/src/pc.vue (2)

16-16: Ensure effect property is documented and tested.

The addition of the effect property allows for dynamic tooltip effects. Make sure this new property is documented and tested to ensure it behaves as expected.


99-100: Verify the integration of the effect property.

Adding effect to the props enhances configurability. Verify that this property is correctly integrated and used throughout the component.

packages/vue/src/action-menu/src/pc.vue (1)

25-29: Conditional rendering logic looks good.

The conditional rendering of the <span> element improves the component's responsiveness. Ensure this logic is tested to confirm it behaves as expected in various scenarios.

packages/theme/src/action-menu/index.less (1)

79-85: Improved specificity in CSS selectors.

The nested selectors improve specificity and maintainability. Verify that these changes do not introduce any visual regressions or conflicts with other styles.

packages/theme/src/dropdown/index.less (1)

179-184: New CSS class .tiny-dropdown__suffix-inner added.

The addition of this class improves the layout of suffix elements. Verify that it aligns with the overall design and does not cause any layout issues.

packages/theme/src/dropdown-menu/index.less (1)

63-65: Ensure browser compatibility for :has() pseudo-class.

The use of :has() enhances styling based on content. Verify that this pseudo-class is supported in the target browsers to avoid potential issues.

Also applies to: 84-86

@MomoPoppy MomoPoppy added the enhancement New feature or request (功能增强) label Aug 22, 2024
@zzcr zzcr merged commit f784e77 into opentiny:dev Aug 23, 2024
3 checks passed
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.

2 participants