Skip to content

Conversation

@Dishant1804
Copy link
Collaborator

@Dishant1804 Dishant1804 commented Mar 31, 2025

Resolves #1204

  • make all links have the same color
  • add icons for main page section headers (calendar for events, location pin for chapters, folder for new projects, globe for the chapters worldwide, etc)
  • make additional information text darker (see recent issuer/pull requests/releases example)
2025-03-31.07-52-51.mp4

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 31, 2025

Summary by CodeRabbit

  • New Features
    • Introduced optional icon support for various components, enhancing visual cues on cards, lists, and headers, including key sections on the homepage.
  • Style
    • Standardized text, link, and button colors to a unified blue tone for improved consistency and readability across the interface.

Walkthrough

This pull request introduces a new mock for the FontAwesomeIcon component in several test files to enable isolated testing. It also extends three UI components—ItemCardList, SecondaryCard, and TopContributors—by adding an optional icon prop of type IconProp and updating their JSX to conditionally render icons. Additionally, the Home.tsx file is updated to import various FontAwesome icons and adjust styling (e.g., link colors and dark mode text) to achieve a unified visual appearance across the application.

Changes

File(s) Change Summary
frontend/__tests__/.../*.test.tsx Added a mock for @fortawesome/react-fontawesome where FontAwesomeIcon returns <span data-testid="mock-icon" /> to support isolated testing.
frontend/src/components/ItemCardList.tsx, SecondaryCard.tsx, TopContributors.tsx Added optional icon?: IconProp prop and updated JSX to conditionally render icons; included minor styling adjustments.
frontend/src/pages/Home.tsx Updated imports and usage to include various new FontAwesome icons (e.g., faFolder, faGlobe) and adjusted link and text colors for consistent styling.

Assessment against linked issues

Objective Addressed Explanation
Unify components look (#1204)

Possibly related PRs


📜 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 471351e and fdb623f.

📒 Files selected for processing (14)
  • frontend/src/components/Card.tsx (1 hunks)
  • frontend/src/components/CardDetailsPage.tsx (3 hunks)
  • frontend/src/components/LeadersList.tsx (1 hunks)
  • frontend/src/components/RepositoriesCard.tsx (2 hunks)
  • frontend/src/components/SnapshotCard.tsx (2 hunks)
  • frontend/src/components/SortBy.tsx (1 hunks)
  • frontend/src/components/ToggleableList.tsx (1 hunks)
  • frontend/src/components/TopContributors.tsx (5 hunks)
  • frontend/src/components/UserCard.tsx (3 hunks)
  • frontend/src/pages/ChapterDetails.tsx (1 hunks)
  • frontend/src/pages/CommitteeDetails.tsx (1 hunks)
  • frontend/src/pages/ProjectDetails.tsx (1 hunks)
  • frontend/src/pages/RepositoryDetails.tsx (1 hunks)
  • frontend/src/pages/UserDetails.tsx (3 hunks)
✅ Files skipped from review due to trivial changes (12)
  • frontend/src/pages/CommitteeDetails.tsx
  • frontend/src/pages/ProjectDetails.tsx
  • frontend/src/pages/ChapterDetails.tsx
  • frontend/src/components/LeadersList.tsx
  • frontend/src/components/RepositoriesCard.tsx
  • frontend/src/components/SortBy.tsx
  • frontend/src/pages/RepositoryDetails.tsx
  • frontend/src/pages/UserDetails.tsx
  • frontend/src/components/SnapshotCard.tsx
  • frontend/src/components/CardDetailsPage.tsx
  • frontend/src/components/ToggleableList.tsx
  • frontend/src/components/UserCard.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/TopContributors.tsx
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Run frontend e2e tests
  • GitHub Check: Run backend tests
  • GitHub Check: Run frontend unit tests
  • GitHub Check: CodeQL (javascript-typescript)
🔇 Additional comments (1)
frontend/src/components/Card.tsx (1)

73-73: Successful implementation of color standardization

The change from dark:text-sky-600 to text-blue-400 aligns perfectly with the PR objectives to standardize link colors across the application. This modification ensures the title link is now consistently blue in both light and dark modes, rather than only having a specific color in dark mode.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • Generate unit testing code for this file.
    • 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 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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: 0

🧹 Nitpick comments (1)
frontend/src/components/SecondaryCard.tsx (1)

17-22: Icon successfully integrated with title display.

The component now displays the icon alongside the title using a flex container with proper spacing. The implementation maintains the original functionality while adding the new feature, which is a good practice.

However, consider adding a conditional check to only render the FontAwesomeIcon when an icon is provided:

-      <h2 className="mb-4 flex flex-row items-center gap-2 text-2xl font-semibold">
-        <FontAwesomeIcon icon={icon} className="h-5 w-5" />
-        {title}
-      </h2>
+      <h2 className="mb-4 flex flex-row items-center gap-2 text-2xl font-semibold">
+        {icon && <FontAwesomeIcon icon={icon} className="h-5 w-5" />}
+        {title}
+      </h2>

This would prevent potential errors if the icon prop is undefined.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c9e78e6 and a928637.

📒 Files selected for processing (9)
  • frontend/__tests__/unit/pages/ChapterDetails.test.tsx (1 hunks)
  • frontend/__tests__/unit/pages/CommitteeDetails.test.tsx (1 hunks)
  • frontend/__tests__/unit/pages/ProjectDetails.test.tsx (1 hunks)
  • frontend/__tests__/unit/pages/RepositoryDetails.test.tsx (1 hunks)
  • frontend/__tests__/unit/pages/UserDetails.test.tsx (1 hunks)
  • frontend/src/components/ItemCardList.tsx (5 hunks)
  • frontend/src/components/SecondaryCard.tsx (1 hunks)
  • frontend/src/components/TopContributors.tsx (4 hunks)
  • frontend/src/pages/Home.tsx (15 hunks)
🧰 Additional context used
🧬 Code Definitions (2)
frontend/src/components/ItemCardList.tsx (3)
frontend/src/types/project.ts (2)
  • ProjectReleaseType (85-97)
  • ProjectIssuesType (9-15)
frontend/src/types/home.ts (1)
  • PullRequestsType (50-59)
frontend/src/types/user.ts (1)
  • PullRequestsType (82-86)
frontend/src/pages/Home.tsx (2)
frontend/src/types/event.ts (1)
  • EventType (1-10)
frontend/src/components/TruncatedText.tsx (1)
  • TruncatedText (3-37)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Run backend tests
  • GitHub Check: Run frontend e2e tests
  • GitHub Check: Run frontend unit tests
  • GitHub Check: CodeQL (javascript-typescript)
🔇 Additional comments (29)
frontend/__tests__/unit/pages/UserDetails.test.tsx (1)

22-24: LGTM: Mock for FontAwesomeIcon component added correctly.

The mock implementation returns a span with a data-testid, which allows for proper testing isolation. This is a good practice for mocking UI components in tests.

frontend/src/components/ItemCardList.tsx (3)

1-1: Icon prop properly added to enhance visual consistency.

The IconProp type is correctly imported and the optional icon prop is properly added to the component interface. This aligns well with the PR objective of adding icons to section headers.

Also applies to: 11-11, 17-17


31-31: Icon successfully passed to SecondaryCard component.

The icon prop is correctly forwarded to the SecondaryCard component, enabling the display of icons in section headers as intended in the PR objectives.


40-40: Link color standardized to improve visual coherence.

The text color classes have been updated from (likely) text-blue-500 to text-blue-400 for both avatar and title links. This change aligns with the PR objective of standardizing all links to have the same color.

Also applies to: 51-51

frontend/__tests__/unit/pages/CommitteeDetails.test.tsx (1)

12-14: LGTM: Mock for FontAwesomeIcon correctly implemented.

The mock implementation is consistent with other test files, returning a span with a data-testid attribute. This ensures proper isolation in tests involving components that use FontAwesome icons.

frontend/src/components/SecondaryCard.tsx (2)

1-2: LGTM: Required FontAwesome imports added.

The necessary imports from FontAwesome libraries are correctly added to support icon functionality.


7-7: Icon prop properly added to SecondaryCard component.

The optional icon prop with the correct IconProp type is added to the component props interface, allowing for icons to be passed to the component.

Also applies to: 12-12

frontend/__tests__/unit/pages/RepositoryDetails.test.tsx (1)

20-22: Good addition of FontAwesomeIcon mock for testing

This mock effectively isolates the component under test from external dependencies, making the tests more reliable and focused.

frontend/src/components/TopContributors.tsx (2)

2-2: Well-implemented icon integration for the header

The addition of the optional icon prop and its implementation in the header aligns well with the PR objective of adding icons to section headers.

Also applies to: 16-16, 23-23, 39-42


53-53: Color adjustments improve visual consistency

The color changes from text-blue-500 to text-blue-400 for links and from dark:text-gray-300 to dark:text-gray-400 for dark mode text align with the PR objectives of standardizing link colors and improving text readability.

Also applies to: 58-58

frontend/__tests__/unit/pages/ChapterDetails.test.tsx (1)

12-14: Good addition of FontAwesomeIcon mock for testing

This mock implementation is consistent with other test files and follows good testing practices for isolating components from external dependencies.

frontend/__tests__/unit/pages/ProjectDetails.test.tsx (1)

20-22: Good addition of FontAwesomeIcon mock for testing

The mock implementation matches those in other test files, showing a consistent approach to testing components that use FontAwesome icons.

frontend/src/pages/Home.tsx (17)

12-16: New FontAwesome icons added for UI consistency

These additional icon imports support the PR objective of adding icons to section headers, which helps unify the visual appearance of the main page.


147-147: Icon added to Upcoming Events section

Adding the calendar icon to the section header improves visual consistency across the page.


153-153: Link color standardized to text-blue-400

This change aligns with the PR objective to standardize all link colors on the main page.


158-158: Text darkness increased for better readability

Changing from dark:text-gray-300 to dark:text-gray-400 improves readability in dark mode, as specified in the PR objectives.


185-185: Map marker icon added to New Chapters section

Adding the location icon to the section header creates visual consistency with the other sections.


190-190: Consistent styling applied to New Chapters section

Link color and text darkness have been standardized to match other sections of the page.

Also applies to: 194-194, 205-205


214-214: Folder icon added to New Projects section

Adding the folder icon to the section header maintains the visual theme established throughout the page.


218-218: Consistent styling applied to New Projects section

Link color and text darkness have been standardized to match other sections of the page.

Also applies to: 223-223, 237-237


248-251: Globe icon added to OWASP Chapters Worldwide heading

This change effectively implements the PR objective to add icons to section headers, specifically using a globe icon for the worldwide chapters section.


264-269: Icon added to TopContributors component

Adding the users icon to the TopContributors component maintains visual consistency with other sections.


274-274: Warning icon added to Recent Issues section

The triangle exclamation icon visually represents issues, improving the UI's semantic clarity.


291-291: Pull request icon added to Recent Pull Requests section

The code pull request icon clearly represents the section's content, enhancing visual communication.


306-306: Tag icon added to Recent Releases section

The tag icon appropriately represents releases, maintaining the visual theme established throughout the page.


317-317: Link colors standardized in Recent Releases section

Link colors have been updated to maintain consistency with other links on the page.

Also applies to: 329-329


353-357: Newspaper icon added to Recent News & Opinions section

The icon choice is semantically appropriate for news content, and the styling matches other section headers.


367-367: Consistent styling applied to Recent News & Opinions section

Link color and text darkness have been standardized to match other sections of the page.

Also applies to: 374-374


394-394: Dark mode text color standardized in remaining sections

The final sections have been updated with consistent dark mode text styling, completing the visual unification of the page.

Also applies to: 402-402

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

The main page looks awesome, thanks for the update @Dishant1804

However, the issue is about making the look unified for the entire site (not main page only). Please take a look at other blue color differences at projects/chapters/users pages, e.g.

Screenshot 2025-03-30 at 7 31 21 PM

@Dishant1804
Copy link
Collaborator Author

The main page looks awesome, thanks for the update @Dishant1804

However, the issue is about making the look unified for the entire site (not main page only). Please take a look at other blue color differences at projects/chapters/users pages, e.g.

Screenshot 2025-03-30 at 7 31 21 PM

sure will do it for every page :)

Copy link
Collaborator

@kasya kasya left a comment

Choose a reason for hiding this comment

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

My only concern here is that originally we were using sky shade for any links and not blue - sky is a bit muted compared to blue. It's got messed up at some point, so we'd need to pick which one we want to keep.
Screenshot 2025-03-30 at 7 41 47 PM

@Dishant1804
Copy link
Collaborator Author

My only concern here is that originally we were using sky shade for any links and not blue - sky is a bit muted compared to blue. It's got messed up at some point, so we'd need to pick which one we want to keep.
Screenshot 2025-03-30 at 7 41 47 PM

You are correct @kasya we are using sky colour in the project details card and we dont have any card background in them, but the main page has gray backgrounds in the small cards within each section, I used sky colour and it was not going well with those gray backgrounds, Let me know which colour to apply I have tried both colours and blue goes well for main page we can modify it to sky colour as well :)

@kasya
Copy link
Collaborator

kasya commented Mar 31, 2025

You are correct @kasya we are using sky colour in the project details card and we dont have any card background in them, but the main page has gray backgrounds in the small cards within each section, I used sky colour and it was not going well with those gray backgrounds, Let me know which colour to apply I have tried both colours and blue goes well for main page we can modify it to sky colour as well :)

We can try the blue shade of course 👍🏼 Just want to make sure it's consistent throughout all pages.

@Dishant1804
Copy link
Collaborator Author

Dishant1804 commented Mar 31, 2025

You are correct @kasya we are using sky colour in the project details card and we dont have any card background in them, but the main page has gray backgrounds in the small cards within each section, I used sky colour and it was not going well with those gray backgrounds, Let me know which colour to apply I have tried both colours and blue goes well for main page we can modify it to sky colour as well :)

We can try the blue shade of course 👍🏼 Just want to make sure it's consistent throughout all pages.

Sure I'll modify the other pages to blue

@Dishant1804 Dishant1804 requested review from arkid15r and kasya March 31, 2025 05:08
@arkid15r arkid15r enabled auto-merge March 31, 2025 15:48
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
12.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@arkid15r arkid15r added this pull request to the merge queue Mar 31, 2025
Merged via the queue into OWASP:main with commit 55c47ad Mar 31, 2025
19 of 20 checks passed
shdwcodr pushed a commit to shdwcodr/Nest that referenced this pull request Jun 5, 2025
* main page with unified components

* modified icon of chapter worldwide

* test modified

* unified blue color for all links

---------

Co-authored-by: Arkadii Yakovets <[email protected]>
@coderabbitai coderabbitai bot mentioned this pull request Oct 8, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify components look

3 participants