Skip to content

[WEB-4561] fix: SVG attributes in react components#7470

Merged
sriramveeraghanta merged 4 commits intopreviewfrom
fix-svg-attributes
Jul 24, 2025
Merged

[WEB-4561] fix: SVG attributes in react components#7470
sriramveeraghanta merged 4 commits intopreviewfrom
fix-svg-attributes

Conversation

@sriramveeraghanta
Copy link
Member

@sriramveeraghanta sriramveeraghanta commented Jul 24, 2025

Description

  • Updated SVG attributes in react components

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

  • Style
    • Updated SVG attribute names across multiple UI components and icons to follow React's camelCase JSX conventions, enhancing consistency and ensuring proper rendering without affecting visual appearance or functionality.

Donal-Noye and others added 3 commits July 24, 2025 14:16
* fix: replace invalid --env-file with dotenv-cli for tsup onSuccess

* fix: replace invalid --env-file usage in start script and move dotenv-cli to dependencies

* chor: update SVG attributes to camelCase for JSX compatibility

* chor: update SVG attributes to camelCase
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 24, 2025

Walkthrough

This change standardizes SVG attribute names in various React components from kebab-case (e.g., stroke-width) to camelCase (e.g., strokeWidth) to comply with React's JSX syntax requirements. The updates affect icon and form field components, ensuring proper rendering and behavior without altering any logic or exported entities.

Changes

Files/Groups Change Summary
packages/ui/src/icons/.tsx
packages/ui/src/icons/cycle/
.tsx
Updated SVG attribute names from kebab-case to camelCase for properties such as strokeWidth, clipPath, fillRule, and clipRule. Also added className and spread props in some icons, and replaced fixed stroke color with dynamic prop in in-progress-icon.
packages/ui/src/form-fields/checkbox.tsx
packages/ui/src/form-fields/input-color-picker.tsx
Changed SVG attribute names to camelCase in JSX; reordered imports in input-color-picker.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • Chore/svg attribute fix #7446: Performs the same type of SVG attribute renaming from kebab-case to camelCase in React icon components for JSX compliance.

Suggested labels

ready_to_merge

Poem

A hop and a skip through SVG land,
CamelCase now takes the stand!
No more dashes, no more pain,
JSX icons shine again.
With every path and every line,
React and rabbits both align!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ad8cee and c9142c9.

📒 Files selected for processing (3)
  • packages/ui/src/icons/activity-icon.tsx (1 hunks)
  • packages/ui/src/icons/favorite-folder-icon.tsx (1 hunks)
  • packages/ui/src/icons/in-progress-icon.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/ui/src/icons/activity-icon.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/ui/src/icons/favorite-folder-icon.tsx
  • packages/ui/src/icons/in-progress-icon.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-svg-attributes

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.

❤️ 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>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this 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.

@sriramveeraghanta sriramveeraghanta changed the title fix: SVG attributes in react components [WEB-4561] fix: SVG attributes in react components Jul 24, 2025
@makeplane
Copy link

makeplane bot commented Jul 24, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

Copy link
Contributor

@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: 4

🧹 Nitpick comments (2)
packages/ui/src/icons/off-track-icon.tsx (1)

7-7: Consider generating a unique clipPath id to avoid DOM-id collisions

clipPath="url(#clip0_365_7595)" works, but this hard-coded id will be duplicated if the icon is rendered multiple times on the same page, resulting in unexpected styling conflicts.
A lightweight fix is to derive the id via React.useId() and interpolate it in both the <g> reference and the <defs> section.

-export const OffTrackIcon: React.FC<ISvgIcons> = ({ width = "16", height = "16" }) => (
-  <svg …>
-    <g clipPath="url(#clip0_365_7595)">
+export const OffTrackIcon: React.FC<ISvgIcons> = ({ width = "16", height = "16" }) => {
+  const clipId = React.useId();
+  return (
+    <svg …>
+      <g clipPath={`url(#${clipId})`}>-    <defs>
-      <clipPath id="clip0_365_7595">
+      <defs>
+        <clipPath id={clipId}>-      </clipPath>
-    </defs>
-  </svg>
-);
+        </clipPath>
+      </defs>
+    </svg>
+  );
+};

This preserves behaviour while eliminating id clashes.

packages/ui/src/icons/cycle/circle-dot-full-icon.tsx (1)

7-8: strokeWidth has no visible effect without a stroke colour

On the inner circle you keep strokeWidth="0.5" but drop the stroke attribute, so the stroke won’t render in most browsers. Either remove strokeWidth or re-add a stroke colour:

