feat(frontend): 广场搜索体验优化与切换tab重置筛选
- 智能体广场:切换 我的/广场/私密广场 时清空重置搜索/标签/排序/发布者筛选 - 通用搜索栏(TagSearchBar):新增「搜索」按钮与回车立即触发(跳过防抖)、 搜索中转圈提示,新增 hideTags / searchPlaceholder 选项 - 定时任务广场:新增客户端搜索(名称/摘要/创建者,兼容脱敏文本) - agents 分页 hook 暴露 isFetching 以驱动搜索中状态 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
87e0ae683e
commit
8fbbfc8093
4 files changed
+127
-25
No files matched your search
@@ -94,7 +94,7 @@ export function useAgentsPaginated(params: {
|
||||
const tagIds = params.tagIds ?? [];
|
||||
const sort = params.sort ?? "time_desc";
|
||||
const owner = params.owner ?? "";
|
||||
const { data, isLoading, error } = useQuery({
|
||||
const { data, isLoading, isFetching, error } = useQuery({
|
||||
queryKey: [
|
||||
"agents",
|
||||
"paginated",
|
||||
@@ -123,6 +123,9 @@ export function useAgentsPaginated(params: {
|
||||
agents: data?.agents ?? [],
|
||||
total: data?.total ?? 0,
|
||||
isLoading,
|
||||
// keepPreviousData keeps isLoading false on subsequent searches; expose
|
||||
// isFetching so callers can show a "searching" indicator on every query.
|
||||
isFetching,
|
||||
error,
|
||||
};
|
||||
}
|
||||
@@ -305,7 +308,7 @@ export function usePrivateAgentsPaginated(
|
||||
const tagIds = params.tagIds ?? [];
|
||||
const sort = params.sort ?? "time_desc";
|
||||
const owner = params.owner ?? "";
|
||||
const { data, isLoading, error, refetch } = useQuery({
|
||||
const { data, isLoading, isFetching, error, refetch } = useQuery({
|
||||
queryKey: [
|
||||
"agents",
|
||||
"private-square",
|
||||
@@ -337,6 +340,7 @@ export function usePrivateAgentsPaginated(
|
||||
agents: data?.agents ?? [],
|
||||
total: data?.total ?? 0,
|
||||
isLoading,
|
||||
isFetching,
|
||||
error,
|
||||
refetch,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user