fix(select): align contract and runtime behavior#304
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
Summary
Align the public
selectcontract with the inline cycler runtime by removing an unsupported error prop, unifying placeholder fallback behavior, and updating the docs and catalog to describe the real interaction model.Problem
selectdocs described a dropdown-style widget while the shipped runtime behaved like an inline cycler. The public type surface also exposedSelectProps.erroreven though the renderer never consumed it, and helper logic, renderer output, and focus metadata disagreed about what to show when the current value did not match any option.Root cause
The contract, docs, and runtime helpers drifted independently. Placeholder fallback behavior was implemented separately in multiple places, and the public type surface kept an unimplemented prop that was never wired through rendering.
Fix
Remove the unsupported
SelectProps.errorprop, route display text through a single helper for renderer and focus metadata fallback, add regression coverage for Enter and Space advancing the inline cycler and for placeholder fallback in widget metadata, and update the widget docs and catalog to match the controlled inline-cycler API.Tests
npm install --prefer-offline
npm run lint
npm run typecheck
npm run build
node scripts/run-tests.mjs --filter "formWidgets.test.js"
node scripts/run-tests.mjs --filter "widgetMeta.test.js"
node scripts/run-tests.mjs --filter "widgetRenderer.integration.test.js"
node scripts/run-tests.mjs
Notes
This keeps the existing inline cycler behavior intentionally; it does not introduce popup or overlay behavior.
Summary by CodeRabbit
New Features
focusable,accessibleLabel,focusConfig,dsVariant,dsTone,dsSizeonChangeis now optional rather than requiredBug Fixes
Tests