Skip to content

Conversation

@SiddharthJiyani
Copy link
Contributor

Proposed change

Renamed the RepositoriesCard component to RepositoryCard (singular) and added cursor-pointer class to repository title buttons as requested in the issue.

Changes:

  • Renamed component file: RepositoriesCard.tsxRepositoryCard.tsx
  • Renamed component export: RepositoriesCardRepositoryCard
  • Added cursor-pointer Tailwind class to repository title button element
  • Renamed type RepositoryItemPropsRepositoryCardProps for consistency with component naming
  • Updated all component imports in CardDetailsPage.tsx and page.tsx
  • Renamed test file: RepositoriesCard.test.tsxRepositoryCard.test.tsx
  • Added cursor pointer validation tests

Files modified: 9 files (5 modified, 2 renamed, 2 created as part of rename)

The cursor now changes to a pointer when hovering over repository titles, improving UX as requested.

Checklist

  • I've read and followed the contributing guidelines.
  • I've run make check-test locally; all checks and tests passed.
nest_issue.mp4

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 26, 2025

Summary by CodeRabbit

  • Style

    • Improved cursor styling on repository title buttons for enhanced visual interaction feedback.
  • Tests

    • Updated and expanded test coverage for repository components.

Walkthrough

Renamed component and types: RepositoriesCardRepositoryCard and RepositoriesCardPropsRepositoryCardListProps; updated imports/usages and tests accordingly; added cursor-pointer class to the repository title button.

Changes

Cohort / File(s) Summary
Type Definitions
frontend/src/types/project.ts
Renamed exported type RepositoriesCardPropsRepositoryCardListProps (structure unchanged)
Component Implementation
frontend/src/components/RepositoryCard.tsx
Renamed component/default export RepositoriesCardRepositoryCard; updated prop type to RepositoryCardListProps; added cursor-pointer class to the repository title button
Component Usage
frontend/src/components/CardDetailsPage.tsx
Updated import and usage from RepositoriesCardRepositoryCard with existing props preserved (maxInitialDisplay, repositories)
Tests
frontend/__tests__/unit/components/CardDetailsPage.test.tsx, frontend/__tests__/unit/components/RepositoryCard.test.tsx
Updated mocks/imports/references from RepositoriesCardRepositoryCard; added tests asserting the title is a button and has cursor-pointer class

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Check all imports/path updates for missed occurrences (including tests and mocks).
  • Verify the renamed exported type is used consistently where applicable.
  • Confirm the cursor-pointer class is applied to the intended element and corresponding tests are correct.

Possibly related PRs

