-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[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
[Shop] Shop WCAG raport #18157
Conversation
""" WalkthroughAccessibility 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
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
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
❌ Preview Environment deleted from BunnyshellAvailable commands:
|
There was a problem hiding this 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 droppingmaximum-scale
altogether for better zoom accessibilitySetting
maximum-scale=10
is an improvement over1
, 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"
andaria-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 usearia-labelledby
instead ofaria-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
: Usehtml_attr
escaping for injected attribute valuesThe 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
📒 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 headingsAdding 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:
- Each view does not end up with two top-level headings conveying different topics.
- The
visually-hidden
utility also setsposition: 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 usingrole="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 ATsChanging 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:
- The main document already uses proper heading levels.
- 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 withrole="banner"
per pageWCAG & 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 carriesrole="banner"
, this additional banner may create duplicate landmarks. Please verify and, if needed, switch torole="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 goodThe 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
Usingaria-hidden="true"
alongsiderole="presentation"
properly removes this decorative separator from screen readers, and the updatedtext-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 techGood call adding
aria-hidden="true"
androle="presentation"
– the separator is now ignored by screen-readers without changing its visual purpose.
4-11
: Verify container semantics forrole="menuitem"
role="menuitem"
is expected to be a direct descendant of an element whose role ismenu
,menubar
, orlistbox
.
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, addrole="menu"
(or switch torole="navigation"
without the menuitem role).
src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/top_bar.html.twig
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/content/logo.html.twig
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/ShopBundle/templates/product/common/list.html.twig
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/footer/content/copy.html.twig
Show resolved
Hide resolved
src/Sylius/Bundle/ShopBundle/templates/homepage/new_collection.html.twig
Show resolved
Hide resolved
...le/ShopBundle/templates/shared/layout/base/header/content/security/visitor/desktop.html.twig
Show resolved
Hide resolved
src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/header/navbar/menu.html.twig
Show resolved
Hide resolved
...dle/ShopBundle/templates/shared/layout/base/header/content/security/visitor/mobile.html.twig
Show resolved
Hide resolved
/bns:deploy |
2 similar comments
/bns:deploy |
/bns:deploy |
678cc98
to
0257ae2
Compare
/bns:deploy |
/bns:deploy |
Summary by CodeRabbit
Accessibility Improvements
UI Enhancements
<h5>
to<h1>
while maintaining visual size for better semantic hierarchy.New Features
Other Updates