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(button): [button]fix error css var #2312

Merged
merged 4 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions examples/sites/demos/pc/app/button/ghost-composition-api.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<div class="gray-bg">
<tiny-button ghost type="primary" reset-time="0">主要按钮</tiny-button>
<tiny-button ghost reset-time="0">次要按钮</tiny-button>
<tiny-button ghost type="success" reset-time="0">成功按钮</tiny-button>
<tiny-button ghost type="info" reset-time="0">信息按钮</tiny-button>
<tiny-button ghost type="warning" reset-time="0">告警按钮</tiny-button>
<tiny-button ghost type="danger" reset-time="0">危险按钮</tiny-button>
<tiny-button ghost type="primary">主要按钮</tiny-button>
<tiny-button ghost>次要按钮</tiny-button>
<tiny-button ghost type="success">成功按钮</tiny-button>
<tiny-button ghost type="info">信息按钮</tiny-button>
<tiny-button ghost type="warning">告警按钮</tiny-button>
<tiny-button ghost type="danger">危险按钮</tiny-button>
Comment on lines +3 to +8
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Inconsistent removal of reset-time attribute across the codebase.

The reset-time attribute is still present in numerous button components across multiple .vue files. This indicates that the removal was not applied consistently, which may lead to unexpected behavior in parts of the application.

Recommended Actions:

  1. Review Scope: Ensure that the removal of reset-time is intended to be global. If so, apply the change consistently across all relevant files.
  2. Verify Functionality: Confirm that removing reset-time does not adversely affect button behavior where it remains.
  3. Update Documentation: Reflect these changes accurately in the PR description for better clarity and documentation.
🔗 Analysis chain

Consistent removal of reset-time attribute, but clarification needed.

The reset-time attribute has been consistently removed from all six button components. This change appears intentional and aligns with the AI-generated summary.

However, I have a few points for consideration:

  1. Could you please clarify the purpose of removing the reset-time attribute? Understanding its impact on button behavior would be helpful.
  2. The PR objectives mention fixing a CSS var error, but this change doesn't directly relate to CSS variables. Could you explain how this change addresses the stated objective?
  3. It would be beneficial to update the PR description to reflect these specific changes for better documentation.

To ensure this change is consistent across the codebase, let's check for any remaining usage of reset-time in button components:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining usage of reset-time in button components
rg --type vue 'reset-time' | grep -i button

Length of output: 71


Script:

#!/bin/bash
# Search for any remaining usage of reset-time in button components within .vue files
rg 'reset-time' --glob '*.vue' | grep -i button

Length of output: 32314

</div>
</template>

Expand Down
12 changes: 6 additions & 6 deletions examples/sites/demos/pc/app/button/ghost.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<div class="gray-bg">
<tiny-button ghost reset-time="0" type="primary">主要按钮</tiny-button>
<tiny-button ghost reset-time="0">次要按钮</tiny-button>
<tiny-button ghost reset-time="0" type="success">成功按钮</tiny-button>
<tiny-button ghost reset-time="0" type="info">信息按钮</tiny-button>
<tiny-button ghost reset-time="0" type="warning">告警按钮</tiny-button>
<tiny-button ghost reset-time="0" type="danger">危险按钮</tiny-button>
<tiny-button ghost type="primary">主要按钮</tiny-button>
<tiny-button ghost>次要按钮</tiny-button>
<tiny-button ghost type="success">成功按钮</tiny-button>
<tiny-button ghost type="info">信息按钮</tiny-button>
<tiny-button ghost type="warning">告警按钮</tiny-button>
<tiny-button ghost type="danger">危险按钮</tiny-button>
Comment on lines +3 to +8
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Inconsistent Removal of reset-time Attribute

The reset-time attribute has not been removed consistently from <tiny-button> components across the project. Numerous files still contain instances of :reset-time, which may lead to inconsistent behavior.

Please ensure that the reset-time attribute is either fully deprecated and removed from all relevant components or retained where necessary with proper documentation.

🔗 Analysis chain

Summary: Consistent removal of reset-time attribute from all buttons.

The changes in this file consistently remove the reset-time attribute from all <tiny-button> components while maintaining their other attributes and overall structure. This appears to be part of a larger effort to remove this attribute from buttons across the project.

To ensure completeness of the review:

  1. Could you provide context on why the reset-time attribute was removed and what its purpose was?
  2. Are there any potential side effects or behavioral changes expected from removing this attribute?
  3. Have all other files using <tiny-button> components been updated similarly?

To verify the consistent removal of the reset-time attribute across the project, please run the following script:

This script will help identify any inconsistencies in the removal of the reset-time attribute and find any related documentation that might need updating.


To address the issue with the rg command not recognizing the vue file type, please run the following updated script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining instances of the reset-time attribute on tiny-button components

# Search for tiny-button components with reset-time attribute
echo "Searching for remaining reset-time attributes on tiny-button components:"
rg --type vue '<tiny-button.*reset-time.*>' -g '!examples/sites/demos/pc/app/button/ghost.vue'

# Search for any mentions of reset-time in relation to buttons in comments or documentation
echo "Searching for mentions of reset-time in relation to buttons:"
rg --type vue 'reset-time.*button|button.*reset-time' -g '!examples/sites/demos/pc/app/button/ghost.vue'

Length of output: 545


Script:

#!/bin/bash
# Description: Check for any remaining instances of the reset-time attribute on tiny-button components

# Search for tiny-button components with reset-time attribute in .vue files
echo "Searching for remaining reset-time attributes on tiny-button components:"
rg '<tiny-button.*reset-time.*>' --glob '*.vue' -g '!examples/sites/demos/pc/app/button/ghost.vue'

# Search for any mentions of reset-time in relation to buttons in comments or documentation within .vue files
echo "Searching for mentions of reset-time in relation to buttons:"
rg 'reset-time.*button|button.*reset-time' --glob '*.vue' -g '!examples/sites/demos/pc/app/button/ghost.vue'

Length of output: 64490

</div>
</template>

Expand Down
4 changes: 2 additions & 2 deletions packages/theme/src/button/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
--tv-Button-font-weight: var(--tv-font-weight-regular);
// 默认时按钮边框宽度
--tv-Button-border-width: var(--tv-border-width);
// 按钮的行产,
--tv-Button-line-height: var(--tv-border-width);
// 按钮的文本行高
--tv-Button-line-height: var(--tv-line-height-number);
// --------------------------------------------------- 场景1、圆角--------------------------------------------
// 默认时按钮圆角
--tv-Button-border-radius: var(--tv-border-radius-round); // 默认规范不需要 6px的圆角的效果,默认就是半圆
Expand Down
Loading