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

Fixed 'ListItem' icons #473

Merged
merged 7 commits into from
Jan 8, 2025
Merged

Fixed 'ListItem' icons #473

merged 7 commits into from
Jan 8, 2025

Conversation

MandeepPaul
Copy link
Contributor

@MandeepPaul MandeepPaul commented Jan 7, 2025

Describe your changes

Changed MUI icons on ListItem to the one on figma file.

Issue number

#472

Please ensure all items are checked off before requesting a review:

  • I deployed the code locally.
  • I have performed a self-review of my code.
  • I have included the issue # in the PR.
  • I have labelled the PR correctly.
  • The issue I am working on is assigned to me.
  • I didn't use any hardcoded values (otherwise it will not scale, and will make it difficult to maintain consistency across the application).
  • I made sure font sizes, color choices etc are all referenced from the theme.
  • My PR is granular and targeted to one specific feature.
  • I took a screenshot or a video and attached to this PR if there is a UI change.

Preview

image

Copy link
Contributor

coderabbitai bot commented Jan 7, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces updates to the frontend's icon system and styling for the ListItem component. New custom SVG icons (DuplicateIcon, TrashIcon, and EditIcon) have been created in the utility icons file, replacing previous Material UI icons. The CSS for the ListItem component has been refined with updated color and font size variables, enhancing the visual consistency of text elements.

Changes

File Change Summary
frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.jsx - Replaced DeleteIcon with TrashIcon
- Replaced ContentCopyTwoToneIcon with DuplicateIcon
- Reformatted EditIcon import
frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.css - Updated text color for .list-item-info
- Modified font size for .item-id
- Changed color variables for text elements
frontend/public/svg/utilityIcons.jsx - Added DuplicateIcon SVG component
- Added TrashIcon SVG component
- Added EditIcon SVG component
frontend/public/svg/IconWrapper.jsx - Introduced IconWrapper component for accessibility features in SVG icons

Possibly Related PRs

  • 434 create a custom component for popup dialogs #464: The changes in the ConfirmationPopup component involve replacing the Material-UI Dialog with a custom PopUpMessages component, which aligns with the modifications made in the main PR regarding the ListItem component's icon usage and structure.
  • 466 add duplicate button #471: The addition of the onDuplicate prop in the ListItem component directly relates to the changes made in the main PR, which also involves the introduction of duplication functionality through new icons and buttons.

Suggested Reviewers

  • gorkem-bwl

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8d83a65 and 2f75c95.

📒 Files selected for processing (1)
  • frontend/public/svg/utilityIcons.jsx (1 hunks)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

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

🧹 Nitpick comments (1)
frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.jsx (1)

4-4: Yo dawg, let's clean up that import path!

That import path's longer than mom's spaghetti recipe! Consider using path aliases to make it cleaner, eh?

-import { DuplicateIcon, EditIcon, TrashIcon } from '../../../../../../public/svg/svg';
+import { DuplicateIcon, EditIcon, TrashIcon } from '@svg/svg';
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 50fb7dc and 8268af2.

