Skip to content

ux: 标签栏拖动增加视觉反馈 show feedback while dragging repository tabs - #2773

Open
VirgilMing wants to merge 1 commit into
sourcegit-scm:developfrom
VirgilMing:codex/sourcegit-tab-drag-feedback
Open

VirgilMing wants to merge 1 commit into
sourcegit-scm:developfrom
VirgilMing:codex/sourcegit-tab-drag-feedback

Conversation

@VirgilMing

@VirgilMing VirgilMing commented Oct 11, 2026 •

Copy link
Copy Markdown

为仓库标签拖动增加视觉反馈:

  • 跟随指针显示标签标题和图标预览。
  • 源标签变淡,目标标签高亮,并显示与重排方向一致的插入标记。
  • 长标题按预览框宽度显示省略号,内容限制在框内。
  • 离开标签栏时隐藏预览并清除目标提示;取消、释放或控件卸载时清理拖动状态。

覆盖层不拦截输入,重排使用原生拖放和现有的 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.

@VirgilMing VirgilMing changed the title ux: show feedback while dragging repository tabs ux: 标签栏拖动增加视觉反馈 show feedback while dragging repository tabs Oct 11, 2026
@VirgilMing
VirgilMing force-pushed the codex/sourcegit-tab-drag-feedback branch from 5c007ef to 5c5d9a9 Compare October 12, 2026 13:52
@VirgilMing
VirgilMing force-pushed the codex/sourcegit-tab-drag-feedback branch 2 times, most recently from a29662f to 9e9f495 Compare October 15, 2026 07:29
@VirgilMing
VirgilMing force-pushed the codex/sourcegit-tab-drag-feedback branch 2 times, most recently from 5cce013 to 4c0bbbd Compare October 28, 2026 09:41
Show a pointer-following title/icon preview, dim the dragged tab, and
highlight the destination with an insertion marker matching the existing
reorder behavior. Clear feedback on leave, cancellation, drop and detach.

Match the tab Border style key and constrain preview titles to the
available width with ellipsis and clipping.

Include isolated rendering and lifecycle checks for long and short
fixed-width titles, welcome tabs and variable-width tabs.
@VirgilMing
VirgilMing force-pushed the codex/sourcegit-tab-drag-feedback branch from 4c0bbbd to 6056d77 Compare October 28, 2026 10:13

This branch has not been deployed

No deployments
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.

1 participant