Skip to content

feat: add CommunityNews component#78

Merged
toto04 merged 19 commits into
mainfrom
bianca/communityNews
May 21, 2026
Merged

feat: add CommunityNews component#78
toto04 merged 19 commits into
mainfrom
bianca/communityNews

Conversation

@BIA3IA

@BIA3IA BIA3IA commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Introduce the CommunityNews component to display community updates

Closes #74

@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7d44f519-3d10-49d4-9f65-aa5613e85770

📥 Commits

Reviewing files that changed from the base of the PR and between 5732f09 and 67effbf.

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

Walkthrough

This PR adds a responsive CommunityNews component and integrates it into the Projects page, replaces the Home donation card with a configured CardSplit, extends GradientIcon to accept size and passes size to the icon, removes the hidden SVG linearGradient from CardAction, adds Tailwind breakpoint theme variables, and ignores .idea and .codex in .gitignore.

Changes

Carousel UI and Community Features

Layer / File(s) Summary
Gradient icon sizing and card styling
src/components/gradient-icon.tsx, src/components/ui/card.tsx, src/styles/globals.css, .gitignore
GradientIconType adds optional size?: string; Icon is rendered with size="16"; CardAction no longer emits the hidden SVG linearGradient; Tailwind @theme adds --breakpoint-1xl and --breakpoint-3xl; .gitignore now ignores .idea and .codex.
CommunityNews component for Projects
src/components/projects/community-news.tsx
New CommunityNews export with communityCards (title, caption, FiCrop icon, iconPosition). Desktop: 2–4 column CardCaption grid. Mobile: Carousel mapping to CarouselItem plus CarouselDots.
Projects page integration
src/app/projects/page.tsx
Imports CommunityNews and renders <CommunityNews /> inside the full-width <main> ahead of the existing <Upload />.
Home page donation card update
src/app/page.tsx
Replaces CardMultipleIcons with CardSplit configured with textPrimary="5x1000", textSecondary="Sostienici!", and textSecondarySmall="CF: 97927490157".

Possibly related PRs

  • PoliNetworkOrg/web#81: Extends projects page with additional components alongside CommunityNews and Upload.
  • PoliNetworkOrg/web#43: Modifies Home page composition near the AboutUs/card area, overlapping Home layout changes.
  • PoliNetworkOrg/web#109: Refactors Carousel and CardCaption building blocks that CommunityNews relies on.

Suggested labels

priority: high

🚥 Pre-merge checks | ✅ 2 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Several changes appear outside the core CommunityNews feature scope: GradientIcon type updates, CardAction SVG gradient removal, theme breakpoint additions, and CardSplit donation block replacement on the home page. Review whether GradientIcon updates, CardAction gradient removal, theme breakpoints, and home page CardSplit changes are necessary for issue #74 or should be addressed in separate PRs.
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add CommunityNews component' directly and clearly reflects the main change: a new CommunityNews component is introduced and integrated into the projects page.
Linked Issues check ✅ Passed Issue #74 requests the Projects - Community News component. The PR adds the CommunityNews component with desktop grid and mobile carousel layouts, integrates it into projects/page.tsx, and supports the required functionality.

✏️ 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 self-assigned this Apr 15, 2026
@BIA3IA BIA3IA marked this pull request as ready for review May 12, 2026 10:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 (2)
src/components/ui/carousel.tsx (2)

133-133: ⚡ Quick win

Add aria-label to improve carousel accessibility.

The carousel section should have a descriptive label so screen reader users understand the purpose of the region.

♿ Proposed fix
-      <section onKeyDownCapture={handleKeyDown} className={cn("relative", className)} data-slot="carousel" {...props}>
+      <section onKeyDownCapture={handleKeyDown} aria-label="Carousel" className={cn("relative", className)} data-slot="carousel" {...props}>

Or allow consumers to override it via props:

