chore(Tiered List): Refactor tiered list macro to extract duplicated code blocks#5683
Open
Nayab-Gauhar wants to merge 2 commits intocanonical:mainfrom
Open
chore(Tiered List): Refactor tiered list macro to extract duplicated code blocks#5683Nayab-Gauhar wants to merge 2 commits intocanonical:mainfrom
Nayab-Gauhar wants to merge 2 commits intocanonical:mainfrom
Conversation
Extract duplicated code blocks into private helper macros to improve maintainability. Created two private helper macros: - _vf_tiered_list_item_separator(): Renders the HR separator between list items - _vf_tiered_list_item(): Renders list item content with parameterized column classes This eliminates code duplication while maintaining the exact same functionality. Fixes canonical#5530
|
Nayab-Gauhar is not a collaborator of the repo |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the vf_tiered_list Jinja macro by extracting repeated list item rendering logic into reusable helper macros, improving code maintainability and reducing duplication.
Key changes:
- Introduced two private helper macros (
_vf_tiered_list_item_separatorand_vf_tiered_list_item) to encapsulate repeated HTML structure - Replaced duplicated list item rendering code with calls to the new helper macros
- Cleaned up formatting by removing extra blank lines and standardizing self-closing HR tags
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jmuzina
reviewed
Dec 1, 2025
Comment on lines
+25
to
+26
| <div class="{{ title_col_classes }}">{{ title_content }}</div> | ||
| <div class="{{ description_col_classes }}">{{ description_content }}</div> |
Member
There was a problem hiding this comment.
nitpick: can we only add the class attributes here if the class parameters are defined and have length > 0?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extract duplicated code blocks into private helper macros to improve maintainability.
Created two private helper macros:
_vf_tiered_list_item_separator(): Renders the HR separator between list items_vf_tiered_list_item(): Renders list item content with parameterized column classesThis eliminates code duplication while maintaining the exact same functionality.
Fixes #5530
Done
_vf_tiered_list_item_separator()macro_vf_tiered_list_item()macro with parameterized column classesQA
Check if PR is ready for release
Maintenance 🔨(suggested for this refactoring)package.jsonshould be updated (this is a maintenance/refactoring change, so a bugfix release x.x.X would be appropriate)