Skip to content

[537] Add breadcrumbs implementation#83

Merged
IhorMasechko merged 6 commits intomainfrom
537-add-bread-crumbs
May 15, 2025
Merged

[537] Add breadcrumbs implementation#83
IhorMasechko merged 6 commits intomainfrom
537-add-bread-crumbs

Conversation

@IhorMasechko
Copy link
Contributor

@IhorMasechko IhorMasechko commented May 13, 2025

  • Implement breadcrumbs component in fragments.html
  • Add accessibility attributes for better screen reader support
  • Create navigation structure with proper hierarchy
  • Add special styling for current page indicators
  • Connect breadcrumbs with page ancestry data
  • Integrate breadcrumb fragment into layout template

@IhorMasechko IhorMasechko self-assigned this May 13, 2025
@IhorMasechko IhorMasechko requested a review from killev as a code owner May 13, 2025 18:31
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 13, 2025

📝 Walkthrough

Walkthrough

Breadcrumb navigation functionality was introduced to the website. This involved adding a new SCSS stylesheet for breadcrumb styling, creating a breadcrumbs fragment to generate the navigation markup and logic, and updating the main layout template to render the breadcrumb fragment after the header.

Changes

File(s) Change Summary
website/modules/asset/ui/src/scss/_base.scss Added SCSS styles for breadcrumb navigation components, including container, list, item, and link styles.
website/views/fragments/fragments.html Added a breadcrumbs fragment that generates semantic breadcrumb navigation based on page context.
website/views/layout.html Updated layout to include the breadcrumbs fragment after the header and reformatted some markup.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant LayoutTemplate
    participant BreadcrumbsFragment

    User->>LayoutTemplate: Request page
    LayoutTemplate->>BreadcrumbsFragment: Render breadcrumbs
    BreadcrumbsFragment->>BreadcrumbsFragment: Determine breadcrumb items (home, ancestors, current page, piece)
    BreadcrumbsFragment-->>LayoutTemplate: Return breadcrumb HTML
    LayoutTemplate-->>User: Return full page with breadcrumbs
Loading

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e322535 and 8e7cc6d.

