-
Notifications
You must be signed in to change notification settings - Fork 388
feat(button): enhance SVG handling and disabled state #1008
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
base: main
Are you sure you want to change the base?
Conversation
- Update gap from 24px to 6 - Change padding-top from 32px to 8 - Modify text color from gray-400 to gray-600 - Set ElInput width to fit instead of fixed
- Add support for SVG color inheritance - Update button styles for disabled state - Improve CsgButton component with disabled prop - Refactor button class handling in RepoClone - Ensure consistent SVG appearance in disabled state
MR Evaluation:This feature is still under test, evaluation are given by AI and might be inaccurate. After evaluation, the code changes in the Merge Request get score: 67. Analysis for the evaluation score:
TipsCodeReview Commands (invoked as MR or PR comments)
CodeReview Discussion ChatThere are 2 ways to chat with Starship CodeReview:
Note: Be mindful of the bot's finite context window. CodeReview Documentation and Community
About Us:Visit the OpenCSG StarShip website for the Dashboard and detailed information on CodeReview, CodeGen, and other StarShip modules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- Change input width to 320px - Adjust width for larger screens
- Update customClass prop to class - Map class to className variable - Adjust class checks in computed properties - Simplify button name binding in RepoClone component
cursor: not-allowed; | ||
pointer-events: none; | ||
} | ||
|
||
/* Add SVG color inheritance styles - including deeply nested SVGs */ | ||
.btn svg, | ||
.btn * svg { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we don't need .btn svg
when we have .btn * svg
.btn svg, | ||
.btn * svg { | ||
fill: currentColor; | ||
color: inherit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these two duplicates
} | ||
|
||
|
||
/* btn-primary */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove btn-primary?
}); | ||
|
||
// Map the reserved keyword 'class' to a regular variable 'className' | ||
const className = computed(() => props.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if we do not do this conversion? it's also working, right?
:type="btnType" | ||
:disabled="loading" | ||
:disabled="loading || disabled" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add one more check here like:
:disabled="loading || disabled || isDisabledClass"
> | ||
<i v-if="loading" class="el-icon is-loading"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"></path></svg></i> | ||
<SvgIcon | ||
v-if="svgName" | ||
:name="svgName" | ||
:class="['fill-current text-inherit', getIconSizeClass]" | ||
:style="{ color: 'currentColor' }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this won't take effect for img element
color: inherit !important; | ||
stroke: currentColor !important; | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as we're using embeded way in SvgIcon, like below, the settings for SVG element will not take effect
<img
:width="width"
:height="height"
:src="`/images/${path}/${name}.svg`"
onerror="this.style.display='none'"
/>
What this PR does:
Which issue(s) this PR fixes:
Fixes gitlab 370
Type of changes
Please delete options that are not relevant.
Feature/Issue validation/testing:
Please describe the tests that you ran to verify your changes and relevant result summary.
Test A
Test B
Logs
Special notes for your reviewer:
Checklist:
Release note:
MR Summary:
The summary is added by @codegpt.
The MR enhances SVG handling and the disabled state of buttons in the application. Key updates include: