Skip to content

chore(skill): close create-core-component gaps surfaced by Date Input#1898

Merged
im-shiv merged 1 commit into
createCoreComponentSkillfrom
enhance-skill
Jun 9, 2026
Merged

chore(skill): close create-core-component gaps surfaced by Date Input#1898
im-shiv merged 1 commit into
createCoreComponentSkillfrom
enhance-skill

Conversation

@im-shiv

@im-shiv im-shiv commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

Closes gaps in the create-core-component skill that were surfaced while building and reviewing the Date Input component (PR #1881). Every defect found in that component traced back to a missing or actively-misleading instruction in the skill — this PR updates the skill (workflow, references, validator) so future components don't repeat them.

Gaps identified & addressed

1. Runtime view-JS override contract was missing / wrong (root cause of most runtime bugs)

  • The accessibility checklist instructed overriding updateValidity/updateEnabled/updateReadOnly to only set ARIA/disabled, with no mention of calling super — which silently drops the base behaviour (data-cmp-* attributes, error-message rendering, --filled/--empty).
  • Added references/runtime-view-js.md documenting the full FormFieldBase override contract: call super.<handler>(value, state) first; an overridden updateValue must call updateEmptyStatus(); setModelValue is not echoed back to the originating field.
  • Rewrote the checklist's "JS View Methods" table and SKILL.md Phase 4 accordingly.

2. No guidance for composite / split widgets

  • The focus-clobber bug (typing 2024024) and stray submitted sub-field params came from having no pattern for multi-input widgets.
  • Added a "Composite / split widget" base-class category and a dedicated section: one hidden combined input carries the value + name; never put name on visible sub-inputs; never repopulate a sub-input the user is actively editing.

3. Cypress tests were entirely absent from the skill

  • The skill only covered unit tests + exporter JSON, so HTL/view-JS/dialog/sync bugs were never caught.
  • Added references/cypress-tests.md (required runtime + authoring specs, IT content, formsConstants.js entry, runtime-all embed) plus the two Cypress gotchas: hidden inputs fail be.visible; chained should('(not.)have.attr') breaks because the first yields the attribute value.

4. Broken aria-labelledby pattern

  • The shared label template emits no id, so aria-labelledby="...__label" references a non-existent element. Documented; grouped widgets must use aria-label.

5. BEM modifier classes with no CSS

  • hideTitleDate shipped a --hidden class that had no styling (dead feature). Added the rule: every emitted modifier must have a matching CSS rule; never ship an empty design dialog.

6. Editor-JS safety & i18n

  • Use textContent not innerHTML; don't wrap locale-neutral format strings in Granite.I18n.get; wrap hard-coded default UI text with @ i18n.

7. Incomplete/incorrect file checklist (component-anatomy.md)

  • Was missing the Cypress specs, _cq_styleConfig, the runtime-all embed and the formsConstants.js entry; had the wrong IT-content path and listed .less instead of .css. Corrected.

8. Validator (scripts/validate_component.py) extended with 4 new check categories

  • view-JS override contract (super on update*, updateEmptyStatus in updateValue)
  • editor-JS innerHTML usage
  • BEM modifier classes have a CSS rule + empty-design-dialog warning
  • Cypress specs / formsConstants entry / runtime-all embed existence + Cypress-gotcha lints

Types of changes

  • Skill / tooling improvement (no runtime component code changed)

Update the create-core-component skill so the defects found while building and
reviewing the Date Input component (PR #1881) can't recur:

- runtime-view-js.md (new): the FormFieldBase override contract — call super on
  update* handlers, updateEmptyStatus() in overridden updateValue, and the
  composite/split-widget rules (hidden combined input, name only on combined,
  don't repopulate a focused sub-input)
- cypress-tests.md (new): required runtime + authoring specs, IT content,
  formsConstants entry and runtime-all embed, plus the hidden-input visibility
  and chained should('(not.)have.attr') gotchas
- accessibility-checklist.md: rewrite the misleading "JS View Methods" table to
  require super; document the broken aria-labelledby (label template emits no id)
- component-anatomy.md: add Cypress specs, _cq_styleConfig, runtime-all embed and
  formsConstants to the checklist; fix the IT path and .less -> .css; add the
  composite-widget base-class category
- SKILL.md: HTL i18n / no-name-on-sub-inputs / BEM-modifier-needs-CSS notes,
  editor-JS textContent + format-string rules, a Cypress runtime-verification
  phase, and new Critical Rules
- validate_component.py: new checks for the override contract, editor-JS
  innerHTML, BEM modifiers without CSS, empty design dialogs, and Cypress
  spec/wiring existence + gotcha lints

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@im-shiv im-shiv mentioned this pull request Jun 8, 2026
8 tasks

@armaang1729 armaang1729 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks for updating these skills.

@im-shiv im-shiv merged commit aadaa6e into createCoreComponentSkill Jun 9, 2026
3 of 6 checks passed
@im-shiv im-shiv deleted the enhance-skill branch June 9, 2026 10:26
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