📒 Files selected for processing (2)
  • frontend/public/svg/svg.jsx (1 hunks)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.jsx (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build (22.x)
🔇 Additional comments (1)
frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.jsx (1)

33-39: Beauty implementation of those icons, eh!

The new icons are lookin' sharp in those IconButtons. Matches the Figma designs perfectly!

frontend/public/svg/svg.jsx Outdated Show resolved Hide resolved
frontend/public/svg/svg.jsx Outdated Show resolved Hide resolved
frontend/public/svg/svg.jsx Outdated Show resolved Hide resolved
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: 0

🧹 Nitpick comments (1)
frontend/public/svg/svg.jsx (1)

29-30: Yo dawg, that stroke-width is making me nervous! 😰

Let's keep it consistent with the other icons:

-      stroke-width="1.66667"
+      stroke-width="1.5"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8268af2 and 92631ae.

📒 Files selected for processing (2)
  • frontend/public/svg/svg.jsx (1 hunks)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.css (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build (22.x)
🔇 Additional comments (2)
frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.css (1)

62-62: Yo, these changes are fresher than mom's spaghetti! 🍝

Nice work using theme variables for both colour and font size. The changes align perfectly with our design system.

Also applies to: 67-68

frontend/public/svg/svg.jsx (1)

1-53: These icons are straight fire! 🔥

Clean implementation with:

  • Consistent dimensions (20x20)
  • Theme variables for colors
  • Well-structured SVG markup

@MandeepPaul MandeepPaul requested a review from gorkem-bwl January 7, 2025 21:21
Copy link
Collaborator

@erenfn erenfn left a comment

Choose a reason for hiding this comment

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

Please change filename of svg.jsx to something descriptive for those icons. Other than that it looks good

@MandeepPaul
Copy link
Contributor Author

MandeepPaul commented Jan 7, 2025

Please change filename of svg.jsx to something descriptive for those icons. Other than that it looks good

How does 'utility-icons.jsx' sounds?

@erenfn
Copy link
Collaborator

erenfn commented Jan 7, 2025

Please change filename of svg.jsx to something descriptive for those icons. Other than that it looks good

How does 'utility-icons.jsx' sounds?

Sounds good

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

🧹 Nitpick comments (1)
frontend/public/svg/utility-icons.jsx (1)

19-35: Mom's spaghetti moment: Inconsistent stroke width!

The TrashIcon's stroke-width (1.66667) is different from the other icons (1.5). Let's keep it consistent:

     <path
       d="M13.3333 4.99996V4.33329C13.3333 3.39987 13.3333 2.93316 13.1517 2.57664C12.9919 2.26304 12.7369 2.00807 12.4233 1.84828C12.0668 1.66663 11.6001 1.66663 10.6667 1.66663H9.33333C8.39991 1.66663 7.9332 1.66663 7.57668 1.84828C7.26308 2.00807 7.00811 2.26304 6.84832 2.57664C6.66667 2.93316 6.66667 3.39987 6.66667 4.33329V4.99996M8.33333 9.58329V13.75M11.6667 9.58329V13.75M2.5 4.99996H17.5M15.8333 4.99996V14.3333C15.8333 15.7334 15.8333 16.4335 15.5608 16.9683C15.3212 17.4387 14.9387 17.8211 14.4683 18.0608C13.9335 18.3333 13.2335 18.3333 11.8333 18.3333H8.16667C6.76654 18.3333 6.06647 18.3333 5.53169 18.0608C5.06129 17.8211 4.67883 17.4387 4.43915 16.9683C4.16667 16.4335 4.16667 15.7334 4.16667 14.3333V4.99996"
       stroke="var(--border-error-solid)"
-      stroke-width="1.66667"
+      stroke-width="1.5"

Also, don't forget to add accessibility attributes:

 <svg
+  role="img"
+  aria-label="Delete item"
   width="20"
   height="20"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 92631ae and 90fd96e.

📒 Files selected for processing (2)
  • frontend/public/svg/utility-icons.jsx (1 hunks)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.jsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.jsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build (22.x)

frontend/public/svg/utility-icons.jsx Outdated Show resolved Hide resolved
frontend/public/svg/utility-icons.jsx Outdated Show resolved Hide resolved
erenfn
erenfn previously approved these changes Jan 7, 2025
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: 0

🧹 Nitpick comments (2)
frontend/public/svg/utilityIcons.jsx (2)

1-53: Yo dawg, let's make these icons more accessible and DRY!

The icons are looking fresh, but we could make them even better by:

  1. Adding ARIA attributes for accessibility
  2. Extracting common SVG props to reduce repetition

Here's a suggested implementation that's straight fire:

const IconWrapper = ({ children, title, ...props }) => (
  <svg
    width="20"
    height="20"
    viewBox="0 0 20 20"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
    role="img"
    aria-hidden="false"
    aria-labelledby={title}
    {...props}
  >
    <title id={title}>{title}</title>
    {children}
  </svg>
);

export const DuplicateIcon = () => (
  <IconWrapper title="duplicate">
    <path
      d="M4.16663 12.5001C3.39006 12.5001 3.00177 12.5001 2.69549 12.3732..."
      stroke="var(--second-text-color)"
      stroke-width="1.5"
      stroke-linecap="round"
      stroke-linejoin="round"
    />
  </IconWrapper>
);

19-35: Knees weak, arms heavy... this stroke-width is unsteady!

The TrashIcon uses a stroke-width of 1.66667 while other icons use 1.5. Let's keep it consistent across all icons.

-      stroke-width="1.66667"
+      stroke-width="1.5"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90fd96e and 4ea59a3.

📒 Files selected for processing (2)
  • frontend/public/svg/utilityIcons.jsx (1 hunks)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.jsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.jsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build (22.x)
🔇 Additional comments (3)
frontend/public/svg/utilityIcons.jsx (3)

1-17: Mom's spaghetti approves this DuplicateIcon! 🍝

The implementation is clean with appropriate stroke width and color variable usage.


37-53: There's no vomit on this sweater - EditIcon is ready! 🎯

The implementation is consistent with the design system, using appropriate color variables and stroke width.


11-11: Verify these CSS variables are defined in the theme, yo!

Let's make sure the color variables --second-text-color and --border-error-solid are properly defined in the theme.

Also applies to: 29-29, 47-47

✅ Verification successful

Yo dawg, these CSS variables are straight fire! 🔥

Both --second-text-color and --border-error-solid are properly defined in frontend/src/styles/variables.css. We're good to go!

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for color variable definitions
rg -g '*.css' -g '*.scss' "second-text-color|border-error-solid"

Length of output: 3043

gorkem-bwl
gorkem-bwl previously approved these changes Jan 7, 2025
@gorkem-bwl
Copy link
Contributor

Looks good!

- Might need to change the name of 'utilityIcons.jsx' file to 'UtilityIcons.jsx' for consistency.
@MandeepPaul MandeepPaul dismissed stale reviews from gorkem-bwl and erenfn via 8d83a65 January 8, 2025 07:15
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: 1

🧹 Nitpick comments (2)
frontend/public/svg/IconWrapper.jsx (1)

5-7: Yo dawg, these hardcoded dimensions are making me nervous!

Consider making width and height configurable through props with default values of 20. This would make the wrapper more reusable for icons of different sizes.

-    width="20"
-    height="20"
+    width={props.width || 20}
+    height={props.height || 20}
frontend/public/svg/utilityIcons.jsx (1)

8-8: There's inconsistency on his sweater already! 🍝

The stroke widths are inconsistent across icons:

  • DuplicateIcon: 1.5
  • TrashIcon: 1.66667
  • EditIcon: 1.5

Consider standardizing to 1.5 for visual consistency.

-      stroke-width="1.66667"
+      stroke-width="1.5"

Also applies to: 20-20, 32-32

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ea59a3 and 8d83a65.

📒 Files selected for processing (2)
  • frontend/public/svg/IconWrapper.jsx (1 hunks)
  • frontend/public/svg/utilityIcons.jsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build (22.x)
🔇 Additional comments (2)
frontend/public/svg/IconWrapper.jsx (1)

3-4: Mom's spaghetti approved! 🍝 Solid accessibility implementation!

The use of role="img" and aria-label props ensures proper screen reader support.

frontend/public/svg/utilityIcons.jsx (1)

7-7: Straight fire! 🔥 Theme variables on point!

Clean implementation using CSS variables for colors, making it easy to maintain consistent theming.

Also applies to: 19-19, 31-31

frontend/public/svg/utilityIcons.jsx Outdated Show resolved Hide resolved
@erenfn erenfn merged commit 25a64d2 into develop Jan 8, 2025
0 of 2 checks passed
@erenfn erenfn deleted the 472-fixing-icons branch January 16, 2025 23:52
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