|
|
@@ -20,7 +20,7 @@ import {
|
|
|
type PaasEffort,
|
|
|
} from "@/paas"
|
|
|
import { PaasRunPanel } from "./run-panel"
|
|
|
-import { createResearchChats, working, type ResearchMessage } from "./chat-state"
|
|
|
+import { createResearchChats, working, type ResearchChat, type ResearchMessage } from "./chat-state"
|
|
|
import { createMaterials } from "./materials"
|
|
|
|
|
|
export function PaasChat(props: {
|
|
|
@@ -333,11 +333,14 @@ export function PaasChat(props: {
|
|
|
}
|
|
|
}
|
|
|
const matches = (title: string) => title.toLocaleLowerCase().includes(ui.search.trim().toLocaleLowerCase())
|
|
|
+ const hasContent = (chat: ResearchChat) =>
|
|
|
+ chat.messages.length > 0 || !!chat.draft.trim() || !!chat.reference || chat.files.length > 0
|
|
|
const sessionGroups = createMemo(() =>
|
|
|
props.agents.flatMap((agent) => {
|
|
|
const id = paasText(agent.id)
|
|
|
const chats = state.chats.filter(
|
|
|
- (chat) => chat.agentID === agent.id && !!chat.archived === ui.archived && matches(chat.title),
|
|
|
+ (chat) =>
|
|
|
+ chat.agentID === agent.id && !!chat.archived === ui.archived && hasContent(chat) && matches(chat.title),
|
|
|
)
|
|
|
const threads = (ui.threads[id] || []).filter(
|
|
|
(thread) =>
|
|
|
@@ -346,7 +349,7 @@ export function PaasChat(props: {
|
|
|
!state.chats.some((chat) => chat.agentID === agent.id && chat.threadID === thread.id),
|
|
|
)
|
|
|
const active = current()?.agentID === id && !ui.archived
|
|
|
- if (!chats.length && !threads.length && (!active || !!ui.search.trim())) return []
|
|
|
+ if (!chats.length && !threads.length) return []
|
|
|
return [
|
|
|
{
|
|
|
agent,
|