Skip to content

fix(webkit): state Required as true/false across every spec props table - #874

Merged
isaque-bock-azion merged 4 commits into
mainfrom
docs/spec-required-boolean
Aug 10, 2026
Merged

fix(webkit): state Required as true/false across every spec props table#874
isaque-bock-azion merged 4 commits into
mainfrom
docs/spec-required-boolean

Conversation

@gabriel-lisboa-azion

@gabriel-lisboa-azion gabriel-lisboa-azion commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to @robsongajunior's review on #873: the Required column of a spec's Props table read yes / no while the Type and Default columns beside it read as literal values, so one table spelled the same boolean fact two ways. Every spec now says true / false, and .specs/_template.md teaches it (plus the escaping rule below) so the next spec does not regress.

Four things fall out of the sweep:

  • Seven specs carried unescaped pipes inside their union typesbutton, card-pricing, currency, icon-button, message, status-indicator, tag. A bare | closes the cell, so those rows render with extra columns on GitHub and their Required cell sat in the wrong column. The pipes are now escaped ('a' \| 'b'), which is also what made those cells reachable by the sweep.
  • Every checksum is recomputed. enforce-spec-exists hashes the spec body, so editing a table without re-hashing would block the next /component-create on that component.
  • catalog.json is rebuilt. build-catalog.mjs copies the Required cell verbatim, so the column change is catalog drift until it is regenerated.
  • The MCP usage-snippet generator needed a fix (src/mcp/queries.js): exampleProps matched the literal 'yes', so with true in the tables it stopped seeing any prop as required and fell back to leading scalars — box-grid-selection's generated snippet became modelValue="undefined" instead of :items="[]". It now accepts both spellings, so it reads correctly whichever specs have migrated. This is the one code change here; test/mcp/queries.test.mjs caught it, which is why the same fix also rides in feat(webkit): add the Hint component, Label's hint prop, and quieter field-* helpers #873.

.specs/_template.md is a shared doc, so per .claude/rules/git-workflow.md it ships here rather than riding along with #873. #873 already carries the column change for the 8 specs it touches (hint, label, field-text, field-select, field-password, field-text-switch, field-phone-number, field-input-group), so this PR deliberately leaves those files alone — no conflict either way.

No .vue, no story, no component behavior change. scroll-area, spinner and tab-view are untouched: their Props tables are _none_.

How to test

  1. grep -rE '\| *(yes|no) *\|' .specs/*.md → no hits.
  2. node -e over .specs/*.md with parseSpecFile + bodyChecksum from .claude/hooks/_lib/spec.mjs → every frontmatter checksum matches its body (verified: 0 mismatches across 82 specs).
  3. cd packages/webkit && node --test "test/mcp/*.test.mjs" → 28/28.
  4. node .claude/hooks/__tests__/run.mjs → 32/34, the same two pre-existing failures as main (legacy-whitelist + enforce-spec-exists fixture; both fail identically on a clean main checkout).
  5. Open .specs/button.md on GitHub → the Props table now renders 5 columns on every row.

Notes

  • Formatting is left exactly as each file had it. 75 specs already fail prettier --check on main and .specs/ is not covered by any format gate (webkit:format:check runs inside packages/webkit), so reformatting them would have buried this diff.
  • The catalog stores "required": "false" as a string, because build-catalog.mjs copies the cell text. Making it a real JSON boolean would read better but changes the catalog's shape for anything consuming it, so it is left alone here.

The Required column read yes/no while the Type and Default columns beside it
read as literal values, so one table spelled the same boolean fact two ways.
Every spec now says true/false, and the template teaches it so the next spec
does not regress.

Seven specs (button, card-pricing, currency, icon-button, message,
status-indicator, tag) carried unescaped pipes inside their union types, which
closed the cell early and rendered those rows with extra columns — and hid
their Required cell from this pass. Those pipes are now escaped.

Each frontmatter checksum is recomputed so enforce-spec-exists still matches
the body. No component code changes.
…ippets

exampleProps matched the literal 'yes', so once the spec tables said true the
generator stopped seeing any prop as required and picked leading scalars
instead — box-grid-selection's snippet became modelValue="undefined" instead
of :items="[]". Both spellings are now accepted, so the reader is correct
whichever spec files have migrated.
@gabriel-lisboa-azion gabriel-lisboa-azion changed the title docs(specs): state Required as true/false across every spec props table fix(webkit): state Required as true/false across every spec props table Aug 10, 2026
@isaque-bock-azion
isaque-bock-azion merged commit 173fc97 into main Aug 10, 2026
23 checks passed
@isaque-bock-azion
isaque-bock-azion deleted the docs/spec-required-boolean branch August 10, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants