Skip to content

feat: add Guides page#113

Open
BIA3IA wants to merge 15 commits into
mainfrom
bianca/guides
Open

feat: add Guides page#113
BIA3IA wants to merge 15 commits into
mainfrom
bianca/guides

Conversation

@BIA3IA
Copy link
Copy Markdown
Contributor

@BIA3IA BIA3IA commented May 20, 2026

Closes #88
Closes #89
Closes #90

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Review Change Stack

Walkthrough

Adds Hero and Pill UI primitives, a reusable CardResource and CardText, a new responsive Guides page (desktop and mobile variants), replaces inline headers with Hero in two pages, updates grid breakpoint modifiers, and removes the CarouselMock module.

Changes

Guides Page & Components

Layer / File(s) Summary
UI foundations: Hero and Pill components
src/components/ui/hero.tsx, src/components/ui/pill.tsx
Hero renders centered title and description; Pill exports PillVariant and renders styled tag spans with variant classes and optional className.
CardResource: reusable card with metadata and bookmark state
src/components/card-resource/types.ts, src/components/card-resource/index.tsx
CardResourceProps defines metadata shape and href; CardResource renders normalized tag pills, title/description/author/date, and a bookmark toggle that manages local state and prevents default link navigation when toggling.
CardText: simple text card wrapper
src/components/card-text.tsx
CardText wraps provided text in Card/CardContent with fixed gradient/typography styling and composable className.
Guides page with responsive desktop/mobile layouts
src/app/guides/page.tsx, src/components/guides/types.ts, src/components/guides/content.tsx, src/components/guides/content-mobile.tsx
GuidePage supplies static guide data for desktop and mobile, renders a Hero header, uses GuideContent for desktop CardText entries and GuideContentMobile for mobile CardResource cards under responsive visibility rules.
Refactor existing pages to use Hero component
src/app/associations/page.tsx, src/components/projects/community-news.tsx
AssociationsPage and CommunityNews now import and render Hero with title/description, replacing inline heading/paragraph markup and simplifying the layout.
Grid breakpoint updates and carousel cleanup
src/components/projects/collection.tsx, src/components/projects/deprecated.tsx, src/components/home/carousel-mock.tsx
Updated responsive grid modifiers from xl:grid-cols-4 to 1xl:grid-cols-4 in collection/deprecated components; removed CarouselMock component and its mock data.

Possibly related PRs

Suggested labels

priority: high

