Skip to content

fix: Fix the issue with selecting screensaver settings#2904

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
pengfeixx:fix-345553
Dec 25, 2025
Merged

fix: Fix the issue with selecting screensaver settings#2904
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
pengfeixx:fix-345553

Conversation

@pengfeixx

@pengfeixx pengfeixx commented Dec 25, 2025

Copy link
Copy Markdown
Contributor

Fix the issue with selecting screensaver settings

Log: Fix the issue with selecting screensaver settings
pms: BUG-345553

Summary by Sourcery

Bug Fixes:

  • Prevent screensaver option items from being treated as checkable controls, fixing selection of screensaver settings.

@sourcery-ai

sourcery-ai Bot commented Dec 25, 2025

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR fixes screensaver settings selection by making three DccListDelegate-like controls in ScreenSaverPage non-checkable while retaining their enabled/opacity behavior, preventing them from being treated as selectable items.

File-Level Changes

Change Details Files
Make screensaver configuration rows non-checkable to avoid incorrect selection behavior.
  • Set checkable: false on the top (Rounded top corners) delegate representing the main screensaver configuration entry.
  • Set checkable: false on the middle (no rounded corners) delegate representing an additional configuration entry.
  • Set checkable: false on the bottom (Rounded bottom corners) delegate representing the final configuration entry.
src/plugin-personalization/qml/ScreenSaverPage.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

@sourcery-ai sourcery-ai 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.

Hey - I've left some high level feedback:

  • Since multiple adjacent items now explicitly set checkable: false, consider extracting a shared base component or style for non-checkable screensaver options to avoid repetition and keep behavior consistent if the default changes later.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since multiple adjacent items now explicitly set `checkable: false`, consider extracting a shared base component or style for non-checkable screensaver options to avoid repetition and keep behavior consistent if the default changes later.

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.

@pengfeixx pengfeixx force-pushed the fix-345553 branch 2 times, most recently from e84f5e3 to 73f6a63 Compare December 25, 2025 03:12
Fix the issue with selecting screensaver settings

Log: Fix the issue with selecting screensaver settings
pms: BUG-345553
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Details 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

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

我来分析一下这个diff的修改内容:

  1. DccEditorItem.qml 的修改:
+ opacity: model.item.enabledToApp ? 1 : 0.4

这个修改添加了透明度控制,当项目不可用时显示为半透明状态。

  1. ScreenSaverPage.qml 的重构:
    这是一个较大的重构,主要改动:
  • 将原来的 ColumnLayout + 多个 ItemDelegate 的结构改造成了更模块化的 DccObject 结构
  • 将每个功能项拆分成独立的 DccObject 组件
  • 简化了布局代码,移除了重复的样式属性

改进建议:

  1. 代码质量:
  • 重构后的代码结构更清晰,组件化程度更高,这是一个很好的改进
  • 建议将通用的样式属性(如 implicitHeight: 36)抽取成一个公共属性或样式,避免重复
  • onParentItemChanged 中的重复代码可以考虑封装成一个函数
  1. 性能优化:
  • CustomComboBox 的 currentIndex 计算每次都会执行,建议考虑缓存计算结果
  • model.get(currentIndex).value 的重复访问可以缓存到临时变量中
  1. 安全性:
  • 在 onCheckedChanged 中已经有了值比较检查,这很好,避免了不必要的更新
  • 建议在所有状态更新前都添加类似的值比较检查
  1. 可维护性:
  • 建议将魔法数字(如 weight: 10/20/30)定义为常量
  • 考虑将重复的 parentName 路径定义为常量
  • 建议添加更详细的组件注释,说明各个 DccObject 的用途
  1. 用户体验:
  • opacity 的修改很好,提供了更好的视觉反馈
  • 建议考虑添加过渡动画,使状态变化更平滑
  • 可以考虑添加工具提示(tooltip)来提供更多上下文信息
  1. 一致性:
  • 确保所有编辑器组件的高度和间距保持一致
  • 统一使用相同的命名约定(如驼峰命名法)

这些修改总体上是积极的,提高了代码的可维护性和可读性。建议在后续开发中继续遵循这种组件化的设计模式。

@pengfeixx

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Dec 25, 2025

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit 593ad15 into linuxdeepin:master Dec 25, 2025
15 checks passed
@pengfeixx pengfeixx deleted the fix-345553 branch December 25, 2025 03:30
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