fix(webui): stabilize live thread rendering and navigation

This commit is contained in:
Xubin Ren
2026-05-13 16:39:07 +00:00
parent 6a4ed255de
commit 5d7f3f2751
14 changed files with 876 additions and 77 deletions
+3 -1
View File
@@ -31,8 +31,10 @@ export function Sidebar(props: SidebarProps) {
const normalizedQuery = query.trim().toLowerCase();
const filteredSessions = useMemo(() => {
if (!normalizedQuery) return props.sessions;
const terms = normalizedQuery.split(/\s+/).filter(Boolean);
return props.sessions.filter((session) => {
const haystack = [
session.title,
session.preview,
session.chatId,
session.channel,
@@ -41,7 +43,7 @@ export function Sidebar(props: SidebarProps) {
.filter(Boolean)
.join(" ")
.toLowerCase();
return haystack.includes(normalizedQuery);
return terms.every((term) => haystack.includes(term));
});
}, [normalizedQuery, props.sessions]);