Skip to content

Commit 84f8ec6

Browse files
committed
feat: extend search to branch and tag names (close #7)
Include local branches, remote branches, and tag names in the commit search haystack. Remote branches are indexed by both short name and full remote/branch form so both 'main' and 'origin/main' match.
1 parent a06f975 commit 84f8ec6

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎webview-ui/src/components/common/SearchBar.svelte‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
commit.author.email,
3737
commit.hash,
3838
commit.abbreviatedHash,
39+
...commit.refs
40+
.filter(r => r.type === 'branch' || r.type === 'remote-branch' || r.type === 'tag')
41+
.flatMap(r => r.type === 'remote-branch' && r.remote ? [r.name, `${r.remote}/${r.name}`] : [r.name]),
3942
].join(' ').toLowerCase();
4043
4144
if (haystack.includes(q)) {

‎webview-ui/src/lib/i18n/en.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export const en: Record<string, string> = {
192192
'details.restore': 'Restore panel',
193193

194194
// Search bar
195-
'search.placeholder': 'Search commits (message, author, hash)',
195+
'search.placeholder': 'Search commits (message, author, hash, branch, tag)',
196196
'search.search': 'Search',
197197
'search.clear': 'Clear',
198198
'search.noResults': 'No results',

‎webview-ui/src/lib/i18n/ko.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export const ko: Record<string, string> = {
192192
'details.restore': '패널 복원',
193193

194194
// Search bar
195-
'search.placeholder': 'Commit 검색 (메시지, 작성자, 해시)',
195+
'search.placeholder': 'Commit 검색 (메시지, 작성자, 해시, 브랜치, 태그)',
196196
'search.search': '검색',
197197
'search.clear': '지우기',
198198
'search.noResults': '결과 없음',

‎webview-ui/src/lib/i18n/zh.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export const zh: Record<string, string> = {
192192
'details.restore': '恢复面板',
193193

194194
// Search bar
195-
'search.placeholder': '搜索提交(消息、作者、哈希)',
195+
'search.placeholder': '搜索提交(消息、作者、哈希、分支、标签)',
196196
'search.search': '搜索',
197197
'search.clear': '清除',
198198
'search.noResults': '无结果',

0 commit comments

Comments
 (0)