📒 Files selected for processing (1)
  • website/views/fragments/fragments.html (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • website/views/fragments/fragments.html
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: e2e-tests
  • GitHub Check: security-scan

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

github-actions bot commented May 13, 2025

🔍 Vulnerabilities of apostrophe-cms:test

📦 Image Reference apostrophe-cms:test
digestsha256:df62af6d0d6f7369351e299181e62cd77a5503909b6d2113ab2a8273d1c563e6
vulnerabilitiescritical: 0 high: 2 medium: 0 low: 0
platformlinux/amd64
size284 MB
packages934
📦 Base Image node:23-alpine
also known as
  • 23-alpine3.21
  • 23.11-alpine
  • 23.11-alpine3.21
  • 23.11.0-alpine
  • 23.11.0-alpine3.21
  • alpine
  • alpine3.21
  • current-alpine
  • current-alpine3.21
digestsha256:0d468be7d2997dd2f6a3cda45e121a6b5140eb7ba3eba299a215030dbb0fb1ca
vulnerabilitiescritical: 0 high: 0 medium: 0 low: 0
critical: 0 high: 1 medium: 0 low: 0 async 0.9.2 (npm)

pkg:npm/async@0.9.2

high 7.8: CVE--2021--43138 OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities

Affected range<2.6.4
Fixed version2.6.4, 3.2.2
CVSS Score7.8
CVSS VectorCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS Score1.061%
EPSS Percentile76th percentile
Description

A vulnerability exists in Async through 3.2.1 (fixed in 3.2.2), which could let a malicious user obtain privileges via the mapValues() method.

critical: 0 high: 1 medium: 0 low: 0 async 1.5.2 (npm)

pkg:npm/async@1.5.2

high 7.8: CVE--2021--43138 OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities

Affected range<2.6.4
Fixed version2.6.4, 3.2.2
CVSS Score7.8
CVSS VectorCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS Score1.061%
EPSS Percentile76th percentile
Description

A vulnerability exists in Async through 3.2.1 (fixed in 3.2.2), which could let a malicious user obtain privileges via the mapValues() method.

Copy link
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: 1

🧹 Nitpick comments (3)
website/views/layout.html (1)

13-13: Breadcrumb placement may misalign with content grid
You’ve rendered fragments.breadcrumbs() immediately after the header, outside of the <div class="sf-container"> wrapper. Since the .breadcrumb styles assume container-level padding and max-width, the trail may sit flush with the viewport rather than aligning with your page content.
Consider moving:

{% render fragments.breadcrumbs() %}

inside the existing <div class="sf-container"> within <main>, or wrapping it in a new .sf-container, to ensure consistent horizontal alignment.

website/modules/asset/ui/src/scss/_base.scss (1)

119-162: Constrain breadcrumb width and alignment
The current .breadcrumb selector uses left offsets but the markup sits outside your main container. To mirror the .sf-container layout and gutters, you can constrain its maximum width and center it:

 .breadcrumb {
   font-weight: $font-weight-medium;
   font-size: $font-size-body-small-mobile;
   line-height: 150%;
-  margin-left: 40px;
+  max-width: $breakpoint-extra-extra-large;
+  margin: 0 auto;
+  padding: 0 40px;
   color: $black;
   @include breakpoint-extra-extra-large {
-    margin-left: 120px;
+    padding: 0 120px;
   }
 }

This adjustment ensures your breadcrumb bar stays aligned with the rest of the page grid.

website/views/fragments/fragments.html (1)

24-27: Add aria-current to the current breadcrumb item
For better screen-reader support, mark the current page in the trail with aria-current="page", for example:

-<li class="breadcrumb-item breadcrumb-item-current">
+<li class="breadcrumb-item breadcrumb-item-current" aria-current="page">

This explicitly tells assistive technologies which item represents the current location.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 110deb1 and d426905.

📒 Files selected for processing (3)
  • website/modules/asset/ui/src/scss/_base.scss (1 hunks)
  • website/views/fragments/fragments.html (1 hunks)
  • website/views/layout.html (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: sonarqube
  • GitHub Check: e2e-tests
  • GitHub Check: security-scan

yuramax
yuramax previously approved these changes May 14, 2025
Copy link
Contributor

@yuramax yuramax left a comment

Choose a reason for hiding this comment

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

Nice job! 👍

Anton-88
Anton-88 previously approved these changes May 14, 2025
Copy link
Contributor

@Anton-88 Anton-88 left a comment

Choose a reason for hiding this comment

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

Good job!

Copy link
Collaborator

@killev killev left a comment

Choose a reason for hiding this comment

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

@IhorMasechko please update PR description. try using cursor rule.

@IhorMasechko IhorMasechko dismissed stale reviews from yuramax and Anton-88 via e322535 May 15, 2025 13:04
Copy link
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: 1

🧹 Nitpick comments (1)
website/views/fragments/fragments.html (1)

24-54: Consider adding unit/integration tests for breadcrumb rendering
There are currently no automated tests covering the breadcrumb fragment. I recommend adding tests to verify output for these scenarios:

  • Home page only (S&F Home)
  • Nested page without a data.piece
  • Nested page with a data.piece
    This will help catch regressions and ensure consistency across page types.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d426905 and e322535.

📒 Files selected for processing (1)
  • website/views/fragments/fragments.html (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: sonarqube
  • GitHub Check: e2e-tests
  • GitHub Check: security-scan
🔇 Additional comments (1)
website/views/fragments/fragments.html (1)

24-27: Breadcrumb fragment structure is well-implemented
The new breadcrumbs fragment uses semantic HTML elements (<nav>, <ol>, <li>) with ARIA labeling and dynamic ancestor loops, aligning well with accessibility and maintainability goals.

@sonarqubecloud
Copy link

Copy link
Contributor

@yuramax yuramax left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@killev killev left a comment

Choose a reason for hiding this comment

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

LGTM, Approved

@IhorMasechko IhorMasechko merged commit 8a0cbba into main May 15, 2025
18 of 19 checks passed
@IhorMasechko IhorMasechko deleted the 537-add-bread-crumbs branch May 15, 2025 13:27
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.

4 participants