fix: Optimized tray window icon sorting#1489
Open
JWWTSL wants to merge 1 commit intolinuxdeepin:masterfrom
Open
fix: Optimized tray window icon sorting#1489JWWTSL wants to merge 1 commit intolinuxdeepin:masterfrom
JWWTSL wants to merge 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
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
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. 代码安全
总结与改进建议这段修改是一个合理且正向的改进。它解决了新图标插入导致旧图标顺序被打乱的用户体验问题,同时顺便提升了插入操作的效率。 建议:
总体而言,这是一个高质量的代码提交。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: