Skip to content

fix(core/ix-date-picker): Several bugfixes - #2641

Open
lzeiml wants to merge 14 commits into
mainfrom
bug/4363_weekday-name-overflow
Open

fix(core/ix-date-picker): Several bugfixes#2641
lzeiml wants to merge 14 commits into
mainfrom
bug/4363_weekday-name-overflow

Conversation

@lzeiml

@lzeiml lzeiml commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

IX-4363

💡 What is the current behavior?

  • Certain translations for weekdays get truncated
  • Using a custom weekStartIndex breaks the calender display in some months
  • Weekday translations always get sliced to 3 characters, even when it does not make sense in the locale
  • Endless scroll does not work with keyboard navigation
  • Selected months/years are not centered when opening their respective dropdown

GitHub Issue Number: #2591

🆕 What is the new behavior?

  • Use luxon 'short' and 'narrow' weekday names, depending on how much space the translation would use
  • Refactor calendar calculation
  • Fix endless scroll with keyboard navigation and avoid wrap around in the dropdown
  • Center month/year dropdown on the selected value on open

🏁 Checklist

A pull request can only be merged if all of these conditions are met (where applicable):

  • 🦮 Accessibility (a11y) features were implemented
  • 🗺️ Internationalization (i18n) - no hard coded strings
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully
  • 📕 Add or update a Storybook story
  • 📄 Documentation was reviewed/updated siemens/ix-docs
  • 🧪 Unit tests were added/updated and pass (pnpm test)
  • 📸 Visual regression tests were added/updated and pass (Guide)
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

Summary by CodeRabbit

  • New Features

    • Date picker now uses full weekday names for accessibility labels/titles while keeping compact visual weekday headers.
    • Month dropdown keyboard selection now scrolls the selected month into view.
    • Year and month dropdown keyboard navigation at list boundaries is improved to avoid disruptive focus wrap.
  • Bug Fixes

    • Fixed truncated weekday header labels in locales with longer translations.
    • Fixed calendar rendering when the week start is set to a non-default day.
    • Fixed ArrowDown on the last year to extend the list and move focus to the newly added year (no wrapping).

@netlify

netlify Bot commented Jul 7, 2026

Copy link
Copy Markdown

Deploy Preview for ix-storybook ready!

Name Link
🔨 Latest commit 7a56ec3
🔍 Latest deploy log https://app.netlify.com/projects/ix-storybook/deploys/6a58be832bb29d000884edbe
😎 Deploy Preview https://deploy-preview-2641--ix-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2d34337e-b2b1-447a-9d80-2f835ce15e80

📥 Commits

Reviewing files that changed from the base of the PR and between 4fa9b24 and 7a56ec3.

📒 Files selected for processing (2)
  • packages/core/src/components/date-picker/date-picker.tsx
  • packages/core/src/components/dropdown/dropdown-focus.ts

📝 Walkthrough

Walkthrough

This PR updates ix-date-picker weekday labels and calendar layout computation, adds non-wrapping dropdown keyboard navigation, and enables the year dropdown to extend beyond its final year. Type declarations, changesets, styling, and regression tests are included.

Changes

Date Picker and Dropdown Keyboard Boundary Fixes

Layer / File(s) Summary
Boundary focus types and keyboard logic
packages/core/src/components/dropdown/dropdown-focus.ts
Adds boundary-navigation types and callback handling for non-wrapping ArrowUp/ArrowDown behavior.
Dropdown/DropdownButton prop wiring and typings
packages/core/src/components/dropdown/dropdown.tsx, packages/core/src/components/dropdown-button/dropdown-button.tsx, packages/core/src/components.d.ts
Adds and forwards disableWrapFocusNavigation and onBoundaryFocus, with matching component and JSX typings.
Calendar layout and weekday rendering
packages/core/src/components/date-picker/date-picker.tsx, packages/core/src/components/date-picker/date-picker.scss, packages/core/src/components/date-picker/test/date-picker.ct.ts, .changeset/date-picker-translation-truncation.md, .changeset/date-picker-week-start.md
Uses grapheme-aware weekday labels, full accessible labels, index-based calendar calculation, updated weekday styling, and calendar-layout regression coverage.
Year dropdown integration
packages/core/src/components/date-picker/date-picker.tsx, packages/core/src/components/date-picker/test/date-picker.ct.ts, .changeset/date-picker-year-dropdown-keyboard.md
Extends the year list at the keyboard boundary, scrolls selected items into view, and tests ArrowDown behavior without focus wrapping.

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
Loading

