Skip to content

feat: add taskbar overflow with cross-window positioning - #1801

Open
wjyrich wants to merge 1 commit into
linuxdeepin:masterfrom
wjyrich:feat-dock-overflow
Open

wjyrich wants to merge 1 commit into
linuxdeepin:masterfrom
wjyrich:feat-dock-overflow

Conversation

@wjyrich

@wjyrich wjyrich commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor
  1. Add TaskOverflowController to move apps exceeding available dock space into an overflow popup, with recent-app shortcut and drag-out support
  2. Introduce TaskOverflowButton UI with popup grid, tooltip, and translations for "Overflow area"
  3. Support cross-window dock positioning in DockPositioner/ DockPanelPositioner so tooltips, previews, and popups anchor to items even when delegate windows differ from the panel window
  4. Add trailingExtent handling in OverflowContainer and skip spacing for zero-width/hidden delegates
  5. Fix MenuHelper to set activeMenu before opening to avoid race with close handlers
  6. Center-alignment spacing fix in main.qml using centerAlignmentEdgeSpacing (14) and dockEffectiveCenterSpace
  7. Extend AppItem with dragEnabled, dragSource, restorePositionAfterDrag, previewAnchor, updateIconGeometry, and Overflow-specific behaviors; add DockedRole to DockGlobalElementModel
  8. Defer TextCalculator calculations via single-shot timer and publish consistent width results
  9. Wire internal vs external DnD flows in TaskManager.qml: overflow popup dragging, reorder during overflow, undock on invalid drop, saveOrder on move

Log: Added dock taskbar overflow area, overflow popup with recent app, improved cross-window tooltip/preview anchoring, and refined center- aligned dock spacing

Influence:

  1. Fill the taskbar until icons reach minimum size and verify the overflow button appears and remaining apps move into the popup
  2. Click the overflow button to open/close popup, verify grid layout, scrolling, and tooltip "Overflow area"
  3. Verify the recent app shortcut shown before the overflow button and that it updates on app activation
  4. Drag apps from the overflow popup to the dock to move them back, and confirm undo/restore position after cancelling with Escape
  5. Verify cross-window positioning of tooltips, window previews, and folder popups in horizontal and vertical docks
  6. Test dock center alignment spacing at all four panel positions and both layouts (row/column)
  7. Verify app reordering from taskbar and overflow, and saveDockElementsOrder persistence after restart
  8. Test undocking by dragging an internal app out of the dock and re- docking an external app
  9. Check that hidden overflow items do not leave extra spacing and animations are smooth
  10. Verify TextCalculator schedule stability (no layout jitter when app count changes rapidly)

feat: 新增任务栏溢出功能及跨窗口定位

  1. 新增 TaskOverflowController,将超出可用空间的应用程序移入溢出弹窗,支 持最近应用快捷项及拖出
  2. 新增 TaskOverflowButton 界面,含弹窗网格、悬浮提示及“溢出区域”多语言 翻译
  3. 在 DockPositioner/DockPanelPositioner 中支持跨窗口 dock 定位,使提 示、预览及弹窗即使在委托窗口与面板窗口不同时也能正确锚定
  4. OverflowContainer 新增 trailingExtent 处理,零宽度/隐藏委托不占额外 间距
  5. 修复 MenuHelper 中先设置 activeMenu 再打开菜单,避免关闭回调竞态
  6. main.qml 居中排列间距修复,使用 centerAlignmentEdgeSpacing(14)及 dockEffectiveCenterSpace
  7. AppItem 扩展 dragEnabled、dragSource、restorePositionAfterDrag、 previewAnchor、updateIconGeometry 等属性;DockGlobalElementModel 新 增 DockedRole
  8. TextCalculator 通过单次定时器延迟计算并保持宽度结果一致
  9. TaskManager.qml 打通内部与外部拖放流程:溢出弹窗拖放、溢出时重排、无 效放置时取消驻留、移动后保存顺序

Log: 新增任务栏溢出区域、含最近应用的溢出弹窗、改进跨窗口提示/预览锚定,
并优化居中对齐的任务栏间距

Influence:

  1. 填满任务栏直至图标缩至最小尺寸,验证溢出按钮出现且剩余应用进入弹窗
  2. 点击溢出按钮打开/关闭弹窗,验证网格布局、滚动及“溢出区域”提示
  3. 验证溢出按钮前的最近应用快捷项,并在应用激活时正确更新
  4. 从溢出弹窗拖拽应用到任务栏以移回,验证取消(Esc)后位置恢复
  5. 在水平和垂直任务栏下验证提示、窗口预览及文件夹弹窗的跨窗口定位
  6. 在四个面板位置及两种布局(行/列)下测试居中对齐间距
  7. 验证任务栏及溢出区域内的应用重排,以及重启后 saveDockElementsOrder 的 持久化
  8. 测试将内部应用拖出任务栏取消驻留,以及外部应用重新驻留
  9. 检查隐藏的溢出项不产生多余间距且动画流畅
  10. 验证 TextCalculator 调度稳定性(应用数量频繁变化时无布局抖动)

