feat: add session tree search functionality

- Add useTreeSearch composable with filtering logic
- Implement search bar with Ctrl+F shortcut
- Show search results with ancestor paths
- Add search match indicator (cyan dot)
- Display "no results" message when search is empty
- Support clear search with X button

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
liumangmang
2026-04-03 16:10:49 +08:00
parent 55953dce83
commit cf7b564b3a
3 changed files with 111 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ const connection = computed(() => {
// Drag-drop functionality
const dragHandlers = inject<any>('dragHandlers', null)
const isSearchMatch = inject<(nodeId: string) => boolean>('isSearchMatch', () => false)
const isDragging = computed(() =>
dragHandlers?.draggedNode.value?.id === props.node.id
@@ -138,8 +139,15 @@ function handleDragEnd() {
<span class="text-sm truncate flex-1">{{ node.name }}</span>
<!-- Search match indicator -->
<span
v-if="connection"
v-if="isSearchMatch(node.id)"
class="w-1.5 h-1.5 rounded-full bg-cyan-400 flex-shrink-0"
title="搜索匹配"
/>
<span
v-else-if="connection"
class="w-2 h-2 rounded-full bg-slate-600"
/>
</div>