Skip to content

fix: align image device sidebar icon - #837

Open
GongHeng2017 wants to merge 1 commit into
linuxdeepin:develop/eaglefrom
GongHeng2017:agent/pms-bug-bot/7e6d3f5762a7
Open

GongHeng2017 wants to merge 1 commit into
linuxdeepin:develop/eaglefrom
GongHeng2017:agent/pms-bug-bot/7e6d3f5762a7

Conversation

@GongHeng2017

@GongHeng2017 GongHeng2017 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Root Cause Analysis

The sidebar image-device entry was built with camera##Image, while DeviceListView loads the sidebar icon from the first segment. Consequently, the application loaded camera_20px.svg and showed a webcam-like glyph for “Image”. The details page already uses the image-device semantic asset, which created the visible mismatch.

Key evidence: deepin-devicemanager/src/DeviceManager/DeviceManager.cpp:248, deepin-devicemanager/src/Widget/DeviceListView.cpp:120, and the existing details-page mapping to image.svg.

修复方案

Add 20px light and dark image icons, register both files in appimage.qrc, and change the sidebar mapping from camera##Image to image##Image. This follows the approved root-cause-level option and does not change device discovery, grouping, details-page routing, or the return structure of getDeviceTypes().

Change Safety Assessment

Code Safety

  • Risk Level: Low
  • The change replaces only one icon key and adds two standalone SVG resources; no function signature, public member, business condition, or device-list structure changes.
  • The target line was not introduced by a relevant icon-behavior bug fix, and the referenced PMS fixes (295379, 332095, 325731) do not depend on camera##Image as the sidebar image-device key.
  • Existing consumers use the display name or complete type identifier; only DeviceListView.cpp:120 consumes the icon segment.

Business Impact Scope

The device sidebar icon for the Image category changes from the camera glyph to the semantic image-device glyph in light and dark themes. Device discovery, other sidebar entries, details-page navigation, and the image-device list remain unchanged.

Verification Suggestion

Verify the Image sidebar icon in light/dark themes with an image device present, then open and refresh its details page. Also confirm that the entry is absent when no image device exists and that other sidebar icons show no regression.


根因分析

侧边栏图像设备条目使用了 camera##Image,而 DeviceListView 按第一段加载侧边栏图标,因此应用实际加载 camera_20px.svg 并显示类似摄像头的图形。详情页已使用图像设备语义资源,二者形成可见不一致。

关键证据:deepin-devicemanager/src/DeviceManager/DeviceManager.cpp:248、deepin-devicemanager/src/Widget/DeviceListView.cpp:120,以及详情页既有的 image.svg 映射。

修复方案

新增 light/dark 两套 20px image 图标并注册到 appimage.qrc,同时将侧边栏映射由 camera##Image 改为 image##Image。该实现遵循已裁决的根因层方案,不改变设备发现、类型分组、详情页跳转或 getDeviceTypes() 返回结构。

改动安全评估

代码安全评估

  • 风险等级: 低风险
  • 本次只替换一个图标标识并新增两个独立 SVG 资源;函数签名、公开成员、业务条件与设备列表结构均未变化。
  • 目标行并非相关图标行为修复的产物,已检查的 PMS 修复(295379、332095、325731)也不依赖 camera##Image 作为图像设备侧边栏标识。
  • 既有消费方按显示名或完整类型标识匹配;只有 DeviceListView.cpp:120 使用图标段。

业务影响范围

存在图像设备时,“图像设备”侧边栏图标会在 light/dark 主题下由摄像头外观切换为图像设备语义图标。设备发现、其他侧边栏条目、详情页导航和图像设备列表均保持不变。

验证建议

在 light/dark 主题且存在图像设备时验证侧边栏图标,然后打开并刷新详情页。同时确认不存在图像设备时不显示该条目,其他侧边栏图标无回归。

Summary by Sourcery

Bug Fixes:

  • Align the Image device sidebar entry with the correct semantic image icon in light and dark themes.

1. Root cause: the sidebar image-device entry used the camera icon
   key while its display type is Image, so Qt loaded camera_20px.svg
   and showed a webcam glyph
2. Fix: add 20px light and dark image-device icons, register them in
   the application resource file, and use image##Image
3. Impact: only the sidebar icon name changes; device discovery,
   grouping, details, and other sidebar entries remain unchanged

Log: fix the image device icon in the device sidebar

Influence:
1. Test the image-device sidebar icon in light and dark themes
2. Test the image-device details page after opening and refreshing
3. Check other sidebar icons for unexpected changes

fix: 对齐图像设备侧边栏图标

1. 根因:侧边栏图像设备条目使用摄像头图标键,而类型语义为图像设
   备,Qt 因此加载 camera_20px.svg 并显示摄像头外观
2. 方案:新增 light/dark 两套 20px 图像设备图标并注册 qrc,侧边栏
   映射改为 image##Image
3. 影响:仅侧边栏图标标识变化;设备发现、分组、详情页和其他侧边
   栏入口行为保持不变

Log: 修复设备侧边栏中的图像设备图标

Influence:
1. 在 light/dark 主题下测试图像设备侧边栏图标
2. 打开并刷新图像设备详情页后确认列表正常
3. 检查其他侧边栏图标未出现非预期变化

PMS: BUG-274917
@sourcery-ai

sourcery-ai Bot commented Oct 14, 2026

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

Reviewer's Guide

The PR fixes the Image category’s sidebar icon by aligning its icon key with the existing image-device semantics, adding theme-specific 20px resources, and registering them without changing device discovery, grouping, navigation, or list structure.

Sequence diagram for image sidebar icon selection

sequenceDiagram
    participant DeviceManager
    participant DeviceListView
    participant IconResources

    DeviceManager->>DeviceManager: getDeviceTypes()
    DeviceManager-->>DeviceListView: image##Image
    DeviceListView->>IconResources: load image_20px.svg
    IconResources-->>DeviceListView: Theme-specific image icon
Loading

File-Level Changes

Change Details Files
Use a semantic image icon for the Image device sidebar entry.
  • Changed the sidebar type mapping from camera##Image to image##Image, preserving device discovery and list behavior.
  • Added light and dark 20px image SVG assets.
  • Registered the new assets in the Qt resource collection.
deepin-devicemanager/src/DeviceManager/DeviceManager.cpp
deepin-devicemanager/assets/icons/deepin/builtin/light/texts/image_20px.svg
deepin-devicemanager/assets/icons/deepin/builtin/dark/texts/image_20px.svg
deepin-devicemanager/assets/appimage.qrc

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

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: GongHeng2017

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

@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 ✨

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.

2 participants