Skip to content

Conversation

@roberttran-cc
Copy link
Member

@roberttran-cc roberttran-cc commented Oct 24, 2025

What does this PR do?

  • add a cc-range-selector component
  • add a cc-range-selector-option sub component
  • add a range-selector-dragging-controller to manage drag selection state
  • add a trimArray utility function to src/lib/utils.js with comprehensive tests
  • add CcRangeSelectEvent to common.events.js
  • add CcRangeSelectorSelectCustom event for custom option selection
  • add i18n translations (EN/FR) for error messages and UI labels
  • integrate cc-range-selector in the form demo sandbox

How to review?

  • check the commits
  • check the stories in the preview
    • test both modes: 'single' for radio-like selection and 'range' for drag selection
    • test the drag interaction: mousedown → drag → mouseup (range mode)
    • test keyboard navigation
    • test the custom option feature with show-custom attribute
  • play with the sandbox

What's to discuss

Feel free to challenge/comment on the following points:

  • the component name (cc-range-selector)
  • the property naming: mode, selection, showCustom
  • the boundary-based selection approach ({ startValue, endValue }) vs storing full array
    • this optimizes memory but requires deriving the full array when needed
  • the drag interaction pattern: clear → preview → apply (with rollback on outside click)
    • single-click without drag doesn't create a selection in range mode
  • the handling of disabled options within a selected range:
    • they're visually included in the range
    • but excluded from form submission and the values array
    • disabled options at range boundaries are automatically trimmed on initialization
  • the custom option button behavior:
    • clears current selection
    • dispatches custom event for parent handling
    • prevents multiple activations

@roberttran-cc roberttran-cc self-assigned this Oct 24, 2025
@roberttran-cc roberttran-cc changed the title feat(cc-range-selector-option): init component feat(cc-range-selector): init component Oct 24, 2025
@roberttran-cc roberttran-cc force-pushed the cc-range-selector/init branch from c879094 to c6a2353 Compare October 24, 2025 15:14
@github-actions
Copy link
Contributor

🔎 A preview has been automatically published : https://clever-components-preview.cellar-c2.services.clever-cloud.com/cc-range-selector/init/index.html.

This preview will be deleted once this PR is closed.

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