Skip to content

Drag workbench scrollbars, wheel lists, and extend word selections - #184

Merged
zuohaisu merged 3 commits into
mainfrom
agent/feat-workbench-pointer-scroll
Oct 18, 2026
Merged

zuohaisu merged 3 commits into
mainfrom
agent/feat-workbench-pointer-scroll

Conversation

@zuohaisu

Copy link
Copy Markdown
Owner

Summary

侧栏、跳转名单、文件列表、交接名单上的滑块可以点、可以拖;滚轮滚动这些名单、侧栏和标签栏。终端有回滚时,窗格边缘有自己的滑块。双击一个词之后再拖,选区按现有词边界扩大。copy_on_select 从配置读取,默认 true。右键菜单可以改成把右键交给窗格里的程序。从侧栏第一次点进已经打开鼠标模式的窗格时,这一下只聚焦。

Refs #183

验收标准

  • 侧栏条目多于视口时,拖动滑块后,画面上的第一行变了,选中行仍按现有规则留在窗口里。
  • 在侧栏上滚轮后,可见的第一行变了;在终端内容上滚轮,侧栏不动。
  • 程序 mouse_mode 非 0 且窗格已是焦点时,内容区滚轮得到发给终端的字节,而不是工作台自己滚。
  • 终端有回滚时,窗格边缘有滑块;拖它之后回滚位置变了。
  • 双击 alpha beta gamma 的 alpha 再拖到 gamma,选区包含这三个词。窗格名和标签名不变。
  • 双击分割线后比例仍是 50/50。
  • 配置里 copy_on_select = false 时,拖选后 Ctrl+C 复制并清掉选区,结果不是 Forward([3])。没有选区时 Ctrl+C 仍是 Forward([3]),quit_requested 为 false。
  • 打开「右键发给窗格」之后,右键内容区得到发给终端的字节;关掉时右键仍打开工作台菜单。
  • 焦点在侧栏时,点一个 mouse_mode 非 0 的窗格,这一下不产生发给终端的鼠标字节;窗格随后成为焦点。

证据(Validation)

$ cargo fmt --all
$ cargo clippy -p viva --all-targets -- -D warnings
(无 warning,退出码 0)

$ cargo test --workspace --offline
test result: FAILED. 365 passed; 1 failed; 1 ignored
失败项:server::v15_tests::handoff_moves_a_worktree_between_agents_with_a_brief
原因:并行跑时 `failed to spawn terminal: No such file or directory (os error 2)`。
本次 diff 不改 server 的终端拉起。单独再跑该测试通过:

$ cargo test -p viva --lib handoff_moves_a_worktree_between_agents_with_a_brief --offline
test result: ok. 1 passed

$ git diff --check
(无输出,退出码 0)

验收用 TestBackend。覆盖包括 sidebar_thumb_and_wheel_scroll_without_moving_the_selection_off_screen、pane_scrollbar_drag_changes_scrollback_and_lists_follow_their_thumbs、wheel_on_the_tab_bar_changes_the_active_tab、double_click_drag_grows_the_selection_by_words、copy_on_select_false_in_config_keeps_ctrl_c_for_the_selection、right_click_menu_can_hand_the_button_to_the_pane、the_first_click_from_the_sidebar_only_focuses_a_mouse_pane。分割线双击 50/50 仍由 focused_terminal_receives_ctrl_c_and_mouse_without_renaming 覆盖。鼠标模式的滚轮字节仍由同一测试里的 wheel 断言覆盖。

风险与安全边界(Risk/Safety Boundaries)

只改工作台鼠标和 copy_on_select 的配置读取。没有改权限、版本号、发布流程或磁盘上的成员数据。右键交给窗格默认关闭;Shift+右键仍打开工作台菜单,用来关掉这一项。

未验证项(Known Limitations)

没有在真实终端里验证 PTY 光标、子进程占着备用屏幕时的缩放、嵌在终端里的 Pi 界面,或颜色对比。上面的并行 spawn 失败单独重跑通过,不记成这项验收失败,也不记成整个 suite 一次干净通过。独立 QA 还没有做。

Made with Cursor

Painted scrollbars did not move their lists, and a double-clicked word
stayed on that one word. Pointer drags and the wheel now scroll those
lists and terminal scrollback, and copy_on_select is read from config.

Co-authored-by: Cursor <cursoragent@cursor.com>
zuohaisu and others added 2 commits October 18, 2026 10:54
Scrollback was painted over the last column the PTY still owned, a
sidebar focus left by prefix+o still forwarded the first click, and
reloading config left copy_on_select at its previous value.

Co-authored-by: Cursor <cursoragent@cursor.com>
A press on the empty track jumped the list, then stored the offset
from before the jump. A drag back to that old position was discarded.

Co-authored-by: Cursor <cursoragent@cursor.com>
@zuohaisu
zuohaisu merged commit 1c580f9 into main Oct 18, 2026
3 checks passed
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