-}: React.ComponentProps<"div"> & CarouselProps) {
+}: React.ComponentProps<"div"> & CarouselProps & { "aria-label"?: string }) {
🤖 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/ui/carousel.tsx` at line 133, The carousel's root <section>
currently lacks an accessible name—add an aria-label (e.g.,
aria-label="Carousel" or a more descriptive string) to the section element
rendered in the Carousel component and allow consumers to override it via props
(accept e.g., ariaLabel or passthrough aria-* props), so update the component
props usage to prefer the provided ariaLabel/props value and fallback to a
sensible default; make changes in the render line that uses handleKeyDown, cn,
className and {...props} so the aria attribute is included and can be
overridden.

177-179: ⚡ Quick win

Add visible focus indicator to dot buttons.

The button uses outline-none but doesn't provide an alternative focus indicator. This creates an accessibility barrier for keyboard users who cannot see which dot has focus.

♿ Proposed fix
           className={cn(
-            "flex size-5 appearance-none items-center justify-center rounded-full bg-transparent p-0 outline-none transition-colors"
+            "flex size-5 appearance-none items-center justify-center rounded-full bg-transparent p-0 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-white/50"
           )}
🤖 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/ui/carousel.tsx` around lines 177 - 179, The dot button
currently removes the browser focus indicator via the "outline-none" class in
the className passed to cn; replace that with an accessible focus style instead
of removing it so keyboard users can see focus. Locate the element rendering the
dot buttons (the className string containing "outline-none" in
src/components/ui/carousel.tsx) and remove or narrow the use of "outline-none",
adding a visible focus-visible style such as a ring/outline on focus (e.g., use
focus-visible:ring, focus-visible:ring-offset, or focus-visible:outline classes
with an appropriate color and offset) so the button keeps a clear visual
indicator when focused while preserving hover/active styles.
🤖 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/projects/community-news.tsx`:
- Around line 5-34: The communityCards constant contains placeholder data
(titles "Title 1"..."Title 4", lorem ipsum captions, and repeated FiCrop icons)
that must be replaced before production; update the communityCards array in
src/components/projects/community-news.tsx by replacing each object’s title,
caption, and icon fields with real community news content and appropriate icon
components (or dynamic props) and ensure iconPosition stays correct; keep the
array shape (the objects and the as const typing) so existing rendering logic
that references communityCards continues to work.

In `@src/components/ui/carousel.tsx`:
- Around line 150-161: The CarouselItem component is using a <fieldset> which is
semantically incorrect for non-form carousel slides; replace the fieldset with a
<div> in the CarouselItem function to correct semantics: update the JSX returned
by CarouselItem (which uses useCarousel() and sets aria-roledescription="slide"
and data-slot="carousel-item") so it renders a div with the same props,
className, aria attributes and data-slot, preserving behavior and accessibility
attributes.
- Around line 170-189: Replace the fragile key usage for carousel indicators: in
the map over scrollSnaps inside the render (the Button elements created from
scrollSnaps.map) use the stable index as the React key instead of the scrollSnap
value; update the Button's key from scrollSnap to index (the rest of the props
such as aria-label, aria-current using selectedIndex, onClick calling
api?.scrollTo(index), and the inner span logic can remain unchanged).

---

Nitpick comments:
In `@src/components/ui/carousel.tsx`:
- Line 133: The carousel's root <section> currently lacks an accessible name—add
an aria-label (e.g., aria-label="Carousel" or a more descriptive string) to the
section element rendered in the Carousel component and allow consumers to
override it via props (accept e.g., ariaLabel or passthrough aria-* props), so
update the component props usage to prefer the provided ariaLabel/props value
and fallback to a sensible default; make changes in the render line that uses
handleKeyDown, cn, className and {...props} so the aria attribute is included
and can be overridden.
- Around line 177-179: The dot button currently removes the browser focus
indicator via the "outline-none" class in the className passed to cn; replace
that with an accessible focus style instead of removing it so keyboard users can
see focus. Locate the element rendering the dot buttons (the className string
containing "outline-none" in src/components/ui/carousel.tsx) and remove or
narrow the use of "outline-none", adding a visible focus-visible style such as a
ring/outline on focus (e.g., use focus-visible:ring, focus-visible:ring-offset,
or focus-visible:outline classes with an appropriate color and offset) so the
button keeps a clear visual indicator when focused while preserving hover/active
styles.
🪄 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: ab530db8-60d2-456d-87d8-13c433b33b3b

📥 Commits

Reviewing files that changed from the base of the PR and between f34cf16 and b705fe2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .gitignore
  • package.json
  • src/app/page.tsx
  • src/app/projects/page.tsx
  • src/components/gradient-icon.tsx
  • src/components/home/carousel-mock.tsx
  • src/components/projects/community-news.tsx
  • src/components/ui/card.tsx
  • src/components/ui/carousel.tsx
💤 Files with no reviewable changes (1)
  • src/components/ui/card.tsx

Comment thread src/components/projects/community-news.tsx
Comment thread src/components/ui/carousel.tsx
Comment thread src/components/ui/carousel.tsx
@toto04 toto04 changed the title Add CommunityNews component feat: add CommunityNews component May 21, 2026
@toto04 toto04 merged commit f38e178 into main May 21, 2026
1 check passed
@toto04 toto04 deleted the bianca/communityNews branch May 21, 2026 21:02
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.

Projects - Comunity News

2 participants