8000 [Shop] Shop WCAG raport by PiotrTulacz · Pull Request #18157 · Sylius/Sylius · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Shop] Shop WCAG raport #18157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 17, 2025
Merged

[Shop] Shop WCAG raport #18157

merged 7 commits into from
Jun 17, 2025

Conversation

PiotrTulacz
Copy link
@PiotrTulacz PiotrTulacz commented Jun 12, 2025

Summary by CodeRabbit

  • Accessibility Improvements

    • Enhanced various navigation, banner, and content regions with appropriate ARIA roles and labels for improved screen reader support.
    • Added visually hidden headings and linked region labels to headings for better semantic structure.
    • Marked decorative elements as presentational to be ignored by assistive technologies.
  • UI Enhancements

    • Updated color classes for separator elements to improve visual consistency.
    • Changed certain headings from <h5> to <h1> while maintaining visual size for better semantic hierarchy.
    • Added new CSS classes to footer links for improved emphasis and styling.
  • New Features

    • Transparent button macro now supports adding custom HTML attributes for greater flexibility.
  • Other Updates

    • Adjusted viewport meta tag for improved scaling support on mobile devices.

@PiotrTulacz PiotrTulacz requested review from a team as code owners June 12, 2025 06:57
@probot-autolabeler probot-autolabeler bot added the Shop ShopBundle related issues and PRs. label Jun 12, 2025
Copy link
coderabbitai bot commented Jun 12, 2025

"""

Walkthrough

Accessibility enhancements were made across multiple Twig template files, including the addition of ARIA roles, labels, and landmark regions to key containers and navigation elements. Several separator elements were updated for better accessibility. Some heading levels and meta tag attributes were adjusted, and a macro was extended to allow dynamic HTML attributes.

Changes

File(s) Change Summary
homepage/banner.html.twig, homepage/new_collection.html.twig, product/common/list.html.twig Added ARIA roles, labels, and landmark region attributes for improved accessibility.
shared/layout/base.html.twig Added a visually hidden <h1> with the channel name for semantic structure.
shared/layout/base/footer/content/copy.html.twig Added CSS classes to the Sylius link in the footer for visual emphasis.
shared/layout/base/footer/content/menu.html.twig Added descriptive aria-label attributes to footer navigation elements.
shared/layout/base/header/content/security/logged_in_user/desktop/logout.html.twig,
shared/layout/base/header/content/security/logged_in_user/desktop/my_account.html.twig,
shared/layout/base/header/content/security/visitor/desktop/register.html.twig
Changed separator color class and added ARIA attributes to indicate decorative purpose.
shared/layout/base/header/content/security/visitor/desktop.html.twig,
shared/layout/base/header/content/security/visitor/mobile.html.twig
Added navigation roles and ARIA labels to account navigation containers.
shared/layout/base/header/navbar/menu.html.twig Added ARIA navigation roles/labels and changed heading from <h5> to <h1> with class for visual consistency.
shared/layout/base/offcanvas/cart/header.html.twig Changed cart header from <h5> to <h1> and added a visual sizing class.
shared/layout/base/metatags.html.twig Updated viewport meta tag: removed maximum-scale and user-scalable attributes, changed attribute order.
shared/buttons.html.twig Extended transparent macro to accept dynamic HTML attributes and render them on the anchor element.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ScreenReader
    participant Template

    User->>Template: Loads page
    Template->>ScreenReader: Provides ARIA roles, labels, and landmarks
    ScreenReader-->>User: Announces enhanced semantic structure and navigation
Loading

Suggested reviewers

  • GSadee

Poem

A hop, a skip, a leap for all—
ARIA sings in every hall.
Headings bold, and buttons bright,
Landmarks guide both day and night.
With every tweak, our pages gleam,
Accessible as a rabbit’s dream!
🐇✨
"""


📜 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 ad2eec5 and 5368701.

