A2UI
A2UI copied to clipboard
refactor: remove minimal catalog from renderers, keep in spec, and add simple basic samples
refactor: remove minimal catalog from renderers, keep in spec, and add simple basic samples
Following the review feedback and discussion on #1432:
- We proposed to keep the minimal catalog and examples in the specification for historical/bootstrap reference.
- However, we completely remove all minimal catalog usage and logic from the renderer packages (Angular and React) to eliminate maintenance burden and "catalog ID override" hacks.
- To ensure that developers still have very simple entry-point examples in the standard Basic Catalog, we have copied the simple minimal examples into the basic catalog examples directory (prefixed with
00_so they sort first). - The simple login form example has been renamed to
00_simple-login-form.jsonto avoid name collisions with the original, more complex basic login form (09_login-form.json). - Re-added the simple tests in Angular as basic
00_tests, loading from the basic catalog. This successfully proves that renderers can load these simple examples seamlessly from the basic catalog.
Issue #1432
Summary of Changes
1. Specification (Kept Minimal Catalog, Added Simple Basic Samples)
- Restored the
minimal/directories inv0_8,v0_9, andv0_10specifications. - Restored the
specification/v0_8/json/README.mddescription of the minimal catalog. - Copied all minimal examples to the
basic/examples/directory inv0_8,v0_9, andv0_10, naming them00_simple-text.json,00_row-layout.json,00_interactive-button.json,00_simple-login-form.json,00_complex-layout.json(and00_capitalized-text.json,00_incremental.jsonfor v0.9/v0.10). - Updated all copied JSON samples to use the
basiccatalog'scatalogIdinstead ofminimal(and removedcatalogIdin v0.8). - Added the
capitalizefunction definition to the v0.9 and v0.10 basic catalogs, as it is used by the migrated00_capitalized-text.jsonexample.
2. Angular Renderer (Cleaned up Minimal, Added Simple Basic Tests)
- Updated
generate-examples.mjsto only build thebasiccatalog. - Restored the
(basic)suffix logic ingenerate-examples.mjsfor v0.8 to match existing test expectations. - Removed all obsolete JSDoc comment blocks in
generate-examples.mjs. - Deleted the redundant v0.8 minimal spec files (re-added as
00_basic tests). - Recovered those tests as new
00_basic spec files (e.g.,00_simple-text.spec.ts,00_simple-login-form.spec.ts), loading from the basic catalog. - Kept the original 28 basic v0.8 spec files and
test_utils.tsunchanged (retaining their(basic)suffixes) to minimize the number of edited files in the PR. - Validated that all 191 Angular explorer tests pass successfully.
3. React Renderer (Updated Tests)
- Updated
renderers/react/tests/a2ui_explorer/examples.test.tsxmock modules and assertions to usecustomcatalog instead ofminimal. - Validated that all 446 React vitests pass successfully.
4. Documentation
- Kept
specification/v0_9/docs/renderer_guide.mdAgent Guide steps updated to target the foundational subset of the Basic Catalog directly, which is much cleaner for new implementations. - Updated
renderers/lit/a2ui_explorer/README.mdreferences to point to v0.9 basic.
TAG=agy CONV=9137c307-af0d-4380-8e89-52054dd1fcb0
Split this in two. Please take a look.
Child PR: #1562
Tests are passing now. Fixed schema validation error in v1.0 basic catalog (moved returnType to root level). Ready for review.