A2UI icon indicating copy to clipboard operation
A2UI copied to clipboard

refactor: remove minimal catalog from renderers, keep in spec, and add simple basic samples

Open josemontespg opened this issue 6 months ago • 2 comments

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.json to 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 in v0_8, v0_9, and v0_10 specifications.
  • Restored the specification/v0_8/json/README.md description of the minimal catalog.
  • Copied all minimal examples to the basic/examples/ directory in v0_8, v0_9, and v0_10, naming them 00_simple-text.json, 00_row-layout.json, 00_interactive-button.json, 00_simple-login-form.json, 00_complex-layout.json (and 00_capitalized-text.json, 00_incremental.json for v0.9/v0.10).
  • Updated all copied JSON samples to use the basic catalog's catalogId instead of minimal (and removed catalogId in v0.8).
  • Added the capitalize function definition to the v0.9 and v0.10 basic catalogs, as it is used by the migrated 00_capitalized-text.json example.

2. Angular Renderer (Cleaned up Minimal, Added Simple Basic Tests)

  • Updated generate-examples.mjs to only build the basic catalog.
  • Restored the (basic) suffix logic in generate-examples.mjs for 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.ts unchanged (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.tsx mock modules and assertions to use custom catalog instead of minimal.
  • Validated that all 446 React vitests pass successfully.

4. Documentation

  • Kept specification/v0_9/docs/renderer_guide.md Agent 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.md references to point to v0.9 basic.

TAG=agy CONV=9137c307-af0d-4380-8e89-52054dd1fcb0

josemontespg avatar May 26 '26 22:05 josemontespg

Split this in two. Please take a look.

Child PR: #1562

josemontespg avatar Jun 05 '26 22:06 josemontespg

Tests are passing now. Fixed schema validation error in v1.0 basic catalog (moved returnType to root level). Ready for review.

josemontespg avatar Jun 09 '26 23:06 josemontespg