fix: Optimized tray window icon sorting#1489
fix: Optimized tray window icon sorting#1489deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
log: TraySortOrderModel::registerToSection() used prepend() to insert newly registered tray items at the beginning of the list, causing tray icons to display in launch order rather than saved order after application restart. Changed prepend() to append(), adding newly registered tray items to the end of the list. This preserves the positional order of existing items, ensuring tray icons display in their last-saved positions. pms: bug-299965
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts tray item registration order so new tray icons are added to the end of the section, preserving the saved ordering of existing tray icons across application restarts. Sequence diagram for tray icon registration with optimized sortingsequenceDiagram
actor User
participant SystemTray
participant TraySortOrderModel
participant SectionList
User->>SystemTray: Launch application
SystemTray->>TraySortOrderModel: registerToSection(surfaceId, sectionId)
TraySortOrderModel->>SectionList: contains(surfaceId)?
alt surfaceId not in section
SectionList-->>TraySortOrderModel: false
TraySortOrderModel->>SectionList: append(surfaceId)
else surfaceId already in section
SectionList-->>TraySortOrderModel: true
TraySortOrderModel-->>SystemTray: no change
end
SystemTray-->>User: Show tray icons in last saved order
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new inline comments are in Chinese; consider aligning the comment language with the rest of the file/repository for consistency and easier maintenance.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new inline comments are in Chinese; consider aligning the comment language with the rest of the file/repository for consistency and easier maintenance.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review这段代码修改的目的是调整托盘图标在配置列表中的插入顺序。以下是对该 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与改进建议这段修改是一个合理且正向的改进。它解决了新图标插入导致旧图标顺序被打乱的用户体验问题,同时顺便提升了插入操作的效率。 建议:
总体而言,这是一个高质量的代码提交。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, JWWTSL The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: behind) |
log: TraySortOrderModel::registerToSection() used prepend() to insert newly registered tray items at the beginning of the list, causing tray icons to display in launch order rather than saved order after application restart. Changed prepend() to append(), adding newly registered tray items to the end of the list. This preserves the positional order of existing items, ensuring tray icons display in their last-saved positions.
pms: bug-299965
Summary by Sourcery
Bug Fixes: