mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-25 17:18:11 +00:00
SessionInfo already carries git_branch from the backend, but neither the ctrl-k command palette nor the sidebar search function included it in their matching fields. Typing a branch name matched nothing. - session-search.ts: add session.git_branch to sessionMatchesSearch - command-palette/index.tsx: thread git_branch through SessionEntry and into the keywords array for both sessions and archived sessions groups - session-search.test.ts: cover full, partial, and "main" branch matches
23 lines
631 B
TypeScript
23 lines
631 B
TypeScript
import { normalize } from '@/lib/text'
|
|
import type { SessionInfo } from '@/types/hermes'
|
|
|
|
import { sessionTitle } from './chat-runtime'
|
|
import { sessionSourceSearchTerms } from './session-source'
|
|
|
|
export function sessionMatchesSearch(session: SessionInfo, query: string): boolean {
|
|
const needle = normalize(query)
|
|
|
|
if (!needle) {
|
|
return true
|
|
}
|
|
|
|
return [
|
|
session.id,
|
|
session._lineage_root_id ?? '',
|
|
sessionTitle(session),
|
|
session.preview ?? '',
|
|
session.cwd ?? '',
|
|
session.git_branch ?? '',
|
|
...sessionSourceSearchTerms(session.source)
|
|
].some(value => value.toLowerCase().includes(needle))
|
|
}
|