Possibly related PRs

  • siemens/ix#2574: Updates related dropdown control and overlay-hierarchy code paths.

Suggested reviewers: nuke-ellington

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the PR, but "Several bugfixes" is too vague to describe the main change clearly. Use a more specific title such as fix(core/ix-date-picker): prevent weekday truncation and calendar/navigation bugs.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bug/4363_weekday-name-overflow

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/core/src/components/date-picker/date-picker.tsx Outdated
Comment thread packages/core/src/components/date-picker/date-picker.scss
@changeset-bot

changeset-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7a56ec3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@siemens/ix Patch
@siemens/ix-angular Patch
@siemens/ix-docs Patch
@siemens/ix-react Patch
@siemens/ix-vue Patch

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

@lzeiml lzeiml changed the title bug(core/ix-date-picker): Overflow truncation for certain locales bug(core/ix-date-picker): Several bugfixes Jul 9, 2026
@lzeiml
lzeiml marked this pull request as ready for review July 9, 2026 15:12

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 53d4b60 and 4fa9b24.

⛔ Files ignored due to path filters (13)
  • packages/react/src/components/components.server.ts is excluded by !packages/react/src/components/**
  • packages/vue/src/components/ix-dropdown-button.ts is excluded by !packages/vue/src/components/**
  • packages/vue/src/components/ix-dropdown.ts is 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.png is excluded by !**/*.png
  • testing/visual-testing/__screenshots__/tests/date-picker/date-picker.e2e.ts/date-picker-locales-1-chromium---classic-light-linux.png is excluded by !**/*.png
  • testing/visual-testing/__screenshots__/tests/date-picker/date-picker.e2e.ts/date-picker-week-start-1-chromium---classic-dark-linux.png is excluded by !**/*.png
  • testing/visual-testing/__screenshots__/tests/date-picker/date-picker.e2e.ts/date-picker-week-start-1-chromium---classic-light-linux.png is excluded by !**/*.png
  • testing/visual-testing/__screenshots__/tests/datetime-picker/datetime-picker.e2e.ts/datetime-picker-basic-1-chromium---classic-dark-linux.png is excluded by !**/*.png
  • testing/visual-testing/__screenshots__/tests/datetime-picker/datetime-picker.e2e.ts/datetime-picker-basic-1-chromium---classic-light-linux.png is excluded by !**/*.png
  • testing/visual-testing/__screenshots__/tests/datetime-picker/datetime-picker.e2e.ts/datetime-picker-mobile-1-chromium---classic-dark-linux.png is excluded by !**/*.png
  • testing/visual-testing/__screenshots__/tests/datetime-picker/datetime-picker.e2e.ts/datetime-picker-mobile-1-chromium---classic-light-linux.png is excluded by !**/*.png
  • testing/visual-testing/__screenshots__/tests/datetime-picker/datetime-picker.e2e.ts/datetime-picker-show-week-numbers-1-chromium---classic-dark-linux.png is excluded by !**/*.png
  • testing/visual-testing/__screenshots__/tests/datetime-picker/datetime-picker.e2e.ts/datetime-picker-show-week-numbers-1-chromium---classic-light-linux.png is 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.md
  • packages/core/src/components.d.ts
  • packages/core/src/components/date-picker/date-picker.scss
  • packages/core/src/components/date-picker/date-picker.tsx
  • packages/core/src/components/date-picker/test/date-picker.ct.ts
  • packages/core/src/components/dropdown-button/dropdown-button.tsx
  • packages/core/src/components/dropdown/dropdown-focus.ts
  • packages/core/src/components/dropdown/dropdown.tsx
💤 Files with no reviewable changes (1)
  • packages/core/src/components/date-picker/date-picker.scss

Comment thread packages/core/src/components/date-picker/date-picker.tsx
Comment thread packages/core/src/components/date-picker/test/date-picker.ct.ts
Comment thread packages/core/src/components/dropdown/dropdown-focus.ts
dmytro-halimov
dmytro-halimov previously approved these changes Jul 13, 2026
@danielleroux danielleroux changed the title bug(core/ix-date-picker): Several bugfixes fix(core/ix-date-picker): Several bugfixes Jul 16, 2026
@sonarqubecloud

Copy link
Copy Markdown

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