Skip to content

feat(date-picker): add restartable range selection#202

Open
singkia wants to merge 2 commits intocloudflare:mainfrom
singkia:codex/range-picker-predictable-selection
Open

feat(date-picker): add restartable range selection#202
singkia wants to merge 2 commits intocloudflare:mainfrom
singkia:codex/range-picker-predictable-selection

Conversation

@singkia
Copy link
Contributor

@singkia singkia commented Mar 10, 2026

Summary

  • add an opt-in rangeSelectionBehavior="restart" mode for DatePicker range selection
  • expose onRangeComplete so popover-based range pickers can close after the second click
  • add regression coverage and update the docs demos to use committed vs draft range state

Why

Popover range pickers should behave like a bounded form interaction: first click starts a draft, second click confirms the range, and the next click after completion should start a new draft instead of mutating the previously confirmed range.

Verification

  • pnpm --dir packages/kumo exec oxlint --config .oxlintrc.json src/components/date-picker/date-picker.tsx src/components/date-picker/date-picker.test.tsx --type-aware
  • pnpm --dir packages/kumo exec eslint src/components/date-picker/date-picker.tsx src/components/date-picker/date-picker.test.tsx src/components/date-picker/index.ts src/index.ts
  • pnpm --filter @cloudflare/kumo exec vitest run --project=unit src/components/date-picker/date-picker.test.tsx
  • pnpm --filter @cloudflare/kumo build

Notes

  • pnpm --filter @cloudflare/kumo-docs-astro exec astro check still reports unrelated existing echarts type errors outside the DatePicker docs files.

@Brayden
Copy link
Collaborator

Brayden commented Mar 17, 2026

Before we run the workflows on this PR do you mind updating all comments from Chinese into English so we can evaluate the text easier and also for the sake of consistency with the rest of the repository? :)

singkia added 2 commits March 18, 2026 15:31
Add an opt-in restart mode for range pickers so popover flows treat the next click after a completed range as a new draft instead of mutating the previous selection. Expose an onRangeComplete callback, add regression coverage, update the docs demos, and record the module changeset/documentation.
Remove the PR-specific CLAUDE.md file and file-level protocol headers from the date-picker changes so the branch stays aligned with the repository's normal documentation style.
@singkia singkia force-pushed the codex/range-picker-predictable-selection branch from 72433e3 to 266c779 Compare March 18, 2026 07:42
@singkia
Copy link
Contributor Author

singkia commented Mar 18, 2026

Updated. I removed the Chinese comments / PR-specific documentation scaffolding for consistency with the rest of the repo, rebased the branch onto current main, and re-ran the relevant local checks.

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