PMS: TASK-395671

Summary by Sourcery

Add taskbar overflow handling and improve dock layout, drag-and-drop, and cross-window popup positioning.

New Features:

  • Add taskbar overflow management with an overflow button, recent-app shortcut, popup grid, scrolling, and drag-out support.

Bug Fixes:

  • Correct menu activation ordering, hidden-item spacing, centered dock spacing, and layout-width update consistency.

Enhancements:

  • Support positioning tooltips, previews, folder popups, and related dock UI across separate windows.
  • Extend taskbar drag-and-drop flows for overflow moves, reordering, docking and undocking, cancellation, and order persistence.

Build:

  • Add the task overflow controller and its Qt Quick integration to the task manager build.

Chores:

  • Add localized overflow-area labels for supported Chinese translations.

@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Sorry @wjyrich, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 2 hours and 34 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@deepin-ci-robot

Copy link
Copy Markdown

[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.

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 commented Nov 10, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Data structures

Add the overflow controller and popup model that determine visible versus overflow items, preserve recent-app activity, and expose drag state and layout to QML.

  • panels/dock/taskmanager/taskoverflowcontroller.cpp L1-585
  • panels/dock/taskmanager/taskoverflowcontroller.h L1-200

Expose docked state through the global element model for overflow entries and drag handling.

  • panels/dock/taskmanager/dockglobalelementmodel.cpp L619-621

API

Extend dock positioning interfaces with cross-window detection, effective bounds, and anchor geometry used by positioners.

  • panels/dock/dockpositioner.cpp L76-103, L169-185, L262-286 (+2 small edits)
  • panels/dock/dockpositioner.h L58-60

Expose the overflow controller to QML and register its type alongside the text calculator.

  • panels/dock/taskmanager/taskmanager.cpp L22, L154

Uses of the API

Wire overflow sizing, hidden delegates, popup reordering, external and internal drag-and-drop, and order persistence into the task manager.

  • panels/dock/taskmanager/package/TaskManager.qml L241-262, L337-388, L394-422 (+16 small edits)

Implementation

Treat trailing overflow extent as part of the layout and prevent zero-width delegates from consuming spacing.

  • panels/dock/OverflowContainer.qml L35-39, L51-55 (+3 small edits)

Defer text-width calculations and publish optimal and total widths as a consistent result.

  • panels/dock/taskmanager/textcalculator.cpp L173-185, L330-334, L340-343 (+2 small edits)
  • panels/dock/taskmanager/textcalculator.h L187

Set the active menu before opening it to avoid close-handler races.

  • panels/dock/MenuHelper.qml L1, L25

UI

Add the overflow button, recent shortcut, tooltip, popup grid, and popup-item drag behavior.

  • panels/dock/taskmanager/package/TaskOverflowButton.qml L1-334

Extend task items for configurable dragging, popup-preserving menus, preview anchoring, and icon geometry updates across windows.

  • panels/dock/taskmanager/package/AppItem.qml L33-41, L56-75, L745-763 (+14 small edits)

Anchor folder popup positioning to a configurable item, including items hosted in a different window.

  • panels/dock/taskmanager/package/FolderPopup.qml L68-72 (+3 small edits)

Adjust center-aligned dock space and margins using a shared edge spacing value.

  • panels/dock/package/main.qml L67-77, L678-681 (+3 small edits)

Make disabled app titles contribute no text to the title calculator.

  • panels/dock/taskmanager/package/AppItemTitle.qml L22

Add translations for the overflow-area tooltip.

  • panels/dock/taskmanager/translations/org.deepin.ds.dock.taskmanager.ts L114-120
  • panels/dock/taskmanager/translations/org.deepin.ds.dock.taskmanager_zh_CN.ts L112-118
  • panels/dock/taskmanager/translations/org.deepin.ds.dock.taskmanager_zh_HK.ts L112-118
  • panels/dock/taskmanager/translations/org.deepin.ds.dock.taskmanager_zh_TW.ts L112-118

Configuration

Link Qt Quick and include the new overflow controller implementation in the task manager build.

  • panels/dock/taskmanager/CMakeLists.txt L5, L89-90, L105

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

1. Add TaskOverflowController to move apps exceeding available dock
space into an overflow popup, with recent-app shortcut and drag-out
support
2. Introduce TaskOverflowButton UI with popup grid, tooltip, and
translations for "Overflow area"
3. Support cross-window dock positioning in DockPositioner/
DockPanelPositioner so tooltips, previews, and popups anchor to items
even when delegate windows differ from the panel window
4. Add trailingExtent handling in OverflowContainer and skip spacing for
zero-width/hidden delegates
5. Fix MenuHelper to set activeMenu before opening to avoid race with
close handlers
6. Center-alignment spacing fix in main.qml using
centerAlignmentEdgeSpacing (14) and dockEffectiveCenterSpace
7. Extend AppItem with dragEnabled, dragSource,
restorePositionAfterDrag, previewAnchor, updateIconGeometry, and
Overflow-specific behaviors; add DockedRole to DockGlobalElementModel
8. Defer TextCalculator calculations via single-shot timer and publish
consistent width results
9. Wire internal vs external DnD flows in TaskManager.qml: overflow
popup dragging, reorder during overflow, undock on invalid drop,
saveOrder on move

Log: Added dock taskbar overflow area, overflow popup with recent app,
improved cross-window tooltip/preview anchoring, and refined center-
aligned dock spacing

Influence:
1. Fill the taskbar until icons reach minimum size and verify the
overflow button appears and remaining apps move into the popup
2. Click the overflow button to open/close popup, verify grid layout,
scrolling, and tooltip "Overflow area"
3. Verify the recent app shortcut shown before the overflow button and
that it updates on app activation
4. Drag apps from the overflow popup to the dock to move them back, and
confirm undo/restore position after cancelling with Escape
5. Verify cross-window positioning of tooltips, window previews, and
folder popups in horizontal and vertical docks
6. Test dock center alignment spacing at all four panel positions and
both layouts (row/column)
7. Verify app reordering from taskbar and overflow, and
saveDockElementsOrder persistence after restart
8. Test undocking by dragging an internal app out of the dock and re-
docking an external app
9. Check that hidden overflow items do not leave extra spacing and
animations are smooth
10. Verify TextCalculator schedule stability (no layout jitter when app
count changes rapidly)

feat: 新增任务栏溢出功能及跨窗口定位

1. 新增 TaskOverflowController,将超出可用空间的应用程序移入溢出弹窗,支
持最近应用快捷项及拖出
2. 新增 TaskOverflowButton 界面,含弹窗网格、悬浮提示及“溢出区域”多语言
翻译
3. 在 DockPositioner/DockPanelPositioner 中支持跨窗口 dock 定位,使提
示、预览及弹窗即使在委托窗口与面板窗口不同时也能正确锚定
4. OverflowContainer 新增 trailingExtent 处理,零宽度/隐藏委托不占额外
间距
5. 修复 MenuHelper 中先设置 activeMenu 再打开菜单,避免关闭回调竞态
6. main.qml 居中排列间距修复,使用 centerAlignmentEdgeSpacing(14)及
dockEffectiveCenterSpace
7. AppItem 扩展 dragEnabled、dragSource、restorePositionAfterDrag、
previewAnchor、updateIconGeometry 等属性;DockGlobalElementModel 新
增 DockedRole
8. TextCalculator 通过单次定时器延迟计算并保持宽度结果一致
9. TaskManager.qml 打通内部与外部拖放流程:溢出弹窗拖放、溢出时重排、无
效放置时取消驻留、移动后保存顺序

Log: 新增任务栏溢出区域、含最近应用的溢出弹窗、改进跨窗口提示/预览锚定,
并优化居中对齐的任务栏间距

Influence:
1. 填满任务栏直至图标缩至最小尺寸,验证溢出按钮出现且剩余应用进入弹窗
2. 点击溢出按钮打开/关闭弹窗,验证网格布局、滚动及“溢出区域”提示
3. 验证溢出按钮前的最近应用快捷项,并在应用激活时正确更新
4. 从溢出弹窗拖拽应用到任务栏以移回,验证取消(Esc)后位置恢复
5. 在水平和垂直任务栏下验证提示、窗口预览及文件夹弹窗的跨窗口定位
6. 在四个面板位置及两种布局(行/列)下测试居中对齐间距
7. 验证任务栏及溢出区域内的应用重排,以及重启后 saveDockElementsOrder 的
持久化
8. 测试将内部应用拖出任务栏取消驻留,以及外部应用重新驻留
9. 检查隐藏的溢出项不产生多余间距且动画流畅
10. 验证 TextCalculator 调度稳定性(应用数量频繁变化时无布局抖动)

PMS: TASK-395671
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 98 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交为 dde-shell 任务栏新增溢出功能与跨窗口定位支持,涉及21个文件、新增约1569行代码。代码结构清晰,新增 TaskOverflowController 控制器设计合理,QML 与 C++ 交互规范。语法逻辑正确,边界处理完善,性能上引入了防抖机制。未发现安全漏洞,防御性编程充分。仅存在少量代码复杂度可优化空间。

🔍 详细分析

1. 语法逻辑 ✅

评价: 语法正确,逻辑清晰 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: []


2. 代码质量 ✅

评价: 代码结构清晰,注释完整 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: ['考虑将 syncRecentItem() 拆分为 updateRecentHistory() 和 selectRecentItem() 两个子函数', '考虑将 DockPanelPositioner::updatePosition() 的 crossWindow 分支提取为独立方法']


3. 代码性能 ✅

评价: 性能良好,资源使用合理 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: []


4. 代码安全 🔒

评价: 存在0个安全漏洞 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: []


💡 改进建议代码示例


本报告由 AI 代码审查工具自动生成

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