Skip to content

fix: 🐛 修复因commit 06106a76b疏忽了startSymbol导致的日期范围选择器异常 - #1170

Closed
HMYang33 wants to merge 1 commit into
Moonofweisheng:masterfrom
HMYang33:master
Closed

HMYang33 wants to merge 1 commit into
Moonofweisheng:masterfrom
HMYang33:master

Conversation

@HMYang33

@HMYang33 HMYang33 commented Jul 20, 2025 •

Copy link
Copy Markdown

🤔 这个 PR 的性质是?(至少选择一个)

  • 日常 bug 修复
  • TypeScript 定义更新

🔗 相关 Issue

还没开issue,感觉就加两行代码给主仓库查漏补缺不需要开issue,直接合并上就行

💡 需求背景和解决方案

bug复现

  1. 打开 https://wot-design-uni.cn/component/datetime-picker.html
  2. 在电脑屏幕右侧的组件预览窗口点击倒数第一个组件(范围tab展示格式)或者倒数第二个组件(区域选择)
  3. 拨动开始日期的年份滚筒
  4. 此时被拨动到上方的年份莫名其妙被禁用

找到原因

  1. debug发现 src/uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue 接收到的startSymbol总是undefined,和类型约束中的boolean不符,组件无法得知是在处理起始时间的边界值还是结束时间的边界值
  2. 翻阅历史提交,发现在作者的一次提交 “typescript类型支持增强” 中无意疏漏,没有把startSymbol属性从组件导出

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项。⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充

Summary by CodeRabbit

  • 新功能
    • 日期时间选择器组件的外部接口现支持访问 startSymbol 属性。

@netlify

netlify Bot commented Jul 20, 2025 •

Copy link
Copy Markdown

❌ Deploy Preview for wot-design-uni failed. Why did it fail? →

Built without sensitive environment variables

Name Link
🔨 Latest commit 8deecf7
🔍 Latest deploy log https://app.netlify.com/projects/wot-design-uni/deploys/687c73626f75d500089fb50d

@vercel

vercel Bot commented Jul 20, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wot-design-uni ❌ Failed (Inspect) Jul 20, 2025 4:42am

@coderabbitai

coderabbitai Bot commented Jul 20, 2025 •

Copy link
Copy Markdown

Walkthrough

此次更改为 wd-datetime-picker-view 组件的暴露接口新增了 startSymbol 属性,使其可被外部访问。相关类型定义和组件暴露对象均已同步更新,未涉及其他逻辑或控制流调整。

Changes

文件/路径 变更摘要
.../wd-datetime-picker-view/types.ts
.../wd-datetime-picker-view.vue
在组件暴露类型和 defineExpose 接口中新增 startSymbol 属性

Suggested reviewers

  • Moonofweisheng

Poem

🐰
小兔挥笔添新意,
startSymbol 现身齐,
组件接口更明晰,
类型同步无遗漏,
外部调用更便利。
代码世界乐无比!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b98c613 and 8deecf7.

