Skip to content

fix(notification): align notification items in staging area#1466

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
add-uos:master
Mar 3, 2026
Merged

fix(notification): align notification items in staging area#1466
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
add-uos:master

Conversation

@add-uos
Copy link
Contributor

@add-uos add-uos commented Mar 3, 2026

Add leftMargin to ListView in NotifyStaging to match NotifyView layout.

在NotifyStaging的ListView中添加leftMargin,使其与NotifyView布局保持一致。

Log: 修复通知中心暂驻区域和常驻区域消息对齐问题
PMS: BUG-351633
Influence: 修复后通知中心暂驻区域和常驻区域的通知项将正确对齐显示。

Summary by Sourcery

Bug Fixes:

  • Fix misalignment between temporary (staging) and persistent notification items in the notification center.

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 3, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Aligns notification items in the staging area ListView with those in the main notification view by applying a consistent left margin style.

File-Level Changes

Change Details Files
Align NotifyStaging ListView content horizontally with NotifyView using a shared left margin style value.
  • Set ListView.leftMargin to NotifyStyle.leftMargin in the staging notification center view
  • Ensure notification items in the temporary (staging) area visually line up with items in the persistent notification area
panels/notification/center/NotifyStaging.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 - I've reviewed your changes and they look great!


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.

18202781743
18202781743 previously approved these changes Mar 3, 2026
18202781743
18202781743 previously approved these changes Mar 3, 2026
Add leftMargin to ListView in NotifyStaging to match NotifyView layout.

在NotifyStaging的ListView中添加leftMargin,使其与NotifyView布局保持一致。

Log: 修复通知中心暂驻区域和常驻区域消息对齐问题
PMS: BUG-351633
Influence: 修复后通知中心暂驻区域和常驻区域的通知项将正确对齐显示。
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: add-uos

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

2 similar comments
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: add-uos

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: add-uos

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

deepin pr auto review

这段代码修改主要是对 NotifyStaging.qml 文件中 ListView 组件的样式属性进行了调整,并更新了版权年份。以下是详细的代码审查意见:

1. 语法逻辑

  • 状态:通过。
  • 分析
    • leftMargin: NotifyStyle.leftMargin 的语法是正确的。在 QML 的 ListView 中,leftMargin 是一个有效的附加属性,用于设置内容区域的左边距。
    • 引用 NotifyStyle.leftMargin 表明这是一个集中管理的样式属性,符合 QML 的最佳实践。

2. 代码质量

  • 状态:良好。
  • 分析
    • 样式解耦:将边距值提取到 NotifyStyle 对象中是非常好的做法。这使得 UI 的维护更加容易,如果需要统一调整边距,只需修改 NotifyStyle 而不需要改动布局文件。
    • 版权年份:将版权年份从 2024 更新为 2024 - 2026 是符合规范的,表示对该代码在后续年份的维护预期。

3. 代码性能

  • 状态:无影响。
  • 分析
    • 仅仅增加一个静态的 leftMargin 属性绑定对性能几乎没有影响。QML 引擎在布局时会处理这个属性,不会造成额外的计算负担或渲染卡顿。

4. 代码安全

  • 状态:安全。
  • 分析
    • 此修改仅涉及 UI 布局和版权声明,不涉及数据处理、用户输入验证或权限控制,因此没有引入安全风险。

5. 改进建议

虽然目前的修改没有问题,但为了代码的健壮性,可以考虑以下几点:

  1. 默认值处理
    虽然 NotifyStyle 应该定义了 leftMargin,但为了防止未来样式表更新时遗漏该属性导致布局崩溃,建议在 NotifyStyle 中确保 leftMargin 有明确的默认值(例如 010)。

  2. 对称性检查
    如果添加了 leftMargin,建议检查是否需要同步添加 rightMargintopMarginbottomMargin,以保持列表项在视口中的视觉平衡,除非设计意图明确只需要左边距(例如为了对齐图标或文本)。

  3. 对齐方式
    确认 ListViewanchors.fill: parent 或其他定位属性是否与 leftMargin 配合良好,确保列表在宽度变化时不会出现意外的滚动条或裁剪。

总结:这是一次清晰、低风险的 UI 调整,符合代码规范。可以直接合并。

@add-uos
Copy link
Contributor Author

add-uos commented Mar 3, 2026

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Mar 3, 2026

This pr force merged! (status: behind)

@deepin-bot deepin-bot bot merged commit 95c4833 into linuxdeepin:master Mar 3, 2026
14 of 20 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