-    <circle cx="12" cy="12" r="6.25" fill="currentColor" strokeWidth="0.5" />
+    <circle cx="12" cy="12" r="6.25" fill="currentColor" stroke="currentColor" strokeWidth="0.5" />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56e4d2c and 1ad8cee.

📒 Files selected for processing (22)
  • packages/ui/src/form-fields/checkbox.tsx (1 hunks)
  • packages/ui/src/form-fields/input-color-picker.tsx (2 hunks)
  • packages/ui/src/icons/activity-icon.tsx (1 hunks)
  • packages/ui/src/icons/ai-icon.tsx (1 hunks)
  • packages/ui/src/icons/at-risk-icon.tsx (1 hunks)
  • packages/ui/src/icons/center-panel-icon.tsx (1 hunks)
  • packages/ui/src/icons/cycle/circle-dot-full-icon.tsx (1 hunks)
  • packages/ui/src/icons/discord-icon.tsx (1 hunks)
  • packages/ui/src/icons/done-icon.tsx (1 hunks)
  • packages/ui/src/icons/favorite-folder-icon.tsx (1 hunks)
  • packages/ui/src/icons/in-progress-icon.tsx (1 hunks)
  • packages/ui/src/icons/info-icon.tsx (1 hunks)
  • packages/ui/src/icons/lead-icon.tsx (1 hunks)
  • packages/ui/src/icons/multiple-sticky.tsx (1 hunks)
  • packages/ui/src/icons/off-track-icon.tsx (1 hunks)
  • packages/ui/src/icons/on-track-icon.tsx (1 hunks)
  • packages/ui/src/icons/pending-icon.tsx (1 hunks)
  • packages/ui/src/icons/plane-icon.tsx (1 hunks)
  • packages/ui/src/icons/planned-icon.tsx (1 hunks)
  • packages/ui/src/icons/sticky-note-icon.tsx (1 hunks)
  • packages/ui/src/icons/updates-icon.tsx (1 hunks)
  • packages/ui/src/icons/wiki-icon.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
packages/ui/src/icons/done-icon.tsx (1)

Learnt from: lifeiscontent
PR: #7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.

packages/ui/src/icons/in-progress-icon.tsx (1)

Learnt from: lifeiscontent
PR: #7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.

packages/ui/src/icons/plane-icon.tsx (1)

Learnt from: vamsikrishnamathala
PR: #7061
File: web/core/components/workspace-notifications/root.tsx:18-18
Timestamp: 2025-05-14T13:16:23.323Z
Learning: In the Plane project codebase, the path alias @/plane-web resolves to the ce directory, making imports like @/plane-web/hooks/use-notification-preview correctly resolve to files in web/ce/hooks/.

packages/ui/src/icons/multiple-sticky.tsx (1)

Learnt from: lifeiscontent
PR: #7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.

packages/ui/src/form-fields/input-color-picker.tsx (1)

Learnt from: lifeiscontent
PR: #7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.

🔇 Additional comments (27)
packages/ui/src/icons/planned-icon.tsx (4)

14-14: Correct JSX attribute casing for clipPath.

Renaming clip-pathclipPath aligns with React’s SVG attribute requirements. ✔️


16-17: fillRule / clipRule converted to camelCase.

React now parses these attributes correctly; no further action needed.


22-23: Consistent attribute casing on the second <path> element.

Change mirrors the first path; maintains consistency across the component.


28-29: Third <path> element attribute fix looks good.

All SVG attributes are now React-compliant; component should render without warnings.

packages/ui/src/icons/off-track-icon.tsx (1)

9-10: Attribute-name change is correct

fillRule / clipRule are the proper camel-case JSX equivalents of the SVG attributes and fix React warnings. Nothing else to address here.

packages/ui/src/icons/pending-icon.tsx (2)

15-16: Corrected to camelCase – resolves React warnings
Switching fill-rulefillRule and clip-ruleclipRule brings the SVG props in line with JSX naming conventions, silencing React console warnings. Looks good.


21-22: Second <path> updated consistently – LGTM
The same attribute-name correction is applied to the second <path>, keeping the component consistent. No further action required.

packages/ui/src/icons/multiple-sticky.tsx (1)

16-17: SVG attributes correctly camel-cased – LGTM

The switch to fillRule / clipRule is the proper JSX form and fixes the React warning without altering rendering.

Also applies to: 22-23

packages/ui/src/icons/discord-icon.tsx (1)

14-14: Attribute camel-cased – looks good

clipPath is the correct JSX spelling and resolves the prior React console warning.

packages/ui/src/icons/ai-icon.tsx (1)

