Make button icon strokes inherit currentColor - #1933
Conversation
|
AI Summary Button icon strokes now use |
📝 WalkthroughWalkthrough
ChangesButton SVG color
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Hi nightcityblade! 👋
Welcome, and thank you for opening your first PR in the repo!
Please wait for triaging by our maintainers.
Please take a look at our contributing guide.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/src/components/common/Button/__tests__/Button.spec.tsx`:
- Around line 43-50: Update the test case “uses the button text color for icon
strokes” to render the Button with an SVG icon fixture whose root element has a
stroke attribute, then assert the matching svg[stroke] selector rule so the
regression test exercises actual stroked SVG markup.
In `@frontend/src/components/common/Button/Button.styled.ts`:
- Around line 60-62: Update the selector in the styled component to use `&
svg[stroke]` so SVG root elements carrying a stroke attribute receive `stroke:
currentColor`; retain a descendant selector only if nested stroked elements also
need the same behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 179c4863-38b2-4b8a-9478-37854c26fd88
📒 Files selected for processing (2)
frontend/src/components/common/Button/Button.styled.tsfrontend/src/components/common/Button/__tests__/Button.spec.tsx
c312034 to
3f117d0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
CI follow-up: the build, tests, lint, CodeQL, SonarCloud, and patch coverage checks all pass. The three failures are repository dependency audits reporting existing advisories, while this PR changes only the Button styling and its regression test and does not touch dependency manifests or lockfiles. The latest main-branch CVE workflow is also failing on commit d3f2ac8: https://github.com/kafbat/kafka-ui/actions/runs/31404896188. I have kept unrelated dependency remediation out of this approved UI fix. |
No.
What changes did you make? (Give an overview)
Button-contained SVG elements that define a stroke now use
currentColor. This makes the broker configuration Save and Cancel icons follow the button text color instead of retaining their hard-coded light strokes.Added a regression assertion for the shared button style.
Is there anything you'd like reviewers to focus on?
The selector only targets SVG descendants that already have a
strokeattribute, so fill-only icons keep their existing styling.How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)
pnpm exec jest src/components/common/Button/__tests__/Button.spec.tsx --runInBand --silent(6 passed)pnpm exec jest src/components/Brokers/Broker/Configs/TableComponents/InputCell/__test__/InputCellEditMode.spec.tsx --runInBand --silent(3 passed)pnpm exec eslint src/components/common/Button/Button.styled.ts src/components/common/Button/__tests__/Button.spec.tsx --max-warnings=0pnpm exec prettier --check src/components/common/Button/Button.styled.ts src/components/common/Button/__tests__/Button.spec.tsxpnpm tscChecklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)
Check out Contributing and Code of Conduct
A picture of a cute animal (not mandatory but encouraged)
N/A
Fixes #372
Summary by CodeRabbit
Bug Fixes
Tests