Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Jul 16, 2025

  1. Added "No recent notifications" message when notification center
    is empty
  2. Created reusable DropShadowText component for consistent text styling
  3. Added viewCount properties to track notification counts
  4. Updated translation files for new empty state message
  5. Improved header text styling by using DropShadowText component

The changes provide better user feedback when there are no notifications
and improve text consistency across the notification center. The
empty state message helps users understand the current state of the
application.

feat: 为通知中心添加空状态提示

  1. 当通知中心为空时添加"没有最近的通知"提示信息
  2. 创建可复用的DropShadowText组件实现统一文本样式
  3. 添加viewCount属性来跟踪通知数量
  4. 更新翻译文件支持新的空状态提示
  5. 使用DropShadowText组件改进标题文本样式

这些改动在通知中心为空时提供了更好的用户反馈,并改进了整个通知中心的文本
一致性。空状态提示帮助用户理解应用的当前状态。

Issue: https://bbs.deepin.org/post/289386

Summary by Sourcery

Add an empty state message to the notification center and improve text styling consistency by introducing a DropShadowText component, tracking notification counts via new properties, and updating translations and build config.

New Features:

  • Show a “No recent notifications” message when the notification center is empty

Enhancements:

  • Introduce a reusable DropShadowText component for consistent drop shadow text styling
  • Add viewCount properties in staging and view components to enable empty state visibility logic
  • Refactor header text to use DropShadowText for uniform styling

Build:

  • Include DropShadowText.qml in the notification plugin’s CMakeLists

Documentation:

  • Update translation files with the new empty state message and add UTF-8 encoding declarations

@sourcery-ai
Copy link

sourcery-ai bot commented Jul 16, 2025

Reviewer's Guide

Introduces a reusable DropShadowText component and viewCount tracking to render a new “No recent notifications” empty state in the notification center, refactors header styling to use the shared component, and updates all translation files with the new message.

Class diagram for DropShadowText and notification viewCount changes

classDiagram
    class DropShadowText {
        +color: rgba(1,1,1,1)
        +layer.enabled: true
        +layer.effect: DropShadow
    }
    class NotifyHeaderTitleText {
        <<refactored>>
        -Text (was base)
        +DropShadowText (now base)
        +tFont: font
    }
    class NotifyView {
        +viewCount: int (readonly)
    }
    class NotifyStaging {
        +viewCount: int (readonly)
    }
    class NotifyCenter {
        +stagingViewCount: int
    }
    NotifyHeaderTitleText --|> DropShadowText
    NotifyCenter o-- NotifyView
    NotifyCenter o-- NotifyStaging
    NotifyView <.. DropShadowText : uses for empty state message
Loading

File-Level Changes

Change Details Files
Render empty‐state message when no notifications are present
  • Added stagingViewCount property to NotifyCenter.qml
  • Bound stagingViewCount to NotifyStaging.viewCount in main.qml
  • Inserted DropShadowText to display “No recent notifications” when both counts are zero
panels/notification/center/NotifyCenter.qml
panels/notification/center/NotifyStaging.qml
panels/notification/center/NotifyView.qml
panels/notification/center/package/main.qml
Create reusable DropShadowText component
  • Added DropShadowText.qml with built-in drop shadow effect
  • Included the new QML file in CMakeLists.txt output directory
panels/notification/plugin/DropShadowText.qml
panels/notification/plugin/CMakeLists.txt
Refactor header text to use DropShadowText
  • Swapped Text to DropShadowText in NotifyHeaderTitleText.qml
  • Removed inline layer.effect definitions from header text
panels/notification/center/NotifyHeaderTitleText.qml
Expose viewCount in staging and view models
  • Added readonly viewCount to NotifyStaging.qml
  • Added readonly viewCount to NotifyView.qml
panels/notification/center/NotifyStaging.qml
panels/notification/center/NotifyView.qml
Update translations for new empty state text
  • Inserted NotifyCenter context and placeholder translation for “No recent notifications” in each TS file
  • Updated XML headers to include utf-8 encoding
panels/notification/center/translations/org.deepin.ds.notificationcenter*.ts

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 @18202781743 - I've reviewed your changes - here's some feedback:

  • Abstract the empty-state display logic into the model (for example a single isEmpty or hasNotifications property) rather than manually tracking stagingViewCount and viewCount in the view hierarchy.
  • Consider renaming stagingViewCount to a more descriptive name like initialNotificationCount to clarify its role in controlling the empty state.
  • Several translations for the new “No recent notifications” context are marked as unfinished; please provide placeholder translations or coordinate with localization to ensure the message is visible in all languages.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Abstract the empty-state display logic into the model (for example a single `isEmpty` or `hasNotifications` property) rather than manually tracking `stagingViewCount` and `viewCount` in the view hierarchy.
- Consider renaming `stagingViewCount` to a more descriptive name like `initialNotificationCount` to clarify its role in controlling the empty state.
- Several translations for the new “No recent notifications” context are marked as `unfinished`; please provide placeholder translations or coordinate with localization to ensure the message is visible in all languages.

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.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, yixinshark, zccrs

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

1. Added "No recent notifications" message when notification center
is empty
2. Created reusable DropShadowText component for consistent text styling
3. Added viewCount properties to track notification counts
4. Updated translation files for new empty state message
5. Improved header text styling by using DropShadowText component

The changes provide better user feedback when there are no notifications
and improve text consistency across the notification center. The
empty state message helps users understand the current state of the
application.

feat: 为通知中心添加空状态提示

1. 当通知中心为空时添加"没有最近的通知"提示信息
2. 创建可复用的DropShadowText组件实现统一文本样式
3. 添加viewCount属性来跟踪通知数量
4. 更新翻译文件支持新的空状态提示
5. 使用DropShadowText组件改进标题文本样式

这些改动在通知中心为空时提供了更好的用户反馈,并改进了整个通知中心的文本
一致性。空状态提示帮助用户理解应用的当前状态。

Issue: https://bbs.deepin.org/post/289386
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. NotifyCenter.qml文件中新增的stagingViewCount属性应该有相应的注释说明其用途和作用,以便其他开发者理解。
  2. NotifyCenter.qml文件中新增的DropShadowText组件用于显示“没有最近的通知”,但是没有提供相应的翻译,应该添加对应的翻译文件。
  3. NotifyHeaderTitleText.qml文件中将Text组件替换为DropShadowText组件,但是原来的Text组件的color属性和layer属性被移除,可能会导致样式变化,需要确认这是否是预期的更改。
  4. NotifyStaging.qmlNotifyView.qmlmain.qml文件中新增的viewCount属性应该有相应的注释说明其用途和作用。
  5. translations文件夹中的.ts文件新增了NotifyCenter的翻译,但是其他时间相关的翻译仍然标记为type="unfinished",需要完成这些翻译。
  6. plugin/CMakeLists.txt文件中新增了DropShadowText.qml文件,但是没有提供相应的注释说明其用途和作用。
  7. DropShadowText.qml文件中新增的DropShadowText组件用于添加阴影效果,但是没有提供相应的注释说明其用途和作用。

以上是代码审查的意见,希望能够帮助到开发者。

@18202781743 18202781743 merged commit 52e2deb into linuxdeepin:master Jul 18, 2025
8 of 11 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.

4 participants