-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add an optional icon and description to the page title #17579
Conversation
WalkthroughThe pull request modifies the header template in the Sylius Admin Bundle, updating the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
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: 0
🧹 Nitpick comments (1)
src/Sylius/Bundle/AdminBundle/templates/shared/helper/header.html.twig (1)
7-12
: Consider adding ARIA attributes for better accessibility.While the semantic structure is good, consider enhancing accessibility by:
- Adding
aria-level
to match the dynamic heading level- Consider adding
aria-describedby
if the subheader provides additional context- <h{{ level }} class="page-title"> + <h{{ level }} class="page-title" aria-level="{{ level }}"{% if subheader %} aria-describedby="page-subheader"{% endif %}> {{ header }} </h{{ level }}> {% if subheader %} - <div>{{ subheader }}</div> + <div id="page-subheader">{{ subheader }}</div>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Sylius/Bundle/AdminBundle/templates/shared/helper/header.html.twig
(1 hunks)
🔇 Additional comments (3)
src/Sylius/Bundle/AdminBundle/templates/shared/helper/header.html.twig (3)
2-2
: LGTM! Well-structured container layout.
The use of Bootstrap's flex utilities with proper spacing and alignment creates a robust and flexible layout structure.
6-6
: LGTM! Clean and semantic content structure.
The nested flex container with column direction provides proper spacing and organization for the header components.
Also applies to: 13-14
3-4
: Verify the ux_icon Twig function implementation.
The icon implementation looks good, but let's ensure the ux_icon
function is properly registered and available.
✅ Verification successful
The ux_icon
function is properly configured and available
The verification shows that:
- The
ux_icon
function is widely used across multiple templates in both Admin and Shop bundles - It's properly configured in
UiBundle
with default icon attributes - The configuration is imported correctly in the bundle's main config
The implementation is consistent with Symfony UX icons component standards, and the usage in the template is correct.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the ux_icon Twig function registration and implementation
# Search for ux_icon function registration
rg -l "ux_icon" --type php
# Search for potential icon-related Twig extensions
rg -l "TwigExtension.*icon" --type php
Length of output: 67
Script:
#!/bin/bash
# Let's broaden our search to find Twig-related files and icon implementations
# Search for any Twig files using ux_icon
rg -l "ux_icon" --type-add 'twig:*.twig' --type twig
# Search for icon-related Twig extensions or functions in PHP files with more context
rg -A 5 "function.*icon" --type php
# Search for UX-related service definitions
fd -e yaml -e yml | xargs rg -l "ux_"
# Look for potential Symfony UX component configurations
fd -e yaml -e yml | xargs rg -l "ux:|symfony/ux"
Length of output: 12300
Script:
#!/bin/bash
# Let's check the UX icons configuration and implementation
# Check the UX icons configuration
cat src/Sylius/Bundle/UiBundle/Resources/config/packages/ux_icons.yaml
# Check the UI bundle configuration for any icon-related settings
cat src/Sylius/Bundle/UiBundle/Resources/config/app/config.yml
# Look for any Twig extension or service that might register the ux_icon function
rg -l "TwigExtension|ux_icon" src/Sylius/Bundle/UiBundle/
Length of output: 551
Bunnyshell Preview Environment deletedAvailable commands:
|
Based on Sylius/Sylius#17579 (improved to retrieve icon and subheader from hooks configuration) Fixes #172 ![Capture d’écran du 2024-12-23 08-48-54](https://github.com/user-attachments/assets/4116de80-2707-454e-a962-2493ee4006d8)
…17592) | Q | A |-----------------|----- | Branch? | 2.0 | Bug fix? | no | New feature? | yes (small improvement) | BC breaks? | no | Deprecations? | no | Related tickets | | License | MIT Improvement to #17579 And also related to Sylius/Stack#193 <!-- - Bug fixes must be submitted against the 1.13 branch - Features and deprecations must be submitted against the 1.14 branch - Features, removing deprecations and BC breaks must be submitted against the 2.0 branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced header rendering with the ability to include an icon and a subheader. - Support for translations for the new header elements. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This isn't strictly necessary for Sylius itself, but it might be useful in the Sylius Stack.
Summary by CodeRabbit