Skip to content

fix: prioritize notification-specific image hints in appIcon#1654

Open
xujin177 wants to merge 1 commit into
linuxdeepin:masterfrom
xujin177:master
Open

fix: prioritize notification-specific image hints in appIcon#1654
xujin177 wants to merge 1 commit into
linuxdeepin:masterfrom
xujin177:master

Conversation

@xujin177

@xujin177 xujin177 commented Jun 30, 2026

Copy link
Copy Markdown
  1. Changed appIcon() to check image/icon data hints from notification hints first
  2. Return icon from hints earlier if available, avoiding fallback to generic app icon
  3. Simplified fallback to return empty string when no hints or app icon present

Log: Fixed app icon display to prioritize notification-specific image data over generic app icon

Influence:

  1. Test notifications with custom image hints to verify correct icon display
  2. Test notifications without image hints to ensure fallback to app icon works
  3. Verify behavior with empty app icon and no hints
  4. Check backward compatibility with existing notification formats

fix: 在appIcon中优先显示通知特定的图像提示

  1. 修改appIcon()方法,优先从通知提示中检查图像/图标数据
  2. 如果有提示中的图标,则提前返回,避免回退到通用应用图标
  3. 当没有提示或应用图标时,简化处理为返回空字符串

Log: 修复通知图标显示,优先使用通知特定的图像数据而非通用应用图标

Influence:

  1. 测试带有自定义图像提示的通知,验证正确显示图标
  2. 测试没有图像提示的通知,确保正确回退到应用图标
  3. 验证应用图标为空且无提示时的表现
  4. 检查与现有通知格式的向后兼容性

PMS: BUG-367549

Summary by Sourcery

Bug Fixes:

  • Ensure notification bubbles use image-data/icon_data hints for icons before falling back to the generic app icon.

1. Changed appIcon() to check image/icon data hints from notification
hints first
2. Return icon from hints earlier if available, avoiding fallback to
generic app icon
3. Simplified fallback to return empty string when no hints or app icon
present

Log: Fixed app icon display to prioritize notification-specific image
data over generic app icon

Influence:
1. Test notifications with custom image hints to verify correct icon
display
2. Test notifications without image hints to ensure fallback to app
icon works
3. Verify behavior with empty app icon and no hints
4. Check backward compatibility with existing notification formats

fix: 在appIcon中优先显示通知特定的图像提示

1. 修改appIcon()方法,优先从通知提示中检查图像/图标数据
2. 如果有提示中的图标,则提前返回,避免回退到通用应用图标
3. 当没有提示或应用图标时,简化处理为返回空字符串

Log: 修复通知图标显示,优先使用通知特定的图像数据而非通用应用图标

Influence:
1. 测试带有自定义图像提示的通知,验证正确显示图标
2. 测试没有图像提示的通知,确保正确回退到应用图标
3. 验证应用图标为空且无提示时的表现
4. 检查与现有通知格式的向后兼容性

PMS: BUG-367549
@sourcery-ai

sourcery-ai Bot commented Jun 30, 2026

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

Reviewer's Guide

App icon resolution in notification bubbles is updated to prioritize notification-specific image hints, returning that image when available and simplifying the fallback when neither hints nor an app icon are present.

Flow diagram for updated appIcon notification icon resolution

flowchart TD
    A[appIcon] --> B["imagePathOfNotification(m_entity.hints(), m_entity.appIcon(), m_entity.appName())"]
    B --> C{iconFromHints isEmpty}
    C -->|false| D[return iconFromHints]
    C -->|true| E{m_entity.appIcon isEmpty}
    E -->|false| F[return m_entity.appIcon]
    E -->|true| G[return empty QString]
Loading

File-Level Changes

Change Details Files
Change appIcon() resolution order to use notification image/icon hints first, then fall back to the generic app icon, and finally an empty string.
  • Introduce an iconFromHints variable that calls imagePathOfNotification with notification hints, app icon, and app name.
  • Return immediately when iconFromHints is non-empty, avoiding the previous late fallback behavior.
  • Keep the existing fallback to m_entity.appIcon() when no valid hint image is found.
  • Simplify the final fallback to return an empty QString when neither hints nor app icon provide an image.
panels/notification/bubble/bubbleitem.cpp

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 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.

@deepin-ci-robot

Copy link
Copy Markdown

Hi @xujin177. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: xujin177

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-bot

deepin-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 2.0.49
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1656

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants