Skip to content

Chore/svg attribute fix#7446

Merged
sriramveeraghanta merged 4 commits intomakeplane:fix-svg-attributesfrom
Donal-Noye:chore/svg-attribute-fix
Jul 24, 2025
Merged

Chore/svg attribute fix#7446
sriramveeraghanta merged 4 commits intomakeplane:fix-svg-attributesfrom
Donal-Noye:chore/svg-attribute-fix

Conversation

@Donal-Noye
Copy link
Contributor

@Donal-Noye Donal-Noye commented Jul 18, 2025

Description

This PR updates multiple SVG icon files by replacing non-JSX-compliant attributes fill-rule and clip-rule with their camelCase equivalents fillRule and clipRule.
This ensures proper rendering of SVGs in React and prevents console warnings

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

N/A — purely code-level SVG attribute fixes

Test Scenarios

  • Verified that all affected SVGs render correctly in the UI
  • Ensured no console warnings related to invalid DOM properties
  • Built the project to confirm no JSX/TS errors related to the icons

References

None

Summary by CodeRabbit

  • Chores

    • Updated environment variable handling for the live app to use a new tool for loading .env files.
    • Added a new dependency to support the updated environment variable loading.
  • Style

    • Standardized SVG attribute naming in various icon components to follow React's JSX conventions, improving code consistency and compatibility. No visual or functional changes to the icons.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 18, 2025

Walkthrough

This update modifies several React SVG icon components to use camelCase attribute names for SVG properties, aligning with React's JSX conventions. Additionally, the live app's package.json scripts are updated to use dotenv-cli for environment variable loading, and dotenv-cli is added as a dependency.

Changes

Files/Paths Change Summary
apps/live/package.json Updated dev and start scripts to use dotenv-cli; added dotenv-cli as a dependency.
packages/ui/src/icons/at-risk-icon.tsx
packages/ui/src/icons/lead-icon.tsx
packages/ui/src/icons/on-track-icon.tsx
packages/ui/src/icons/off-track-icon.tsx
packages/ui/src/icons/planned-icon.tsx
packages/ui/src/icons/ai-icon.tsx
packages/ui/src/icons/discord-icon.tsx
packages/ui/src/icons/plane-icon.tsx
packages/ui/src/icons/wiki-icon.tsx
Changed SVG attributes (clip-path, fill-rule, clip-rule) to camelCase for React JSX.
packages/ui/src/icons/done-icon.tsx Changed SVG attributes (stroke-width, fill-rule, clip-rule) to camelCase for React JSX.
packages/ui/src/icons/multiple-sticky.tsx
packages/ui/src/icons/pending-icon.tsx
packages/ui/src/icons/sticky-note-icon.tsx
packages/ui/src/icons/updates-icon.tsx
Updated SVG fill-rule and clip-rule to fillRule and clipRule in React components.
packages/ui/src/icons/activity-icon.tsx Updated SVG attributes (clip-path, stroke-width, stroke-linecap, stroke-linejoin) to camelCase for React JSX.

Suggested reviewers

  • sriramveeraghanta

Poem

A hop, a skip, a camelCase leap,
SVGs now tidy, no rules to keep—
Dotenv joins the script parade,
With React's syntax, all upgrades made.
🐇✨
Code polished bright,
Bugs out of sight,
Let’s ship this change tonight!


📜 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 1ec1a62 and 046c9d8.

📒 Files selected for processing (7)
  • packages/ui/src/icons/activity-icon.tsx (1 hunks)
  • packages/ui/src/icons/ai-icon.tsx (1 hunks)
  • packages/ui/src/icons/discord-icon.tsx (1 hunks)
  • packages/ui/src/icons/off-track-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/wiki-icon.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • packages/ui/src/icons/discord-icon.tsx
  • packages/ui/src/icons/plane-icon.tsx
  • packages/ui/src/icons/ai-icon.tsx
  • packages/ui/src/icons/wiki-icon.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/ui/src/icons/planned-icon.tsx
  • packages/ui/src/icons/off-track-icon.tsx
