Skip to content

fix: add wrap support for datetime spinboxes #2283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025

Conversation

wyu71
Copy link
Contributor

@wyu71 wyu71 commented May 21, 2025

Add wrap:true property to all SpinboxEx components in DateTimeSettingDialog for better date/time selection experience.

Log: add wrap support for datetime spinboxes
pms: BUG-282845

Summary by Sourcery

New Features:

  • Add wrapping support to year, month, day, hour, and minute spinboxes in the date/time settings dialog

Copy link

sourcery-ai bot commented May 21, 2025

Reviewer's Guide

Enabled wrap-around selection on all SpinboxEx components in DateTimeSettingDialog to improve date/time navigation.

File-Level Changes

Change Details Files
Enabled wrap-around on date/time spinboxes
  • Added wrap:true to year spinbox
  • Added wrap:true to month spinbox
  • Added wrap:true to day spinbox
  • Added wrap:true to hour spinbox
  • Added wrap:true to minute spinbox
src/plugin-datetime/qml/DateTimeSettingDialog.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @wyu71 - I've reviewed your changes - here's some feedback:

  • Consider defining wrap: true as a common default or via a style for SpinboxEx in this dialog to avoid repeating it on each component.
  • Double-check month wrapping (e.g., 12 → 1) still updates the year and triggers updateDateMax on the day spinbox to prevent invalid dates.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Add wrap:true property to all SpinboxEx components in DateTimeSettingDialog
for better date/time selection experience.

Log: add wrap support for datetime spinboxes
pms: BUG-282845
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23, wyu71

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wyu71 wyu71 changed the title feat: add wrap support for datetime spinboxes fix: add wrap support for datetime spinboxes May 21, 2025
@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • 在新增的 wrap: true 属性中,需要确认是否所有相关的 SpinboxEx 组件都应支持 wrap 功能,以保持一致性。
  • 检查 value: currentDate.getMonth() + 1 是否正确处理了月份从0开始的特性,以避免逻辑错误。

是否建议立即修改:

  • 是,需要确保新增的 wrap: true 属性不会引入任何逻辑错误,并且与整个组件的行为保持一致。
  • 是,需要验证月份的计算逻辑是否正确,以避免潜在的日期显示问题。

@wyu71
Copy link
Contributor Author

wyu71 commented May 21, 2025

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented May 21, 2025

This pr force merged! (status: behind)

@deepin-bot deepin-bot bot merged commit 9013bea into linuxdeepin:master May 21, 2025
15 of 18 checks passed
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.

3 participants