Skip to content

chore: add link and metadata to pages#124

Merged
toto04 merged 6 commits into
mainfrom
bianca/link-and-metadata
Jun 2, 2026
Merged

chore: add link and metadata to pages#124
toto04 merged 6 commits into
mainfrom
bianca/link-and-metadata

Conversation

@BIA3IA
Copy link
Copy Markdown
Contributor

@BIA3IA BIA3IA commented Jun 2, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

Warning

Review limit reached

@BIA3IA, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b20a2099-64a0-4dac-848d-42cb56b0715a

📥 Commits

Reviewing files that changed from the base of the PR and between 0e33972 and 0c90b38.

📒 Files selected for processing (1)
  • src/app/associations/page.tsx

Walkthrough

This 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 CardCaption component to support clickable overlays, and converts static button CTAs across home sections and headers to proper Next.js navigation links.

Changes

Navigation and Routing Infrastructure

Layer / File(s) Summary
Associations page component extraction and metadata
src/app/associations/page.tsx, src/components/associations/associations-list.tsx
Associations page moves from hardcoded accordion data to rendering a new AssociationsList component. The component encapsulates accordion items with association details, shared logo, descriptive content, and icon-paired link entries. Page exports metadata with title and description.
Page metadata exports for SEO
src/app/projects/page.tsx
Projects page adds metadata export defining page title ("Progetti") and description for search engines.
CardCaption component href enhancement
src/components/card-caption.tsx
CardCaption gains optional href prop to render an absolutely-positioned overlay Link spanning the card when href is provided, enabling cards to function as clickable navigation.
Header menu navigation routing
src/components/header/constants.ts
Header menu items replace placeholder "#" hrefs with concrete internal and external URLs across Materials section (Rankings, Tol Project), Community section (Groups, Projects, Associations), and About section (About us, Join us, Contact us).
Home section CTAs as navigation links
src/components/home/about-us.tsx, src/components/home/hero.tsx, src/components/home/materials.tsx, src/components/home/projects.tsx
Home page section CTAs refactor to render Next.js Links via asChild, adding routes to /about, /groups, /materials, and /projects. Projects component adds href properties to featured card data entries alongside titles and captions.

Possibly related PRs

  • PoliNetworkOrg/web#41: Main PR extends the CardCaption component with optional href prop for clickable overlays, building on the original CardCaption creation.
  • PoliNetworkOrg/web#115: Both PRs modify src/app/associations/page.tsx to restructure the page layout, with potential overlapping changes to page JSX structure.
  • PoliNetworkOrg/web#109: Main PR adds href fields to src/components/home/projects.tsx cards and wraps CTAs in Next.js Links, extending the component infrastructure introduced in the retrieved PR.
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding metadata to pages and converting navigation to use proper Next.js Link components throughout the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

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

@toto04 toto04 enabled auto-merge (squash) June 2, 2026 20:49
@toto04 toto04 merged commit cfeb10f into main Jun 2, 2026
1 of 2 checks passed
@toto04 toto04 deleted the bianca/link-and-metadata branch June 2, 2026 20:49
Copy link
Copy Markdown
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 (3)
src/app/projects/page.tsx (2)

6-9: ⚡ Quick win

Type the metadata export with Metadata for consistency and type safety.

The associations page (src/app/associations/page.tsx) types this as Metadata. 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 value

Misleading component name on the projects page.

The default export is named Home but this is the projects route. Rename to ProjectsPage for 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 win

Overlay link lacks handling for external URLs.

href is rendered through next/link with no target/rel. In src/components/home/projects.tsx, every featuredCards entry 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 missing rel="noopener noreferrer". Consider detecting external hrefs (or accepting an optional target) 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

📥 Commits

Reviewing files that changed from the base of the PR and between 62f71ad and 0e33972.

📒 Files selected for processing (9)
  • src/app/associations/page.tsx
  • src/app/projects/page.tsx
  • src/components/associations/associations-list.tsx
  • src/components/card-caption.tsx
  • src/components/header/constants.ts
  • src/components/home/about-us.tsx
  • src/components/home/hero.tsx
  • src/components/home/materials.tsx
  • src/components/home/projects.tsx

Comment thread src/components/associations/associations-list.tsx
Comment thread src/components/associations/associations-list.tsx
Comment thread src/components/header/constants.ts
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.

2 participants