Skip to content

Conversation

@garrity-miepub
Copy link
Contributor

  • 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 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

business-hour-editor-update.mov

- 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
Copilot AI review requested due to automatic review settings January 31, 2026 03:00
@garrity-miepub garrity-miepub marked this pull request as ready for review January 31, 2026 03:00
Copy link

Copilot AI left a 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 unimplemented use24Hour prop from Storybook docs.
  • Adds default args for remaining controls so toggles/text start with concrete values.
  • Adds a useEffect in the wrapper to sync internal schedule state when props.value changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 31, 2026

Deploying ui with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copy link

Copilot AI left a 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.

@garrity-miepub garrity-miepub merged commit bbf2f1f into main Jan 31, 2026
10 checks passed
@garrity-miepub garrity-miepub deleted the feature/business-hours-editor-updates branch January 31, 2026 03:25
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