useProjectThreadFeed() is the infinite-list thread feed hook. It returns a flattened thread list together with loadMore() and the archive/query controls that a project sidebar usually needs.
Usage
The following example shows a basic usage of useProjectThreadFeed().
The hook returns the following fields and methods.
›
threads?: AgentThread[] | undefined;
Flattened thread feed across the currently loaded pages.
›
hasMore?: boolean | undefined;
Whether another page can be loaded.
›
loadingMore?: boolean | undefined;
Whether the next page is currently loading.
›
loadMore?: () => Promise<void> | undefined;
Loads the next page when `hasMore` is true.
Overview
The feed hook is the one that matches a sidebar or other infinite scroll surface. It can include archived threads, restrict the feed to archived threads only, or filter the returned feed with a free-text query.