Skip to content

Conversation

@dmaduzia
Copy link
Contributor

@dmaduzia dmaduzia commented Oct 24, 2025

Adds a POC for a related articles wrapper. Currently, it renders 2 elements for each related article returned by the backend for presentation purposes. According to my findings, we need to update the YARPP plugin configuration to change the number of returned related articles from 2 to 4.

I've utilized the ngx-owl-carousel-o library for implementing the carousel. I'm leaving the final decision on including it in the package.json on the main branch for further consideration.

Additionally, this PR adds a missing translation for the Related Articles title and ensures proper accessibility for the carousel navigation.

Summary by CodeRabbit

  • New Features

    • Added a carousel-based related articles section with previous/next slide navigation controls
    • Added multi-language support for related articles labels in English and Polish
  • Improvements

    • Enhanced avatar component with explicit pixel-based sizing controls

Copilot AI review requested due to automatic review settings October 24, 2025 12:07
@coderabbitai
Copy link

coderabbitai bot commented Oct 24, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The PR introduces a carousel-based related articles component with internationalization support in English and Polish. It adds the ngx-owl-carousel-o library dependency, integrates carousel styling, and updates the avatar component with explicit pixel-based size bindings.

Changes

Cohort / File(s) Summary
Internationalization
apps/blog/src/assets/i18n/en.json, apps/blog/src/assets/i18n/pl.json
Added top-level relatedArticles key with translated carousel labels (title, previousSlide, nextSlide) in English and Polish
Related Articles Component
libs/blog/articles/feature-related-articles/src/lib/related-articles.component.ts
Replaced static markup with Transloco-enabled carousel layout; integrated ngx-owl-carousel-o with responsive options; added carousel navigation buttons with ARIA labels; imported TranslocoDirective, CarouselModule, ButtonComponent
Carousel Styling
apps/blog/src/styles.scss
Added SCSS imports for owl.carousel and owl.theme.default from ngx-owl-carousel-o
Avatar Component
libs/blog/shared/ui-avatar/src/lib/avatar.component.html
Added style bindings for width and height in pixels using component's size() value
Dependencies
package.json
Added ngx-owl-carousel-o@^20.0.1 dependency

Sequence Diagram

sequenceDiagram
    participant Component as RelatedArticles<br/>Component
    participant Store as Article Store
    participant Carousel as ngx-owl-carousel-o
    participant i18n as Transloco i18n

    Component->>Store: fetch related articles (ngOnInit)
    activate Store
    Store-->>Component: articles$ observable
    deactivate Store

    Component->>Carousel: initialize carousel with<br/>customOptions
    activate Carousel
    Carousel->>Carousel: render slides from articles
    Carousel-->>Component: carousel ready
    deactivate Carousel

    Component->>i18n: load relatedArticles keys<br/>(title, previousSlide, nextSlide)
    activate i18n
    i18n-->>Component: translated strings
    deactivate i18n

    rect rgb(200, 220, 240)
    Note over Component,Carousel: User interaction
    Component->>Carousel: next/previous button click
    Carousel->>Carousel: animate to next/previous slide
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Most changes are straightforward additions: i18n entries follow established patterns, styling imports are simple, and the avatar binding is a direct style addition. The component refactoring introduces carousel integration with clear structure and dependencies, but remains cohesive and well-defined.

Suggested reviewers

  • DamianBrzezinskiHoA
  • DDonochVA
  • mateuszbasinski

Poem

🐰 A carousel of tales now spins so bright,
With slides that dance, left and right,
Transloco whispers in each tongue,
Related articles, sweetly sung,
The owl library helps us glide—hop-hop-hooray!

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Feat/carousel" is related to the changeset and accurately reflects that carousel functionality is being introduced. However, it refers to an implementation detail (the carousel technology) rather than the main feature objective. According to the PR objectives, the primary change is adding a "related-articles wrapper" component that uses carousel technology for presentation. While the title captures the technology aspect, it lacks specificity about the related-articles context, making it partially rather than fully descriptive of the core change being delivered.

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.

@valueadd-robot
Copy link

PR is detected, will deploy to dev environment

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a carousel feature for displaying related articles on the blog, replacing the static grid layout with an interactive carousel component. It introduces the ngx-owl-carousel-o library to enable smooth navigation through related articles with responsive breakpoints and accessibility features.

Key changes:

  • Addition of ngx-owl-carousel-o carousel library with custom navigation controls
  • Implementation of internationalization for carousel navigation labels and titles
  • Enhancement of avatar component sizing capabilities

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
package.json Adds ngx-owl-carousel-o library dependency
libs/blog/shared/ui-avatar/src/lib/avatar.component.html Adds dynamic sizing support for avatar component
libs/blog/articles/feature-related-articles/src/lib/related-articles.component.ts Replaces grid layout with carousel implementation including custom navigation buttons and accessibility features
apps/blog/src/styles.scss Imports carousel library styles
apps/blog/src/assets/i18n/pl.json Adds Polish translations for carousel navigation
apps/blog/src/assets/i18n/en.json Adds English translations for carousel navigation
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 71 to 89
customOptions: OwlOptions = {
loop: true,
mouseDrag: false,
touchDrag: true,
pullDrag: true,
dots: true,
margin: 24,
navSpeed: 700,
navText: ['', ''],
responsive: {
// Keep in mind these breakpoints refer to container width, not the viewport width
0: {
items: 1,
},
540: {
items: 2,
},
},
};
Copy link