🔇 Additional comments (2)
packages/ui/src/icons/activity-icon.tsx (2)

7-7: LGTM! Correct JSX attribute conversion.

The conversion from clip-path to clipPath aligns with React's JSX naming conventions and eliminates console warnings about invalid DOM properties.


11-13: LGTM! Proper JSX attribute naming.

The conversion of stroke-related attributes from kebab-case (stroke-width, stroke-linecap, stroke-linejoin) to camelCase (strokeWidth, strokeLinecap, strokeLinejoin) correctly follows React's JSX syntax conventions. This ensures proper rendering and eliminates console warnings.

✨ Finishing Touches
  • 📝 Generate Docstrings

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

♻️ Duplicate comments (1)
packages/ui/src/icons/pending-icon.tsx (1)

21-22: Same attribute fix as above
Mirrors the correction in the first path element; no further issues.

🧹 Nitpick comments (7)
packages/ui/src/icons/at-risk-icon.tsx (1)

1-1: Consider dropping the explicit React import if the repo already uses the new JSX transform

Since React 17 the jsx/tsx transform no longer requires import React from "react" at the top of every file (unless you rely on the classic runtime or use React directly). If the project is on React 17+ with "jsx": "react-jsx" (or "react-jsxdev") in tsconfig.json, you can safely remove this line to eliminate an unused import.

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

14-20: Expose colour via the existing color prop for consistency.

color is accepted in the component signature but never used. Hard-coding #15A34A here forces a single colour and weakens theming. Consider:

-    <circle cx="5" cy="5.5" r="4.4" stroke="#15A34A" strokeWidth="1.2" />
+    <circle cx="5" cy="5.5" r="4.4" stroke={color ?? "#15A34A"} strokeWidth="1.2" />-      fill="#15A34A"
+      fill={color ?? "#15A34A"}

This keeps the current appearance by default while letting callers override it when needed.

apps/live/package.json (2)

10-13: Rethink switching from Node --env-file to dotenv-cli.

Node ≥ 20 already supports --env-file, which means the previous implementation worked without an extra runtime dependency.
By replacing it with dotenv-cli we:

  1. Add a new prod dependency (≈ 140 KB installed) that brings its own transitive tree and potential CVE surface.
  2. Lose the guarantee that we are using the same .env parsing semantics as dotenv in the application code (e.g. multiline / escaped values).
  3. Introduce slightly slower start-up (extra process spawn).

Unless you need features missing from the built-in flag — such as multiple -e files or --example validation — you can keep the original, simpler script:

-    "dev": "tsup --watch --onSuccess \"dotenv -e .env -- node dist/server.js\"",
+    "dev": "tsup --watch --onSuccess \"node --env-file=.env dist/server.js\"",-    "start": "dotenv -e .env -- node dist/server.js",
+    "start": "node --env-file=.env dist/server.js",

If you decide to keep dotenv-cli, please add a short comment in the README explaining the specific requirement so future maintainers do not revert it inadvertently.


46-46: dotenv-cli should probably live in devDependencies.

The package is only needed at launch time for the host process, not inside the bundled code produced by tsup.
Moving it keeps the production footprint minimal:

-    "dotenv-cli": "^8.0.0",

and in the devDependencies block:

+    "dotenv-cli": "^8.0.0",

Double-check the deployment workflow: if production containers invoke npm start directly without running npm install --production, leaving it in dependencies is acceptable.

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

5-14: Optional: expose an accessible name / role for screen-reader users.

These decorative icons currently have no accessibility attributes. Adding either aria-hidden for purely decorative use or role="img" aria-label="Sticky note" (with a prop override) will improve a11y compliance.

   <svg
     width={width}
     height={height}
     className={className}
     viewBox="0 0 17 17"
     fill={"currentColor"}
     xmlns="http://www.w3.org/2000/svg"
     style={{ color }}
