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

Skip to content

feat(popconfirm): [popconfirm] Adapting to the SMB theme #2072

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 1 commit into from
Sep 7, 2024

Conversation

Youyou-smiles
Copy link
Collaborator

@Youyou-smiles Youyou-smiles commented Sep 6, 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 popconfirm dialog messages for improved readability.
    • Introduced new CSS variable for customizable popover text color.
  • Bug Fixes

    • Enhanced styling responsiveness with conditional class for message presence.
  • Style

    • Added new class for elements without messages.
    • Adjusted default width of the popconfirm component for a more compact design.
  • Chores

    • Minor syntactical updates for improved code maintainability.

Copy link

coderabbitai bot commented Sep 6, 2024

Walkthrough

The changes involve modifications to the content and styling of the popconfirm component in a Vue application. Key updates include shortening message texts for improved readability, introducing new CSS variables for better styling flexibility, and adjusting default properties such as width. Additionally, new class bindings enhance visual feedback based on the presence of messages.

Changes

File Path Change Summary
examples/sites/demos/pc/app/popconfirm/basic-usage-composition-api.vue
examples/sites/demos/pc/app/popconfirm/basic-usage.vue
The message variable's content was shortened for conciseness.
packages/theme/src/popconfirm/index.less Added .no-message class for styling and updated &__content color to a CSS variable.
packages/theme/src/popconfirm/smb-theme.js Added new properties to tinyPopconfirmSmbTheme for enhanced styling options.
packages/theme/src/popconfirm/vars.less Introduced new CSS variable --ti-popconfirm-popover-text-color for text color customization.
packages/vue/src/popconfirm/src/pc.vue Updated class binding for the title based on the message prop and changed default width value from 350 to 260.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Popconfirm
    User->>Popconfirm: Trigger popconfirm
    Popconfirm->>Popconfirm: Check message presence
    alt Message exists
        Popconfirm->>Popconfirm: Render message
    else No message
        Popconfirm->>Popconfirm: Apply no-message class
    end
    Popconfirm->>User: Display popconfirm
Loading

Poem

🐇
In the garden, bright and fair,
Messages shorter, light as air.
With colors that dance and sway,
Our popconfirm shines today!
Hooray for changes, oh so neat,
A joyful hop, a happy feat!
🌼


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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d3be75b and 66bdda5.

Files selected for processing (6)
  • examples/sites/demos/pc/app/popconfirm/basic-usage-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/popconfirm/basic-usage.vue (1 hunks)
  • packages/theme/src/popconfirm/index.less (2 hunks)
  • packages/theme/src/popconfirm/smb-theme.js (1 hunks)
  • packages/theme/src/popconfirm/vars.less (1 hunks)
  • packages/vue/src/popconfirm/src/pc.vue (2 hunks)
Files skipped from review due to trivial changes (2)
  • examples/sites/demos/pc/app/popconfirm/basic-usage-composition-api.vue
  • examples/sites/demos/pc/app/popconfirm/basic-usage.vue
Additional comments not posted (7)
packages/theme/src/popconfirm/smb-theme.js (3)

9-9: Approved: Trailing comma added.

The addition of a trailing comma is a good practice in JavaScript objects as it facilitates easier modifications and version control handling.


11-11: Approved: New text color property.

The addition of ti-popconfirm-popover-text-color enhances the theme customization by allowing specific control over the text color.


12-12: Approved: New line height property.

The addition of ti-popconfirm-popover-line-height with a value of 1.5 is appropriate for ensuring good text readability within the popover.

packages/theme/src/popconfirm/index.less (2)

47-47: Approved: New class for elements without a message.

The addition of the .no-message class with a font weight of 400 is appropriate for styling elements that do not contain a message, enhancing the component's visual hierarchy.


64-64: Approved: Updated color property to use CSS variable.

Updating the color property in the &__content class to use the variable var(--ti-popconfirm-popover-text-color) enhances styling flexibility and maintainability.

packages/vue/src/popconfirm/src/pc.vue (2)

25-25: Conditional class binding for better visual feedback.

The introduction of the no-message class based on the message prop's value enhances visual feedback. Ensure that this change does not negatively impact accessibility or introduce unexpected behavior in the UI.

Please verify the visual and accessibility impact of this change.


99-99: Default width property adjustment.

The change in the default value of the width property from 350 to 260 likely aims to optimize the component's layout. Ensure that this change does not adversely affect the layout in existing implementations.

Please verify the impact of this width adjustment on existing layouts where the component is used.

@@ -6,5 +6,8 @@ export const tinyPopconfirmSmbTheme = {
'ti-popconfirm-popover-icon-width': 'var(--ti-common-size-4x)',
'ti-popconfirm-popover-title-font-weight': 'var(--ti-common-font-weight-bold)',
'ti-popconfirm-popover-title-font-size': 'var(--ti-common-font-size-2)',
'ti-popconfirm-popover-icon-margin-right': 'var(--ti-common-space-base)'
'ti-popconfirm-popover-icon-margin-right': 'var(--ti-common-space-base)',
'ti-popconfirm-popover-margin-bottomt': '8px',
Copy link

Choose a reason for hiding this comment

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

Typo in property name.

The property name ti-popconfirm-popover-margin-bottomt appears to have a typo. It should likely be ti-popconfirm-popover-margin-bottom.

Propose a correction:

-'ti-popconfirm-popover-margin-bottomt': '8px',
+'ti-popconfirm-popover-margin-bottom': '8px',
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'ti-popconfirm-popover-margin-bottomt': '8px',
'ti-popconfirm-popover-margin-bottom': '8px',

@@ -30,4 +30,5 @@
// 标题字重、大小
--ti-popconfirm-popover-title-font-size: var(--ti-common-font-size-1);
--ti-popconfirm-popover-title-font-weight: var(--ti-common-font-weight-normal, 400);
--ti-popconfirm-popover-text-color: #5c6976;
Copy link

Choose a reason for hiding this comment

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

Potential color inconsistency.

The new variable --ti-popconfirm-popover-text-color is set to #5c6976, which differs from the #191919 used in the smb-theme.js file. Please verify if this discrepancy is intentional or if one of the values needs to be updated for consistency.

@zzcr zzcr merged commit 3bd664a into opentiny:dev Sep 7, 2024
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants