Skip to content

Fix TypeScript API contracts and component rendering - #32

Merged
elithrar merged 4 commits into
mainfrom
fix/typescript-component-api-review
Sep 5, 2026
Merged

elithrar merged 4 commits into
mainfrom
fix/typescript-component-api-review

Conversation

@elithrar

@elithrar elithrar commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Reviewed all 43 component modules and validated the following fixes:

  • Select and RadioGroup: bind selection props to their string-valued options. Select now infers string | null for single selection and string[] for multiple selection, rejects mismatched values, and preserves existing unparameterized SelectProps prop bags.
  • Slider, Accordion, and ToggleGroup: preserve Base UI generic parameters so callbacks retain scalar/range types, item types, and literal string unions.
  • Autocomplete: restore grouped-item inference and render the Base UI root through JSX instead of calling it directly. Preserve flat items, prop forwarding, and the existing open-on-input-click default.
  • Dialog, AlertDialog, and Popover: remove the inherited native title collision so their title slots accept React content as declared.
  • Empty: render children in the existing contents slot; preserve explicit contents precedence.
  • Switch: inherit disabled fieldset state, including nested fieldsets and disabled={false} children, and apply it to interaction and label styling.
  • Validation: compile consumer fixtures against source and emitted root/subpath package declarations, reject invalid API usage, add focused runtime/browser regressions, and ignore generated Playwright output so subsequent checks stay clean.
  • Update affected docs examples and include the review record with evidence, coverage, compatibility notes, and validation limitations.

Validation completed:

  • npm run check — format, lint, typecheck, and 54 tests pass.
  • npm run test:browser with PLAYWRIGHT_EXECUTABLE_PATH — all 23 tests pass; reviewed rendered captures at 1280, 768, 390, and 320 pixels.
  • npm run build, npm run build:docs, and npm run pack:check — pass, including consumer declarations with skipLibCheck: false, SSR imports, and bundle budgets.
  • Confirmed new type/runtime failures against the original code; the updated docs reproduce the missing Switch disabled state at all four widths before the fix.

The standard Playwright download timed out locally, so browser validation used a temporary npm-distributed Chromium executable. No browser dependency or version bump is included. Select/RadioGroup now intentionally reject non-string selections that cannot match their options.

Rendering fixes and docs simplification:

  • SegmentedMeter: a 50/100 value previously filled the entire track and zero-value segments left a divider. Fill now reflects the resolved maximum, with unused capacity visible.
  • Tabs: fix vertical orientation, long-label containment, and disabled-state styling. Preserve nested orientation and keyboard behavior. Restore the original undecorated content panel and horizontal spacing.
  • Toolbar: keep grouped controls within narrow containers and stack vertical groups while preserving input entry and arrow-key navigation.
  • Docs: remove the added vertical/nested/long-label tab cards, capacity-comparison and empty-meter card, and narrow/vertical toolbar cards. Keep the existing examples; show partial capacity in the existing segmented meter and disabled state in the existing tabs.
  • Regression coverage: move synthetic edge cases into isolated browser fixtures, excluded from the production docs. Retain all 12 rendering/interaction regressions.
  • Re-review: checked the other PR additions for redundant cards and filler. Grouped autocomplete, inherited disabled Switch, and brief API guidance remain within existing examples. Removed the superseded screenshot gallery.

The rendering review record documents the findings, rejected styling change, simplifications, and validation. Re-reviewed at 1280, 768, 390, and 320px with no document overflow. All 54 unit tests, 23 browser tests, library/docs builds, and package checks pass locally. A separate clean production docs build confirms the stress fixtures are excluded. Browser coverage is Chromium only.

Release: bump package.json and package-lock.json from 0.6.2 to 0.6.3. The existing main-branch release workflow validates the merged commit and creates v0.6.3.

@elithrar elithrar changed the title Fix TypeScript inference and component API contracts Fix TypeScript API contracts and component rendering Sep 5, 2026
@elithrar
elithrar merged commit dcb3425 into main Sep 5, 2026
1 check passed
@elithrar
elithrar deleted the fix/typescript-component-api-review branch September 5, 2026 08:55
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.

1 participant