为仓库标签拖动增加视觉反馈:
- 跟随指针显示标签标题和图标预览。
- 源标签变淡,目标标签高亮,并显示与重排方向一致的插入标记。
- 长标题按预览框宽度显示省略号,内容限制在框内。
- 离开标签栏时隐藏预览并清除目标提示;取消、释放或控件卸载时清理拖动状态。
覆盖层不拦截输入,重排使用原生拖放和现有的 Launcher.MoveTab。沿用 Avalonia 11.3.22 依赖。
提供 tests/TabDragFeedback/ 控件测试,使用隔离配置并输出日志和预览截图。
本地验证
环境:Linux x64,.NET SDK 10.0.111。控件测试使用现有 fontconfig 缓存的独立副本。
- Release 构建通过。
- 固定宽度长名称、固定宽度短名称、欢迎标签和可变宽度标签四种预览用例通过,并检查了渲染截图。
- 验证源标签透明度、目标背景、左右插入位置、离开后重入、取消及样式恢复、释放后的重排,以及控件卸载后的清理。
- 实际鼠标和键盘输入验证了拖动反馈、释放后重排,以及 Esc 取消后保持顺序并清理反馈。
- 测试项目的
dotnet format whitespace --verify-no-changes 和 git diff --check 通过。
运行控件测试:
python3 tests/TabDragFeedback/run.py
可用 --dotnet /path/to/dotnet 指定 SDK,用 --output DIRECTORY 指定日志与截图的父目录。
Add visual feedback while dragging repository tabs:
- Show a title/icon preview that follows the pointer.
- Dim the source tab, highlight the destination, and display an insertion marker matching the reorder direction.
- Constrain long titles to the preview width with ellipsis and clipping.
- Hide the preview and clear destination feedback when leaving the tab bar; clear drag state on cancellation, drop, or control detachment.
The overlay does not intercept input. Reordering uses native drag-and-drop and the existing Launcher.MoveTab. The existing Avalonia 11.3.22 dependencies are retained.
The tests/TabDragFeedback/ control tests use isolated configuration and produce logs and rendered previews.
Local validation
Environment: Linux x64, .NET SDK 10.0.111. Control tests use a private copy of the existing fontconfig cache.
- Release build passed.
- All four preview cases passed: fixed-width long and short names, welcome tabs, and variable-width tabs. Rendered previews were inspected.
- Checks cover effective source opacity and destination background, insertion edges in both directions, leave/re-entry, cancellation and style restoration, drop reordering, and detach cleanup.
- Actual mouse and keyboard input verified drag feedback, reordering on release, and Escape cancellation preserving the order and clearing feedback.
- The test project's
dotnet format whitespace --verify-no-changes and git diff --check passed.
Run the control tests:
python3 tests/TabDragFeedback/run.py
Use --dotnet /path/to/dotnet to select the SDK and --output DIRECTORY to select the parent directory for logs and previews.