🚥 Pre-merge checks | ✅ 2 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Out of Scope Changes check ❓ Inconclusive Changes to projects grid breakpoints (Collection, Deprecated) and removal of CarouselMock appear out of scope relative to the Guides page feature, though may reflect broader design system updates. Clarify whether grid breakpoint changes and CarouselMock removal are intentional refactoring or should be split into separate PRs for better change isolation.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add Guides page' clearly and concisely summarizes the main change in the pull request, which is the addition of a new Guides page.
Linked Issues check ✅ Passed The pull request implements a Guides page with both desktop and mobile layouts for Courses (#89) and General (#90) guides, matching the visual designs provided in the linked issues.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

@BIA3IA BIA3IA changed the title Bianca/guides feat: add Guides page May 20, 2026
@BIA3IA BIA3IA marked this pull request as ready for review May 22, 2026 12:31
@BIA3IA BIA3IA added the status: blocked Work cannot proceed until another issue is resolved label May 22, 2026
@BIA3IA BIA3IA self-assigned this May 22, 2026
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: 8

♻️ Duplicate comments (1)
src/components/projects/deprecated.tsx (1)

50-50: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Verify that 1xl: is a defined Tailwind breakpoint.

The class 1xl:grid-cols-4 uses a 1xl: breakpoint prefix that is not part of Tailwind's standard breakpoint set (sm, md, lg, xl, 2xl). If 1xl is not defined as a custom breakpoint in your Tailwind configuration, this utility class will be ignored and the grid will remain at 2 columns on all screen sizes.

This is the same issue flagged in collection.tsx line 86. Please verify that 1xl is defined in your Tailwind configuration, or update to use a standard breakpoint like xl: or 2xl:.

🤖 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/projects/deprecated.tsx` at line 50, The grid class uses a
nonstandard breakpoint prefix `1xl:grid-cols-4` (seen in the JSX string in
deprecated.tsx and similarly in collection.tsx), which will be ignored unless
you have a custom `1xl` in your Tailwind config; either update these classnames
to a standard breakpoint such as `xl:grid-cols-4` or `2xl:grid-cols-4`, or
confirm and document that `1xl` is declared in your Tailwind `theme.screens` so
the utility is applied correctly.
🧹 Nitpick comments (2)
src/app/guides/page.tsx (2)

82-82: ⚡ Quick win

Icon choice semantically mismatched.

FiLogIn is a login/sign-in icon, but it's used for "Trova le guide del tuo corso" (Find guides for your course). Consider using a more semantically appropriate icon like FiBook, FiFileText, or FiSearch.

💡 Suggested icons
-import { FiLogIn } from "react-icons/fi"
+import { FiBook } from "react-icons/fi"

 const guidesMobile = {
   title: "Trova le guide del tuo corso",
   caption: "Una raccolta di guide scritte dagli studenti del tuo corso",
-  icon: FiLogIn,
+  icon: FiBook,
 }
🤖 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/guides/page.tsx` at line 82, The icon FiLogIn used for the "Trova le
guide del tuo corso" card is semantically incorrect; replace FiLogIn with a more
appropriate icon (e.g., FiBook, FiFileText, or FiSearch) where the icon is
assigned (the object/prop setting icon: FiLogIn in the page component), update
the import to import the chosen icon and remove FiLogIn if unused, and ensure
the UI uses the new icon symbol in the same place that currently references
FiLogIn.

39-68: Mock data contains identical placeholder descriptions.

All three guide entries use the same truncated description: "È un esame che tratta tutti argomenti già visti in qualsiasi liceo scientifico...". This appears to be placeholder content. Ensure unique, descriptive content is added before production.

🤖 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/guides/page.tsx` around lines 39 - 68, The three guide objects with
titles "Chimica Generale", "Chimica", and "Generale" currently share identical
placeholder descriptions; replace these truncated placeholders in the guides
array (the objects that include title/description/tag/author/date/href) with
unique, descriptive copy for each entry that accurately reflects the guide
content and length expected in production, ensuring the description strings are
meaningful and localized where appropriate before shipping.
🤖 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/app/guides/page.tsx`:
- Around line 37-77: The guidesInfoMobile array currently sets every guide's
href to "/guides", causing links to reload the current page; update each object
in guidesInfoMobile (type CardResourceProps) to use the correct destination for
each guide (e.g., unique slugs or detail paths like "/guides/chimica-generale",
"/guides/chimica-2-anno", etc.) so the Card or Link component navigates to the
intended guide detail pages; ensure href values are consistent with your routing
convention and any Link/Nav components that consume CardResourceProps.

In `@src/components/card-resource/index.tsx`:
- Around line 33-42: The bookmark toggle button lacks an accessible label;
update the button in the component that uses setBookmarked and bookmarked (the
button rendering FiBookmark) to include an aria-label reflecting the current
state (e.g., "Add bookmark" when bookmarked is false and "Remove bookmark" when
bookmarked is true) and/or aria-pressed={bookmarked} so screen readers can
understand its purpose and state; ensure the label text is computed from the
bookmarked state and remains in sync with the onClick handler that calls
setBookmarked.
- Around line 27-31: The map over (Array.isArray(tag) ? tag : [tag]) uses t.text
as the React key which can collide for tags with identical text; update the key
on the <Pill> inside that map to a unique value (e.g., combine t.text and
t.variant like `${t.text}-${t.variant}`) or, if the tag list is strictly static,
fall back to the map index; ensure the change is applied where the Pill is
rendered so keys are stable and unique.
- Line 24: Replace the native anchor with Next.js client-side routing by
importing Link and using it instead of the <a> tag in the CardResource
component: remove the <a href={href} className="flex h-full flex-col"> usage and
wrap the card content with <Link href={href}> applying the same className (and
pass any child elements) so Next's prefetching and client-side navigation are
used; ensure Link is imported from "next/link" at the top of the file.

In `@src/components/card-resource/types.ts`:
- Line 15: The href prop is optional but used unconditionally in the anchor,
producing invalid links; make href required by changing the prop definition from
href?: string to href: string in the Card resource props type (the type declared
in types.ts), then update all components/call sites that instantiate this card
to pass a valid href; alternatively, if you prefer optional behavior, update the
CardResource component to only render the <a href={...}> when href is defined or
fall back to a safe no-op (e.g., render a <div> or use '#'/role="link"), but the
simplest fix is to make href non-optional and ensure callers provide it.

In `@src/components/card-text.tsx`:
- Line 6: The CardContent element's responsive typography class has a typo:
change the class string on CardContent that currently contains
"sm:typo-hedline-small" to the correct "sm:typo-headline-small" so the
small-screen typography rule in the CardText component applies properly.

In `@src/components/guides/content-mobile.tsx`:
- Around line 9-11: The current list rendering uses guide.title as the React key
in guides.map when returning <CardResource key={guide.title} {...guide} />,
which can produce duplicate keys; update the mapper to use a stable unique
identifier from the guide object (e.g., guide.id or guide.href) as the key,
falling back to the array index only if no unique id exists, so locate the
guides.map(...) expression and replace guide.title with the chosen unique
property (or with the index fallback).

In `@src/components/guides/content.tsx`:
- Around line 13-15: The current JSX in guides.map uses guide.text as the React
key which can collide; change the key to a stable unique identifier by adding
and using guide.id in the guide type (update GuideContentProps / guide object to
include id and then use key={guide.id} on the CardText), or if you cannot add
ids immediately use the map index as a fallback (key={`${guide.text}-${index}`
or key={index}) inside the guides.map call that renders CardText to ensure keys
are unique and stable across renders.

---

Duplicate comments:
In `@src/components/projects/deprecated.tsx`:
- Line 50: The grid class uses a nonstandard breakpoint prefix `1xl:grid-cols-4`
(seen in the JSX string in deprecated.tsx and similarly in collection.tsx),
which will be ignored unless you have a custom `1xl` in your Tailwind config;
either update these classnames to a standard breakpoint such as `xl:grid-cols-4`
or `2xl:grid-cols-4`, or confirm and document that `1xl` is declared in your
Tailwind `theme.screens` so the utility is applied correctly.

---

Nitpick comments:
In `@src/app/guides/page.tsx`:
- Line 82: The icon FiLogIn used for the "Trova le guide del tuo corso" card is
semantically incorrect; replace FiLogIn with a more appropriate icon (e.g.,
FiBook, FiFileText, or FiSearch) where the icon is assigned (the object/prop
setting icon: FiLogIn in the page component), update the import to import the
chosen icon and remove FiLogIn if unused, and ensure the UI uses the new icon
symbol in the same place that currently references FiLogIn.
- Around line 39-68: The three guide objects with titles "Chimica Generale",
"Chimica", and "Generale" currently share identical placeholder descriptions;
replace these truncated placeholders in the guides array (the objects that
include title/description/tag/author/date/href) with unique, descriptive copy
for each entry that accurately reflects the guide content and length expected in
production, ensuring the description strings are meaningful and localized where
appropriate before shipping.
🪄 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: cb7d3d54-81cd-4810-970a-2325e1da673c

📥 Commits

Reviewing files that changed from the base of the PR and between 68e769e and c1e619e.

📒 Files selected for processing (14)
  • src/app/associations/page.tsx
  • src/app/guides/page.tsx
  • src/components/card-resource/index.tsx
  • src/components/card-resource/types.ts
  • src/components/card-text.tsx
  • src/components/guides/content-mobile.tsx
  • src/components/guides/content.tsx
  • src/components/guides/types.ts
  • src/components/home/carousel-mock.tsx
  • src/components/projects/collection.tsx
  • src/components/projects/community-news.tsx
  • src/components/projects/deprecated.tsx
  • src/components/ui/hero.tsx
  • src/components/ui/pill.tsx
💤 Files with no reviewable changes (1)
  • src/components/home/carousel-mock.tsx

Comment thread src/app/guides/page.tsx
Comment thread src/components/card-resource/index.tsx Outdated
Comment thread src/components/card-resource/index.tsx
Comment thread src/components/card-resource/index.tsx
Comment thread src/components/card-resource/types.ts Outdated
Comment thread src/components/card-text.tsx Outdated
Comment thread src/components/guides/content-mobile.tsx
Comment thread src/components/guides/content.tsx
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.

♻️ Duplicate comments (1)
src/components/card-resource/index.tsx (1)

29-29: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

React key collision risk remains.

Using t.text as the key can still produce duplicate-key warnings if multiple tags share identical text (even with different variants). The past review suggested combining text and variant or using the index.

🔑 Suggested fix: unique composite key
-            {(Array.isArray(tag) ? tag : [tag]).map((t) => (
-              <Pill key={t.text} variant={t.variant}>
+            {(Array.isArray(tag) ? tag : [tag]).map((t) => (
+              <Pill key={`${t.text}-${t.variant}`} variant={t.variant}>
                 {t.text}
               </Pill>
🤖 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-resource/index.tsx` at line 29, The Pill elements use a
non-unique key (key={t.text}), which can collide when different tags share the
same text; update the key on the Pill inside the map (the element rendering
Pill) to a unique composite value such as combining t.text and t.variant (e.g.,
`${t.text}-${t.variant}`) or include the map index as a fallback to guarantee
uniqueness for each Pill.
🤖 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.

Duplicate comments:
In `@src/components/card-resource/index.tsx`:
- Line 29: The Pill elements use a non-unique key (key={t.text}), which can
collide when different tags share the same text; update the key on the Pill
inside the map (the element rendering Pill) to a unique composite value such as
combining t.text and t.variant (e.g., `${t.text}-${t.variant}`) or include the
map index as a fallback to guarantee uniqueness for each Pill.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 347358b4-ff1c-40b5-93fe-e14b9bbc4fef

📥 Commits

Reviewing files that changed from the base of the PR and between c1e619e and 6ffa8e2.

📒 Files selected for processing (3)
  • src/components/card-resource/index.tsx
  • src/components/card-resource/types.ts
  • src/components/card-text.tsx
✅ Files skipped from review due to trivial changes (1)
  • src/components/card-text.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: blocked Work cannot proceed until another issue is resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Guides - General Guides - Courses Guides Page

1 participant