Skip to content

fix(core/date-dropdown): discard pending ranges on dismissal - #2862

Closed
shin4141 wants to merge 2 commits into
siemens:mainfrom
shin4141:codex/ix-2772-discard-pending-range
Closed

shin4141 wants to merge 2 commits into
siemens:mainfrom
shin4141:codex/ix-2772-discard-pending-range

Conversation

@shin4141

@shin4141 shin4141 commented Oct 5, 2026 •

Copy link
Copy Markdown

Problem

Dismissing ix-date-dropdown commits an unfinished custom range. Clicking Done also emits the confirmed range twice because closing the dropdown confirms it again.

Change

Keep the last confirmed range and restore it on dismissal. Done confirms once; explicit preset selections and programmatic range updates remain applied. Bind the calendar to the current range so reopening shows the restored selection. Include a patch changeset.

Validation

  • Unmodified main: existing date-dropdown tests 11/11 pass; the five new behavioral regressions fail.
  • Final patch: date-dropdown 17, date-picker 36, and dropdown 58 tests pass (111 total, Chromium, no retries).
  • ESLint passes with three existing warnings; Prettier and git diff --check pass.

Scope and limits

No new API, clear button, styling, or dependency changes. Tested on Node 22.19.0 with the development build. Production builds of both unmodified and patched source were killed in the 4 GB local environment; production build, full-suite and framework-app validation remain unverified.

Summary by CodeRabbit

Summary

  • Bug Fixes
    • Custom date-range edits remain pending until confirmed. Dismissing the dropdown with Escape or an outside click discards unconfirmed changes without emitting a change event.
    • Selecting Done commits the range and emits a single change event.
    • Explicitly selected presets and externally updated date ranges remain intact when the dropdown is dismissed.

@shin4141
shin4141 requested a review from a team as a code owner October 5, 2026 01:20
@shin4141
shin4141 requested a review from lzeiml October 5, 2026 01:20
@changeset-bot

changeset-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e36de6e

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

This PR includes changesets to release 4 packages
Name Type
@siemens/ix Patch
@siemens/ix-angular 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

@netlify

netlify Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for ix-storybook ready!

Name Link
🔨 Latest commit 6b99b06
🔍 Latest deploy log https://app.netlify.com/projects/ix-storybook/deploys/6ad0e068e7f4f45e58c07407
😎 Deploy Preview https://deploy-preview-2862--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 Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: siemens/ix/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 55e35c72-31de-41fc-bf6e-dded2bfb69bb
📥 Commits

Reviewing files that changed from the base of the PR and between e36de6e and 6b99b06.

⛔ Files ignored due to path filters: 1
  • packages/angular/standalone/src/components.ts is excluded by !packages/angular/standalone/src/components.ts
📒 Files selected for processing: 3
  • packages/angular/src/components.ts
  • packages/core/src/components.d.ts
  • packages/core/src/components/date-dropdown/test/date-dropdown.ct.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

The date dropdown tracks confirmed ranges separately from pending edits. Done commits the edited range and emits a change event. Dismissal discards pending edits without an event. Preset selections and external range updates remain committed.

Changes: Date range confirmation

Layer / File(s) Summary
Range confirmation and dismissal
packages/core/src/components/date-dropdown/date-dropdown.tsx, packages/core/src/components/date-dropdown/test/date-dropdown.ct.ts, packages/angular/src/components.ts, packages/core/src/components.d.ts, .changeset/date-dropdown-discard-pending-range.md
The dropdown snapshots confirmed ranges and restores them on dismissal without emitting a change event. Done confirms the current range, and preset selections and external range updates remain committed. The date picker receives the current range directly. Tests cover dismissal, confirmation, presets, external updates, and accessibility. The API documentation and changeset describe the behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: alexkaduk

Merge Risk: ⚪ Minimal · up to 6b99b

Unconfirmed date-range edits are discarded on dismissal while confirmed selections are retained. No actionable merge risk is established by the available review evidence.

Security architecture risk: ⚪ Minimal · up to 6b99b

The change separates tentative date selections from confirmed values and prevents dismissal from committing unfinished edits. The reviewed changes introduce no material security risk, new privileges, or privileged operations.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The directly affected scope is each dropdown instance and consumers of its dateRangeChange event. The public declaration edits do not themselves expand reachability, permissions, tenant scope, or service exposure.

Resilience and Maintainability Implications

  • observed — Updating confirmed state before public emission and making dismissal restoration-only removes the close-induced duplicate commit path. Regression assertions cover outside-click and Escape dismissal, reopening, single-event confirmation, and preservation of external updates.
Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: discarding pending date ranges when the date dropdown is dismissed.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
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 unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@CLAassistant

CLAassistant commented Oct 12, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@lzeiml lzeiml left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I removed the "Fixes #2772" from the PR description, because this would cause the issue to close on PR merge. We only add this inside the changeset (like you did aswell), so the issue gets closed once the fix is actually released.

@lzeiml lzeiml left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I just ran the pipeline and the build seems to be failling because of diff error. This is usually caused by not committing changes to the components file. Please run pnpm build on your local environment and commit the changes.

@sonarqubecloud

Copy link
Copy Markdown

@benjgil

benjgil commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Hi @shin4141
Thank you for your contribution, great minds think alike as we have already identified this issue (and a few others like it) and have already implemented a fix, arriving soon in the next version. See PR here.

Note, the fix also contains the ability to require confirmation before saving a value, and a refactor of the event firing so that now there's an event for any pick, and one for a final applied pick.

The new version will include full details, as well as any migration steps needed

So you can close this PR and await the fix in the new version coming soon

@shin4141 shin4141 closed this Oct 21, 2026
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.

4 participants