Sitelet https://github.com/sdcorejs/sdcorejs-angular/pull/70
Skip to content

feat(form-generic)!: rewrite builder and renderer on SdFormGenericSchema v1 (phase 1) - #70

Merged
sdcorejs merged 4 commits into
mainfrom
claude/form-builder-rewrite-3ed1e3
Oct 1, 2026
Merged

sdcorejs merged 4 commits into
mainfrom
claude/form-builder-rewrite-3ed1e3

Conversation

@sdcorejs

@sdcorejs sdcorejs commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 1 of the form-generic-schema-v1 contract. SdFormGenericSchema (pages → group → element) replaces SdFormGeneric, and sd-form-render and sd-form-builder are rebuilt on it.

Breaking for consumers. The SdFormGeneric schema, SdFeelExpression and the legacy expression and configuration exports are removed. CHANGELOG.md → [Unreleased] → ### Changed (BREAKING for consumers) has the before/after mapping and the full list of 20 removed runtime exports.

Changes

cea63493a: v19, showcase, docs and approved artifacts (336 files).

  • Pure core: a schema model with normalize/validate; a 3-tier layout picked from the form width (SD_FORM_GENERIC_BREAKPOINTS); one Filter evaluator for rules and form validations; structured value refs for catalog params and fill; a key rename that updates every structured reference; one source for presets, field defaults and display formats.
  • sd-form-render: [schema], a [(value)] model that never mutates its inputs, [form], [variables], [viewed], [breakpoint], [labelPlacement] and [keys]. validate() returns { valid, messages }, and upload() resolves params. Catalog results are cached per renderer instance.
  • sd-form-builder: [(schema)], Desktop / Tablet / Mobile span editing with inherited labels, newRow, Filter rules edited with sd-query-builder, and a preview through the real renderer.
  • provideSdFormGeneric({ catalogs, templates, htmlDefinitions, validators, breakpoints }) replaces SD_FORM_GENERIC_CONFIGURATION.
  • Core form controls (forms/**, assets/scss/core/form.scss), which form-generic needs:
    • labelPlacement: 'float' | 'top', default 'float';
    • sd-input type tel / url, with inputmode and autocomplete;
    • sd-label for / labelId;
    • sd-textarea minlength.
  • i18n for vi/en/ko/ja/zh, sd-form-generic.md, the CHANGELOG.md [Unreleased] entry and the showcase demo.
  • .sdcorejs/: the approved spec r2, architecture r2 and plan r3, with the superseded revisions and drafts (14 files).

11202efe2, 29e0e2a86 and a3e6d90e3: npm run sync output for v20, v21 and v22, 317 files each. The v22 files are normalized to LF.

Against main, the PR changes 1287 files: 306 added, 556 deleted and 425 modified (+128,368 / −66,685). About three quarters of the paths are generated mirrors.

Verification

All checks below ran on the clean head a3e6d90e, after the commits, with Node 22.22.3:

  • Karma, form-generic specs only: 285/285.
  • Full v19 suite, ng test sdcorejs-angular --watch=false --browsers=ChromeHeadlessCI --code-coverage: 6168/6168, exit 0 (Jasmine seed 775614).
  • Showcase npm test: 209/209.
  • These checks pass:
    • npm run test:scripts
    • npm run check:sync
    • lint, check:i18n, check:i18n-parity and check:scss-hex
    • the v22 LF check
  • ng build sdcorejs-angular passes on v19, v20, v21 and v22. The v20, v21 and v22 test suites did not run locally; the CI compatibility job runs them.
  • The form-generic docs-contract and folder-structure checks pass.
  • sdcorejs gates:
    • The validation map passes 38/38 cases.
    • Delivery convergence is CONVERGED, with receipt convergence-form-generic-schema-v1 (sha256:v1:14fe5e05…6f0c).
    • Branch-ready gave READY WITH WARNINGS. The warnings are covered in the reviewer notes.

An earlier full run on the same content, before the commits, had 2 SdImageEditor export tests time out under load. That spec passes 114/114 alone, and both later full runs passed. This is the load-sensitive flake also seen in #65, and this PR does not touch the image editor.

Risks and rollback

  • Breaking change. Apps that use SdFormGeneric, SdFeelExpression or the removed helpers and constants must migrate with the before/after mapping in the CHANGELOG.
  • Core form controls. Every new input defaults to the current behaviour, and form.scss only adds .sd-label-top rules. Existing forms keep their layout unless they opt in.
  • Nothing is published from this PR. npm publishing runs only on a release tag, and Pages deploys only from main.
  • Rollback: revert the merge, or the four commits.

Notes for reviewer

  • Review cea63493a. The three chore(sync) commits are generated, and npm run check:sync guards them.

  • main gained docs: fix module "Related" links and the showcase library note #69 (docs only) after this branch was cut. The branch still merges cleanly. CHANGELOG.md is the only file both sides changed, and the edits are in separate hunks.

  • The console.warn / console.error calls in the renderer are intentional. They report invalid schema input (an unsupported element type, a reserved key, an unregistered catalog or an invalid validation.pattern), and they log errors in error handlers.

  • The secret scan flags two things. Both are false positives:

    • the i18n key core.component.form-builder.preset.password;
    • a password-mask expectation in form-render.service.spec.ts.

    The git-secrets hooks passed on every commit and on the push.

  • Follow-up, not in this PR: the builder palette and the inspector still set currency: 'VND' and the default precisions as literals. They should read the shared display defaults.

🤖 Generated with Claude Code

nghiatt15 and others added 4 commits October 1, 2026 10:13
…ema v1 (phase 1)

Phase 1 of form-generic-schema-v1: SdFormGenericSchema (pages -> group ->
element, no schemaVersion) replaces SdFormGeneric, and sd-form-render and
sd-form-builder move to it.

- Pure core: schema model with normalize/validate, a 3-tier layout picked
  from the form width (SD_FORM_GENERIC_BREAKPOINTS), one Filter evaluator
  for rules and form validations, structured value refs for catalog params
  and fill, key rename that updates every structured reference, and one
  source for presets, field defaults and display formats.
- sd-form-render: [schema], [(value)] model that never mutates its inputs,
  [form], [variables], [viewed], [breakpoint], [labelPlacement], [keys];
  validate() returns { valid, messages } and upload() resolves params;
  catalog results are cached per renderer instance.
- sd-form-builder: [(schema)], Desktop | Tablet | Mobile span editing with
  inherited labels, newRow, Filter rules edited with sd-query-builder, and
  a preview through the real renderer.
- provideSdFormGeneric({ catalogs, templates, htmlDefinitions, validators,
  breakpoints }) replaces SD_FORM_GENERIC_CONFIGURATION.
- Core form controls: labelPlacement ('float' | 'top'), sd-input type
  tel/url, inputmode and autocomplete, sd-label for/labelId, textarea
  minlength.
- i18n for vi/en/ko/ja/zh, sd-form-generic.md, CHANGELOG [Unreleased] and
  the showcase demo.
- .sdcorejs: approved spec r2, architecture r2 and plan r3, with the
  superseded revisions and drafts.

The v20, v21 and v22 mirrors follow in the next three commits.

BREAKING CHANGE: the SdFormGeneric schema, SdFeelExpression and the legacy
expression and configuration exports are removed. CHANGELOG [Unreleased]
has the before/after mapping and the full list of removed exports.

Verification (worktree tree 6f3965c, the same content as this commit
series): Karma form-generic 285/285; full v19 suite with coverage
6168/6168 (the first run had 2 SdImageEditor export timeouts under load;
that spec alone passes 114/114); lint; check:i18n; check:i18n-parity;
check:scss-hex; showcase 209/209; test:scripts; check:sync; v22 LF check;
docs and structure checks; build v19, v20, v21 and v22.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm run sync from versions/v19 (cea6349): form-generic, Core form controls,
i18n and SYNC-STATUS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm run sync from versions/v19 (cea6349): form-generic, Core form controls,
i18n and SYNC-STATUS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm run sync from versions/v19 (cea6349): form-generic, Core form controls,
i18n and SYNC-STATUS. Files stay LF (eol=lf): the CRLF that sync writes on this checkout was normalized before verification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sdcorejs
sdcorejs merged commit 6e0509a into main Oct 1, 2026
6 checks passed
@sdcorejs
sdcorejs deleted the claude/form-builder-rewrite-3ed1e3 branch October 1, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants