-
Notifications
You must be signed in to change notification settings - Fork 60
Revert "fix: correct icon display order from right to left" #1444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This reverts commit eacd145. Log: The plugins should be inserted from the beginning, not appended from the end. Influence: Plugin sequence display PMS: BUG-349997
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: xionglinlin 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 icon registration so new plugin surfaces are inserted at the beginning of their section rather than appended, restoring the original plugin display sequence from left to right (or from start to end) and removing the right-to-left ordering logic. Sequence diagram for tray icon registration ordering changesequenceDiagram
actor User
participant Plugin as PluginInstance
participant Manager as PluginManager
participant Model as TraySortOrderModel
participant Section as TraySection
User ->> Plugin: Trigger load
Plugin ->> Manager: registerTraySurface(surfaceId, sectionId)
Manager ->> Model: registerToSection(surfaceId, sectionId)
Model ->> Section: contains(surfaceId)?
alt surfaceId not in Section
Model ->> Section: prepend(surfaceId)
else surfaceId already registered
Model -->> Section: no change
end
Section -->> Model: updated ordering
Model -->> Manager: registration complete
Manager -->> Plugin: tray surface registered
Updated class diagram for TraySortOrderModel tray section orderingclassDiagram
class TraySortOrderModel {
+registerToSection(surfaceId: QString, sectionId: QString) void
}
class TraySection {
+id: QString
+surfaceIds: QList~QString~
+contains(surfaceId: QString) bool
+prepend(surfaceId: QString) void
+append(surfaceId: QString) void
}
class PluginManager {
+registerTraySurface(surfaceId: QString, sectionId: QString) void
}
class PluginInstance {
+surfaceId: QString
+sectionId: QString
+initialize() void
}
PluginInstance --> PluginManager : uses
PluginManager --> TraySortOrderModel : manages
TraySortOrderModel --> TraySection : organizes
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've left some high level feedback:
- Given this reverts the previous right-to-left behavior, consider adding a brief code comment explaining why
prependis now the correct semantics for plugin insertion order to avoid future flip-flops on this logic. - Double-check any consumers of
sectionthat may assume newly registered surfaces appear at the end, as switching fromappendtoprependinverts that assumption and might require corresponding adjustments elsewhere.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Given this reverts the previous right-to-left behavior, consider adding a brief code comment explaining why `prepend` is now the correct semantics for plugin insertion order to avoid future flip-flops on this logic.
- Double-check any consumers of `section` that may assume newly registered surfaces appear at the end, as switching from `append` to `prepend` inverts that assumption and might require corresponding adjustments elsewhere.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. 代码安全
总结与建议这段修改改变了托盘图标的插入顺序,从“追加到末尾”变为“插入到头部”。这通常是为了改变 UI 上图标的排列顺序(例如让新出现的图标显示在最前面)。 建议修改后的代码片段(包含注释更新): if (!section->contains(surfaceId)) {
// 将新图标插入到列表头部,使其在UI中显示在最前面
section->prepend(surfaceId);
}如果 UI 布局是从右向左排列的,且列表头部对应右侧,那么原注释“从右到左”可能依然适用,但为了代码清晰度,建议明确指出是“插入头部”这一行为。 |
This reverts commit eacd145.
Log: The plugins should be inserted from the beginning, not appended from the end.
Influence: Plugin sequence display
PMS: BUG-349997
Summary by Sourcery
Bug Fixes: