Skip to content

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

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

VirgilMing wants to merge 1 commit into
sourcegit-org: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/ 控件夹具,使用隔离配置和现有 fontconfig 缓存的独立副本,输出日志与预览截图。

本地验证(2026-11-26)

环境:Linux x64,.NET SDK 10.0.111,Avalonia 11.3.22。

  • Release 构建通过,零警告、零错误。
  • 四个 headless 用例通过:固定宽度长名称、固定宽度短名称、欢迎标签和可变宽度标签。检查实际样式、预览裁切与省略号、图标、左右插入位置、离开后重入、取消、释放重排和卸载清理。
  • 原生鼠标/键盘事件检查通过:拖动反馈、释放后重排,以及 Esc 取消后保持顺序并清理反馈。
  • git diff --check 通过。

headless 夹具直接调用反馈处理器;原生拖放与 Esc 取消另行通过原生输入检查。

运行与检查

python3 tests/TabDragFeedback/run.py

--dotnet /path/to/dotnet 可指定 SDK,--output DIRECTORY 可指定日志与截图的父目录。

在包含多个标签的窗口中,分别向左、向右拖动并释放,检查预览、落点提示与重排结果;再次拖动并按 Esc,确认标签顺序不变且反馈消失。固定宽度长名称应显示省略号,欢迎标签应保留对应图标。


Add visual feedback while dragging repository tabs so the dragged item and destination are clear:

  • Show a pointer-following title/icon preview, constraining long titles to its width with ellipsis.
  • Dim the source tab, highlight the destination, and display an insertion marker matching the existing reorder direction.
  • 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 project's Avalonia 11.3.22 dependencies are retained.

The tests/TabDragFeedback/ control fixture uses isolated configuration and a private copy of the existing fontconfig cache, and produces logs and rendered previews.

Local validation (2026-11-26)

Environment: Linux x64, .NET SDK 10.0.111, Avalonia 11.3.22.

  • Release build passed with zero warnings and zero errors.
  • All four headless cases passed: fixed-width long and short names, welcome tabs, and variable-width tabs. Checks cover effective styles, preview clipping and ellipsis, icons, insertion edges in both directions, leave/re-entry, cancellation, drop reordering, and detach cleanup.
  • Native mouse/keyboard event checks passed for drag feedback, reordering on release, and Escape cancellation preserving the order and clearing feedback.
  • git diff --check passed.

The headless fixture invokes feedback handlers directly; native drag sessions and Escape cancellation were checked separately through native input.

Run and check

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.

In a window with several tabs, drag and drop in both directions and check the preview, destination feedback, and resulting order. Start another drag and press Escape: the order should remain unchanged and feedback should disappear. A long fixed-width title should use ellipsis, and a welcome tab should retain its corresponding icon.

@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 5 times, most recently from 61913c3 to 823b598 Compare October 30, 2026 14:04
@VirgilMing
VirgilMing force-pushed the codex/sourcegit-tab-drag-feedback branch from 823b598 to b99ce96 Compare November 12, 2026 12:30
@VirgilMing
VirgilMing force-pushed the codex/sourcegit-tab-drag-feedback branch from b99ce96 to fad197d Compare November 22, 2026 08:04
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 fad197d to 0c597eb Compare November 26, 2026 10:59

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