14-14: Correct JSX attribute

clipPath is now compliant with React; no further action needed.

packages/ui/src/icons/plane-icon.tsx (1)

19-19: clipPath update confirmed

Good catch – this removes the invalid clip-path attribute for JSX.

packages/ui/src/icons/sticky-note-icon.tsx (1)

26-27: LGTM! Correct SVG attribute conversion for React JSX.

The conversion from fill-rule and clip-rule to fillRule and clipRule properly aligns with React's JSX naming conventions for SVG properties.

packages/ui/src/icons/wiki-icon.tsx (1)

14-14: LGTM! Correct SVG attribute conversion for React JSX.

The conversion from clip-path to clipPath properly follows React's JSX naming conventions for SVG properties.

packages/ui/src/icons/updates-icon.tsx (1)

8-9: LGTM! Correct SVG attribute conversion for React JSX.

The conversion from fill-rule and clip-rule to fillRule and clipRule properly aligns with React's JSX naming conventions for SVG properties.

packages/ui/src/icons/center-panel-icon.tsx (2)

17-19: LGTM! Correct SVG attribute conversion for React JSX.

The conversion of stroke attributes from kebab-case (stroke-width, stroke-linecap, stroke-linejoin) to camelCase (strokeWidth, strokeLinecap, strokeLinejoin) properly follows React's JSX naming conventions.


25-27: LGTM! Consistent SVG attribute conversion.

The stroke attribute conversions are applied consistently across both path elements, maintaining proper React JSX compliance.

packages/ui/src/form-fields/checkbox.tsx (1)

81-81: LGTM! Correct SVG attribute conversion for React JSX.

The conversion of stroke attributes from kebab-case to camelCase (strokeWidth, strokeLinecap, strokeLinejoin) properly aligns with React's JSX naming conventions for SVG properties.

packages/ui/src/icons/info-icon.tsx (1)

11-13: Correct JSX-compliant attribute names – good catch.
Switching to strokeWidth, strokeLinecap, and strokeLinejoin eliminates the React warning and is semantically correct.

packages/ui/src/icons/done-icon.tsx (1)

14-18: Attributes correctly camel-cased – looks good.

strokeWidth, fillRule, and clipRule are now React-friendly. No further action needed.

packages/ui/src/icons/activity-icon.tsx (1)

7-13: Camel-cased SVG attributes – good.

packages/ui/src/icons/at-risk-icon.tsx (1)

7-11: Attribute names correctly updated to React format.

packages/ui/src/icons/lead-icon.tsx (2)

11-11: LGTM! SVG attribute standardization.

The clip-path to clipPath conversion aligns with React's JSX camelCase naming requirements.


14-15: LGTM! SVG attribute standardization.

The conversion of fill-rule to fillRule and clip-rule to clipRule follows React's JSX camelCase conventions for SVG attributes.

packages/ui/src/form-fields/input-color-picker.tsx (2)

2-2: LGTM! Import organization improvement.

The reordering of imports with React import placement and component grouping improves code organization without affecting functionality.

Also applies to: 7-9


74-76: LGTM! SVG attribute standardization.

The stroke-related attributes have been correctly converted to camelCase (strokeWidth, strokeLinecap, strokeLinejoin) for React JSX compliance.

packages/ui/src/icons/on-track-icon.tsx (2)

7-7: LGTM! SVG attribute standardization.

The clip-path to clipPath conversion follows React's JSX camelCase requirements.


9-10: LGTM! Consistent SVG attribute standardization across all path elements.

All instances of fill-rule and clip-rule have been correctly converted to fillRule and clipRule throughout the component, ensuring consistent React JSX compliance.

Also applies to: 15-16, 21-22, 27-28

@sriramveeraghanta sriramveeraghanta merged commit 2746bad into preview Jul 24, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix-svg-attributes branch July 24, 2025 09:16
lifeiscontent pushed a commit that referenced this pull request Aug 18, 2025
* chore: svg attribute fix (#7446)

* fix: replace invalid --env-file with dotenv-cli for tsup onSuccess

* fix: replace invalid --env-file usage in start script and move dotenv-cli to dependencies

* chor: update SVG attributes to camelCase for JSX compatibility

* chor: update SVG attributes to camelCase

* fix: removed dontenv-cli

* fix: svg attibute fixes

* chore: minor attribute customizations

---------

Co-authored-by: Donal Noye <68372408+Donal-Noye@users.noreply.github.com>
@coderabbitai coderabbitai bot mentioned this pull request Oct 7, 2025
2 tasks
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.

3 participants