chore: add link and metadata to pages#124
Conversation
…e Link for navigation
|
Warning Review limit reached
More reviews will be available in 55 minutes and 20 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR establishes site-wide navigation infrastructure by wiring real routes throughout the application. It moves the associations page from inline accordion data to a reusable component, adds page metadata for SEO, enhances the ChangesNavigation and Routing Infrastructure
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (3)
src/app/projects/page.tsx (2)
6-9: ⚡ Quick winType the metadata export with
Metadatafor consistency and type safety.The associations page (
src/app/associations/page.tsx) types this asMetadata. Doing the same here catches invalid/misspelled metadata fields at compile time.♻️ Proposed change
+import type { Metadata } from "next" import { Collection } from "`@/components/projects/collection`" import { CommunityNews } from "`@/components/projects/community-news`" import { Deprecated } from "`@/components/projects/deprecated`" import { Upload } from "`@/components/projects/upload`" -export const metadata = { +export const metadata: Metadata = { title: "Progetti", description: "Esplora e contribuisci ai progetti degli studenti", }🤖 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/projects/page.tsx` around lines 6 - 9, The metadata export lacks an explicit type; annotate the exported constant with the Next.js Metadata type to enable compile-time checks. Import the Metadata type from next (e.g., import type { Metadata } from "next") and change the export to use that type annotation on the metadata constant (export const metadata: Metadata = { ... }) so misspelled or invalid metadata fields in the metadata object are caught by the compiler; update the metadata object in page.tsx (symbol: metadata) accordingly.
11-11: 💤 Low valueMisleading component name on the projects page.
The default export is named
Homebut this is the projects route. Rename toProjectsPagefor clarity.♻️ Proposed change
-export default function Home() { +export default function ProjectsPage() {🤖 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/projects/page.tsx` at line 11, The component default export is named Home but represents the projects route; rename the function and its default export from Home to ProjectsPage to match the route and intent—update the function declaration (export default function Home() → export default function ProjectsPage()) and any local references/imports that might use Home to ensure consistency.src/components/card-caption.tsx (1)
23-23: ⚡ Quick winOverlay link lacks handling for external URLs.
hrefis rendered throughnext/linkwith notarget/rel. Insrc/components/home/projects.tsx, everyfeaturedCardsentry now passes an external URL (e.g.https://github.com/...,https://tol.polinetwork.org/), so these cards navigate away from the site in the same tab and the new-tab links would be missingrel="noopener noreferrer". Consider detecting external hrefs (or accepting an optionaltarget) here so the overlay behaves correctly for both internal and external destinations.♻️ Possible approach
- {href && <Link href={href} className="absolute inset-0 z-10" aria-label={title} />} + {href && + (() => { + const external = /^https?:\/\//.test(href) + return ( + <Link + href={href} + className="absolute inset-0 z-10" + aria-label={title} + {...(external ? { target: "_blank", rel: "noopener noreferrer" } : {})} + /> + ) + })()}Verify intended behavior (same-tab vs new-tab) for the external project links before applying.
🤖 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/card-caption.tsx` at line 23, The overlay Link in CardCaption (src/components/card-caption.tsx) doesn't handle external URLs — update the component to detect whether the passed href is external (e.g., startsWith('http://') or 'https://', or compare host) and render the overlay accordingly: for internal routes keep using next/link as before, for external URLs render a plain <a> anchor (or next/link with passHref) with target="_blank" and rel="noopener noreferrer" (or accept an optional target prop and honor it) so featuredCards external links open in a new tab and include the security rel attributes; update the logic around the Link rendering at the expression with {href && <Link ... />} to branch based on external vs internal href.
🤖 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.
Inline comments:
In `@src/components/associations/associations-list.tsx`:
- Around line 22-74: The associations array is populated with placeholder data:
every item uses the same esnLogo, identical lorem-ipsum content (the content
property), and all link hrefs point to "https://www.google.com"; replace these
placeholders with real assets and URLs by updating each association object
(identify by value/name strings like "Lista Aperta", "MESA", "Polifonia", etc.),
provide a unique logo reference instead of esnLogo, meaningful content text for
the content field, and correct hrefs for each entry's links array (entries use
keys like links -> { key: "Facebook", href: "...", icon: FiFacebook }); ensure
links point to the actual association pages or social profiles and that icons
(FiFacebook, FiInstagram, etc.) match the provided hrefs.
- Line 81: The Accordion never opens because defaultValue ("ESN - Erasmus
Student Network") does not match the first item's value ("ESN"); update the call
in associations-list.tsx so the default matches the item value—either set
defaultValue={accordionItems[0].value} or change the hardcoded defaultValue to
"ESN" (referencing AccordionAssociation and accordionItems) so the ESN accordion
expands by default.
In `@src/components/header/constants.ts`:
- Line 21: The header link currently shows title "Freshman" while href is
"/matricole" (see the object with title "Freshman", href "/matricole", icon
FiChevronRight in header constants); change the title to "Matricole" for
consistency with src/app/matricole/page.tsx (or explicitly keep bilingual if
intentional), and verify any other header labels or navigation data use the same
language choice so the link label and route content match.
---
Nitpick comments:
In `@src/app/projects/page.tsx`:
- Around line 6-9: The metadata export lacks an explicit type; annotate the
exported constant with the Next.js Metadata type to enable compile-time checks.
Import the Metadata type from next (e.g., import type { Metadata } from "next")
and change the export to use that type annotation on the metadata constant
(export const metadata: Metadata = { ... }) so misspelled or invalid metadata
fields in the metadata object are caught by the compiler; update the metadata
object in page.tsx (symbol: metadata) accordingly.
- Line 11: The component default export is named Home but represents the
projects route; rename the function and its default export from Home to
ProjectsPage to match the route and intent—update the function declaration
(export default function Home() → export default function ProjectsPage()) and
any local references/imports that might use Home to ensure consistency.
In `@src/components/card-caption.tsx`:
- Line 23: The overlay Link in CardCaption (src/components/card-caption.tsx)
doesn't handle external URLs — update the component to detect whether the passed
href is external (e.g., startsWith('http://') or 'https://', or compare host)
and render the overlay accordingly: for internal routes keep using next/link as
before, for external URLs render a plain <a> anchor (or next/link with passHref)
with target="_blank" and rel="noopener noreferrer" (or accept an optional target
prop and honor it) so featuredCards external links open in a new tab and include
the security rel attributes; update the logic around the Link rendering at the
expression with {href && <Link ... />} to branch based on external vs internal
href.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5bbfd67d-fb5d-4998-bc10-021cd8dbe46d
📒 Files selected for processing (9)
src/app/associations/page.tsxsrc/app/projects/page.tsxsrc/components/associations/associations-list.tsxsrc/components/card-caption.tsxsrc/components/header/constants.tssrc/components/home/about-us.tsxsrc/components/home/hero.tsxsrc/components/home/materials.tsxsrc/components/home/projects.tsx
No description provided.