feat: add fashion dock mode with card plugin support - #1722
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wjyrich 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 GuideAdds a DConfig-gated fashion dock mode with a floating adaptive layout, top/bottom-only constraints, and mode propagation, alongside a Card plugin surface type with sorted multi-card navigation, popup handling, and persisted selection. Sequence diagram for card discovery, sorting, and navigation persistencesequenceDiagram
participant Plugin as CardPlugin
participant Compositor as DockCompositor
participant Area as CardLeftDockArea
participant Settings as DockSettings
Plugin->>Compositor: create card surface
Compositor->>Area: add cardPluginSurfaces
Plugin->>Compositor: request_message(cardOrder)
Compositor->>Area: cardOrderChanged
Area->>Area: desiredSurfaces()
Area->>Area: syncSortedCards()
Area->>Settings: read cardCurrent
Settings-->>Area: persisted pluginId::itemKey
Area->>Area: syncCurrentCard()
Area->>Area: SwipeView.setCurrentIndex()
Area->>Settings: setCardCurrent(pluginId::itemKey)
Settings->>Settings: debounce Card_Current write
Sequence diagram for fashion mode propagation to plugins and task managersequenceDiagram
participant Panel as DockPanel
participant Compositor as PluginManager
participant Plugin as CardPlugin
participant TaskManager as TaskManager
Panel->>Compositor: set fashionMode
Compositor->>Plugin: sendEventMsg(dockFashionMode)
Compositor-->>Plugin: fashion mode state
Panel->>TaskManager: setFashionMode(fashionMode)
TaskManager->>TaskManager: isWindowSplit()
TaskManager-->>TaskManager: disable window split in fashion mode
Flow diagram for fashion mode configuration and fallbackflowchart TD
Start[Dock startup or alignment change] --> Enabled{fashionModeEnabled?}
Enabled -- No --> Center[Use CenterAlignment]
Enabled -- Yes --> Fashion{FashionAlignment selected?}
Fashion -- No --> Normal[Use configured alignment]
Fashion -- Yes --> Edge{Position is top or bottom?}
Edge -- No --> Bottom[Set position to Bottom]
Edge -- Yes --> FashionDock[Enable floating adaptive dock]
FashionDock --> Constraints[Hide left/right options and show desktop]
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 found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="panels/dock/dockpanel.cpp" line_range="136-139" />
<code_context>
+ // 时尚模式没有放开时不允许切过去,把对齐方式改回居中
</code_context>
<issue_to_address>
**issue (broader_impact):** When fashion mode is disabled while the dock is in fashion alignment, the `itemAlignmentChanged` handler changes the alignment to centered and returns before emitting `fashionModeChanged`. QML objects whose `Panel.fashionMode` binding depends on that notification keep the stale fashion-mode state, so the card area, show-desktop item, task manager sizing, and split controls do not update until a later unrelated notification or restart.
**Triggers:** When `enableFashionMode` is changed to false while the dock is running in fashion mode.
**Suggested fix:** Emit `fashionModeChanged()` after normalizing the alignment, including on the early-return path, or make `fashionMode` notify from the alignment/position changes directly.
```suggestion
if (!fashionModeEnabled() && SETTINGS->itemAlignment() == ItemAlignment::FashionAlignment) {
SETTINGS->setItemAlignment(ItemAlignment::CenterAlignment);
Q_EMIT fashionModeChanged();
return;
}
```
</issue_to_address>| if (!fashionModeEnabled() && SETTINGS->itemAlignment() == ItemAlignment::FashionAlignment) { | ||
| SETTINGS->setItemAlignment(ItemAlignment::CenterAlignment); | ||
| return; | ||
| } |
There was a problem hiding this comment.
issue (broader_impact): When fashion mode is disabled while the dock is in fashion alignment, the itemAlignmentChanged handler changes the alignment to centered and returns before emitting fashionModeChanged. QML objects whose Panel.fashionMode binding depends on that notification keep the stale fashion-mode state, so the card area, show-desktop item, task manager sizing, and split controls do not update until a later unrelated notification or restart.
Triggers: When enableFashionMode is changed to false while the dock is running in fashion mode.
Suggested fix: Emit fashionModeChanged() after normalizing the alignment, including on the early-return path, or make fashionMode notify from the alignment/position changes directly.
| if (!fashionModeEnabled() && SETTINGS->itemAlignment() == ItemAlignment::FashionAlignment) { | |
| SETTINGS->setItemAlignment(ItemAlignment::CenterAlignment); | |
| return; | |
| } | |
| if (!fashionModeEnabled() && SETTINGS->itemAlignment() == ItemAlignment::FashionAlignment) { | |
| SETTINGS->setItemAlignment(ItemAlignment::CenterAlignment); | |
| Q_EMIT fashionModeChanged(); | |
| return; | |
| } |
f3e0309 to
ff0c6d5
Compare
1. Implement fashion dock mode as a new item alignment style with floating window appearance, rounded corners, and content-based sizing 2. Add new plugin type `Card` for card-style plugins displayed in the dock 3. Create CardLeftDockArea component supporting multiple card plugins with swipe navigation, wheel switching, and page indicators 4. Add card sorting mechanism allowing plugins to report their display order 5. Add card current position persistence across dock restarts 6. Implement fashion mode propagation to plugins and task manager 7. Add fashion mode enable/disable configuration with fallback to centered mode 8. Disable window split functionality in fashion mode 9. Update context menu to reflect fashion mode constraints Log: Added fashion dock mode with card plugin area, including sorting, persistence, and plugin communication support Influence: 1. Test switching between centered and fashion dock modes via context menu 2. Verify fashion mode disables left/right position options 3. Test card plugin display, sorting, and swapping between multiple cards 4. Test card persistence across dock restarts 5. Verify fashion mode correctly hides show desktop button 6. Test that window split is not applied in fashion mode 7. Verify fashion mode disabled via DConfig returns to centered mode 8. Test plugin communication of fashion mode state feat: 添加时尚模式任务栏及卡片插件支持 1. 实现时尚模式任务栏,采用新的对齐方式,支持悬浮窗口、圆角和自适应内容 宽度 2. 添加“卡片”类型插件,用于在任务栏展示卡片样式组件 3. 创建卡片区域组件,支持多卡片滑动切换、滚轮切换和页面指示器 4. 添加卡片排序机制,插件可上报显示顺序 5. 添加卡片当前位置持久化,重启后恢复 6. 实现时尚模式状态向插件和任务管理器的通知 7. 增加时尚模式开关配置,关闭时回退至居中模式 8. 时尚模式下禁用窗口分屏功能 9. 更新右键菜单以适配时尚模式限制 Log: 新增时尚模式任务栏和卡片插件区域,包含排序、状态持久化及插件通信 支持 Influence: 1. 测试通过右键菜单在居中模式和时尚模式之间切换 2. 验证时尚模式下左/右位置选项被隐藏 3. 测试卡片插件的显示、排序,以及多卡片之间的切换 4. 测试任务栏重启后卡片位置恢复 5. 验证时尚模式下显示桌面图标被隐藏 6. 测试时尚模式下窗口分屏功能无效 7. 验证通过 DConfig 关闭时尚模式后回退至居中模式 8. 测试插件接收时尚模式状态通知 PMS: TASK-392671
ff0c6d5 to
3965538
Compare
deepin pr auto reviewAI 代码审查报告
总体评价
本次 PR 为 dde-shell 的任务栏(dock)新增了时尚模式(Fashion Mode)和卡片插件(Card Plugin)支持。代码整体质量优秀,架构设计合理,注释详尽,安全方面无漏洞。存在少量代码质量和性能优化建议,不影响功能正确性。 漏洞对比统计漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个 四维度评分维度1:语法逻辑(25分)✓ 语法正确,逻辑清晰得分:25/25 代码语法正确,逻辑清晰。各模块协作关系明确:
边界条件处理完善:
维度2:代码质量(25分)✓ 代码结构清晰,注释完整得分:20/25 扣分明细:
代码优点:
维度3:代码性能(20分)✓ 性能良好,资源使用合理得分:19/20 扣分明细:
性能优点:
维度4:代码安全(30分)✓ 存在0个安全漏洞得分:30/30 安全审查结果:
OCR 审查补充OpenCodeReview 工具审查了 13 个文件,发现 7 个建议(0 个安全漏洞):
改进建议建议1:修复 const-correctness// dockpanel.h
- bool fashionMode();
+ bool fashionMode() const;
// dockpanel.cpp
- bool DockPanel::fashionMode()
+ bool DockPanel::fashionMode() const
// taskmanager.h
- bool fashionMode();
+ bool fashionMode() const;
// taskmanager.cpp
- bool TaskManager::fashionMode()
+ bool TaskManager::fashionMode() const
// taskmanagersettings.h
- bool isWindowSplit();
+ bool isWindowSplit() const;
// taskmanagersettings.cpp
- bool TaskManagerSettings::isWindowSplit()
+ bool TaskManagerSettings::isWindowSplit() const建议2:避免 fashionModeChanged() 重复发射// dockpanel.cpp, itemAlignmentChanged handler
connect(SETTINGS, &DockSettings::itemAlignmentChanged, this, [this](){
if (!fashionModeEnabled() && SETTINGS->itemAlignment() == ItemAlignment::FashionAlignment) {
SETTINGS->setItemAlignment(ItemAlignment::CenterAlignment);
return;
}
if (SETTINGS->itemAlignment() == ItemAlignment::FashionAlignment
&& (position() == Position::Left || position() == Position::Right)) {
setPosition(Position::Bottom);
// fashionModeChanged() is already emitted by the positionChanged handler
} else {
Q_EMIT fashionModeChanged();
}
});建议3:避免不必要的 fashionModeChanged() 发射// dockpanel.cpp, positionChanged handler
connect(SETTINGS, &DockSettings::positionChanged, this, [this, dockDaemonAdaptor](){
const bool wasFashionMode = fashionMode();
Q_EMIT positionChanged(position());
if (wasFashionMode != fashionMode())
Q_EMIT fashionModeChanged();
// ...
});建议4:修复枚举对齐// constants.h
- FashionAlignment = 2,
+ FashionAlignment = 2,审查清单
|

Cardfor card-style plugins displayed in the dockLog: Added fashion dock mode with card plugin area, including sorting, persistence, and plugin communication support
Influence:
feat: 添加时尚模式任务栏及卡片插件支持
Log: 新增时尚模式任务栏和卡片插件区域,包含排序、状态持久化及插件通信
支持
Influence:
PMS: TASK-392671
Summary by Sourcery
Introduce fashion dock mode and card plugin support with persistent navigation, plugin integration, and mode-specific behavior.
New Features:
Bug Fixes:
Enhancements:
Build: