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。
反馈样式匹配标签控件的 Border 样式键,默认透明背景也放在样式中,使目标高亮能够正常生效。

该 PR 仅包含一个基于最新 develop (61667f1e)的提交,沿用 Avalonia 11.3.22 依赖。

本地验证(.NET 10.0.111):

  • Release 构建通过。
  • Linux x64 Native AOT 发布通过,使用 PublishAotUsingRuntimePack=true;发布时会出现来自 Avalonia.Controls.DataGrid 的 IL3053 警告。
  • 完整 dotnet format --verify-no-changes 和 git diff --check 通过。
  • Avalonia 11 无界面控件验证通过,覆盖实际渲染的变淡和高亮、预览生命周期、左右插入位置、取消及样式恢复、释放后的重排、控件卸载后的清理,并检查了渲染结果。
  • 固定宽度长名称、短名称、欢迎标签和可变宽度标签的预览验证通过:标题保持在框内,仅超长标题显示省略号,图标保留正常。
  • 手动确认了标签拖放交互。

手动验证步骤:向左、向右拖动标签,离开并重新进入标签栏,再取消或释放,确认中间反馈和最终顺序。


Currently, repository tabs change order on mouse drag drop, but provide no visual cue while dragging.
This adds a title/icon preview that follows the pointer, dims the source tab, and highlights the destination with an insertion marker matching the direction of the existing reorder operation.
Long preview titles are constrained to the available width and ellipsized, with the content clipped to the preview border.

Leaving the tab bar hides the preview and clears the destination feedback; cancellation, drop, and control detachment clear all drag state.
The overlay does not intercept input, and reordering continues to use native drag-and-drop and the existing Launcher.MoveTab.
The feedback styles match the tab's Border style key; the default transparent background lives in a style so the destination highlight can take precedence.

This PR contains one commit based on the latest develop (61667f1e), using the existing Avalonia 11.3.22 dependencies.

Local validation (.NET 10.0.111):

  • Release build passed.
  • Linux x64 Native AOT publish passed with PublishAotUsingRuntimePack=true; the publish emits an IL3053 warning for Avalonia.Controls.DataGrid.
  • Full dotnet format --verify-no-changes and git diff --check passed.
  • Avalonia 11 headless control checks passed for rendered dimming/highlight, preview lifecycle, left/right insertion edges, cancellation and style restoration, drop reordering, and detach cleanup; rendered feedback inspected.
  • Preview checks passed for fixed-width long and short names, welcome tabs, and variable-width tabs: titles stay inside the preview, only overflowing titles are ellipsized, and icons remain visible.
  • Interactive tab dragging was manually verified.

Manual verification steps: drag a tab left and right, leave and re-enter the tab bar, then cancel or drop to confirm the feedback and final order.

@VirgilMing VirgilMing changed the title ux: show feedback while dragging repository tabs ux: 标签栏拖动增加视觉反馈 show feedback while dragging repository tabs Oct 11, 2026
Show a title/icon preview, dim the dragged tab, and highlight the
destination with an insertion marker matching the existing reorder
behavior. Clear feedback when leaving the tab bar, cancelling, dropping,
or detaching.

Match the tab's Border style key and keep its transparent background in a
default style so the drag feedback styles take effect.

Constrain preview titles to the available width and ellipsize long names.
Clip the preview content to keep it inside the tab-sized border.

Keep native drag-and-drop and the current Launcher.MoveTab behavior.
@VirgilMing
VirgilMing force-pushed the codex/sourcegit-tab-drag-feedback branch from 5c007ef to 5c5d9a9 Compare October 12, 2026 13:52

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