Skip to content

Fix/project card routing#730

Open
GaneshDeshmane wants to merge 2 commits into
AOSSIE-Org:mainfrom
GaneshDeshmane:fix/project-card-routing
Open

Fix/project card routing#730
GaneshDeshmane wants to merge 2 commits into
AOSSIE-Org:mainfrom
GaneshDeshmane:fix/project-card-routing

Conversation

@GaneshDeshmane

@GaneshDeshmane GaneshDeshmane commented Jun 23, 2026

Copy link
Copy Markdown

Addressed Issues:
Fixes #726
Screenshots/Recordings:
Before:
Clicking on project cards on the homepage did not navigate to the project detail page.
After:
Project cards now correctly link to their respective project pages using /projects/[slug].
Example: /projects/pictopy, /projects/djed, etc.
Navigation works correctly in both development and production builds.
Additional Notes:
Added href navigation to the CardEffect component.
Wired homepage project cards to dynamic project routes using slug.
Verified routing behavior locally using npm run dev and production build using npm run build && npm start.
No breaking changes introduced.
AI Usage Disclosure:
☑ This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with it. I have tested the code locally and I am responsible for it.
I have used the following AI models and tools:
ChatGPT (OpenAI GPT-5.3-mini) for debugging and implementation guidance
Checklist:
☑ My PR addresses a single issue, fixes a single bug or makes a single improvement.
☑ My code follows the project's code style and conventions
☑ My changes generate no new warnings or errors
☑ I have tested locally (npm run dev and npm run build)
☑ I have joined the Discord server and will share the PR link
☑ I have read the Contribution Guidelines
☑ I have filled this PR template completely and carefully

Summary by CodeRabbit

  • New Features
    • Project cards in the "Our Projects" section are now clickable and navigate to individual project detail pages.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Project cards on the home page are made clickable by adding an href prop to CardEffect (rendered as a motion.a element) and passing /projects/${project.slug} from the home page. Additionally, the stats route's topRepos sort is made non-mutating, and jsconfig.json gains an ignoreDeprecations: "6.0" compiler option.

Changes

Project Card Clickable Link

Layer / File(s) Summary
CardEffect href prop and home page wiring
src/components/home/CardEffect.jsx, src/app/page.jsx
CardEffect accepts a new href prop and renders its root as a motion.a with that href. The home page passes /projects/${project.slug} as href to each card in the randomProjects map.

Minor Code Fixes

Layer / File(s) Summary
Non-mutating sort and jsconfig ignoreDeprecations
src/app/api/stats/route.js, jsconfig.json
topRepos is now computed by spreading repos into a copy before sorting and slicing, preventing mutation of the original array. jsconfig.json adds ignoreDeprecations: "6.0" under compilerOptions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • AOSSIE-Org/Website#670: Also modifies CardEffect JSX rendering (heading wrapping/overflow styling), touching the same component that this PR converts to a clickable anchor.
  • AOSSIE-Org/Website#673: Fixes missing slug fields in projects.js and adds guards in the [slug] page, directly affecting the /projects/${project.slug} URLs this PR generates.
  • AOSSIE-Org/Website#678: Modifies the same motion.a outer element in CardEffect (CSS/className changes), overlapping with this PR's structural change to that element.

Suggested reviewers

  • Zahnentferner

Poem

🐇 Hop, hop, a card was lost,
No link to click — what a cost!
Now motion.a leads the way,
To project pages, hip hooray!
The slugs are wired, the paths are clear,
Every card is linked from here! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive The repos array mutation fix in route.js is not mentioned in the linked issue requirements. Clarify whether the repos array mutation prevention was intentional and required, or if it should be separated into a different PR.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding href navigation to project cards for routing.
Linked Issues check ✅ Passed Changes directly address issue #726 by adding href navigation to CardEffect and wiring homepage project cards to dynamic routes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/app/page.jsx (1)

213-220: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Filter invalid slugs before constructing project card links.

