Files
PraisonAIUI/test_validation.py
f56cbf6243 fix: compile enterprise config fields to frontend (fixes #64) (#90)
* feat: implement ConfigFeatureRegistry to fix schema-runtime gap

- Add ConfigFeatureRegistry to track implementation status of config fields
- Enhance validation with --strict flag warning about experimental fields
- Update compiler to emit seo/a11y configs to ui-config.json
- Add logoImage support in Header component
- SEO tags generation now uses configured title template and OG image
- Runtime warnings for experimental fields (i18n)
- Maintains backward compatibility with existing configs

Fixes #64

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>

* feat: fix multi-layer config contract - emit enterprise fields to frontend (fixes #64)

- Update compiler to emit seo, i18n, a11y, logo fields to ui-config.json
- Add TypeScript interfaces for enterprise config fields
- Enhance Header component to support logo configuration (light/dark variants)
- Add SkipLink component for accessibility with conditional rendering
- Enhance SEO meta tag generation with titleTemplate and Twitter config
- Add strict validation mode for experimental features
- All fields now flow properly: YAML → Pydantic → ui-config → Frontend

Co-authored-by: Mervin Praison <[email protected]>

* fix: address critical architecture and accessibility issues

- Fix double-templating bug in SEO title generation (compiler.py:581)
- Improve skip link accessibility by targeting Content component only
- Add logo fallback logic for missing theme variants
- Simplify title template parsing with sequential replace
- Correct CLI flag reference in validation error messages
- Exclude metadata fields from unimplemented feature validation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mervin Praison <[email protected]>
Co-authored-by: Mervin Praison <[email protected]>
Co-authored-by: Claude <[email protected]>
2026-06-15 15:46:04 +01:00

33 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""Test script to demonstrate the new validation functionality."""
import yaml
from pathlib import Path
from praisonaiui.schema.models import Config
from praisonaiui.schema.validators import validate_config
# Test with the 11-full-featured example
config_path = Path("examples/yaml/11-full-featured/aiui.template.yaml")
if config_path.exists():
with open(config_path) as f:
data = yaml.safe_load(f)
cfg = Config.model_validate(data)
# Test regular validation
result = validate_config(cfg, config_path.parent)
print(f"Regular validation: {'✓ PASS' if result.valid else '✗ FAIL'}")
# Test strict validation
result_strict = validate_config(cfg, config_path.parent, strict=True)
print(f"Strict validation: {'✓ PASS' if result_strict.valid else '✗ FAIL'}")
if not result_strict.valid:
print("\nStrict validation errors:")
for error in result_strict.errors:
print(f" [{error.category}] {error.message}")
if error.suggestion:
print(f" 💡 {error.suggestion}")
else:
print(f"Config file not found: {config_path}")