Skip to content

feat(git-review): 分支切换下拉增加筛选输入框 - #843

Merged
Loosand merged 1 commit into
Stack-Cairn:developfrom
AlphaCatMeow:feat/git-review-branch-filter
Sep 20, 2026
Merged

Loosand merged 1 commit into
Stack-Cairn:developfrom
AlphaCatMeow:feat/git-review-branch-filter

Conversation

@AlphaCatMeow

@AlphaCatMeow AlphaCatMeow commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

背景

Git 审查面板顶部的分支切换下拉(GitReviewBranchMenu)只平铺全部本地/远程分支,没有筛选入口;Composer 里的 GitBranchSelector 早已有「筛选分支」搜索框。分支多的仓库里只能靠滚动找目标。

Closes #842

改动

只改 crates/agent-ui/src/components/project-tools/git-review/Toolbar.tsx

  • 下拉标题下方增加带放大镜图标的筛选输入框,样式与 Composer 分支选择器一致
  • 匹配规则相同:按 fullName 大小写不敏感子串匹配,本地与远程同时过滤
  • 输入框内按键 stopPropagation,不触发菜单 typeahead;Esc 只清空筛选不关菜单;输入法合成中不处理
  • 菜单关闭时重置筛选
  • 远程分支 40 条截断在筛选后应用,补上「还有 N 个远端分支未显示」提示;无匹配时显示「没有匹配的分支」
  • 容器改为 flex-col + max-h-[min(400px,75dvh)],列表区独立滚动,搜索框固定顶部

复用现有 i18n 键(git.branchSelector.filterBranches / noMatches / moreRemoteBranches),无新增翻译。

验证

  • biome check:通过
  • @liveagent/ui tsc --noEmit:通过
  • Windows 桌面端手动验证:输入筛选、Esc 清空、关闭重置均正常

工作记录:docs/worklog/issue-842-git-review-branch-filter.md

截图

2026-09-20_16-12-01

The Git Review branch dropdown listed every local/remote branch with no way
to narrow it down, unlike the composer GitBranchSelector. Add a filter input
at the top of the menu that matches case-insensitively on the full ref name,
resets on close, keeps keystrokes out of the menu typeahead, and shows the
existing no-match / hidden-remote hints.

Closes Stack-Cairn#842
@StackCairn
StackCairn marked this pull request as draft September 20, 2026 07:41
@github-actions

github-actions Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

PR governance checks passed. Awaiting human review.

@AlphaCatMeow
AlphaCatMeow marked this pull request as ready for review September 20, 2026 08:12
@Loosand
Loosand merged commit f4fd0a0 into Stack-Cairn:develop Sep 20, 2026
10 of 11 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.

2 participants