Line 219 assumes every project.slug is valid, but the project route itself filters out invalid slugs (p?.slug && p.slug !== "undefined"). Aligning this list generation prevents cards linking to /projects/undefined or missing routes.

Proposed fix
-    const others = projects.filter(p => !featuredNames.includes(p.name));
+    const others = projects.filter(
+      (p) => !featuredNames.includes(p.name) && p?.slug && p.slug !== 'undefined'
+    );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/page.jsx` around lines 213 - 220, The randomProjects array is being
mapped without validating that each project has a valid slug, which can result
in CardEffect components linking to undefined routes. Add a filter condition to
the randomProjects array before the map call to exclude projects where the slug
is missing or equals the string "undefined", using the same validation pattern
as the project route (checking p?.slug && p.slug !== "undefined"). This ensures
only valid project cards with valid slug links are rendered in the CardEffect
component.
🧹 Nitpick comments (1)
src/components/home/CardEffect.jsx (1)

6-13: 🚀 Performance & Scalability | 🔵 Trivial

Use next/link for internal project routes instead of a raw anchor.

At line 13, motion.a with href={/projects/${project.slug}} works, but internal app navigation should use Next routing to preserve client-side transitions and prefetch behavior. The codebase already uses Next's Link component elsewhere for similar internal navigation.

Wrapping the motion animations in an inner div and moving them outside the <a> element maintains the animation behavior while enabling proper Next.js routing:

Proposed refactor
+import Link from 'next/link'
 import { motion } from 'framer-motion'

 export function CardEffect({ heading, content, logo, href }){
     return (
-        <motion.a href={href}
+        <Link href={href}>
+            <motion.div
                 initial={{ opacity: 0, rotateY: -90 }}
                 whileInView={{ opacity: 1, rotateY: 0 }}
                 viewport={{ once: true }}
                 transition={{ duration: 0.8 }}
                 className="group relative block h-[22rem] w-full cursor-pointer [perspective:1000px]"
             >
                 <div className="relative h-full w-full transition-all duration-500 [transform-style:preserve-3d] group-hover:[transform:rotateY(180deg)]">
                     {/* content */}
                 </div>
-            </motion.a>
+            </motion.div>
+        </Link>
     )
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/home/CardEffect.jsx` around lines 6 - 13, In the CardEffect
component, replace the raw motion.a element with Next.js Link component for
internal navigation. Import Link from next/link, then restructure the component
so that the Link wraps around the motion animations instead of using motion.a
directly with the href attribute. This ensures proper client-side routing and
prefetch behavior while maintaining the animation effects by keeping the motion
elements as children inside the Link component.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/app/page.jsx`:
- Around line 213-220: The randomProjects array is being mapped without
validating that each project has a valid slug, which can result in CardEffect
components linking to undefined routes. Add a filter condition to the
randomProjects array before the map call to exclude projects where the slug is
missing or equals the string "undefined", using the same validation pattern as
the project route (checking p?.slug && p.slug !== "undefined"). This ensures
only valid project cards with valid slug links are rendered in the CardEffect
component.

---

Nitpick comments:
In `@src/components/home/CardEffect.jsx`:
- Around line 6-13: In the CardEffect component, replace the raw motion.a
element with Next.js Link component for internal navigation. Import Link from
next/link, then restructure the component so that the Link wraps around the
motion animations instead of using motion.a directly with the href attribute.
This ensures proper client-side routing and prefetch behavior while maintaining
the animation effects by keeping the motion elements as children inside the Link
component.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e7884420-64ac-4921-b97a-ef1302c1c673

📥 Commits

Reviewing files that changed from the base of the PR and between 895772c and 321e071.

📒 Files selected for processing (4)
  • jsconfig.json
  • src/app/api/stats/route.js
  • src/app/page.jsx
  • src/components/home/CardEffect.jsx

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.

[BUG]: Project should be linked to it's project page

1 participant