-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/business hours editor updates #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add meta.args with defaults for disabled, showDescription, use24Hour, weekStartsOn, addHoursLabel - Remove hardcoded showDescription from wrapper - Clean up redundant args in individual stories
…nal props
- Hide 'value', 'onChange', 'className' controls from Storybook docs
- Clicking 'Set object' on value control caused 'schedule.find is not a function'
error because Storybook defaults to {} (object) instead of [] (array)
- These props are managed by the interactive wrapper component
- Hide 'use24Hour' control - prop exists in interface but is not implemented
- Component uses native <input type='time'> which uses browser locale
- Prop is destructured as _use24Hour (intentionally unused)
- Can be implemented in future if 24-hour format support is needed
- Add default args for remaining controls (disabled, showDescription, weekStartsOn, addHoursLabel)
- Ensures boolean controls start with actual values instead of undefined
- Add useEffect to sync schedule state when props.value changes from Storybook controls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates the BusinessHoursEditor Storybook stories to better reflect how the component is meant to be used (via an interactive wrapper) and to prevent problematic controls from causing runtime errors.
Changes:
- Hides wrapper-managed props (
value,onChange,className) and the unimplementeduse24Hourprop from Storybook docs. - Adds default
argsfor remaining controls so toggles/text start with concrete values. - Adds a
useEffectin the wrapper to sync internal schedule state whenprops.valuechanges.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/components/BusinessHoursEditor/BusinessHoursEditor.stories.tsx
Outdated
Show resolved
Hide resolved
Address Copilot review feedback: spread props was overriding controlled state. Now destructure value and onChange from props before spreading restProps, ensuring the wrapper's controlled state is always used.
Deploying ui with
|
| Latest commit: |
81cf750
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ac685672.ui-6d0.pages.dev |
| Branch Preview URL: | https://feature-business-hours-edito.ui-6d0.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Hide 'value', 'onChange', 'className' controls from Storybook docs
error because Storybook defaults to {} (object) instead of [] (array)
Hide 'use24Hour' control - prop exists in interface but is not implemented
Add default args for remaining controls (disabled, showDescription, weekStartsOn, addHoursLabel)
Add useEffect to sync schedule state when props.value changes from Storybook controls
business-hour-editor-update.mov