📒 Files selected for processing (1)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base.html.twig (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base.html.twig
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Static checks / PHP 8.4, Symfony ^7.2
  • GitHub Check: Static checks / PHP 8.3, Symfony ^7.2
  • GitHub Check: Static checks / PHP 8.2, Symfony ^6.4

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.

Copy link
github-actions bot commented Jun 12, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands:

  • 🚀 /bns:deploy to redeploy the environment

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: 8

🧹 Nitpick comments (3)
src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/metatags.html.twig (1)

5-5: Consider dropping maximum-scale altogether for better zoom accessibility

Setting maximum-scale=10 is an improvement over 1, yet it still imposes an upper bound. WCAG recommends not restricting user zoom. Unless there is a hard technical reason, the simplest, most accessible viewport is:

<meta name="viewport" content="width=device-width, initial-scale=1">

Removing the cap ensures low-vision users can pinch-zoom beyond 10× if needed.

src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/footer/content/menu.html.twig (1)

4-9: Good ARIA labelling – consider pairing with visible headings for context

aria-label="Footer informational links" and aria-label="Footer help links" make each <nav> landmark explicit – nice. For even clearer context (and to surface labels visually), it’s common to precede each group with a visually rendered heading (<h2 class="visually-hidden">…</h2> or similar) and use aria-labelledby instead of aria-label. No change required, just something to keep in mind.

Also applies to: 13-17

src/Sylius/Bundle/ShopBundle/templates/shared/buttons.html.twig (1)

23-32: Use html_attr escaping for injected attribute values

The loop now prints arbitrary attributes, which is great for flexibility, but we should escape values with the html_attr strategy to cover the full set of characters that can break out of attribute context (quotes, backticks, etc.).

-        {% for n
8000
ame, value in attributes %}
-            {{ name }}="{{ value }}"
-        {% endfor %}
+        {% for name, value in attributes %}
+            {{- ' ' ~ name|e ~ '="' ~ value|e('html_attr') ~ '"' }}
+        {% endfor %}

This keeps the door open for user-supplied attribute values without compromising safety.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b3dd2af and 2de27ed.

📒 Files selected for processing (17)
  • src/Sylius/Bundle/ShopBundle/templates/homepage/banner.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/homepage/new_collection.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/product/common/list.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/buttons.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/footer/content/copy.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/footer/content/menu.html.twig (2 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/content/logo.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/content/security/logged_in_user/desktop/logout.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/content/security/logged_in_user/desktop/my_account.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/content/security/visitor/desktop.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/content/security/visitor/desktop/register.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/content/security/visitor/mobile.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/navbar/menu.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/top_bar.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/metatags.html.twig (1 hunks)
  • src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/offcanvas/cart/header.html.twig (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Static checks / PHP 8.3, Symfony ^7.2
  • GitHub Check: Static checks / PHP 8.4, Symfony ^7.2
  • GitHub Check: Static checks / PHP 8.2, Symfony ^6.4
🔇 Additional comments (8)
src/Sylius/Bundle/ShopBundle/templates/shared/layout/base.html.twig (1)

26-26: Verify heading hierarchy – hidden <h1> may clash with page-specific headings

Adding a site-wide, visually-hidden <h1> improves landmark discoverability, but many templates already render their own <h1> for the page title/product name. HTML5 tolerates multiple <h1> tags, yet screen-reader verbosity and heading-outline tools may become noisy.

Please double-check that:

  1. Each view does not end up with two top-level headings conveying different topics.
  2. The visually-hidden utility also sets position: absolute/clip-path etc. to keep the element out of the reading order for sighted users relying on virtual cursor.

If conflicts arise, consider demoting page-specific headings to <h2> or using role="heading" aria-level="1" on this element instead of a real <h1>.

src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/offcanvas/cart/header.html.twig (1)

2-2: Double-check heading hierarchy – introducing a second <h1> may confuse some ATs

Changing the cart drawer title from <h5> to <h1> improves landmark clarity inside the off-canvas, but it will coexist with the page-level <h1> that already exists in most views. Although multiple <h1> elements are valid HTML5, some assistive technologies still expect a single top-level heading.
Please verify that:

  1. The main document already uses proper heading levels.
  2. There are no other inadvertent <h1> replicas generated elsewhere.

If necessary, consider <h2> + aria-level="1" to keep semantics without duplicating an <h1>.

src/Sylius/Bundle/ShopBundle/templates/homepage/banner.html.twig (1)

1-1: Ensure only one landmark with role="banner" per page

WCAG & ARIA guidance stipulates the banner landmark should appear once at the top-level of the page (outside any other landmark). If the layout header already carries role="banner", this additional banner may create duplicate landmarks. Please verify and, if needed, switch to role="region" with an appropriate label.

src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/content/security/logged_in_user/desktop/logout.html.twig (1)

3-3: Separator correctly marked decorative – looks good

The pipe is now fully black and excluded from accessibility tree via aria-hidden & role="presentation". Implementation is clean.

src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/content/security/logged_in_user/desktop/my_account.html.twig (1)

3-3: Separator correctly hidden for assistive tech
Using aria-hidden="true" alongside role="presentation" properly removes this decorative separator from screen readers, and the updated text-black class improves contrast.

src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/navbar/menu.html.twig (1)

5-7: Verify heading level change
Updating from <h5> to <h1> may introduce multiple H1s. Ensure this level fits within the document outline or adjust it to an appropriate heading level.

src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/content/security/visitor/desktop/register.html.twig (2)

3-3: Decorative separator correctly hidden from assistive tech

Good call adding aria-hidden="true" and role="presentation" – the separator is now ignored by screen-readers without changing its visual purpose.


4-11: Verify container semantics for role="menuitem"

role="menuitem" is expected to be a direct descendant of an element whose role is menu, menubar, or listbox.
If the surrounding markup is still a plain <nav> or list without one of those roles, assistive technologies may not treat the link as part of a menu and keyboard interaction patterns can break.
Please double-check the parent template and, if necessary, add role="menu" (or switch to role="navigation" without the menuitem role).

@PiotrTulacz
Copy link
Author

/bns:deploy

2 similar comments
@GSadee
Copy link
Member
GSadee commented Jun 16, 2025

/bns:deploy

@GSadee
Copy link
Member
GSadee commented Jun 16, 2025

/bns:deploy

@PiotrTulacz
Copy link
Author

/bns:deploy

@GSadee
Copy link
Member
GSadee commented Jun 17, 2025

/bns:deploy

@GSadee GSadee added UX Issues and PRs aimed at improving User eXperience. Frontend Issues and PRs related to frontend labels Jun 17, 2025
@GSadee GSadee merged commit 91c99c3 into Sylius:2.1 Jun 17, 2025
54 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Issues and PRs related to frontend Shop ShopBundle related issues and PRs. UX Issues and PRs aimed at improving User eXperience.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0