Suggested reviewers

  • kasya
  • arkid15r

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "feat: rename RepositoriesCard to RepositoryCard and add cursor pointe…" clearly and concisely summarizes the main objectives of the changeset: renaming the component from plural to singular form and adding cursor pointer styling. The title is specific, uses a conventional "feat:" prefix, and directly reflects the primary changes evident in the code modifications across multiple files. The title accurately represents the core intent of the PR without unnecessary noise.
Linked Issues Check ✅ Passed The code changes comprehensively address all objectives from issue #2447. The component has been renamed from RepositoriesCard to RepositoryCard across all files (component file, exports, imports, and usage locations as shown in CardDetailsPage.tsx and test files). The cursor-pointer Tailwind class has been added to the repository title button element in RepositoryCard.tsx. Supporting type renames (RepositoriesCardProps to RepositoryCardListProps and RepositoryItemProps to RepositoryCardProps) were made for consistency. Test files have been updated with new tests validating the cursor-pointer class and button element rendering. All acceptance criteria from the issue appear to be satisfied by the changes made.
Out of Scope Changes Check ✅ Passed All changes in the pull request are directly scoped to the objectives defined in issue #2447. The modifications include the component rename from RepositoriesCard to RepositoryCard, the addition of cursor-pointer class to the title button, necessary supporting type renames for consistency, and corresponding test updates. No unrelated changes or improvements outside the stated objectives are evident in the provided summaries. The refactoring is focused and maintains scope discipline.
Description Check ✅ Passed The pull request description is well-structured and directly related to the changeset. It references the linked issue (#2447), clearly explains the proposed changes including the component rename and cursor-pointer addition, lists specific files modified with their changes, and confirms local testing was performed with all checks and tests passed. The description provides sufficient context about what was changed and why, making it clear and related to the code modifications present in the PR.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Please resolve the conflicts first.

@SiddharthJiyani SiddharthJiyani force-pushed the feat/rename-repository-card-add-cursor-pointer branch from 44b3f29 to 250907c Compare October 27, 2025 03:48
@sonarqubecloud
Copy link

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/__tests__/unit/components/RepositoryCard.test.tsx (1)

180-198: Consider combining the two cursor-pointer tests for better specificity.

The tests verify cursor-pointer behavior, but they could be more robust by checking that the repository title button specifically has the cursor-pointer class.

Consider merging these into a single, more specific test:

-  it('repository title button has cursor-pointer class', () => {
+  it('repository title button has cursor-pointer class and is clickable', () => {
     const repositories = [createMockRepository(0)]
-
-    const { container } = render(<RepositoryCard repositories={repositories} />)
-
-    const button = container.querySelector('button.cursor-pointer')
-    expect(button).toBeInTheDocument()
-    expect(button).toHaveClass('cursor-pointer')
-  })
-
-  it('repository title is rendered as a button element', () => {
-    const repositories = [createMockRepository(0)]
-
     render(<RepositoryCard repositories={repositories} />)
 
     const repositoryButton = screen.getByText('Repository 0').closest('button')
     expect(repositoryButton).toBeInTheDocument()
     expect(repositoryButton?.tagName).toBe('BUTTON')
+    expect(repositoryButton).toHaveClass('cursor-pointer')
   })
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44b3f29 and 250907c.

📒 Files selected for processing (5)
  • frontend/__tests__/unit/components/CardDetailsPage.test.tsx (1 hunks)
  • frontend/__tests__/unit/components/RepositoryCard.test.tsx (19 hunks)
  • frontend/src/components/CardDetailsPage.tsx (2 hunks)
  • frontend/src/components/RepositoryCard.tsx (3 hunks)
  • frontend/src/types/project.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/tests/unit/components/CardDetailsPage.test.tsx
  • frontend/src/types/project.ts
🧰 Additional context used
🧬 Code graph analysis (1)
frontend/src/components/RepositoryCard.tsx (1)
frontend/src/types/project.ts (1)
  • RepositoryCardListProps (49-52)
🔇 Additional comments (4)
frontend/src/components/RepositoryCard.tsx (2)

5-5: LGTM! Component rename executed correctly.

The import, type annotations, and export have been updated consistently to reflect the rename from RepositoriesCard to RepositoryCard, and the props type correctly uses RepositoryCardListProps.

Also applies to: 11-11, 76-76


45-45: LGTM! Cursor pointer enhancement improves UX.

The cursor-pointer class correctly indicates that the repository title is clickable, meeting the PR requirement.

frontend/src/components/CardDetailsPage.tsx (1)

32-32: LGTM! Import and usage updated correctly.

The component import and usage have been properly updated to reflect the RepositoryCard rename, with props remaining unchanged.

Also applies to: 282-282

frontend/__tests__/unit/components/RepositoryCard.test.tsx (1)

7-7: LGTM! All test references updated consistently.

The import, describe block, and all render calls have been correctly updated to reference RepositoryCard instead of RepositoriesCard.

Also applies to: 43-43, 77-77, 84-84, 95-95, 105-105, 113-113, 121-121, 145-145, 157-157, 177-178, 183-183, 193-193, 207-207, 218-218, 228-228, 241-241, 253-253, 265-265, 278-278, 292-292, 304-304, 315-315, 334-334

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.

This looks good! Thank you @SiddharthJiyani 👍🏼

@kasya kasya dismissed arkid15r’s stale review October 28, 2025 03:05

Already addressed

@kasya kasya added this pull request to the merge queue Oct 28, 2025
Merged via the queue into OWASP:main with commit ecbdbea Oct 28, 2025
26 checks passed
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.

Update RepositoriesCard component to RepositoryCard and add cursor pointer

3 participants