fix(core/ix-date-picker): Several bugfixes - #2641
Conversation
✅ Deploy Preview for ix-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR updates ChangesDate Picker and Dropdown Keyboard Boundary Fixes
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant YearDropdown
participant DropdownFocus
participant DatePicker
User->>YearDropdown: ArrowDown on last year
YearDropdown->>DropdownFocus: Reach non-wrapping boundary
DropdownFocus->>DatePicker: onYearDropdownBoundaryFocus
DatePicker->>DatePicker: Extend year list and locate target
DatePicker-->>DropdownFocus: Return target year element
DropdownFocus->>YearDropdown: Focus target element
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the date-picker component to use short weekday names directly and removes the associated overflow styling. However, the review feedback points out a critical bug where changing to short weekday names breaks the calendar calculation when weekStartIndex is not zero, due to string matching on long weekday names. A mathematical approach is recommended to resolve this. Additionally, a changeset is required for these user-facing changes per the repository style guide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
🦋 Changeset detectedLatest commit: 7a56ec3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/core/src/components/date-picker/date-picker.tsx`:
- Around line 1096-1106: The weekday header list in the date picker can generate
duplicate VDOM keys when `setTranslations()` switches to narrow labels, since
`key={name}` may repeat across days. Update the `this.dayNames.map(...)` render
in `date-picker.tsx` to use a stable unique key based on the day position (for
example the `index`, or a composite key), so each weekday header remains
distinct across re-renders.
In `@packages/core/src/components/date-picker/test/date-picker.ct.ts`:
- Around line 278-301: Add a regression test for the double ArrowDown boundary
case in the date picker CT suite: the current ArrowDown-on-last-year test in the
date-picker test file only covers a single key press, but the review asks to
lock in the async boundary behavior noted in dropdown-focus.ts. Extend the
existing year-selection scenario by sending two ArrowDown presses back-to-back
without waiting between them at the last year boundary, and assert the focused
year advances correctly without re-entrant duplication or wrapping. Use the
existing regressionTest, yearSelection, and activeYear selectors to keep the
test close to the current coverage.
In `@packages/core/src/components/dropdown/dropdown-focus.ts`:
- Around line 211-234: The boundary-handling logic in the `ArrowDown` and
`ArrowUp` branches of `dropdown-focus.ts` is duplicated, so extract the repeated
index lookup, boundary check, `options.onBoundaryFocus` call, and
`setItemActive` update into a shared helper (for example inside
`handleDropdownFocus`) that accepts the direction and boundary condition. Then
have both branches call that helper so the `ArrowDown` and `ArrowUp` cases stay
aligned and only the boundary predicate differs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: dd612921-6c6b-4696-9571-ff9fa8cb5b45
⛔ Files ignored due to path filters (13)
packages/react/src/components/components.server.tsis excluded by!packages/react/src/components/**packages/vue/src/components/ix-dropdown-button.tsis excluded by!packages/vue/src/components/**packages/vue/src/components/ix-dropdown.tsis excluded by!packages/vue/src/components/**testing/visual-testing/__screenshots__/tests/date-picker/date-picker.e2e.ts/date-picker-locales-1-chromium---classic-dark-linux.pngis excluded by!**/*.pngtesting/visual-testing/__screenshots__/tests/date-picker/date-picker.e2e.ts/date-picker-locales-1-chromium---classic-light-linux.pngis excluded by!**/*.pngtesting/visual-testing/__screenshots__/tests/date-picker/date-picker.e2e.ts/date-picker-week-start-1-chromium---classic-dark-linux.pngis excluded by!**/*.pngtesting/visual-testing/__screenshots__/tests/date-picker/date-picker.e2e.ts/date-picker-week-start-1-chromium---classic-light-linux.pngis excluded by!**/*.pngtesting/visual-testing/__screenshots__/tests/datetime-picker/datetime-picker.e2e.ts/datetime-picker-basic-1-chromium---classic-dark-linux.pngis excluded by!**/*.pngtesting/visual-testing/__screenshots__/tests/datetime-picker/datetime-picker.e2e.ts/datetime-picker-basic-1-chromium---classic-light-linux.pngis excluded by!**/*.pngtesting/visual-testing/__screenshots__/tests/datetime-picker/datetime-picker.e2e.ts/datetime-picker-mobile-1-chromium---classic-dark-linux.pngis excluded by!**/*.pngtesting/visual-testing/__screenshots__/tests/datetime-picker/datetime-picker.e2e.ts/datetime-picker-mobile-1-chromium---classic-light-linux.pngis excluded by!**/*.pngtesting/visual-testing/__screenshots__/tests/datetime-picker/datetime-picker.e2e.ts/datetime-picker-show-week-numbers-1-chromium---classic-dark-linux.pngis excluded by!**/*.pngtesting/visual-testing/__screenshots__/tests/datetime-picker/datetime-picker.e2e.ts/datetime-picker-show-week-numbers-1-chromium---classic-light-linux.pngis excluded by!**/*.png
📒 Files selected for processing (10)
.changeset/date-picker-translation-truncation.md.changeset/date-picker-week-start.md.changeset/date-picker-year-dropdown-keyboard.mdpackages/core/src/components.d.tspackages/core/src/components/date-picker/date-picker.scsspackages/core/src/components/date-picker/date-picker.tsxpackages/core/src/components/date-picker/test/date-picker.ct.tspackages/core/src/components/dropdown-button/dropdown-button.tsxpackages/core/src/components/dropdown/dropdown-focus.tspackages/core/src/components/dropdown/dropdown.tsx
💤 Files with no reviewable changes (1)
- packages/core/src/components/date-picker/date-picker.scss
|



IX-4363
💡 What is the current behavior?
GitHub Issue Number: #2591
🆕 What is the new behavior?
🏁 Checklist
A pull request can only be merged if all of these conditions are met (where applicable):
pnpm test)pnpm lint)pnpm build, changes pushed)👨💻 Help & support
Summary by CodeRabbit
New Features
Bug Fixes