Skip to content

fix: preserve pending range selection on hover - #1010

Merged
zombieJ merged 7 commits into
masterfrom
codex/fix-range-picker-hover-selection
Sep 4, 2026
Merged

fix: preserve pending range selection on hover#1010
zombieJ merged 7 commits into
masterfrom
codex/fix-range-picker-hover-selection

Conversation

@zombieJ

@zombieJ zombieJ commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • keep a modified RangePicker endpoint selected while its confirmation is pending
  • render the hovered cell with an independent hover state while retaining the input preview
  • preserve existing range and preset previews and add regression coverage

Validation

  • ut test --runInBand: 15 suites passed, 469 tests passed, 2 skipped
  • ut lint:tsc
  • ut lint: 0 errors, 16 existing hook warnings
  • focused Prettier check and git diff --check

Fixes ant-design/ant-design#59070.

AI assistance disclosure: Codex was used to trace the hover state flow, add the regression test, implement the fix, run validation, and draft this description.

Summary by CodeRabbit

  • Bug 修复
    • 修复 RangePicker 启用时间选择时,选择开始日期后悬停结束日期,待确认的选中状态显示不正确的问题。
    • 优化范围选择中的悬停反馈:已有另一端日期时优先显示完整范围悬停效果。
    • 悬停结束日期时,开始日期与悬停日期的高亮样式及输入框预览值现可正确更新。
  • 测试
    • 增加了针对日期时间范围选择及悬停状态的覆盖测试。

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
picker Ready Ready Preview Sep 4, 2026 9:57am UTC

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 8b853a4.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: e3278b8d-52a4-4476-9707-eaf0b2f86791

📥 Commits

Reviewing files that changed from the base of the PR and between b26da4a and 8b853a4.

📒 Files selected for processing (2)
  • src/PickerInput/RangePicker.tsx
  • tests/range.spec.tsx

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


Walkthrough

RangePicker 现在保留待确认的选中日期,并单独显示悬停日期。范围模式会根据另一字段的值选择弱悬停或完整范围悬停。测试覆盖 showTime、确认和非确认场景。

Changes

范围选择悬停状态

Layer / File(s) Summary
选择面板悬停值
src/PickerInput/RangePicker.tsx
当另一字段没有值时,RangePicker 使用当前字段的单个悬停值。否则使用完整的 hoverValues 范围。
渲染并验证悬停状态
src/PickerInput/Popup/PopupPanel.tsx, tests/range.spec.tsx
PopupPanel 在范围模式下单独传递 hoverRangeValue。测试验证待确认选中状态和已确认范围悬停样式。

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

Merge Risk: ⚪ Minimal · up to 8b853

RangePicker preserves a pending selected endpoint while rendering the hovered date independently, and retains full-range hover styling once an endpoint is confirmed. The covered behavior is ready to merge.

Suggested reviewers: qdyanbing

Poem

小兔轻点悬停键,
选中日期仍闪亮。
范围端点分明现,
时间面板不迷航。
测试铃声叮当响。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题“fix: preserve pending range selection on hover”准确概括了主要变更:修复 RangePicker 在悬停时丢失待确认范围选择样式的问题。
Linked Issues check ✅ Passed 变更满足直接关联问题 #59070 的要求:在启用 showTime 时保留已选端点的选中样式,并为悬停日期显示独立的悬停样式。实现同时覆盖确认和未确认的范围选择状态,并新增回归测试。
Out of Scope Changes check ✅ Passed 所有变更均围绕 RangePicker 的范围悬停状态和选中样式修复,包括 PopupPanel、RangePicker 逻辑调整及相关回归测试。未发现与问题 #59070 无关的代码变更。
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-range-picker-hover-selection

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.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

❌ Deploy failed

PR preview ❌ Failed ❌ Failed
🔗 Preview https://react-component-picker-preview-pr-1010.surge.sh (may be unavailable)
📝 Commit8b853a4
🪵 LogsView logs
📋 Build log (last lines)
npm error
npm error Could not resolve dependency:
npm error peer eslint@"^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" from eslint-plugin-react@7.37.5
npm error node_modules/eslint-plugin-react
npm error   dev eslint-plugin-react@"^7.37.5" from the root project
npm error   eslint-plugin-react@"^7.32.2" from @umijs/fabric@4.0.1
npm error   node_modules/@umijs/fabric
npm error     @umijs/fabric@"^4.0.0" from rc-test@7.1.3
npm error     node_modules/rc-test
npm error       dev rc-test@"^7.1.3" from the root project
npm error
npm error Conflicting peer dependency: eslint@9.39.5
npm error node_modules/eslint
npm error   peer eslint@"^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" from eslint-plugin-react@7.37.5
npm error   node_modules/eslint-plugin-react
npm error     dev eslint-plugin-react@"^7.37.5" from the root project
npm error     eslint-plugin-react@"^7.32.2" from @umijs/fabric@4.0.1
npm error     node_modules/@umijs/fabric
npm error       @umijs/fabric@"^4.0.0" from rc-test@7.1.3
npm error       node_modules/rc-test
npm error         dev rc-test@"^7.1.3" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/runner/.npm/_logs/2026-09-04T10_02_00_770Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2026-09-04T10_02_00_770Z-debug-0.log

🤖 Powered by surge-preview

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.88%. Comparing base (f367642) to head (8b853a4).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1010   +/-   ##
=======================================
  Coverage   98.88%   98.88%           
=======================================
  Files          68       68           
  Lines        2859     2873   +14     
  Branches      811      823   +12     
=======================================
+ Hits         2827     2841   +14     
  Misses         29       29           
  Partials        3        3           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zombieJ
zombieJ merged commit b6599fa into master Sep 4, 2026
13 checks passed
@zombieJ
zombieJ deleted the codex/fix-range-picker-hover-selection branch September 4, 2026 09:58
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.

RangePicker 开启 showTime 时,选定一个日期后会有选中样式,鼠标再 hover 到其它日期时该样式丢失

1 participant