diff --git a/CHANGELOG.md b/CHANGELOG.md index 02d75ca..2351a17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,11 @@ This format follows Keep a Changelog principles and aims for Semantic Versioning ## [Unreleased] ### Added +- **Template Validation Tests**: Comprehensive test suite for HTML/Jinja2 templates + - Validates Jinja2 syntax across all templates + - Checks HTML structure (balanced tags, unique IDs, proper attributes) + - Basic accessibility validation (alt text, form labels, button types) + - Regression prevention thresholds to maintain code quality - **Code Quality Tools**: Enhanced development tooling for maintainability - Automated utilities for code cleanup - Improved type checking configuration @@ -81,6 +86,10 @@ This format follows Keep a Changelog principles and aims for Semantic Versioning - Optimized linting rules for development workflow ### Fixed +- **Template Quality**: Resolved HTML structure issues found by validation tests + - Fixed duplicate ID attributes in build wizard and theme picker templates + - Removed erroneous block tags from component documentation + - Corrected template structure for HTMX fragments - **Code Quality**: Resolved type checking warnings and improved code maintainability - Fixed type annotation inconsistencies - Cleaned up redundant code quality suppressions diff --git a/RELEASE_NOTES_TEMPLATE.md b/RELEASE_NOTES_TEMPLATE.md index e21aec0..f03d5c5 100644 --- a/RELEASE_NOTES_TEMPLATE.md +++ b/RELEASE_NOTES_TEMPLATE.md @@ -3,9 +3,14 @@ ## [Unreleased] ### Summary -Web UI improvements with Tailwind CSS migration, TypeScript conversion, component library, enhanced code quality tools, and optional card image caching for faster performance and better maintainability. +Web UI improvements with Tailwind CSS migration, TypeScript conversion, component library, template validation tests, enhanced code quality tools, and optional card image caching for faster performance and better maintainability. ### Added +- **Template Validation Tests**: Comprehensive test suite ensuring HTML/template quality + - Validates Jinja2 syntax and structure + - Checks for common HTML issues (duplicate IDs, balanced tags) + - Basic accessibility validation + - Prevents regression in template quality - **Code Quality Tools**: Enhanced development tooling for maintainability - Automated utilities for code cleanup - Improved type checking configuration @@ -78,6 +83,10 @@ Web UI improvements with Tailwind CSS migration, TypeScript conversion, componen _None_ ### Fixed +- **Template Quality**: Resolved HTML structure issues + - Fixed duplicate ID attributes in templates + - Removed erroneous template block tags + - Corrected structure for HTMX fragments - **Code Quality**: Resolved type checking warnings and improved code maintainability - Fixed type annotation inconsistencies - Cleaned up redundant code quality suppressions diff --git a/code/web/templates/build/_step1.html b/code/web/templates/build/_step1.html index 0f54ecd..dfea715 100644 --- a/code/web/templates/build/_step1.html +++ b/code/web/templates/build/_step1.html @@ -66,8 +66,8 @@ {% endif %} {% if (query is defined and query and (not candidates or (candidates|length == 0))) and not inspect %} -
- No results for “{{ query }}”. Try a shorter name or a different spelling. +
+ No results for "{{ query }}". Try a shorter name or a different spelling.
{% endif %} diff --git a/code/web/templates/docs/components.html b/code/web/templates/docs/components.html index e8cca98..a6d83f5 100644 --- a/code/web/templates/docs/components.html +++ b/code/web/templates/docs/components.html @@ -33,7 +33,6 @@
{% call panel(title='Buttons', padding='lg') %} - {% block body %}

Button Variants

@@ -76,16 +75,14 @@
{{ button('Go Home', href='/', variant='ghost') }} {{ button('Build Deck', href='/build', variant='primary') }} -
+ - {% endblock %} {% endcall %}
{% call panel(title='Modals', padding='lg') %} - {% block body %}

Click buttons to see modal examples

@@ -104,14 +101,12 @@ {{ button('XLarge (960px)', onclick='showSizedModal("xl")') }}
- {% endblock %} {% endcall %}
{% call panel(title='Form Components', padding='lg') %} - {% block body %}
@@ -147,14 +142,12 @@
- {% endblock %} {% endcall %}
{% call panel(title='Card Display Components', padding='lg') %} - {% block body %}

Card Thumbnail Sizes

@@ -179,14 +172,12 @@ {'name': 'Birds of Paradise', 'role': 'ramp', 'tags': ['Ramp', 'Creature']} ], size='medium', columns=3) }} - {% endblock %} {% endcall %}
{% call panel(title='Panel Components', padding='lg') %} - {% block body %}

Panel Variants

{{ simple_panel(title='Default Panel', content='

This is a default panel with standard background.

', variant='default') }} @@ -232,14 +223,12 @@

Collapsible Panel

{% call collapsible_panel(title='Advanced Options', expanded=False) %} - {% block body %}

These are advanced settings that are hidden by default.

- {% endblock %} {% endcall %}

Empty State

@@ -254,7 +243,6 @@

Loading State

{{ loading_panel(message='Building deck...', spinner=True) }} - {% endblock %} {% endcall %}
diff --git a/code/web/templates/partials/_forms.html b/code/web/templates/partials/_forms.html index 560c807..6a47c55 100644 --- a/code/web/templates/partials/_forms.html +++ b/code/web/templates/partials/_forms.html @@ -17,9 +17,9 @@ Examples: {% call form_field('Email', 'email', required=True) %} - {% block body %} + - {% endblock %} + {% endcall %} #} {% macro form_field(label='', name='', required=False, help_text='', error='', classes='') %} @@ -72,7 +72,7 @@ #} {% macro text_input(name, label='', type='text', value='', placeholder='', required=False, disabled=False, readonly=False, help_text='', error='', classes='', attrs='') %} {% call form_field(label, name, required, help_text, error, classes) %} - {% block body %} + - {% endblock %} + {% endcall %} {% endmacro %} @@ -110,7 +110,7 @@ #} {% macro textarea(name, label='', value='', placeholder='', rows=4, required=False, disabled=False, readonly=False, help_text='', error='', classes='', attrs='') %} {% call form_field(label, name, required, help_text, error, classes) %} - {% block body %} + - {% endblock %} + {% endcall %} {% endmacro %} @@ -148,7 +148,7 @@ #} {% macro select(name, label='', options=[], value='', required=False, disabled=False, help_text='', error='', classes='', attrs='') %} {% call form_field(label, name, required, help_text, error, classes) %} - {% block body %} + - {% endblock %} + {% endcall %} {% endmacro %} @@ -295,7 +295,7 @@ #} {% macro number_input(name, label='', value='', min='', max='', step=1, placeholder='', required=False, disabled=False, help_text='', error='', classes='', attrs='') %} {% call form_field(label, name, required, help_text, error, classes) %} - {% block body %} + - {% endblock %} + {% endcall %} {% endmacro %} @@ -333,7 +333,7 @@ #} {% macro file_input(name, label='', accept='', multiple=False, required=False, disabled=False, help_text='', error='', classes='', attrs='') %} {% call form_field(label, name, required, help_text, error, classes) %} - {% block body %} + - {% endblock %} + {% endcall %} {% endmacro %} diff --git a/code/web/templates/themes/picker.html b/code/web/templates/themes/picker.html index c596ad5..374ddd7 100644 --- a/code/web/templates/themes/picker.html +++ b/code/web/templates/themes/picker.html @@ -77,7 +77,6 @@ {% endif %}
-