+    aria-hidden={typeof className === "undefined" ? true : undefined}
+    role={typeof className !== "undefined" ? "img" : undefined}
+    aria-label={typeof className !== "undefined" ? "Sticky note" : undefined}
   >
packages/ui/src/icons/multiple-sticky.tsx (1)

5-14: Optional: expose intent with accessibility attributes

All icons in the library appear to be decorative. Explicitly declaring this helps assistive tech and avoids the SVG being exposed in the a11y tree.

   {...rest}
+  aria-hidden="true"
+  focusable="false"
+  role="img"

(If any icon is meant to be announced, provide a <title> child instead.)

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

5-13: color prop is accepted but never applied

PlannedState destructures color yet no element uses it, so the consumer cannot actually set the icon color. Either:

  1. Pass color to all fill attributes, or
  2. Remove the unused prop to avoid a misleading API.

Example of option 1:

-        fill="#455068"
+        fill={color ?? "#455068"}

(then do the same for the other two <path> elements).

This keeps the component predictable and avoids dead props.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f3daac6 and 1ec1a62.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (11)
  • apps/live/package.json (2 hunks)
  • packages/ui/src/icons/at-risk-icon.tsx (1 hunks)
  • packages/ui/src/icons/done-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/planned-icon.tsx (1 hunks)
  • packages/ui/src/icons/sticky-note-icon.tsx (1 hunks)
  • packages/ui/src/icons/updates-icon.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
packages/ui/src/icons/multiple-sticky.tsx (1)
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: 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.
🔇 Additional comments (11)
packages/ui/src/icons/pending-icon.tsx (1)

15-16: Camel-cased SVG attributes resolve React DOM warnings – LGTM
The switch to fillRule / clipRule is correct for JSX and eliminates the invalid-prop console noise.

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

11-11: LGTM: Correct JSX attribute conversion

The clipPath attribute correctly replaces the kebab-case clip-path to align with React's JSX conventions.


14-15: LGTM: Proper camelCase attribute conversion

The conversion from fill-rule to fillRule and clip-rule to clipRule correctly addresses JSX compliance requirements. This eliminates console warnings and ensures proper SVG rendering in React components.

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

7-28: LGTM! Correct JSX attribute naming conversion.

The changes properly convert SVG attributes from kebab-case to camelCase for React JSX compatibility:

  • clip-pathclipPath
  • fill-rulefillRule
  • clip-ruleclipRule

This fixes the console warnings about invalid DOM properties while maintaining the same visual output and functionality.

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

7-10: SVG attribute casing fixed – resolves React warnings

Changing clipPath, fillRule, and clipRule to camel-case is the correct approach for JSX and will silence the “invalid DOM property” console warnings. No functional or visual regressions expected.

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

9-10: Camel-case conversion of fillRule / clipRule is correct.

Nice catch—this resolves the React console warnings for these attributes.

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

14-14: Attribute casing fixed — looks good.

Converting stroke-widthstrokeWidth removes the React warning and preserves SVG behaviour.


16-17: fillRule / clipRule camel-cased correctly.

Same JSX-compliance fix as above; no further issues spotted.

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

26-27: Camel-case fix aligns with JSX conventions – looks good.

fillRule / clipRule are the correct React-friendly attribute names and eliminate the previous console warnings.

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

16-17: Attributes correctly converted to camelCase – React warning resolved

The change from fill-rule / clip-rule to fillRule / clipRule matches JSX conventions and prevents the “Invalid DOM property” console noise. Nice tidy-up.

Also applies to: 22-23

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

8-9: Correct JSX camelCase attributes – looks good
fillRule and clipRule replace the kebab-case variants, removing React’s invalid-prop warnings while preserving SVG semantics.

@sriramveeraghanta sriramveeraghanta changed the base branch from preview to fix-svg-attributes July 24, 2025 08:46
@sriramveeraghanta sriramveeraghanta merged commit 2dc1c25 into makeplane:fix-svg-attributes Jul 24, 2025
2 of 3 checks passed
sriramveeraghanta added a commit that referenced this pull request Jul 24, 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>
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.

2 participants