📒 Files selected for processing (2)
  • src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/types.ts (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/wd-datetime-picker-view.vue (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test Components (wd-datetime-picker-view)
🔇 Additional comments (2)
src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/types.ts (1)

107-107: LGTM! 正确添加了 startSymbol 到暴露接口类型定义中

此更改将 startSymbol 属性添加到 DatetimePickerViewExpose 类型定义中,使其可以通过组件的暴露接口访问。类型定义 boolean | undefined 与组件 props 中的定义保持一致,符合 TypeScript 最佳实践。

src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/wd-datetime-picker-view.vue (1)

524-524: LGTM! 正确修复了 startSymbol 属性未暴露的问题

此更改将 startSymbol 属性添加到组件的 defineExpose 中,使其可以被外部组件访问。这直接修复了 PR 中描述的问题:之前 startSymbol 在父组件中总是 undefined,导致日期范围选择器无法正确区分是处理开始边界还是结束边界。

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.21%. Comparing base (27243c1) to head (8deecf7).
Report is 2 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

❗ There is a different number of reports uploaded between BASE (27243c1) and HEAD (8deecf7). Click for more details.

HEAD has 170 uploads less than BASE
Flag BASE (27243c1) HEAD (8deecf7)
wd-overlay 1 0
h5 86 1
wd-grid-item 1 0
wd-password-input 1 0
wd-sticky 1 0
wd-circle 1 0
wd-checkbox 1 0
wd-video-preview 1 0
wd-loadmore 1 0
wd-select-picker 1 0
wd-index-bar 1 0
wd-toast 1 0
wd-tag 1 0
wd-cell 1 0
wd-badge 1 0
wd-cell-group 1 0
wd-img-cropper 1 0
wd-tabbar 1 0
wd-icon 1 0
wd-skeleton 1 0
wd-floating-panel 1 0
wd-watermark 1 0
wd-img 1 0
wd-notice-bar 1 0
wd-status-tip 1 0
wd-gap 1 0
wd-progress 1 0
wd-popover 1 0
wd-navbar-capsule 1 0
wd-message-box 1 0
wd-calendar-view 1 0
wd-tooltip 1 0
wd-backtop 1 0
wd-navbar 1 0
wd-transition 1 0
wd-grid 1 0
wd-slider 1 0
wd-sticky-box 1 0
wd-loading 1 0
wd-count-to 1 0
wd-keyboard 1 0
wd-notify 1 0
wd-picker-view 1 0
wd-upload 1 0
wd-popup 1 0
wd-pagination 1 0
wd-divider 1 0
wd-form 1 0
wd-text 1 0
wd-curtain 1 0
wd-tabs 1 0
wd-col-picker 1 0
wd-sort-button 1 0
wd-swiper-nav 1 0
wd-config-provider 1 0
wd-search 1 0
wd-count-down 1 0
wd-swipe-action 1 0
wd-signature 1 0
wd-checkbox-group 1 0
wd-fab 1 0
wd-number-keyboard 1 0
wd-layout 1 0
wd-datetime-picker 1 0
wd-step 1 0
wd-picker 1 0
wd-table 1 0
wd-textarea 1 0
wd-drop-menu 1 0
wd-calendar 1 0
wd-collapse 1 0
wd-radio 1 0
wd-root-portal 1 0
wd-switch 1 0
wd-swiper 1 0
wd-steps 1 0
wd-radio-group 1 0
wd-action-sheet 1 0
wd-resize 1 0
wd-sidebar 1 0
wd-index-anchor 1 0
wd-input 1 0
wd-rate 1 0
wd-button 1 0
wd-card 1 0
wd-input-number 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1170      +/-   ##
==========================================
- Coverage   89.71%   80.21%   -9.51%     
==========================================
  Files         215        7     -208     
  Lines       29206     1314   -27892     
  Branches     2742      123    -2619     
==========================================
- Hits        26203     1054   -25149     
+ Misses       3003      260    -2743     
Flag Coverage Δ
h5 80.21% <100.00%> (-9.51%) ⬇️
wd-action-sheet ?
wd-backtop ?
wd-badge ?
wd-button ?
wd-calendar ?
wd-calendar-view ?
wd-card ?
wd-cell ?
wd-cell-group ?
wd-checkbox ?
wd-checkbox-group ?
wd-circle ?
wd-col-picker ?
wd-collapse ?
wd-config-provider ?
wd-count-down ?
wd-count-to ?
wd-curtain ?
wd-datetime-picker ?
wd-datetime-picker-view 80.21% <100.00%> (+0.03%) ⬆️
wd-divider ?
wd-drop-menu ?
wd-fab ?
wd-floating-panel ?
wd-form ?
wd-gap ?
wd-grid ?
wd-grid-item ?
wd-icon ?
wd-img ?
wd-img-cropper ?
wd-index-anchor ?
wd-index-bar ?
wd-input ?
wd-input-number ?
wd-keyboard ?
wd-layout ?
wd-loading ?
wd-loadmore ?
wd-message-box ?
wd-navbar ?
wd-navbar-capsule ?
wd-notice-bar ?
wd-notify ?
wd-number-keyboard ?
wd-overlay ?
wd-pagination ?
wd-password-input ?
wd-picker ?
wd-picker-view ?
wd-popover ?
wd-popup ?
wd-progress ?
wd-radio ?
wd-radio-group ?
wd-rate ?
wd-resize ?
wd-root-portal ?
wd-search ?
wd-select-picker ?
wd-sidebar ?
wd-signature ?
wd-skeleton ?
wd-slider ?
wd-sort-button ?
wd-status-tip ?
wd-step ?
wd-steps ?
wd-sticky ?
wd-sticky-box ?
wd-swipe-action ?
wd-swiper ?
wd-swiper-nav ?
wd-switch ?
wd-tabbar ?
wd-table ?
wd-tabs ?
wd-tag ?
wd-text ?
wd-textarea ?
wd-toast ?
wd-tooltip ?
wd-transition ?
wd-upload ?
wd-video-preview ?
wd-watermark ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

This branch had an error being deployed

1 failed deployment
Preview — 8deecf72 Deployed Jul 20, 2025 by vercel[bot]
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