Copilot AI Oct 24, 2025

Choose a reason for hiding this comment

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

The carousel configuration object should be declared as readonly since it's never modified after initialization. This prevents accidental mutations and clearly communicates intent.

Copilot uses AI. Check for mistakes.
(click)="carousel.prev()"
size="small"
>
<span class="text-2xl">‹</span>
Copy link

Copilot AI Oct 24, 2025

Choose a reason for hiding this comment

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

Using raw Unicode characters (‹ and ›) for navigation buttons may not be announced properly by screen readers. Consider using icon components with proper aria-hidden attributes or text alternatives instead.

Copilot uses AI. Check for mistakes.
@valueadd-robot
Copy link

Deployed to dev environment
Branch: feat/carousel
BFF URL: https://04962c09-blog-bff-dev.contact-ef8.workers.dev
Deploy URL: https://23a60d66.angular-love-client.pages.dev
Alias URL: https://feat-carousel.angular-love-client.pages.dev

Copy link

@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: 0

🧹 Nitpick comments (1)
libs/blog/articles/feature-related-articles/src/lib/related-articles.component.ts (1)

71-89: Consider disabling built-in navigation and review mouseDrag setting.

Since custom navigation buttons are implemented, explicitly set nav: false to prevent potential conflicts with the library's default navigation.

Additionally, mouseDrag: false disables desktop drag functionality, which some users might expect. Consider whether this is intentional for the UX or if it should be enabled.

Apply this diff to disable built-in navigation:

 customOptions: OwlOptions = {
   loop: true,
   mouseDrag: false,
   touchDrag: true,
   pullDrag: true,
   dots: true,
+  nav: false,
   margin: 24,
   navSpeed: 700,
   navText: ['', ''],

Additionally, consider enabling mouseDrag for desktop users:

-  mouseDrag: false,
+  mouseDrag: true,
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd190d7 and 379c811.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • apps/blog/src/assets/i18n/en.json (1 hunks)
  • apps/blog/src/assets/i18n/pl.json (1 hunks)
  • apps/blog/src/styles.scss (1 hunks)
  • libs/blog/articles/feature-related-articles/src/lib/related-articles.component.ts (1 hunks)
  • libs/blog/shared/ui-avatar/src/lib/avatar.component.html (1 hunks)
  • package.json (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
libs/blog/articles/feature-related-articles/src/lib/related-articles.component.ts (2)
libs/blog/articles/feature-article/src/lib/article-details/article-details.component.ts (1)
  • Component (36-69)
libs/blog/articles/data-access/src/lib/state/related-article.store.ts (1)
  • RelatedArticleListStore (25-60)
🔇 Additional comments (9)
libs/blog/shared/ui-avatar/src/lib/avatar.component.html (1)

3-4: LGTM! Explicit sizing improves layout consistency.

The explicit width and height style bindings ensure the container matches the image dimensions, preventing potential layout shifts.

apps/blog/src/styles.scss (1)

5-6: LGTM! Carousel styling properly integrated.

The imports for ngx-owl-carousel-o styles are correctly placed and will provide the necessary styling for the carousel component.

apps/blog/src/assets/i18n/en.json (1)

316-320: LGTM! Clear and appropriate translation keys.

The new i18n keys for related articles provide proper labels for the carousel title and navigation controls, enhancing accessibility.

apps/blog/src/assets/i18n/pl.json (1)

319-323: LGTM! Consistent Polish translations.

The Polish translations for related articles are properly structured and match the English keys, ensuring consistent i18n support.

libs/blog/articles/feature-related-articles/src/lib/related-articles.component.ts (4)

8-13: LGTM! Dependencies correctly imported.

The new imports for TranslocoDirective, CarouselModule, OwlOptions, and ButtonComponent properly support the carousel-based i18n implementation.


19-30: LGTM! Strong accessibility implementation.

The carousel implementation demonstrates good accessibility practices:

  • Transloco integration for i18n support
  • role="list" on the carousel container
  • List items wrapped in <li> elements
  • Padding added to prevent focus ring clipping

32-56: LGTM! Custom navigation with proper ARIA labels.

The custom navigation buttons with ARIA labels provide better accessibility than default carousel controls. The positioning for large viewports is appropriate.


69-96: Verify YARPP plugin configuration for article count.

As noted in the PR description, the YARPP plugin configuration needs to be updated to return four related articles instead of two for proper carousel presentation.

Verify that the backend/YARPP plugin is configured to return the expected number of related articles. This can be confirmed by checking the API response or configuration settings.

package.json (1)

60-60: Package version verified as valid with no security vulnerabilities.

ngx-owl-carousel-o version 20.0.1 is the latest version on NPM, and no security advisories were found for this package.

@dmaduzia dmaduzia marked this pull request as draft October 24, 2025 13:20
@valueadd-robot
Copy link

PR is detected, will deploy to dev environment

@valueadd-robot
Copy link

Deployed to dev environment
Branch: feat/carousel
BFF URL: https://f29d429e-blog-bff-dev.contact-ef8.workers.dev
Deploy URL: https://b92552fa.angular-love-client.pages.dev
Alias URL: https://feat-carousel.angular-love-client.pages.dev

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.

3 participants