fix(knowledge): refresh inflight items and skip empty chunked groups
Poll the knowledge item list every 5s while any item is still pending or processing so the UI reflects ingestion progress without manual refresh, and exclude items that have no active chunks from group counters so groups with no usable content do not appear populated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -62,6 +62,14 @@ const groupsQuery = useQuery({
|
||||
const itemsQuery = useQuery({
|
||||
queryKey: computed(() => ['knowledge', 'items', selectedGroupId.value]),
|
||||
queryFn: () => knowledgeApi.listItems(selectedGroupId.value ?? undefined),
|
||||
refetchInterval: (query) => {
|
||||
const items = query.state.data as KnowledgeItem[] | undefined
|
||||
if (!items || items.length === 0) return false
|
||||
const hasInflight = items.some(
|
||||
(item) => item.status !== 'completed' && item.status !== 'failed',
|
||||
)
|
||||
return hasInflight ? 5000 : false
|
||||
},
|
||||
})
|
||||
|
||||
const columns: TableColumnsType<KnowledgeItem> = [
|
||||
|
||||
Reference in New Issue
Block a user